Skip to content

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

@aiyengar2

Description

@aiyengar2

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions