Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Inject COLLECTOR_VERSION into Konflux-built images #1694

Merged
merged 7 commits into from
Jun 5, 2024

Conversation

msugakov
Copy link
Contributor

@msugakov msugakov commented May 31, 2024

Description

Following up on ROX-19958, I decided to check if make tag for collector would print the same thing as we tag the image. It will not. Here I try to address that.

The only place I found where COLLECTOR_TAG/COLLECTOR_VERSION is meaningfully used is logging during the startup

log "Collector Version: ${COLLECTOR_VERSION}"

This is, for reference, how COLLECTOR_VERSION is set downstream: https://gitlab.cee.redhat.com/stackrox/rhacs-midstream/-/blob/50310ae51698a9f1a27382764dd9957fb12ab75c/distgit/containers/rhacs-collector/Dockerfile.in#L109

I conclude, the precision is not very important there, it is free-form, and 3.18.x-284-ge3f5c5566c-fast should be fine.

Also, as Tom looked into Konflux releases, I think version label contents aren't important for releasing (unlike downstream where it is important). Therefore, I'm addressing that thing.

If/when we will retag images, we can revisit the label but that's for later.

NPROC change is not connected to everything else but why not.

Checklist

  • Investigated and inspected CI test results
  • [ ] Updated documentation accordingly - not needed.

Automated testing

None will be added.

  • Added unit tests
  • Added integration tests
  • Added regression tests

Testing Performed

  • CI is green enough (excluding Konflux Enterprise Contract which is ok to yell at us).
  • Konflux-built image still has -fast suffix in tag.
  • make tag manually ran in the repo does not fail and does not output -fast.
  • Konflux-built image has the same thing as tag in the version label and has $COLLECTOR_VERSION environment variable defined.
  • GHA-built image is still fine.

@msugakov msugakov force-pushed the misha/inject-collector-version-konflux branch from e3f5c55 to eb4d122 Compare May 31, 2024 15:10
@msugakov msugakov changed the title Bump build parallelism to 4 chore: Inject COLLECTOR_VERSION into Konflux-built images May 31, 2024
Copy link
Contributor

@tommartensen tommartensen left a comment

Choose a reason for hiding this comment

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

Two style nits, LGTM.

@tommartensen
Copy link
Contributor

Konflux-built image has the same thing as tag in the version label and has $COLLECTOR_VERSION environment variable defined.

Also the correct version is logged:

$ podman run quay.io/rhacs-eng/collector:3.18.x-283-geb4d1224d4-fast
Collector Version: 3.18.x-283-geb4d1224d4-fast
OS: Linux
Kernel Version: 6.7.5-200.fc39.aarch64
Starting StackRox Collector...
...

@msugakov
Copy link
Contributor Author

msugakov commented Jun 5, 2024

Regarding validation of GHA images.

Due to a known thing, collector images in PR get a different tag.
For instance, in Konflux I get 3.18.x-284-gb177db993f (CI), same as when I run make tag locally. In GHA it is 3.18.x-285-g33f14d7e5e (CI).
Apart from that, COLLECTOR_VERSION=3.18.x-285-g33f14d7e5e is there and version label is unset. Most important, we did not overwrite GHA images because determine-image-tag returned -fast in the tag 3.18.x-284-gb177db993f-fast, and there is quay.io/rhacs-eng/collector:3.18.x-284-gb177db993f-fast but no quay.io/rhacs-eng/collector:3.18.x-284-gb177db993f.

msugakov and others added 7 commits June 5, 2024 12:07
@msugakov msugakov force-pushed the misha/inject-collector-version-konflux branch from fd9df34 to 4fb5f6d Compare June 5, 2024 10:07
@msugakov msugakov marked this pull request as ready for review June 5, 2024 12:18
@msugakov msugakov requested review from a team as code owners June 5, 2024 12:18
@msugakov
Copy link
Contributor Author

msugakov commented Jun 5, 2024

Creation of test VMs is known to be broken ATM. https://redhat-internal.slack.com/archives/CFMQ5C2TT/p1717585747118389

Will merge.

@msugakov msugakov merged commit cabaa6d into master Jun 5, 2024
114 of 119 checks passed
@msugakov msugakov deleted the misha/inject-collector-version-konflux branch June 5, 2024 14:02
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.

3 participants