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

ROX-19655: build infra with multi-stage image #981

Merged
merged 6 commits into from
Sep 13, 2023

Conversation

tommartensen
Copy link
Contributor

No description provided.

@tommartensen tommartensen requested a review from a team as a code owner September 11, 2023 08:22
@tommartensen tommartensen self-assigned this Sep 11, 2023
@ghost
Copy link

ghost commented Sep 11, 2023

A single node development cluster (infra-pr-981) was allocated in production infra for this PR.

CI will attempt to deploy us.gcr.io/stackrox-infra/infra-server:0.7.11-11-gca7882e581 to it.

🔌 You can connect to this cluster with:

gcloud container clusters get-credentials infra-pr-981 --zone us-central1-a --project srox-temp-dev-test

🛠️ And pull infractl from the deployed dev infra-server with:

nohup kubectl -n infra port-forward svc/infra-server-service 8443:8443 &
make pull-infractl-from-dev-server

🚲 You can then use the dev infra instance e.g.:

bin/infractl -k -e localhost:8443 whoami

⚠️ Any clusters that you start using your dev infra instance should have a lifespan shorter then the development cluster instance. Otherwise they will not be destroyed when the dev infra instance ceases to exist when the development cluster is deleted. ⚠️

Further Development

☕ If you make changes, you can commit and push and CI will take care of updating the development cluster.

🚀 If you only modify configuration (chart/infra-server/configuration) or templates (chart/infra-server/{static,templates}), you can get a faster update with:

make install-local

Logs

Logs for the development infra depending on your @stackrox.com authuser:

Or:

kubectl -n infra logs -l app=infra-server --tail=1 -f

@tommartensen tommartensen changed the title build infra with multi-stage image ROX-19655: build infra with multi-stage image Sep 12, 2023
Copy link
Contributor

@BradLugo BradLugo left a comment

Choose a reason for hiding this comment

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

LGTM. One little nit, just in case


FROM alpine:3.18.3 as app

COPY --from=golang-builder /go/src/github.com/stackrox/infra/bin/infra-server-linux-amd64 /infra-server
Copy link
Contributor

Choose a reason for hiding this comment

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

This is probably silly to bring up, but is there a possibility that rhtap doesn't use amd64 (I know cloud providers have been making arm64 more relevant these days)? If that's a concern, we can do a regular go build so it creates a binary for the arch that's building it (this assumes they build the container image with the same arch). Not gonna block on this tho

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not silly. RHTAP only supports amd64 builds, with multi-arch planned for beginning of next year.
I would leave it as is, as we'll keep using the GHA build for a while :-)

Copy link
Contributor

@gavin-stackrox gavin-stackrox left a comment

Choose a reason for hiding this comment

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

LGTM!

@tommartensen tommartensen merged commit f6aceca into master Sep 13, 2023
7 checks passed
@tommartensen tommartensen deleted the tm/multi-stage-build branch September 13, 2023 07: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