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

Two version deploy support #2171

Merged
merged 50 commits into from
Jan 10, 2024
Merged
Changes from 1 commit
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
bc740db
fix e2e test to work in a 2-version environment
hlts2 Sep 7, 2023
ca2c669
add workflow to create backport pr
hlts2 Sep 7, 2023
9813973
add reusable workflow to detect ci container image tag
hlts2 Sep 7, 2023
239f8d5
use dynamic ci container image tag
hlts2 Sep 7, 2023
a929bc5
add workflow execution rule
hlts2 Sep 7, 2023
a3f4019
deleted unnecessary workflow execution rule
hlts2 Sep 8, 2023
ed1ccd4
add new workflow to build docker images when release branch is created
hlts2 Sep 8, 2023
4cb78ed
refactor curl command
hlts2 Sep 8, 2023
4b4eb63
use dynamic ci container image for unit test and hack test
hlts2 Sep 8, 2023
79c269a
add new workflow execution rule to codeql and protobuf build
hlts2 Sep 8, 2023
624a628
add workflow to release
hlts2 Sep 8, 2023
3a96489
make format
hlts2 Sep 8, 2023
2842756
deleted unnecessary code
hlts2 Sep 8, 2023
3eeca3d
add step to create release tag and release commit
hlts2 Sep 8, 2023
41c3418
deleted invalid environment variable
hlts2 Sep 8, 2023
4b18281
add release logic and auto generate code for release
hlts2 Sep 11, 2023
71df66e
deleted unnecessary code
hlts2 Sep 11, 2023
cff1398
bugfix branch specification
hlts2 Sep 11, 2023
b54e74c
bugfix release logic
hlts2 Sep 11, 2023
76b2f6d
add checkout to release branch
hlts2 Sep 12, 2023
d64f734
bugfix set step result and add gpg import step
hlts2 Sep 12, 2023
e0afbae
fix typo
hlts2 Sep 12, 2023
9e392cf
add new workflow for two version support
hlts2 Sep 20, 2023
e1a1749
add space to improve readability
hlts2 Sep 20, 2023
82e66ee
deleted unnecessary line
hlts2 Sep 20, 2023
bfe2f72
bugfix github object error for release pr
hlts2 Sep 20, 2023
40f7291
add cluster-info dump
hlts2 Sep 25, 2023
095bae9
change workflow name
hlts2 Sep 26, 2023
c386808
fix: apply latest workflow changes and fix actionlint warning
hlts2 Oct 24, 2023
06233c4
Merge branch 'main' into feature/ci/two-version-deploy-support
hlts2 Nov 16, 2023
617f879
Merge branch 'main' into feature/ci/two-version-deploy-support
hlts2 Nov 21, 2023
9871ef5
Merge branch 'main' into feature/ci/two-version-deploy-support
hlts2 Nov 22, 2023
51bd500
Merge branch 'main' into feature/ci/two-version-deploy-support
hlts2 Nov 28, 2023
d445acb
Merge branch 'main' into feature/ci/two-version-deploy-support
hlts2 Dec 4, 2023
1e15f75
Merge branch 'main' into feature/ci/two-version-deploy-support
hlts2 Dec 7, 2023
9b6c697
Merge branch 'main' into feature/ci/two-version-deploy-support
hlts2 Dec 7, 2023
e45d41f
fix: add new line for readability
hlts2 Dec 7, 2023
9c1bb13
Merge branch 'main' into feature/ci/two-version-deploy-support
hlts2 Dec 7, 2023
c5b69f4
Merge branch 'main' into feature/ci/two-version-deploy-support
hlts2 Dec 7, 2023
185ca69
Merge branch 'main' into feature/ci/two-version-deploy-support
hlts2 Dec 7, 2023
cdf61a6
Merge branch 'main' into feature/ci/two-version-deploy-support
hlts2 Dec 7, 2023
3a6562e
Merge branch 'main' into feature/ci/two-version-deploy-support
hlts2 Dec 12, 2023
4ccfc7c
fix: deleted unnecessary file
hlts2 Dec 12, 2023
cf93296
feat: add release branch image creation logic for new component
hlts2 Dec 12, 2023
dacaf04
Merge branch 'main' into feature/ci/two-version-deploy-support
hlts2 Dec 12, 2023
297c74b
Merge branch 'main' into feature/ci/two-version-deploy-support
hlts2 Dec 15, 2023
16ced22
Merge branch 'main' into feature/ci/two-version-deploy-support
hlts2 Dec 20, 2023
1ae1c91
Merge branch 'main' into feature/ci/two-version-deploy-support
hlts2 Dec 26, 2023
9c17ef3
Merge branch 'main' into feature/ci/two-version-deploy-support
hlts2 Jan 9, 2024
3d12458
fix: execute make format to update license
hlts2 Jan 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix e2e test to work in a 2-version environment
Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>
hlts2 committed Nov 8, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit bc740db04eaa117fe811c87c1a69c4b407dbb427
34 changes: 29 additions & 5 deletions .github/actions/determine-docker-image-tag/action.yaml
Original file line number Diff line number Diff line change
@@ -20,6 +20,9 @@ outputs:
PRIMARY_TAG:
description: "Primary tag"
value: ${{ steps.determine_tag_name.outputs.PRIMARY_TAG }}
DEFAULT_TAG:
description: "default tag. Tag to be used if the primary tag does not exist"
value: ${{ steps.determine_tag_name.outputs.DEFAULT_TAG }}

runs:
using: "composite"
@@ -28,6 +31,7 @@ runs:
shell: bash
run: |
echo "GITHUB_REF $GITHUB_REF"
echo "GITHUB_BASE_REF $GITHUB_BASE_REF"
echo "GITHUB_EVENT_PATH $GITHUB_EVENT_PATH"
echo "GITHUB_EVENT_NAME ${{ github.event_name }}"
echo "GITHUB_EVENT_NUMBER ${{ github.event.number }}"
@@ -38,20 +42,40 @@ runs:
run: |
if [[ "$GITHUB_REF" =~ ^refs/tags/.* ]]; then
tag_name=`echo $GITHUB_REF | sed -e 's:^refs/tags/::'`
echo "${tag_name}" > versions/VALD_VERSION
primary_tag="${tag_name}"
elif [ "${{ github.event_name }}" = "pull_request" ]; then
pr_num=`cat $GITHUB_EVENT_PATH | jq -r ".number"`
echo "PR-${pr_num}" > versions/VALD_VERSION
primary_tag="pr-${pr_num}"
elif [ "${{ github.event_name }}" = "pull_request_target" ]; then
default_tag="${tag_name}"
elif [[ "${{ github.event_name }}" = "pull_request" || "${{ github.event_name }}" = "pull_request_target" ]]; then
pr_num=`cat $GITHUB_EVENT_PATH | jq -r ".number"`
echo "PR-${pr_num}" > versions/VALD_VERSION
primary_tag="pr-${pr_num}"
default_tag="nightly"
# For pull request to the release branch, use the release branch latest tag as the default tag (vx.x).
# This is only set if the event that triggers the workflow execution is pull_request or pull_request_target.
if [[ "$GITHUB_BASE_REF" =~ ^release/v([0-9]+)\.([0-9]+)$ ]]; then
tag_name=`echo $GITHUB_BASE_REF | sed -e 's:^release/::'`
default_tag="${tag_name}"
fi
elif [ "$GITHUB_REF" = "refs/heads/main" ]; then
echo "nightly" > versions/VALD_VERSION
primary_tag="nightly"
default_tag="nightly"
elif [[ "$GITHUB_REF" =~ ^refs/heads/release/v([0-9]+)\.([0-9]+)$ ]]; then
tag_name=`echo $GITHUB_REF | sed -e 's:^refs/heads/release/::'`
echo "${tag_name}" > versions/VALD_VERSION
primary_tag="${tag_name}"
default_tag="${tag_name}"
else
primary_tag="unknown"
default_tag="unknown"
fi
echo "PRIMARY_TAG is determined: ${primary_tag}"
echo "DEFAULT_TAG is determined: ${default_tag}"
echo "PRIMARY_TAG=${primary_tag}" >> $GITHUB_OUTPUT
echo "DEFAULT_TAG=${default_tag}" >> $GITHUB_OUTPUT
10 changes: 8 additions & 2 deletions .github/actions/e2e-deploy-vald-helm-operator/action.yaml
Original file line number Diff line number Diff line change
@@ -41,6 +41,10 @@ inputs:
description: "If you want to use local charts, set this to true."
required: false
default: "true"
default_image_tag:
description: "Default image tag. e.g) nightly, vx.x, vx.x.x, pr-xxx"
required: true
default: "nightly"
outputs:
POD_NAME:
description: "A pod name that waited for"
@@ -67,22 +71,24 @@ runs:
if: ${{ inputs.use_local_charts == 'false' }}
run: |
helm install vald-helm-operator \
--set image.tag=nightly \
--set image.tag=${DEFAULT_IMAGE_TAG} \
${HELM_EXTRA_OPTIONS} \
charts/vald-helm-operator/.
sleep 3
env:
DEFAULT_IMAGE_TAG: ${{ inputs.default_image_tag }}
HELM_EXTRA_OPTIONS: ${{ inputs.helm_extra_options }}

- name: Deploy vald helm operator from local charts
shell: bash
id: deploy_vald_helm_operator_local
if: ${{ inputs.use_local_charts == 'true' }}
run: |
make k8s/vald-helm-operator/deploy VERSION=nightly HELM_EXTRA_OPTIONS="${HELM_EXTRA_OPTIONS}"
make k8s/vald-helm-operator/deploy VERSION=${DEFAULT_IMAGE_TAG} HELM_EXTRA_OPTIONS="${HELM_EXTRA_OPTIONS}"
sleep 3
env:
DEFAULT_IMAGE_TAG: ${{ inputs.default_image_tag }}
HELM_EXTRA_OPTIONS: ${{ inputs.helm_extra_options }}

- name: Deploy vald
10 changes: 8 additions & 2 deletions .github/actions/e2e-deploy-vald/action.yaml
Original file line number Diff line number Diff line change
@@ -41,6 +41,10 @@ inputs:
description: "If you want to use local charts, set this to true."
required: false
default: "true"
default_image_tag:
description: "Default image tag. e.g) nightly, vx.x, vx.x.x"
required: true
default: "nightly"
outputs:
POD_NAME:
description: "A pod name that waited for"
@@ -68,7 +72,7 @@ runs:
run: |
helm install \
--values ${VALUES} \
--set defaults.image.tag=nightly \
--set defaults.image.tag=${DEFAULT_IMAGE_TAG} \
${HELM_EXTRA_OPTIONS} \
--generate-name charts/vald
@@ -81,6 +85,7 @@ runs:
podname=`kubectl get pods --selector=${WAIT_FOR_SELECTOR} | tail -1 | awk '{print $1}'`
echo "POD_NAME=${podname}" >> $GITHUB_OUTPUT
env:
DEFAULT_IMAGE_TAG: ${{ inputs.default_image_tag }}
VALUES: ${{ inputs.values }}
HELM_EXTRA_OPTIONS: ${{ inputs.helm_extra_options }}
WAIT_FOR_SELECTOR: ${{ inputs.wait_for_selector }}
@@ -91,7 +96,7 @@ runs:
id: deploy_vald_local
if: ${{ inputs.use_local_charts == 'true' }}
run: |
make k8s/vald/deploy VERSION=nightly HELM_VALUES=${VALUES} HELM_EXTRA_OPTIONS="${HELM_EXTRA_OPTIONS}"
make k8s/vald/deploy VERSION=${DEFAULT_IMAGE_TAG} HELM_VALUES=${VALUES} HELM_EXTRA_OPTIONS="${HELM_EXTRA_OPTIONS}"
sleep 3
@@ -102,6 +107,7 @@ runs:
podname=`kubectl get pods --selector=${WAIT_FOR_SELECTOR} | tail -1 | awk '{print $1}'`
echo "POD_NAME=${podname}" >> $GITHUB_OUTPUT
env:
DEFAULT_IMAGE_TAG: ${{ inputs.default_image_tag }}
VALUES: ${{ inputs.values }}
HELM_EXTRA_OPTIONS: ${{ inputs.helm_extra_options }}
WAIT_FOR_SELECTOR: ${{ inputs.wait_for_selector }}
4 changes: 4 additions & 0 deletions .github/actions/setup-e2e/action.yaml
Original file line number Diff line number Diff line change
@@ -47,6 +47,10 @@ outputs:
IMAGE_TAGS:
description: "Specifies E2E target image tags"
value: ${{ steps.specify_container_versions.outputs.IMAGE_TAGS }}
DEFAULT_IMAGE_TAG:
description: "Default E2E target image tag"
value: ${{ steps.determine_tag_name.outputs.DEFAULT_TAG }}

runs:
using: "composite"
steps:
4 changes: 4 additions & 0 deletions .github/workflows/e2e-chaos.yaml
Original file line number Diff line number Diff line change
@@ -60,6 +60,7 @@ jobs:
id: deploy_vald
uses: ./.github/actions/e2e-deploy-vald
with:
default_image_tag: ${{ steps.setup_e2e.outputs.DEFAULT_IMAGE_TAG }}
helm_extra_options: ${{ steps.setup_e2e.outputs.HELM_EXTRA_OPTIONS }}
values: ${{ env.VALUES }}
wait_for_selector: app=vald-lb-gateway
@@ -104,6 +105,7 @@ jobs:
id: deploy_vald
uses: ./.github/actions/e2e-deploy-vald
with:
default_image_tag: ${{ steps.setup_e2e.outputs.DEFAULT_IMAGE_TAG }}
helm_extra_options: ${{ steps.setup_e2e.outputs.HELM_EXTRA_OPTIONS }}
values: ${{ env.VALUES }}
wait_for_selector: app=vald-lb-gateway
@@ -148,6 +150,7 @@ jobs:
id: deploy_vald
uses: ./.github/actions/e2e-deploy-vald
with:
default_image_tag: ${{ steps.setup_e2e.outputs.DEFAULT_IMAGE_TAG }}
helm_extra_options: ${{ steps.setup_e2e.outputs.HELM_EXTRA_OPTIONS }}
values: ${{ env.VALUES }}
wait_for_selector: app=vald-lb-gateway
@@ -192,6 +195,7 @@ jobs:
id: deploy_vald
uses: ./.github/actions/e2e-deploy-vald
with:
default_image_tag: ${{ steps.setup_e2e.outputs.DEFAULT_IMAGE_TAG }}
helm_extra_options: ${{ steps.setup_e2e.outputs.HELM_EXTRA_OPTIONS }}
values: ${{ env.VALUES }}
wait_for_selector: app=vald-lb-gateway
3 changes: 2 additions & 1 deletion .github/workflows/e2e-max-dim.yml
Original file line number Diff line number Diff line change
@@ -67,7 +67,7 @@ jobs:
fi
export HELM_EXTRA_OPTIOINS="--set agent.ngt.dimension=${DIM}"
make k8s/vald/deploy VERSION="nightly" HELM_VALUES=${VALUES} HELM_EXTRA_OPTIONS="${HELM_EXTRA_OPTIOINS}"
make k8s/vald/deploy VERSION=${DEFAULT_IMAGE_TAG} HELM_VALUES=${VALUES} HELM_EXTRA_OPTIONS="${HELM_EXTRA_OPTIOINS}"
sleep 3
@@ -105,6 +105,7 @@ jobs:
echo "MAX_BIT=${BIT}" >> $GITHUB_OUTPUT
echo "MAX_BIT=${BIT}"
env:
DEFAULT_IMAGE_TAG: ${{ steps.setup_e2e.outputs.DEFAULT_IMAGE_TAG }}
WAIT_FOR_SELECTOR: app=vald-agent-ngt
WAIT_FOR_TIMEOUT: 29m
VALUES: .github/helm/values/values-max-dim.yaml
1 change: 1 addition & 0 deletions .github/workflows/e2e-profiling.yml
Original file line number Diff line number Diff line change
@@ -56,6 +56,7 @@ jobs:
id: deploy_vald
uses: ./.github/actions/e2e-deploy-vald
with:
default_image_tag: ${{ steps.setup_e2e.outputs.DEFAULT_IMAGE_TAG }}
helm_extra_options: ${{ steps.setup_e2e.outputs.HELM_EXTRA_OPTIONS }}
values: .github/helm/values/values-profile.yaml
wait_for_selector: app=vald-lb-gateway
6 changes: 6 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
@@ -55,6 +55,7 @@ jobs:
id: deploy_vald
uses: ./.github/actions/e2e-deploy-vald
with:
default_image_tag: ${{ steps.setup_e2e.outputs.DEFAULT_IMAGE_TAG }}
helm_extra_options: ${{ steps.setup_e2e.outputs.HELM_EXTRA_OPTIONS }}
values: .github/helm/values/values-lb.yaml
wait_for_selector: app=vald-lb-gateway
@@ -106,6 +107,7 @@ jobs:

- name: Merge Docker image tag
run: |
yq e ".spec.defaults.image.tag=\"${{ steps.setup_e2e.outputs.DEFAULT_IMAGE_TAG }}\"" -i ./.github/valdrelease/valdrelease.yaml
IMAGE_TAGS=(${{ steps.setup_e2e.outputs.IMAGE_TAGS }})
for IMAGE_TAG in "${IMAGE_TAGS[@]}"
@@ -122,6 +124,7 @@ jobs:
id: deploy_vald
uses: ./.github/actions/e2e-deploy-vald-helm-operator
with:
default_image_tag: ${{ steps.vald_helm_operator.outputs.DEFAULT_IMAGE_TAG }}
helm_extra_options: ${{ steps.vald_helm_operator.outputs.HELM_EXTRA_OPTIONS }}
valdrelease: ./.github/valdrelease/valdrelease.yaml
wait_for_selector: app=vald-lb-gateway
@@ -165,6 +168,7 @@ jobs:
id: deploy_vald
uses: ./.github/actions/e2e-deploy-vald
with:
default_image_tag: ${{ steps.setup_e2e.outputs.DEFAULT_IMAGE_TAG }}
helm_extra_options: ${{ steps.setup_e2e.outputs.HELM_EXTRA_OPTIONS }}
values: .github/helm/values/values-lb.yaml
wait_for_selector: app=vald-lb-gateway
@@ -208,6 +212,7 @@ jobs:
id: deploy_vald
uses: ./.github/actions/e2e-deploy-vald
with:
default_image_tag: ${{ steps.setup_e2e.outputs.DEFAULT_IMAGE_TAG }}
helm_extra_options: ${{ steps.setup_e2e.outputs.HELM_EXTRA_OPTIONS }}
values: .github/helm/values/values-lb.yaml
wait_for_selector: app=vald-lb-gateway
@@ -285,6 +290,7 @@ jobs:
id: deploy_vald
uses: ./.github/actions/e2e-deploy-vald
with:
default_image_tag: ${{ steps.setup_e2e.outputs.DEFAULT_IMAGE_TAG }}
require_minio: "true"
helm_extra_options: ${{ steps.setup_e2e.outputs.HELM_EXTRA_OPTIONS }}
values: .github/helm/values/values-agent-sidecar.yaml
1 change: 1 addition & 0 deletions .github/workflows/helm.yml
Original file line number Diff line number Diff line change
@@ -157,6 +157,7 @@ jobs:
id: deploy_vald
uses: ./.github/actions/e2e-deploy-vald
with:
default_image_tag: ${{ steps.setup_e2e.outputs.DEFAULT_IMAGE_TAG }}
helm_extra_options: ${{ steps.setup_e2e.outputs.HELM_EXTRA_OPTIONS }}
values: .github/helm/values/values-lb.yaml
wait_for_selector: app=vald-lb-gateway