Skip to content

Releasing

Zdeněk Materna edited this page Jul 11, 2022 · 6 revisions

This guide is mainly for maintainers of the repository and documents procedures that are necessary to make (high-quality) releases.

Before Release

  • Make sure VERSION and CHANGELOG.md files are up-to-date and in sync.
  • Never release locally modified stuff - first merge changes and then do a release (to make sure that CI is happy).
  • Make sure that there are no cyclic dependencies between packages (not checked so far by CI).

Release Itself

  1. Build and test docker images.
    1. The image tag is specified in src/docker/service_name/BUILD file - keep that in sync with the Python package version.
    2. Build images using ./pants package src/docker/service_name/Dockerfile.
    3. Test them locally (there are no automated tests for Docker images so far).
  2. Generate Python packages, push them to Test PyPI, and try to install them in a clean virtual environment.
    1. Generate Python packages (.whl, .tar.gz) using ./pants package src/python/SERVICE_NAME:SERVICE_NAME_dist (for a specific one) or ./pants filter --target-type=python_distribution :: | xargs ./pants package (all). The packages are created in the dist folder.
    2. To upload a package to the test server (for verification), use twine upload --repository testpypi PACKAGE_NAME-version* (e.g. arcor2_execution-0.19.3* which will upload both arcor2_execution-0.19.3-py38-none-any.whl and arcor2_execution-0.19.3.tar.gz files).
    3. Create a new virtual environment (python3.9 -m venv release_test_venv), activate it (source release_test_venv/bin/activate) and try to install released Python package from Test PyPI (pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ your-package).
  3. Create a GitHub release for each released package with the tag and the name PACKAGE_NAME/VERSION (e.g. arcor2_execution/0.19.3).
    1. Attach previously generated packages as assets.
  4. Publish Docker images using ./pants publish src/docker/service_name/Dockerfile (to be able to upload an image to docker hub, you need to be logged in using docker login).
  5. Upload previously created Python packages to PyPI.
    1. Using twine upload --repository pypi PACKAGE_NAME.
    2. To upload the packages, you need credentials for robo_fit.
    3. WARNING - once you upload a package with a certain version to the PyPI, it could not be updated anymore and you will have to release a new version, so make double sure you upload the correct package

After Release

  • Update the main README.
  • Update docker-compose.yml files with new versions of services.
Clone this wiki locally