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

Switch to using Docker instead of using pulled-in binaries #99

Open
aiyengar2 opened this issue May 19, 2023 · 0 comments
Open

Switch to using Docker instead of using pulled-in binaries #99

aiyengar2 opened this issue May 19, 2023 · 0 comments

Comments

@aiyengar2
Copy link
Contributor

aiyengar2 commented May 19, 2023

Since charts-build-scripts directly exec the diff call, as seen here:

pathToDiffCmd, err := exec.LookPath("diff")

It doesn't have the same results on all machines since the version of diff used can be different.

To solve this, we should be using containerized rancher/charts-build-scripts runs instead of pulling in an appropriate charts-build-scripts binary to a machine (the current approach).

To do this, a couple of steps needs to be taken:

  1. We need to fix the Dockerfile to actually work: filed a PR in Fix Dockerfile to use SLES bci-base and include GNU patch #98 to resolve this
  2. Drone / GitHub workflows need to be set up to actually create the rancher/charts-build-scripts images and put them in a publicly accessible Docker repository
  3. make commands in https://github.com/rancher/charts-build-scripts/blob/master/templates/template/Makefile need to be modified to actually use this binary
  4. changes need to be made across relevant repos to use this appraoch

I pushed an image based on my current PR in https://github.com/rancher/charts-build-scripts/blob/master/templates/template/Makefile (based on v0.4.2) to my DockerHub fork for now, in case anyone wants to use it. To create your own, I ran REPO=arvindiyengar TAG=dev make build; REPO=arvindiyengar TAG=dev make package.

To run all the relevant commands in the containerized approach today, you can do that as follows:

# Assuming your current pwd is your charts directory (rancher/charts, rancher/rke2-charts, etc.)

PACKAGE=rancher-monitoring/rancher-monitoring

docker run -v $(pwd):/charts -w /charts -e USE_CACHE=1 -e PACKAGE=${PACKAGE} arvindiyengar/charts-build-scripts:dev charts-build-scripts prepare

docker run -v $(pwd):/charts -w /charts -e USE_CACHE=1 -e PACKAGE=${PACKAGE} arvindiyengar/charts-build-scripts:dev charts-build-scripts patch

docker run -v $(pwd):/charts -w /charts -e USE_CACHE=1 -e PACKAGE=${PACKAGE} arvindiyengar/charts-build-scripts:dev charts-build-scripts clean

docker run -v $(pwd):/charts -w /charts -e USE_CACHE=1 -e PACKAGE=${PACKAGE} arvindiyengar/charts-build-scripts:dev charts-build-scripts charts

docker run -v $(pwd):/charts -w /charts -e USE_CACHE=1 -e PACKAGE=${PACKAGE} arvindiyengar/charts-build-scripts:dev charts-build-scripts validate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants