Skip to content

Commit

Permalink
Add sync images step and scripts in release process
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeffwan committed Oct 9, 2024
1 parent 85a7411 commit 28a39cf
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 18 deletions.
41 changes: 23 additions & 18 deletions docs/source/development/release.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,17 @@ Follow these steps to ensure a smooth and consistent release cycle.
1. Prepare the code
-----------------------------

Option 1.1: minor version release without prior release candidates
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Option 1 minor version release
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

For new minor version release like ``v0.1.0``, please checkout a new branch named ``release-0.1``.

.. code-block:: bash
git checkout -b release-v0.1
git checkout -b release-0.1 # cut from main branch
git fetch origin main
git rebase origin/main
git push origin release-v0.1
.. note::
If origin doesn't points to upstream, let's say you fork the remote, ``upstream`` or other remotes should be right remote to push to.

Option 1.2: minor version release with prior release candidates
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. code-block:: bash
git checkout release-v0.1
git fetch origin main
git rebase origin/main
git push origin release-v0.1
git push origin release-0.1
.. note::
If origin doesn't points to upstream, let's say you fork the remote, ``upstream`` or other remotes should be right remote to push to.
Expand All @@ -50,13 +37,16 @@ for patch release, we do not rebase ``main`` because it will introduce new featu
.. code-block:: bash
git checkout release-0.1
git fetch origin
git rebase origin/release-0.1
# not need to push, it should be update to date.
Cut a PR
--------

Make sure the manifest images tags and updated and python version is updated. A sample PR is `Cut v0.1.0-rc.2 release <https://github.com/aibrix/aibrix/pull/226>`_.
Make sure the manifest images tags and updated and python version is updated. A sample PR is `Cut v0.1.0-rc.3 release <https://github.com/aibrix/aibrix/pull/280>`_.
Merge the PR.

.. note::
Expand Down Expand Up @@ -111,3 +101,18 @@ Optionally attach binaries, documentation, or other assets. In the end, let's pu
:alt: draft-release
:width: 70%
:align: center

Sync images to Volcano Engine Container Registry
------------------------------------------------

Currently, release pipeline only push images to dockerhub. In order to use them in VKE,
we need to retag the images and push to VKE Container Registry.

.. note::
It requires you to use a machine that have both VKE and Dockerhub access.
Do not forget to get the temporary credential and login the registry service before pushing.

.. code-block:: bash
./hack/sync-images.sh v0.1.0-rc.3 aibrix-container-registry-cn-beijing.cr.volces.com
./hack/sync-images.sh v0.1.0-rc.3 aibrix-container-registry-cn-shanghai.cr.volces.com
24 changes: 24 additions & 0 deletions hack/sync-images.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

# check the required parameters
if [ -z "$1" ] || [ -z "$2" ]; then
echo "Error: Missing required parameters."
echo "Usage: $0 <version> <region>"
echo "Example: $0 v0.1.0-rc.3 aibrix-container-registry-cn-beijing.cr.volces.com"
exit 1
fi

# aibrix tag,e.g. v0.1.0-rc.3
# registry,e.g. aibrix-container-registry-cn-beijing.cr.volces.com
VERSION=$1
REGISTRY=$2

# image list
IMAGES=("runtime" "users" "plugins" "controller-manager")

# pull、retag and push images
for IMAGE in "${IMAGES[@]}"; do
docker pull aibrix/${IMAGE}:${VERSION}
docker tag aibrix/${IMAGE}:${VERSION} ${REGISTRY}/aibrix/${IMAGE}:${VERSION}
docker push ${REGISTRY}/aibrix/${IMAGE}:${VERSION}
done

0 comments on commit 28a39cf

Please sign in to comment.