Open iameskild opened 2 years ago
Looking into this, two ways I see this being easier:
If we build both, the image in the chart could start out as a one-line Dockerfile, ensuring the right version:
FROM kbatch-dev/kbatch-proxy:$version
The main reason I see for building an image in the Python repo is continuous publishing, which we haven't done (though https://github.com/kbatch-dev/kbatch/pull/82 introduces it). If we're not doing that, I think there's little reason to build the image in the Python repo as opposed to the chart repo.
This could all be fairly straightforward by adding chartpress to the helm chart.
WDYT, @yuvipanda ?
Just created 0.5.0a1 with the new process, and it worked fine. Assuming making a kbatch-proxy package and chart release (not required to do together)
tbump
, e.g. tbump 0.5.0a1
git tag -am "release 0.5.0 alpha 1" 0.5.0-alpha.1; git push origin 0.5.0-alpha.1
)Not all of these steps are required unless making a prerelease of the Python package and propagating it through to a release of the chart all at the same time. 1-2 publish a Python package release, 3 updates the chart, 4 tags the chart (chart version does not need to match appVersion). 1-2
Leaving this open only until I write that down in the docs, which I'll try to do tomorrow.
At the moment, working through a pre-release process can be a little tricky given the differences between how Python and Helm handle pre-releases. Helm enforces a strict SemVer versioning scheme thus in order to cut a non-production (i.e. alpha/beta/RC) release, you must specify a pre-release in the following format:
For example,
0.4.0-rc1
.This conflicts with how Python handles pre-releases. Python PEP 440 outlines the particular syntax that should be followed which also includes a discussion on version "normalization". According to Python PEP 440, pre-releases are normalized as follows:
0.4.0-rc1
becomes0.4.0rc1
.Now because of these differences and the fact that the docker image is tagged using the python release version syntax, when the helm chart of the same pre-release version is pulled and installed, the
container.image
indeployment.yaml
is unable to find this version. It's looking for0.4.0-rc1
when it needs0.4.0rc1
.To get this to work more smoothly, we can either add/update the tag using the
docker/metadata-action
or find a way to specify the tag incontainer.image
indeployment.yaml
.