-
Notifications
You must be signed in to change notification settings - Fork 12
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
ROX-20750: Onboard scanner-db-slim to Konflux #1436
ROX-20750: Onboard scanner-db-slim to Konflux #1436
Conversation
Skipping CI for Draft Pull Request. |
Co-authored-by: red-hat-konflux <rhtap@redhat.com>
io.k8s.display-name="scanner-db" \ | ||
name="rhacs-scanner-db-rhel8" | ||
|
||
COPY blob-pg-definitions.sql.gz \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that /docker-entrypoint-initdb.d/definitions.sql.gz
is now owned by 70:70
(postgres:postgres), the user that executes the container.
It was owned root
before, read allowed for all users.
Konflux EC fails because of scanner-v4, unrelated to the changes in this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Just a few cosmetic notes
COPY blob-pg-definitions.sql.gz \ | ||
/docker-entrypoint-initdb.d/definitions.sql.gz |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, you can keep root
ownership by doing this:
COPY blob-pg-definitions.sql.gz \ | |
/docker-entrypoint-initdb.d/definitions.sql.gz | |
USER 0:0 | |
COPY blob-pg-definitions.sql.gz \ | |
/docker-entrypoint-initdb.d/definitions.sql.gz | |
USER 70:70 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it necessary though or was root ownership just an artifact of the midstream Dockerfile?
- name: TARGET_STAGE | ||
value: scanner-db |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically, this isn't necessary since Dockerfile will be built until the final stage by default. Although I'm happy if you keep this for explicitness.
- name: TARGET_STAGE | ||
value: scanner-db-slim |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After diffing normal and slim pipelines, a thought crossed my mind. It feels a bit wrong that this essential setting which actually differentiates slim and non-slim builds is hidden somewhere in a middle of the file.
How would you feel about introducing a top-level param (under spec.params
) for this value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Co-authored-by: Misha Sugakov <537715+msugakov@users.noreply.github.com>
84ee52c
into
tm/scanner-slim-konflux-onboarding
How are
scanner-db-slim
pipelines different fromscanner-db
?->
scanner-db
includes SQL definitions,scanner-db-slim
ships without->
TARGET_STAGE
points to the respective stage in the DockerfileMulti-stage Docker build:
We have a
scanner-db-common
stage.The final
scanner-db-slim
is just this plus updated labels andROX_SLIM_MODE
env var.The full
scanner-db
, in addition toscanner-common
stage, copies the SQL definitions to the container image (and has slightly different labels).Validation
Looking at the images and confirming that slim does not have SQL definitions.
docker run -it --entrypoint /bin/sh quay.io/redhat-user-workloads/rh-acs-tenant/acs/scanner-db-slim:on-pr-679696d44285c6dc3d20c72ebdd79ddabffacf99
docker run -it --entrypoint /bin/sh quay.io/redhat-user-workloads/rh-acs-tenant/acs/scanner-db:on-pr-679696d44285c6dc3d20c72ebdd79ddabffacf99
Do the new pipelines match?
Do the slim and full pipelines match?
TODO:
tm/scanner-slim-konflux-onboarding
, after ROX-20752: scanner-slim konflux onboarding #1429 is merged should be rebased.