Skip to content

Commit

Permalink
Merge pull request #1450 from FZJ-INM1-BDA/staging
Browse files Browse the repository at this point in the history
v2.14.5
  • Loading branch information
xgui3783 authored Jul 8, 2024
2 parents 8102341 + 06dd4ce commit 8421d26
Show file tree
Hide file tree
Showing 216 changed files with 5,269 additions and 1,611 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
- run: |
if [[ "$GITHUB_REF" = *hotfix* ]] || [[ "$GITHUB_REF" = refs/heads/staging ]]
then
export SIIBRA_API_ENDPOINTS=https://siibra-api-rc.apps.hbp.eu/v2_0,https://siibra-api-rc.apps.jsc.hbp.eu/v2_0
export SIIBRA_API_ENDPOINTS=https://siibra-api-rc.apps.hbp.eu/v3_0
node src/environments/parseEnv.js ./environment.ts
fi
npm run test-ci
Expand Down
77 changes: 57 additions & 20 deletions .github/workflows/deploy-helm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,77 @@ on:
inputs:
DEPLOYMENT_NAME:
required: true
type: string
type: string # prod, rc, expmt
IMAGE_TAG:
required: true
type: string
IMAGE_DIGEST:
required: false
type: string
default: 'default-digest'

secrets:
KUBECONFIG:
required: true

jobs:
trigger-deploy:

trigger-deploy-prod:
runs-on: ubuntu-latest
if: ${{ inputs.DEPLOYMENT_NAME == 'prod' }}
steps:
- uses: actions/checkout@v4
- name: 'Deploy'
run: |
kubecfg_path=${{ runner.temp }}/.kube_config
echo "${{ secrets.KUBECONFIG }}" > $kubecfg_path
helm --kubeconfig=$kubecfg_path \
upgrade \
--history-max 3 \
--reuse-values \
--set image.tag=${{ inputs.IMAGE_TAG }} \
--set podLabels.image-digest=${{ inputs.IMAGE_DIGEST }} \
${{ inputs.DEPLOYMENT_NAME }} .helm/siibra-explorer/
rm $kubecfg_path
trigger-deploy-rc:
runs-on: ubuntu-latest
if: ${{ inputs.DEPLOYMENT_NAME == 'rc' }}
steps:
- uses: actions/checkout@v4
- name: 'Deploy'
run: |
kubecfg_path=${{ runner.temp }}/.kube_config
echo "${{ secrets.KUBECONFIG }}" > $kubecfg_path
helm --kubeconfig=$kubecfg_path \
upgrade \
--history-max 3 \
--reuse-values \
--set image.tag=${{ inputs.IMAGE_TAG }} \
--set podLabels.image-digest=${{ inputs.IMAGE_DIGEST }} \
${{ inputs.DEPLOYMENT_NAME }} .helm/siibra-explorer/
rm $kubecfg_path
trigger-deploy-expmt:
runs-on: ubuntu-latest
if: ${{ inputs.DEPLOYMENT_NAME == 'expmt' }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: 'Deploy'
run: |
kubecfg_path=${{ runner.temp }}/.kube_config
echo "${{ secrets.KUBECONFIG }}" > $kubecfg_path
helm --kubeconfig=$kubecfg_path status ${{ inputs.DEPLOYMENT_NAME }}
helm_status=$(echo $?)
if [[ $helm_status = "0" ]]
then
echo "tag ${{ inputs.DEPLOYMENT_NAME }} found. Update"
helm --kubeconfig=$kubecfg_path \
upgrade \
--set image.tag=${{ inputs.IMAGE_TAG }} \
${{ inputs.DEPLOYMENT_NAME }} .helm/siibra-explorer/
else
echo "tag ${{ inputs.DEPLOYMENT_NAME }} not found. Install"
helm --kubeconfig=$kubecfg_path \
install \
--set image.tag=${{ inputs.IMAGE_TAG }} \
${{ inputs.DEPLOYMENT_NAME }} .helm/siibra-explorer/
fi
helm --kubeconfig=$kubecfg_path \
upgrade \
--history-max 3 \
--reuse-values \
--set image.tag=${{ inputs.IMAGE_TAG }} \
--set podLabels.image-digest=${{ inputs.IMAGE_DIGEST }} \
${{ inputs.DEPLOYMENT_NAME }} .helm/siibra-explorer/
rm $kubecfg_path
85 changes: 0 additions & 85 deletions .github/workflows/deploy-on-okd.yml

This file was deleted.

73 changes: 39 additions & 34 deletions .github/workflows/docker_img.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,13 @@ jobs:
PRODUCTION: 'true'
DOCKER_REGISTRY: 'docker-registry.ebrains.eu/siibra/'

SIIBRA_API_STABLE: 'https://siibra-api-stable.apps.hbp.eu/v3_0,https://siibra-api-stable.apps.jsc.hbp.eu/v3_0'
SIIBRA_API_STABLE: 'https://siibra-api-stable.apps.hbp.eu/v3_0,https://siibra-api-prod.apps.tc.humanbrainproject.eu/v3_0'
SIIBRA_API_RC: 'https://siibra-api-rc.apps.hbp.eu/v3_0'
SIIBRA_API_LATEST: 'https://siibra-api-latest.apps-dev.hbp.eu/v3_0'

outputs:
GIT_DIGEST: ${{ steps.build-docker-image.outputs.GIT_DIGEST }}

steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -59,7 +62,8 @@ jobs:
else
echo "dev bulid, enable experimental features"
fi
- name: 'Build docker image'
- id: 'build-docker-image'
name: 'Build docker image'
run: |
DOCKER_BUILT_TAG=${{ env.DOCKER_REGISTRY }}siibra-explorer:$BRANCH_NAME
echo "Building $DOCKER_BUILT_TAG"
Expand All @@ -73,6 +77,18 @@ jobs:
echo "Successfully built $DOCKER_BUILT_TAG"
echo "DOCKER_BUILT_TAG=$DOCKER_BUILT_TAG" >> $GITHUB_ENV
inspect_str=$(docker image inspect --format='json' $DOCKER_BUILT_TAG)
echo "Inspected tag: $inspect_str"
GIT_DIGEST=${{ github.sha }}
echo "Git digest: $GIT_DIGEST"
# 62 char limit in label
GIT_DIGEST=$(echo $GIT_DIGEST | grep -oP '^.{6}')
echo "Using first 6 chars of hash: $GIT_DIGEST"
echo "GIT_DIGEST=$GIT_DIGEST" >> $GITHUB_OUTPUT
- name: 'Push to docker registry'
run: |
echo "Login to docker registry"
Expand All @@ -97,8 +113,9 @@ jobs:
BRANCH_NAME: ${{ steps.set-vars.outputs.BRANCH_NAME }}
BUILD_TEXT: ${{ steps.set-vars.outputs.BUILD_TEXT }}
DEPLOY_ID: ${{ steps.set-vars.outputs.DEPLOY_ID }}
SXPLR_VERSION: ${{ steps.set-vars.outputs.SXPLR_VERSION }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- id: set-vars
name: Set vars
run: |
Expand All @@ -124,54 +141,42 @@ jobs:
echo "SXPLR_VERSION=$SXPLR_VERSION"
echo "SXPLR_VERSION=$SXPLR_VERSION" >> $GITHUB_OUTPUT
trigger-deploy-master-prod:
if: ${{ needs.setting-vars.outputs.BRANCH_NAME == 'master' && success() }}
needs:
- build-docker-img
- setting-vars
uses: ./.github/workflows/deploy-on-okd.yml
with:
FULL_DEPLOY_ID: siibra-explorer-branch-deploy-2-prodpathviewer
OKD_ENDPOINT: https://okd.hbp.eu:443
OKD_PROJECT: interactive-viewer
secrets:
okd_token: ${{ secrets.OKD_PROD_SECRET }}
trigger-deploy-master-rancher:
if: ${{ needs.setting-vars.outputs.BRANCH_NAME == 'master' && success() }}
trigger-deploy-rc-rancher:
if: ${{ needs.setting-vars.outputs.BRANCH_NAME == 'staging' && success() }}
needs:
- build-docker-img
- setting-vars
uses: ./.github/workflows/deploy-helm.yml
with:
DEPLOYMENT_NAME: master
IMAGE_TAG: ${{ needs.setting-vars.outputs.SXPLR_VERSION }}
DEPLOYMENT_NAME: rc
IMAGE_TAG: staging
IMAGE_DIGEST: ${{ needs.build-docker-img.outputs.GIT_DIGEST }}
secrets:
KUBECONFIG: ${{ secrets.KUBECONFIG }}

trigger-deploy-staging-viewer-validation:
trigger-deploy-expmt-rancher:
if: ${{ needs.setting-vars.outputs.BRANCH_NAME == 'staging' && success() }}
needs:
- build-docker-img
- setting-vars
uses: ./.github/workflows/deploy-on-okd.yml
uses: ./.github/workflows/deploy-helm.yml
with:
FULL_DEPLOY_ID: siibra-explorer-branch-deploy-2-stagingpathed
OKD_ENDPOINT: https://okd.hbp.eu:443
OKD_PROJECT: interactive-viewer
DEPLOYMENT_NAME: expmt
IMAGE_TAG: staging
IMAGE_DIGEST: ${{ needs.build-docker-img.outputs.GIT_DIGEST }}
secrets:
okd_token: ${{ secrets.OKD_PROD_SECRET }}
trigger-deploy-staging-data-validation:
if: ${{ needs.setting-vars.outputs.BRANCH_NAME == 'staging' && success() }}
KUBECONFIG: ${{ secrets.KUBECONFIG }}

trigger-deploy-master-rancher:
if: ${{ needs.setting-vars.outputs.BRANCH_NAME == 'master' && success() }}
needs:
- build-docker-img
- setting-vars
uses: ./.github/workflows/deploy-on-okd.yml
uses: ./.github/workflows/deploy-helm.yml
with:
FULL_DEPLOY_ID: siibra-explorer-rc
OKD_ENDPOINT: https://okd.jsc.hbp.eu:443
OKD_PROJECT: siibra-explorer
DEPLOYMENT_NAME: master
IMAGE_TAG: ${{ needs.setting-vars.outputs.SXPLR_VERSION }}
IMAGE_DIGEST: ${{ needs.build-docker-img.outputs.GIT_DIGEST }}
secrets:
okd_token: ${{ secrets.OKD_JSC_TOKEN }}

KUBECONFIG: ${{ secrets.KUBECONFIG }}
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
failure-state: ${{ steps.failure-state-step.outputs.failure-state }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.event.ref }}

Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/manual_e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
hide_previous_if_exists:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: 'master'
- uses: actions/github-script@v5
Expand All @@ -23,7 +23,14 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: 'Install gherkin-official'
run: 'pip install gherkin-official'
- name: 'Generate checklist'
run: 'python features/_convert.py'
- name: 'Add checklist comment'
uses: actions/github-script@v5
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
if: always()
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: |
MASTER_VERSION=$(git show origin/master:package.json | jq '.version')
THIS_VERSION=$(jq '.version' < package.json)
Expand All @@ -19,7 +19,7 @@ jobs:
if: always()
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: |
VERSION_NUM=$(jq '.version' < package.json)
VERSION_NUM=${VERSION_NUM#\"}
Expand All @@ -30,7 +30,7 @@ jobs:
if: always()
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: |
VERSION_NUM=$(jq '.version' < package.json)
VERSION_NUM=${VERSION_NUM#\"}
Expand Down
Loading

0 comments on commit 8421d26

Please sign in to comment.