8000 Inherit variables from main Dockerfile to agent's Dockerfile · Issue #41741 · rancher/rancher · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Inherit variables from main Dockerfile to agent's Dockerfile #41741

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

Closed
maxsokolovsky opened this issue Jun 5, 2023 · 4 comments
Closed

Inherit variables from main Dockerfile to agent's Dockerfile #41741

maxsokolovsky opened this issue Jun 5, 2023 · 4 comments
Assignees
Labels
kind/enhancement Issues that improve or augment existing functionality QA/M status/dev-validate team/area1
Milestone

Comments

@maxsokolovsky
Copy link
Contributor
maxsokolovsky commented Jun 5, 2023

Is your feature request related to a problem? Please describe.
Related to #41730, which is a short-term solution to the problem of having to specify the pinned webhook version upstream (package/Dockerfile) and downstream (package/Dockerfile.agent).

The goal is to minimize the number of steps release captains need to take to prepare a release. The more things are automated, the better.

Describe the solution you'd like

Describe alternatives you've considered

Additional context

SURE-6429

@maxsokolovsky maxsokolovsky added the kind/enhancement Issues that improve or augment existing functionality label Jun 5, 2023
@maxsokolovsky maxsokolovsky added this to the 2023-Q3-v2.7x milestone Jun 5, 2023
moio added a commit that referenced this issue Jun 7, 2023
These tests broke because of https://jira.suse.com/browse/SURE-6429, #41741

Rancher will pull the wrong development version of rancher-webhook during CI tests.

Fix is available in 2.7.4, but that also pulls in other changes, so I am temporarily disabling the tests here.

Signed-off-by: Silvio Moioli <silvio@moioli.net>
@anupama2501 anupama2501 removed their assignment Jun 15, 2023
@anupama2501 anupama2501 self-assigned this Jun 23, 2023
@anupama2501
Copy link
Contributor
anupama2501 commented Jul 5, 2023

QA to validate:

Fresh install checks without passing the env var
Fresh install checks
Upgrade checks

@maxsokolovsky
Copy link
Contributor Author

QA Testing

Use the default config

Build Rancher for linux amd64

Build and package Rancher (and the agent) using our scripts.

Currently, the scripts assume the desired OS and architecture are those of the current system.
Thus, you'd need to adjust the scripts for linux amd64.
Prepend GOOS=linux GOARCH=amd64 to the commands that build the agent and server binaries:

CGO_ENABLED=0 go build -tags k8s -gcflags="all=${GCFLAGS}" -ldflags "-X main.VERSION=$VERSION $LINKFLAGS" -o bin/agent ./cmd/agent

CGO_ENABLED=0 go build -tags k8s \

Modify the docker build command invocations, so that they start as
docker buildx build --platform linux/amd64 rather than docker build:

docker build \

docker build \

Run scripts

Run build and package. Tag the resulting two images however you want and push them.

Run your custom Rancher build with your custom agent

For Docker, run:
docker run -d -p 80:80 -p 443:443 -e CATTLE_AGENT_IMAGE={your-agent-image} --privileged --name rancher {your-main-image}

For an HA setup with Helm, specify the agent and main image as needed.

Check component versions in a running Rancher instance

Ensure the version of the webhook deployed in the local cluster is one you find in the build.yaml. Same for the
fleet agent.

Change the configuration

Change some configuration value in the build.yaml file. For example, change the version of webhookVersion to be
2.0.4+up0.3.4. Then run go generate. This causes all codegen programs to run, which is wasteful. Instead, you can
run just the program in pkg/codegen/buildconfig/main.go. As a result, your Git working area has two changed files:
the build.yaml file itself and pkg/buildconfig/constants.go.

Run the scripts again, tag and push the images. Repeat the previous test and ensure that the webhook deployed in the
local cluster is the one you specified in your configuration update.

@MKlimuszka MKlimuszka modified the milestones: v2.8-Next1, v2.8.3 Jan 9, 2024
@MKlimuszka MKlimuszka modified the milestones: v2.8.3, v2.8-Next1 Jan 22, 2024
@andreas-kupries
Copy link
Contributor

As it is closed as completed should it still be in review ?

@maxsokolovsky
Copy link
Contributor Author

Moved to Done, thanks for catching this.

@zube zube bot removed the [zube]: Done label May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Issues that improve or augment existing functionality QA/M status/dev-validate team/area1
Projects
None yet
Development

No branches or pull requests

6 participants
0