feat: propagate run ID and session UID to jobs #3680
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy PR | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| on: | |
| pull_request: | |
| types: | |
| - opened | |
| - edited | |
| - closed | |
| - reopened | |
| - synchronize | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| check-deploy: | |
| runs-on: ubuntu-24.04 | |
| outputs: | |
| deploy: ${{ steps.deploy-comment.outputs.pr-contains-string }} | |
| renku: ${{ steps.deploy-comment.outputs.renku}} | |
| renku-core: ${{ steps.deploy-comment.outputs.renku-core}} | |
| renku-gateway: ${{ steps.deploy-comment.outputs.renku-gateway}} | |
| renku-graph: ${{ steps.deploy-comment.outputs.renku-graph}} | |
| renku-notebooks: ${{ steps.deploy-comment.outputs.renku-notebooks}} | |
| renku-ui: ${{ steps.deploy-comment.outputs.renku-ui}} | |
| renku-data-services: ${{ steps.deploy-comment.outputs.renku-data-services}} | |
| test-enabled: ${{ steps.deploy-comment.outputs.test-enabled == 'true' }} | |
| test-slow-enabled: ${{ steps.deploy-comment.outputs.test-slow-enabled == 'true' }} | |
| extra-values: ${{ steps.deploy-comment.outputs.extra-values}} | |
| steps: | |
| - name: Check PR description | |
| id: deploy-comment | |
| uses: SwissDataScienceCenter/renku-actions/check-pr-description@v1.23.1 | |
| with: | |
| pr_ref: ${{ github.event.number }} | |
| deploy-pr: | |
| name: Deploy | |
| runs-on: ubuntu-24.04 | |
| needs: [check-deploy] | |
| permissions: | |
| pull-requests: write | |
| id-token: write | |
| if: github.event.action != 'closed' && needs.check-deploy.outputs.deploy == 'true' | |
| # NOTE: using GitHub deploy environments does not work with Azure at the moment | |
| # environment: | |
| # name: renku-ci-am-${{ github.event.number }} | |
| # url: https://renku-ci-am-${{ github.event.number }}.dev.renku.ch | |
| steps: | |
| - name: Checkout renku repository | |
| uses: actions/checkout@v7 | |
| with: | |
| repository: SwissDataScienceCenter/renku | |
| sparse-checkout: | | |
| minimal-deployment | |
| - name: Find deplyoment url | |
| uses: peter-evans/find-comment@v4 | |
| id: deploymentUrlMessage | |
| with: | |
| issue-number: ${{ github.event.pull_request.number }} | |
| comment-author: "RenkuBot" | |
| body-includes: "You can access the deployment of this PR at" | |
| - name: Create comment deployment url | |
| if: steps.deploymentUrlMessage.outputs.comment-id == 0 | |
| uses: peter-evans/create-or-update-comment@v5 | |
| with: | |
| token: ${{ secrets.RENKUBOT_GITHUB_TOKEN }} | |
| issue-number: ${{ github.event.pull_request.number }} | |
| body: | | |
| You can access the deployment of this PR at https://renku-ci-am-${{ github.event.number }}.dev.renku.ch | |
| - name: Azure login | |
| uses: azure/login@v3 | |
| with: | |
| client-id: ${{ secrets.CI_RENKU_AZURE_CLIENT_ID }} | |
| tenant-id: ${{ secrets.CI_RENKU_AZURE_TENANT_ID }} | |
| subscription-id: ${{ secrets.CI_RENKU_AZURE_SUBSCRIPTION_ID }} | |
| - name: Set AKS context | |
| uses: azure/aks-set-context@v5 | |
| with: | |
| resource-group: "renku-dev" | |
| cluster-name: "aks-switzerlandnorth-renku-dev" | |
| # See: https://github.com/orgs/community/discussions/168949 | |
| # It is easier to have the kube config in {{ github.workspace }}. | |
| - name: Setup kubeconfig | |
| run: | | |
| mv "${KUBECONFIG}" "${{ github.workspace }}/renkubot-kube.config" | |
| export KUBECONFIG="${{ github.workspace }}/renkubot-kube.config" | |
| echo "KUBECONFIG=${KUBECONFIG}" >> "$GITHUB_ENV" | |
| - name: Build and deploy | |
| uses: SwissDataScienceCenter/renku-actions/deploy-renku@v1.23.1 | |
| env: | |
| DOCKER_PASSWORD: ${{ secrets.RENKU_DOCKER_PASSWORD }} | |
| DOCKER_USERNAME: ${{ secrets.RENKU_DOCKER_USERNAME }} | |
| GITLAB_TOKEN: ${{ secrets.DEV_GITLAB_TOKEN }} | |
| RENKU_RELEASE: renku-ci-am-${{ github.event.number }} | |
| RENKU_VALUES_FILE: ${{ github.workspace }}/values.yaml | |
| RENKU_VALUES: minimal-deployment/sdsc-azure-ci-deployment-values.yaml | |
| TEST_ARTIFACTS_PATH: "tests-artifacts-${{ github.sha }}" | |
| renku_ui: "${{ needs.check-deploy.outputs.renku-ui }}" | |
| KUBERNETES_CLUSTER_FQDN: "dev.renku.ch" | |
| RENKU_ANONYMOUS_SESSIONS: "true" | |
| renku: "${{ needs.check-deploy.outputs.renku }}" | |
| renku_core: "${{ needs.check-deploy.outputs.renku-core }}" | |
| renku_gateway: "${{ needs.check-deploy.outputs.renku-gateway }}" | |
| renku_graph: "${{ needs.check-deploy.outputs.renku-graph }}" | |
| renku_notebooks: "${{ needs.check-deploy.outputs.renku-notebooks }}" | |
| renku_data_services: "${{ needs.check-deploy.outputs.renku-data-services }}" | |
| amalthea: "@${{ github.head_ref }}" | |
| amalthea_sessions: "@${{ github.head_ref }}" | |
| extra_values: "${{ needs.check-deploy.outputs.extra-values }}" | |
| cypress-acceptance-tests: | |
| name: Cypress acceptance tests | |
| runs-on: ubuntu-24.04 | |
| needs: [check-deploy, deploy-pr] | |
| if: github.event.action != 'closed' && needs.check-deploy.outputs.deploy == 'true' && needs.check-deploy.outputs.test-enabled == 'true' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| tests: | |
| - anonymousNavigation | |
| - codeRepositories | |
| - dashboard | |
| - dataConnectors | |
| - groups | |
| - projects | |
| - search | |
| - sessionLaunchers | |
| - sessions | |
| steps: | |
| - name: Extract Renku repository reference | |
| run: echo "RENKU_REFERENCE=`echo '${{ needs.check-deploy.outputs.renku }}' | cut -d'@' -f2`" >> $GITHUB_ENV | |
| - uses: SwissDataScienceCenter/renku-actions/test-renku-cypress@v1.23.1 | |
| with: | |
| e2e-folder: cypress/e2e/v2/ | |
| e2e-target: ${{ matrix.tests }} | |
| renku-reference: ${{ env.RENKU_REFERENCE }} | |
| renku-release: renku-ci-am-${{ github.event.number }} | |
| test-user-password: ${{ secrets.RENKU_BOT_DEV_PASSWORD }} | |
| cypress-acceptance-tests-slow: | |
| name: Cypress slow acceptance tests | |
| runs-on: ubuntu-24.04 | |
| needs: [check-deploy, deploy-pr] | |
| if: github.event.action != 'closed' && needs.check-deploy.outputs.deploy == 'true' && needs.check-deploy.outputs.test-enabled == 'true' && needs.check-deploy.outputs.test-slow-enabled == 'true' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| tests: | |
| - sessions | |
| - sessionSecrets | |
| steps: | |
| - name: Extract Renku repository reference | |
| run: echo "RENKU_REFERENCE=`echo '${{ needs.check-deploy.outputs.renku }}' | cut -d'@' -f2`" >> $GITHUB_ENV | |
| - uses: SwissDataScienceCenter/renku-actions/test-renku-cypress@v1.23.1 | |
| with: | |
| e2e-folder: cypress/e2e/slow/ | |
| e2e-target: ${{ matrix.tests }} | |
| renku-reference: ${{ env.RENKU_REFERENCE }} | |
| renku-release: renku-ci-am-${{ github.event.number }} | |
| test-user-password: ${{ secrets.RENKU_BOT_DEV_PASSWORD }} | |
| cleanup: | |
| name: Cleanup | |
| runs-on: ubuntu-24.04 | |
| needs: check-deploy | |
| if: github.event.action == 'closed' && needs.check-deploy.outputs.deploy == 'true' | |
| permissions: | |
| pull-requests: write | |
| id-token: write | |
| steps: | |
| - name: Find deplyoment url | |
| uses: peter-evans/find-comment@v4 | |
| id: deploymentUrlMessage | |
| with: | |
| issue-number: ${{ github.event.pull_request.number }} | |
| comment-author: "RenkuBot" | |
| body-includes: "Tearing down the temporary RenkuLab deplyoment" | |
| - name: Create comment deployment url | |
| if: steps.deploymentUrlMessage.outputs.comment-id == 0 | |
| uses: peter-evans/create-or-update-comment@v5 | |
| with: | |
| token: ${{ secrets.RENKUBOT_GITHUB_TOKEN }} | |
| issue-number: ${{ github.event.pull_request.number }} | |
| body: | | |
| Tearing down the temporary RenkuLab deplyoment for this PR. | |
| - name: Azure login | |
| uses: azure/login@v3 | |
| with: | |
| client-id: ${{ secrets.CI_RENKU_AZURE_CLIENT_ID }} | |
| tenant-id: ${{ secrets.CI_RENKU_AZURE_TENANT_ID }} | |
| subscription-id: ${{ secrets.CI_RENKU_AZURE_SUBSCRIPTION_ID }} | |
| - name: Set AKS context | |
| uses: azure/aks-set-context@v5 | |
| with: | |
| resource-group: "renku-dev" | |
| cluster-name: "aks-switzerlandnorth-renku-dev" | |
| # See: https://github.com/orgs/community/discussions/168949 | |
| # It is easier to have the kube config in {{ github.workspace }}. | |
| - name: Setup kubeconfig | |
| run: | | |
| mv "${KUBECONFIG}" "${{ github.workspace }}/renkubot-kube.config" | |
| export KUBECONFIG="${{ github.workspace }}/renkubot-kube.config" | |
| echo "KUBECONFIG=${KUBECONFIG}" >> "$GITHUB_ENV" | |
| - name: Renku teardown | |
| uses: SwissDataScienceCenter/renku-actions/cleanup-renku-ci-deployments@v1.23.1 | |
| env: | |
| HELM_RELEASE_REGEX: "^renku-ci-am-${{ github.event.number }}$" | |
| GITLAB_TOKEN: ${{ secrets.DEV_GITLAB_TOKEN }} | |
| MAX_AGE_SECONDS: 0 | |
| DELETE_NAMESPACE: "true" |