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

Automate release process #296

Closed
jcrist opened this issue Jul 24, 2020 · 3 comments
Closed

Automate release process #296

jcrist opened this issue Jul 24, 2020 · 3 comments

Comments

@jcrist
Copy link
Member

jcrist commented Jul 24, 2020

Currently the release process is manual, and has several error-prone steps. It would be good to automate much of this, both for ease of maintenance and to prevent mistakes. The artifacts from a release are:

  • dask-gateway and dask-gateway-server packages on pypi and conda-forge
  • daskgateway/dask-gateway and daskgateway/dask-gateway-server images on docker hub
  • A new helm chart packaged to https://dask.org/dask-gateway-helm-repo/

Releasing the packages

  • Update the versions for both dask-gateway and dask-gateway-server. These are currently stored in _version.py files in each package.

  • Commit and tag the release

git commit -m "Release $VERSION"
git tag -a $VERSION -m "Release $VERSION"
  • Build dask-gateway as an sdist and a bdist_wheel, and upload to pypi:
cd dask-gateway
python setup.py sdist
python setup.py bdist_wheel
twine upload dist/*
  • Build dask-gateway-server as an sdist and a bdist_wheel, and upload to pypi. Since this package has a binary component, this is a bit more involved:
cd dask-gateway-server
python setup.py sdist
python build_tools/build_macos.py
python build_tools.build_manylinux.py
twine upload dist/*
  • Update the dask-gateway-feedstock on conda-forge, and merge. Usually the conda-forge automation takes care of this for us.

Releasing the helm chart and docker images

  • Build the dask-gateway and dask-gateway-server docker images and upload to docker hub. If it's been a bit between releases and miniconda has updated a lot, we may also need to build the dask-gateway-base image that's shared between those, updating miniconda to a newer release (that dockerfile lives here). Generally when releasing I also bump the dependencies in the provided docker images to the latest stable version. We advise users to build their own dask-gateway images (since those run user code), but the dask-gateway-server image should work for all users and should be thoroughly tested. There's almost certainly a better system than this.
docker build dask-gateway-server/ --tag daskgateway/dask-gateway-server:$VERSION
docker tag dask-gateway-server:$VERSION daskgateway/dask-gateway-server:latest
docker build dask-gateway/ --tag daskgateway/dask-gateway:$VERSION
docker tag dask-gateway:$VERSION daskgateway/dask-gateway:latest
docker push daskgateway/dask-gateway-server:$VERSION
docker push daskgateway/dask-gateway-server:latest
docker push daskgateway/dask-gateway:$VERSION
docker push daskgateway/dask-gateway:latest
  • Update the helm chart with the new version info. We need to bump the version and apiVersion fields in the Chart.yaml, and update the image versions for the dask-gateway and dask-gateway-server images in the values.yaml file.

  • Package the helm chart and push it to helm chart repo. I've been doing this manually, which isn't terrible, but has a few steps. Chartpress does this automatically, but I scripting our own process wouldn't be to hard either, and we don't need all of chartpress's functionality. The general process is:

# Package the helm chart
cd resources/helm
mkdir temp
helm package dask-gateway --destination temp

# Update the repo index
helm repo index temp --url https://dask.org/dask-gateway-helm-repo/ --merge /path/to/dask-gateway-helm-repo/index.yaml

# Copy over the new files
cp -r temp/ /path/to/dask-gateway-helm-repo

# Commit and push daks-gateway-helm-repo
git add -a
git commit -m "Release $VERSION"
git push origin gh-pages
@fanshi118
Copy link
Contributor

Are there any tools you'd recommend for this? (i.e. bash, python, or makefile)

@consideRatio
Copy link
Collaborator

Python package related automation

I would suggest that building and pushing the packages are automated via GitHub workflow jobs like in this github Workflow if a tag is pushed, and that a tag should only be pushed if one has updated the version in _version.py manually first for both packages.

Docker image and and helm chart related automation

I suggest this is automated via a github workflow either by a mix of using scaffold and chartpress or solely by using chartpress. I'm very experienced in using chartpress but very inexperienced in using skaffold. I think though that its probably best to let a single GitHub Workflow with one or more coupled jobs (via needs) do image and chart build/push as they are quite related.

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