Skip to content

ROX-10613: Use ubi-minimal for scanner-db #956

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

Merged
merged 14 commits into from
Oct 26, 2022
Merged

Conversation

janisz
Copy link
Contributor

@janisz janisz commented Oct 4, 2022

janisz added a commit to janisz/release that referenced this pull request Oct 4, 2022
@janisz
Copy link
Contributor Author

janisz commented Oct 4, 2022

I guess to test it we need to first merge openshift/release#32848

Copy link
Contributor

@vladbologa vladbologa left a comment

Choose a reason for hiding this comment

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

I gave this a try, because I wanted to see whether local arm64 builds would still work with these changes.

And it seems that they don't. I'm running into a similar issue like here:
https://github.com/stackrox/stackrox/blob/989dbbaca060d22745d03e75f427e5841d0d3d5c/image/postgres/create-bundle.sh#L36

But I can't make the same workaround as @connorgorman did, because microdnf doesn't implement the --nogpgcheck option.

This is just FYI, I guess arm builds are not very important atm.

@janisz janisz force-pushed the ubi-minimal-scanner-db branch from a9f7976 to 39b6c1e Compare October 5, 2022 19:16
@janisz
Copy link
Contributor Author

janisz commented Oct 5, 2022

@vladbologa Thanks for testing. Could you try now?

@janisz janisz requested a review from vladbologa October 5, 2022 19:23
@janisz janisz requested a review from RTann October 6, 2022 10:57
@janisz janisz requested a review from vladbologa October 6, 2022 17:39
Copy link
Contributor

@vladbologa vladbologa left a comment

Choose a reason for hiding this comment

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

works on arm64, thanks!

@janisz janisz requested a review from erthalion October 7, 2022 12:33
@@ -25,18 +25,27 @@ COPY --from=extracted_bundle /bundle/etc/postgresql.conf /bundle/etc/pg_hba.conf

ARG POSTGRESQL_ARCH=x86_64

RUN groupadd -g 70 postgres && \
RUN curl -sSLf https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-${POSTGRESQL_ARCH}/pgdg-redhat-repo-latest.noarch.rpm -o /tmp/pg_repo.rpm && \
Copy link
Collaborator

Choose a reason for hiding this comment

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

how come we removed the gpg key import? I think it'd still be best to keep that. Perhaps just for x86_64?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Previously we don't need that and it's in repo definition rpm so I think we don't need to add it manually. Something is broken with arm package I think it's build with different gpg key then used to sign.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we re-add it here just for x86_64 prior to rpm -i /tmp/pg_repo.rpm to remove the warning that's generated?

@RTann
Copy link
Collaborator

RTann commented Oct 7, 2022

Let's keep the gpg key check for x86_64. We can keep it out for aarch64 since that's just for dev purposes (though let's also add a comment saying we are skipping it due to the fact it's just for dev purposes)

@janisz
Copy link
Contributor Author

janisz commented Oct 10, 2022

✔️ Let's keep the gpg key check for x86_64.
✔️ let's also add a comment saying we are skipping it due to the fact it's just for dev purposes
@RTann PTAL

@janisz janisz requested a review from RTann October 10, 2022 08:10
@janisz
Copy link
Contributor Author

janisz commented Oct 19, 2022

@RTann ping

Copy link
Collaborator

@RTann RTann left a comment

Choose a reason for hiding this comment

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

Confirmed the change has been made as expected between both files:

$ diff -du image/db/rhel/Dockerfile image/db/rhel/Dockerfile.slim 
--- image/db/rhel/Dockerfile	2022-10-24 11:30:22.000000000 -0700
+++ image/db/rhel/Dockerfile.slim	2022-10-24 11:30:22.000000000 -0700
@@ -10,7 +10,7 @@
 
 FROM ${BASE_REGISTRY}/${BASE_IMAGE}:${BASE_TAG} AS base
 
-LABEL name="scanner-db" \
+LABEL name="scanner-db-slim" \
       vendor="StackRox" \
       maintainer="support@stackrox.com" \
       summary="Image scanner database for the StackRox Kubernetes Security Platform" \
@@ -57,7 +57,7 @@
 # This is equivalent to postgres:postgres.
 USER 70:70
 
-COPY --from=extracted_bundle /bundle/docker-entrypoint-initdb.d/definitions.sql.gz /docker-entrypoint-initdb.d/
+ENV ROX_SLIM_MODE="true"
 
 ENTRYPOINT ["docker-entrypoint.sh"]

@RTann
Copy link
Collaborator

RTann commented Oct 24, 2022

@janisz it looks like you'll need to rebase for CI to pass

@janisz
Copy link
Contributor Author

janisz commented Oct 24, 2022

Are you sure. I think we need to merge osci release config change first and then CI will pass.

@RTann
Copy link
Collaborator

RTann commented Oct 24, 2022

Are you sure. I think we need to merge osci release config change first and then CI will pass.

that, too, but ci/prow/images shows me this as well:

error: Your local changes to the following files would be overwritten by checkout:
	.openshift-ci/build/Dockerfile.generate-genesis-dump

@janisz janisz force-pushed the ubi-minimal-scanner-db branch from 10d5447 to 5b6b31e Compare October 25, 2022 08:41
@janisz
Copy link
Contributor Author

janisz commented Oct 25, 2022

Rebased

openshift-merge-robot pushed a commit to openshift/release that referenced this pull request Oct 26, 2022
* Use ubi-minimal for scanner-db

Refs: stackrox/scanner#956

* Update stackrox-scanner-master.yaml

* Update stackrox-scanner-master.yaml

* Update stackrox-scanner-master.yaml
@janisz
Copy link
Contributor Author

janisz commented Oct 26, 2022

/retest

@ghost
Copy link

ghost commented Oct 26, 2022

Images are ready for the commit at 5b6b31e.

To use the images, use the tag 2.26.x-19-g5b6b31e06b.

@openshift-ci
Copy link

openshift-ci bot commented Oct 26, 2022

@janisz: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-tests 5b6b31e link false /test e2e-tests

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@janisz janisz merged commit 1cf4201 into master Oct 26, 2022
@janisz janisz deleted the ubi-minimal-scanner-db branch October 26, 2022 13: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