Skip to content

fix(build): Dynamically tag base images for Ubuntu 24.04#14248

Merged
hunsche merged 8 commits intomasterfrom
fix/ubuntu-dynamic-tagging
Nov 5, 2025
Merged

fix(build): Dynamically tag base images for Ubuntu 24.04#14248
hunsche merged 8 commits intomasterfrom
fix/ubuntu-dynamic-tagging

Conversation

@hunsche
Copy link
Copy Markdown
Contributor

@hunsche hunsche commented Nov 4, 2025

This commit addresses the issue where builds for Ubuntu 24.04 projects were incorrectly using the ':latest' tag for base images, leading to build failures.

Changes include:

  • Added 'ubuntu_version' to the 'Project' class, defaulting to 'legacy'.
  • Modified 'create_config' to accept and pass 'base_image_tag' to the 'Config' object.
  • Updated calls to 'build_lib.get_runner_image_name' to use 'config.base_image_tag'.
  • Updated 'expected_build_steps.json' to reflect the new 'ubuntu-24-04' image tags in test data.

This ensures that projects specifying 'ubuntu-24-04' in their 'project.yaml' will correctly pull the versioned base images, while projects without a specified version will continue to use ':latest' (legacy).

This commit addresses the issue where builds for Ubuntu 24.04 projects were
incorrectly using the ':latest' tag for base images, leading to build failures.

Changes include:
- Added 'ubuntu_version' to the 'Project' class, defaulting to 'legacy'.
- Modified 'create_config' to accept and pass 'base_image_tag' to the 'Config' object.
- Updated calls to 'build_lib.get_runner_image_name' to use 'config.base_image_tag'.
- Updated 'expected_build_steps.json' to reflect the new 'ubuntu-24-04' image tags in test data.

This ensures that projects specifying 'ubuntu-24-04' in their 'project.yaml'
will correctly pull the versioned base images, while projects without a
specified version will continue to use ':latest' (legacy).
@hunsche hunsche requested a review from javanlacerda November 4, 2025 19:56
This change modifies the build process to support dynamic tagging of
base runner images based on the  specified in a
project's .

- The  function now reads the .
- If the version is 'legacy' or not specified, it defaults to ,
  ensuring that existing projects continue to use the  tag.
- If a specific version like 'ubuntu-24-04' is provided, it is passed
  through the configuration and used to tag the runner image name.

This fixes an issue where projects intended for Ubuntu 24.04 were
incorrectly using the latest base image.
@javanlacerda
Copy link
Copy Markdown
Contributor

/gcbrun trial_build.py bios-bmc-smm-error-logger

Copy link
Copy Markdown
Contributor

@javanlacerda javanlacerda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've left a comment and the tests are failing.


steps = get_build_steps_func(project_name, project_yaml,
dockerfile_contents, config)
base_image_tag = project_yaml.get('ubuntu_version')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it be base_os_version?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, I fixed it.

This commit introduces a new JSON file containing the expected build steps for the OSS-Fuzz project on Ubuntu 24.04. The file includes various build configurations for different architectures and fuzzing engines, ensuring compatibility and proper setup for the fuzzing process.
@hunsche
Copy link
Copy Markdown
Contributor Author

hunsche commented Nov 5, 2025

/gcbrun trial_build.py bios-bmc-smm-error-logger

…y and consistency

test(build): Add unittest.main() call to enable test execution from command line
@hunsche
Copy link
Copy Markdown
Contributor Author

hunsche commented Nov 5, 2025

/gcbrun trial_build.py bios-bmc-smm-error-logger

Copy link
Copy Markdown
Contributor

@javanlacerda javanlacerda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the effort on this.

Could we re-run this pipeline for this branch, to assure that it will work with the changes?

@hunsche
Copy link
Copy Markdown
Contributor Author

hunsche commented Nov 5, 2025

Thanks for the effort on this.

Could we re-run this pipeline for this branch, to assure that it will work with the changes?

It's not that simple. The plan is to deploy the current change and see if it fixes the issue. The tests indicate it should work correctly.

Copy link
Copy Markdown
Contributor

@javanlacerda javanlacerda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for that!

@hunsche hunsche merged commit e89ca7a into master Nov 5, 2025
19 of 20 checks passed
@hunsche hunsche deleted the fix/ubuntu-dynamic-tagging branch November 5, 2025 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants