Skip to content

Commit

Permalink
Support upgrade scenario
Browse files Browse the repository at this point in the history
Signed-off-by: wen.rui <wen.rui@daocloud.io>
  • Loading branch information
Rei1010 committed Feb 7, 2025
1 parent c022221 commit e65dd14
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 12 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/auto-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,17 +135,17 @@ jobs:
uses: ./.github/workflows/call-release-website.yaml
with:
ref: ${{ needs.ensure-tag.outputs.tag }}
# excute a full e2e test when hami release
# execute a full e2e test when hami release
release-e2e:
needs: [release-notes]
needs: [ensure-tag, release-notes]
uses: ./.github/workflows/call-e2e.yaml
with:
ref: ${{ needs.ensure-tag.outputs.tag }}
type: "release"

# excute a compatibility test when hami release
# execute a compatibility test when hami release
release-e2e-upgrade:
needs: [release-notes]
needs: [ensure-tag, release-notes]
uses: ./.github/workflows/call-e2e-upgrade.yaml
with:
ref: ${{ needs.ensure-tag.outputs.tag }}
Expand Down
71 changes: 66 additions & 5 deletions .github/workflows/call-e2e-upgrade.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,71 @@ on:
permissions: write-all

jobs:
upgrade-e2e:
runs-on: ubuntu-latest
e2e-test:
strategy:
matrix:
include:
- device: nvidia
type: tesla-p4
# - device: nvidia
# type: rtx-4090
# - device: huawei
# type: ascend-910b
runs-on: [ "${{ matrix.device }}", "${{ matrix.type }}" ]
environment: ${{ matrix.device }}
env:
HAMI_VERSION: ${{ inputs.ref }}
E2E_TYPE: ${{ inputs.type }}
steps:
- name: e2e upgrade test
# https://github.com/actions/virtual-environments/issues/709
- name: checkout code
uses: actions/checkout@v4

- name: install Go
uses: actions/setup-go@v5
with:
go-version: "1.21"

- name: setup e2e env
run: |
make e2e-env-setup
- name: download hami helm
if: inputs.type == 'pullrequest'
uses: actions/download-artifact@v4
with:
name: chart_package_artifact
path: charts/

- name: download hami image
if: inputs.type == 'pullrequest'
uses: actions/download-artifact@v4
with:
name: hami-image
path: ./image

- name: load e2e image
if: inputs.type == 'pullrequest'
run: |
echo "Loading Docker image from image.tar..."
if [ -z "${VSPHERE_GPU_VM_IP}" ]; then
echo "Error: VSPHERE_GPU_VM_IP is not defined!"
exit 1
fi
scp ./image/image.tar root@$VSPHERE_GPU_VM_IP:/home/
ssh root@$VSPHERE_GPU_VM_IP "nerdctl load -i /home/image.tar"
ssh root@$VSPHERE_GPU_VM_IP "nerdctl image ls | grep hami"
- name: deploy previous release hami helm
run: |
HAMI_VERSION=$(git tag -l --sort=-v:refname | grep -v ${{ env.HAMI_VERSION }} | head -n3 )
E2E_TYPE="upgrade"
echo "Previous release tag is: ${HAMI_VERSION}"
make helm-deploy
- name: deploy release hami helm
run: |
make helm-deploy
- name: e2e test
run: |
echo "Need to add e2e upgrade test"
make e2e-test
2 changes: 1 addition & 1 deletion .github/workflows/call-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ jobs:
runs-on: [ "${{ matrix.device }}", "${{ matrix.type }}" ]
environment: ${{ matrix.device }}
env:
E2E_TYPE: ${{ inputs.type }}
HAMI_VERSION: ${{ inputs.ref }}
E2E_TYPE: ${{ inputs.type }}
steps:
- name: checkout code
uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions hack/deploy-helm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ if [ "${E2E_TYPE}" == "pullrequest" ]; then
echo "Error: No .tgz file found in the charts directory."
exit 1
fi
elif [ "${E2E_TYPE}" == "release" ]; then
elif [ "${E2E_TYPE}" == "release" ] || [ "${E2E_TYPE}" == "upgrade" ]; then
HELM_SOURCE="${HELM_NAME}/${HAMI_ALIAS}"
echo "Using remote chart: ${HELM_SOURCE}"
else
Expand Down Expand Up @@ -102,4 +102,4 @@ if ! util::check_pods_status "${KUBE_CONF}" ; then
exit 1
fi

echo "HAMI Helm Chart deployed successfully."
echo "HAMI Helm Chart deployed successfully."

0 comments on commit e65dd14

Please sign in to comment.