From 40a32792561e49c4e940d35d2b4839f83d282029 Mon Sep 17 00:00:00 2001 From: "ecmwf-ci-workflow-regenerator[bot]" <335005108+ecmwf-ci-workflow-regenerator[bot]@users.noreply.github.com> Date: Thu, 3 Dec 2026 20:11:44 +0000 Subject: [PATCH] Regenerate downstream-CI workflows --- .../workflows/cross-repo-trigger-hpc-atos.yml | 248 +++++++++++ .github/workflows/pr-label-downstream-ci.yml | 4 +- .github/workflows/pr-label-hpc-ci.yml | 29 ++ .../workflows/trigger-downstream-hpc-atos.yml | 385 ++++++++++++++++++ .github/workflows/trigger-downstream.yml | 380 ++++++++++++++++- .pre-commit-config.yaml | 2 +- 6 files changed, 1039 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/cross-repo-trigger-hpc-atos.yml create mode 100644 .github/workflows/pr-label-hpc-ci.yml create mode 100644 .github/workflows/trigger-downstream-hpc-atos.yml diff --git a/.github/workflows/cross-repo-trigger-hpc-atos.yml b/.github/workflows/cross-repo-trigger-hpc-atos.yml new file mode 100644 index 00000000..3efd5703 --- /dev/null +++ b/.github/workflows/cross-repo-trigger-hpc-atos.yml @@ -0,0 +1,248 @@ +# GENERATED FILE - DO NOT EDIT. +# Regenerate via the ci-infrastructure-generate CLI. +# Source of truth: each repo's .ci/manifest.toml. +name: Cross-repo trigger (odc) + +run-name: Cross-repo trigger (${{ inputs.from-repo }}@${{ inputs.from-sha }}) [${{ inputs.dispatch-id }}] + +on: + workflow_call: + inputs: + from-repo: + description: owner/repo of the dispatcher (upstream producer or downstream consumer) + required: true + type: string + from-sha: + description: SHA of the dispatcher commit + required: true + type: string + from-jobs: + description: JSON array of package/kinds that triggered us (e.g. '["fortmath/build","fortmath/build-hpc"]') for upstream-change dispatches. '[]' when rebuild-request is true. + required: false + default: '[]' + type: string + rebuild-request: + description: True when a downstream consumer dispatches us because our artifact was missing. Mutually exclusive with from-jobs. + required: false + default: false + type: boolean + branch: + description: Dispatcher branch name; we attempt branch-matching against it + required: true + type: string + fallback-ref: + description: Ref to check out if branch does not exist in this repo + required: false + type: string + default: main + pin: + description: 'Space-separated owner/repo@sha to resolve against: those of the downstream runner, or of the consumer that requests a rebuild. Empty pins from-repo@from-sha alone.' + required: false + default: '' + type: string + resolved: + description: The resolve-deps json output for this repo's kinds, resolved by the downstream runner with the rest of its run. Empty resolves here. + required: false + default: '' + type: string + resolved-ref: + description: The commit of this repo that `resolved` is for + required: false + default: '' + type: string + workflow_dispatch: + inputs: + dispatch-id: + description: Correlation id stamped into run-name so the dispatcher can find this run + required: false + default: '' + type: string + from-repo: + description: owner/repo of the dispatcher (upstream producer or downstream consumer) + required: true + type: string + from-sha: + description: SHA of the dispatcher commit + required: true + type: string + from-jobs: + description: JSON array of package/kinds that triggered us (e.g. '["fortmath/build","fortmath/build-hpc"]') for upstream-change dispatches. '[]' when rebuild-request is true. + required: false + default: '[]' + type: string + rebuild-request: + description: True when a downstream consumer dispatches us because our artifact was missing. Mutually exclusive with from-jobs. + required: false + default: false + type: boolean + branch: + description: Dispatcher branch name; we attempt branch-matching against it + required: true + type: string + fallback-ref: + description: Ref to check out if branch does not exist in this repo + required: false + type: string + default: main + pin: + description: 'Space-separated owner/repo@sha to resolve against: those of the downstream runner, or of the consumer that requests a rebuild. Empty pins from-repo@from-sha alone.' + required: false + default: '' + type: string + resolved: + description: The resolve-deps json output for this repo's kinds, resolved by the downstream runner with the rest of its run. Empty resolves here. + required: false + default: '' + type: string + resolved-ref: + description: The commit of this repo that `resolved` is for + required: false + default: '' + type: string + +concurrency: + group: cross-repo-trigger-hpc-atos-odc-${{ inputs.from-repo }}-${{ inputs.from-sha }} + cancel-in-progress: false + +env: + ARTIFACT_POLL_INTERVAL: ${{ vars.ARTIFACT_POLL_INTERVAL || '60' }} + ARTIFACT_WAIT_TIMEOUT: ${{ vars.ARTIFACT_WAIT_TIMEOUT || '1800' }} + ARTIFACT_S3_ENDPOINT: ${{ secrets.ARTIFACT_S3_ENDPOINT }} + ARTIFACT_S3_BUCKET: ${{ secrets.ARTIFACT_S3_BUCKET }} + SCCACHE_BUCKET: ${{ secrets.SCCACHE_BUCKET }} + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + +jobs: + resolve: + if: (contains(fromJSON(inputs.from-jobs), 'eckit/build-hpc') || contains(fromJSON(inputs.from-jobs), 'stack-deps/build-hpc') || inputs.rebuild-request) && !inputs.resolved + runs-on: ubuntu-latest + outputs: + ref: ${{ steps.r.outputs.own-sha }} + json: ${{ steps.r.outputs.json }} + dispatch-plans: ${{ steps.r.outputs.dispatch-plans }} + steps: + - id: mint + uses: ecmwf/ci-infrastructure/actions/mint-token@main + with: + client-id: ${{ vars.CI_READER_APP_CLIENT_ID }} + private-key: ${{ secrets.CI_READER_APP_PRIVATE_KEY }} + repositories: ecbuild,eckit,odc,stack-dependencies + permissions: contents:read actions:read + - id: pick + uses: ecmwf/ci-infrastructure/actions/pick-ref@main + with: + repo: ecmwf/odc + try-branch: ${{ inputs.branch }} + fallback-ref: ${{ inputs.fallback-ref }} + token: ${{ steps.mint.outputs.token }} + - uses: actions/checkout@v6 + with: + repository: ecmwf/odc + ref: ${{ steps.pick.outputs.ref }} + token: ${{ steps.mint.outputs.token }} + persist-credentials: false + - id: r + uses: ecmwf/ci-infrastructure/actions/resolve-deps@main + with: + current-branch: ${{ steps.pick.outputs.ref }} + pin: ${{ !inputs.rebuild-request && (inputs.pin || format('{0}@{1}', inputs.from-repo, inputs.from-sha)) || inputs.pin }} + matrix: build-hpc + token: ${{ steps.mint.outputs.token }} + rebuild-missing: 'true' + + rebuild-producers: + needs: [resolve] + runs-on: ubuntu-latest + steps: + - if: needs.resolve.outputs.dispatch-plans != '' && needs.resolve.outputs.dispatch-plans != '[]' + uses: ecmwf/ci-infrastructure/actions/dispatch-producers@main + with: + dispatch-plans: ${{ needs.resolve.outputs.dispatch-plans }} + repositories: ecbuild,eckit,odc,stack-dependencies + client-id: ${{ vars.CI_DISPATCHER_APP_CLIENT_ID }} + app-private-key: ${{ secrets.CI_DISPATCHER_APP_PRIVATE_KEY }} + + odc__build_hpc: + needs: [resolve, rebuild-producers] + if: ${{ !failure() && !cancelled() && (contains(fromJSON(inputs.from-jobs), 'eckit/build-hpc') || contains(fromJSON(inputs.from-jobs), 'stack-deps/build-hpc') || inputs.rebuild-request) }} + name: odc/build-hpc (${{ matrix._resolved['job-name'] }}) + runs-on: ${{ matrix['runs-on'] }} + container: + image: ${{ matrix.container || '' }} + credentials: + username: ${{ secrets.ECCR_PULL_ATOS_CITESTER_NAME }} + password: ${{ secrets.ECCR_PULL_ATOS_CITESTER_TOKEN }} + strategy: + fail-fast: false + matrix: ${{ fromJSON(inputs.resolved || needs.resolve.outputs.json)['build-hpc'] }} + steps: + - id: mint + uses: ecmwf/ci-infrastructure/actions/mint-token@main + with: + client-id: ${{ vars.CI_READER_APP_CLIENT_ID }} + private-key: ${{ secrets.CI_READER_APP_PRIVATE_KEY }} + repositories: ecbuild,eckit,odc,stack-dependencies + permissions: contents:read actions:read + - name: Announce image + uses: ecmwf/ci-infrastructure/actions/announce-image@main + - uses: actions/checkout@v6 + with: + repository: ecmwf/odc + ref: ${{ inputs.resolved-ref || needs.resolve.outputs.ref }} + token: ${{ steps.mint.outputs.token }} + persist-credentials: false + - name: Fetch resolved deps + id: deps + uses: ecmwf/ci-infrastructure/actions/fetch-deps@main + with: + deps-json: ${{ toJSON(matrix._resolved.deps) }} + token: ${{ steps.mint.outputs.token }} + stage-only: 'true' + - name: Build on HPC + id: build + uses: ecmwf/ci-infrastructure/actions/build-on-hpc@main + with: + site: ${{ matrix.site }} + job-script: ${{ matrix.job-script }} + matrix-leg: ${{ toJSON(matrix) }} + artifact-name: ${{ matrix._resolved['own-artifact-name'] }} + cmake-prefix-path: ${{ steps.deps.outputs.cmake-prefix-path }} + work-dir: ${{ vars.HPC_CI_WORK_DIR }} + remote-work-dir: ${{ vars.HPC_CI_REMOTE_WORK_DIR }} + + check-start__odc__build_hpc: + needs: [resolve] + if: ${{ !failure() && !cancelled() && (contains(fromJSON(inputs.from-jobs), 'eckit/build-hpc') || contains(fromJSON(inputs.from-jobs), 'stack-deps/build-hpc') || inputs.rebuild-request) && github.event_name == 'workflow_dispatch' && inputs.from-jobs != '[]' }} + runs-on: ubuntu-latest + permissions: {} + outputs: + check-runs: ${{ steps.report.outputs.check-runs }} + steps: + - id: report + uses: ecmwf/ci-infrastructure/actions/report-check-runs@main + with: + client-id: ${{ vars.CI_REPORTER_APP_CLIENT_ID }} + private-key: ${{ secrets.CI_REPORTER_APP_PRIVATE_KEY }} + head-repo: ${{ inputs.from-repo }} + head-sha: ${{ inputs.from-sha }} + phase: start + job-name: odc/build-hpc + matrix: ${{ toJSON(fromJSON(inputs.resolved || needs.resolve.outputs.json)['build-hpc']) }} + + check-finish__odc__build_hpc: + needs: [check-start__odc__build_hpc, odc__build_hpc] + if: ${{ always() && needs.check-start__odc__build_hpc.outputs.check-runs != '' && needs.check-start__odc__build_hpc.outputs.check-runs != '{}' }} + runs-on: ubuntu-latest + permissions: + actions: read + steps: + - uses: ecmwf/ci-infrastructure/actions/report-check-runs@main + with: + client-id: ${{ vars.CI_REPORTER_APP_CLIENT_ID }} + private-key: ${{ secrets.CI_REPORTER_APP_PRIVATE_KEY }} + head-repo: ${{ inputs.from-repo }} + head-sha: ${{ inputs.from-sha }} + phase: finish + check-runs: ${{ needs.check-start__odc__build_hpc.outputs.check-runs }} + job-result: ${{ needs.odc__build_hpc.result }} diff --git a/.github/workflows/pr-label-downstream-ci.yml b/.github/workflows/pr-label-downstream-ci.yml index d52322d5..94ff579f 100644 --- a/.github/workflows/pr-label-downstream-ci.yml +++ b/.github/workflows/pr-label-downstream-ci.yml @@ -18,7 +18,7 @@ jobs: - uses: ecmwf/ci-infrastructure/actions/post-downstream-decision@main with: contexts: downstream/runner - no-consumers: downstream/hpc-atos + hpc-contexts: downstream/hpc-atos - uses: ecmwf/ci-infrastructure/actions/dispatch-downstream@main with: - workflows: trigger-downstream.yml + workflows: trigger-downstream.yml trigger-downstream-hpc-atos.yml diff --git a/.github/workflows/pr-label-hpc-ci.yml b/.github/workflows/pr-label-hpc-ci.yml new file mode 100644 index 00000000..1f5ca03e --- /dev/null +++ b/.github/workflows/pr-label-hpc-ci.yml @@ -0,0 +1,29 @@ +# GENERATED FILE - DO NOT EDIT. +# Regenerate via the ci-infrastructure-generate CLI. +# Source of truth: each repo's .ci/manifest.toml. +name: '[PR] HPC-CI label gate' + +on: + pull_request_target: + types: [labeled, unlabeled] + workflow_run: + workflows: [CI] + types: [completed] + +permissions: + statuses: write + actions: read + pull-requests: read + +concurrency: + group: pr-label-hpc-ci-${{ github.event.pull_request.number || github.event.workflow_run.head_sha }} + +jobs: + gate: + if: github.event_name == 'workflow_run' && github.event.workflow_run.event != 'push' && github.event.workflow_run.event != 'schedule' || contains(fromJSON('["run-hpc-ci", "hpc-ci-not-needed"]'), github.event.label.name) + runs-on: ubuntu-latest + steps: + - uses: ecmwf/ci-infrastructure/actions/hpc-label-decision@main + with: + client-id: ${{ vars.CI_DISPATCHER_APP_CLIENT_ID }} + app-private-key: ${{ secrets.CI_DISPATCHER_APP_PRIVATE_KEY }} diff --git a/.github/workflows/trigger-downstream-hpc-atos.yml b/.github/workflows/trigger-downstream-hpc-atos.yml new file mode 100644 index 00000000..a5660901 --- /dev/null +++ b/.github/workflows/trigger-downstream-hpc-atos.yml @@ -0,0 +1,385 @@ +# GENERATED FILE - DO NOT EDIT. +# Regenerate via the ci-infrastructure-generate CLI. +# Source of truth: each repo's .ci/manifest.toml. +name: Downstream HPC (odc) + +on: + workflow_run: + workflows: [CI] + types: [completed] + workflow_dispatch: + inputs: + pull-request: + description: Number of the pull request whose commit to run downstream CI for + required: true + type: string + level: + description: '''all'', or the highest consumer level to run (as the run-downstream-ci labels)' + required: true + default: '1' + type: string + +concurrency: + group: trigger-downstream-hpc-atos-${{ github.event.workflow_run.head_sha || inputs.pull-request }} + cancel-in-progress: true + +jobs: + ci-approval: + runs-on: ubuntu-latest + permissions: + pull-requests: write + steps: + - uses: ecmwf/ci-infrastructure/actions/require-ci-approval@main + + context: + runs-on: ubuntu-latest + permissions: + actions: read + pull-requests: read + outputs: + head-sha: ${{ steps.ctx.outputs.head-sha }} + head-branch: ${{ steps.ctx.outputs.head-branch }} + ci-conclusion: ${{ steps.ctx.outputs.ci-conclusion }} + ci-url: ${{ steps.ctx.outputs.ci-url }} + ci-run-id: ${{ steps.ctx.outputs.ci-run-id }} + ci-summary: ${{ steps.ctx.outputs.ci-summary }} + pull-request: ${{ steps.ctx.outputs.pull-request }} + hpc-only: ${{ steps.ctx.outputs.hpc-only }} + steps: + - name: Resolve the commit under test + id: ctx + uses: ecmwf/ci-infrastructure/actions/resolve-dispatch-context@main + with: + pull-request: ${{ inputs.pull-request }} + needs: [ci-approval] + + label-gate: + runs-on: ubuntu-latest + permissions: + pull-requests: read + outputs: + run: ${{ steps.gate.outputs.run }} + depth: ${{ steps.gate.outputs.depth }} + quarantined: ${{ steps.gate.outputs.quarantined }} + steps: + - name: Check the downstream-CI label + id: gate + uses: ecmwf/ci-infrastructure/actions/should-downstream-run@main + with: + sha: ${{ needs.context.outputs.head-sha }} + pull-request: ${{ needs.context.outputs.pull-request }} + level: ${{ inputs.level }} + require-label: run-hpc-ci + needs: [ci-approval, context] + + validate: + if: ${{ (needs.context.outputs.ci-conclusion == 'success') && needs['label-gate'].outputs.run == 'true' }} + runs-on: ubuntu-latest + steps: + - id: mint + uses: ecmwf/ci-infrastructure/actions/mint-token@main + with: + client-id: ${{ vars.CI_READER_APP_CLIENT_ID }} + private-key: ${{ secrets.CI_READER_APP_PRIVATE_KEY }} + repositories: "*" + permissions: contents:read actions:read + - uses: actions/checkout@v6 + with: + ref: ${{ needs.context.outputs.head-sha }} + token: ${{ steps.mint.outputs.token }} + persist-credentials: false + allow-unsafe-pr-checkout: true + - uses: ecmwf/ci-infrastructure/actions/validate-generated-workflows@main + with: + token: ${{ steps.mint.outputs.token }} + needs: [ci-approval, context, label-gate] + + resolve: + if: ${{ (needs.context.outputs.ci-conclusion == 'success') && needs['label-gate'].outputs.run == 'true' }} + needs: [ci-approval, context, label-gate, validate] + runs-on: ubuntu-latest + env: + ARTIFACT_S3_ENDPOINT: ${{ secrets.ARTIFACT_S3_ENDPOINT }} + ARTIFACT_S3_BUCKET: ${{ secrets.ARTIFACT_S3_BUCKET }} + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + outputs: + metkit: ${{ steps.r-metkit.outcome == 'success' && steps.r-metkit.outputs.json || '' }} + metkit-ref: ${{ steps.r-metkit.outcome == 'success' && steps.r-metkit.outputs.own-sha || '' }} + fdb: ${{ steps.r-fdb.outcome == 'success' && steps.r-fdb.outputs.json || '' }} + fdb-ref: ${{ steps.r-fdb.outcome == 'success' && steps.r-fdb.outputs.own-sha || '' }} + gribjump: ${{ steps.r-gribjump.outcome == 'success' && steps.r-gribjump.outputs.json || '' }} + gribjump-ref: ${{ steps.r-gribjump.outcome == 'success' && steps.r-gribjump.outputs.own-sha || '' }} + pins: ${{ steps.pins.outputs.pins }} + dispatch-plans: ${{ steps.plans.outputs.dispatch-plans }} + steps: + - id: mint + uses: ecmwf/ci-infrastructure/actions/mint-token@main + with: + client-id: ${{ vars.CI_READER_APP_CLIENT_ID }} + private-key: ${{ secrets.CI_READER_APP_PRIVATE_KEY }} + repositories: ecbuild,eccodes,eccodes-python,eckit,fdb,findlibs,gribjump,metkit,odc,stack-dependencies + permissions: contents:read actions:read + - name: Pin the commits the upstream's CI resolved + env: + GH_TOKEN: ${{ steps.mint.outputs.token }} + HEAD_SHA: ${{ needs.context.outputs.head-sha }} + CI_RUN_ID: ${{ needs.context.outputs.ci-run-id }} + run: "set -euo pipefail\npins=\"${GITHUB_REPOSITORY}@${HEAD_SHA}\"\ndir=\"${RUNNER_TEMP}/resolved-pins\"\nif [ -n \"${CI_RUN_ID}\" ] && gh run download \"${CI_RUN_ID}\" --repo \"${GITHUB_REPOSITORY}\" \\\n --name resolved-pins --dir \"$dir\" 2>/dev/null; then\n while read -r pin; do\n if [[ \"$pin\" =~ ^[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+@[0-9a-f]{40}$ ]] && [[ \"$pin\" != \"${GITHUB_REPOSITORY}@\"* ]]; then\n pins=\"$pins $pin\"\n fi\n done < <(tr ' ' '\\n' < \"$dir/pins.txt\")\n echo \"Starting from the commits run ${CI_RUN_ID} resolved: $pins\"\nelse\n echo \"::notice::No resolved-pins artifact on CI run '${CI_RUN_ID}'; the other repos resolve at their branch tips.\"\nfi\necho \"PINS=$pins\" >> \"$GITHUB_ENV\"\necho \"EXPECTED=\" >> \"$GITHUB_ENV\"\n" + - id: pick-metkit + if: (needs['label-gate'].outputs.depth == 'all' || needs['label-gate'].outputs.depth >= 1) + uses: ecmwf/ci-infrastructure/actions/pick-ref@main + with: + repo: ecmwf/metkit + try-branch: ${{ needs.context.outputs.head-branch }} + fallback-ref: develop + token: ${{ steps.mint.outputs.token }} + - if: (needs['label-gate'].outputs.depth == 'all' || needs['label-gate'].outputs.depth >= 1) + uses: actions/checkout@v6 + with: + repository: ecmwf/metkit + ref: ${{ steps.pick-metkit.outputs.ref }} + token: ${{ steps.mint.outputs.token }} + persist-credentials: false + path: .downstream/metkit + sparse-checkout: .ci + - name: Resolve metkit + id: r-metkit + if: (needs['label-gate'].outputs.depth == 'all' || needs['label-gate'].outputs.depth >= 1) + continue-on-error: true + uses: ecmwf/ci-infrastructure/actions/resolve-deps@main + with: + manifest: .downstream/metkit/.ci/manifest.toml + current-branch: ${{ steps.pick-metkit.outputs.ref }} + pin: ${{ env.PINS }} + expected-artifacts: ${{ env.EXPECTED }} + matrix: build-hpc + token: ${{ steps.mint.outputs.token }} + rebuild-missing: 'true' + - name: Carry metkit's commits to the next consumer + if: steps.r-metkit.outcome == 'success' + env: + R_PINS: ${{ steps.r-metkit.outputs.pins }} + R_ARTIFACTS: ${{ steps.r-metkit.outputs.artifacts }} + run: 'echo "PINS=${R_PINS}" >> "$GITHUB_ENV" + + echo "EXPECTED=${EXPECTED} ${R_ARTIFACTS}" >> "$GITHUB_ENV"' + - id: pick-fdb + if: (needs['label-gate'].outputs.depth == 'all' || needs['label-gate'].outputs.depth >= 2) + uses: ecmwf/ci-infrastructure/actions/pick-ref@main + with: + repo: ecmwf/fdb + try-branch: ${{ needs.context.outputs.head-branch }} + fallback-ref: develop + token: ${{ steps.mint.outputs.token }} + - if: (needs['label-gate'].outputs.depth == 'all' || needs['label-gate'].outputs.depth >= 2) + uses: actions/checkout@v6 + with: + repository: ecmwf/fdb + ref: ${{ steps.pick-fdb.outputs.ref }} + token: ${{ steps.mint.outputs.token }} + persist-credentials: false + path: .downstream/fdb + sparse-checkout: .ci + - name: Resolve fdb + id: r-fdb + if: (needs['label-gate'].outputs.depth == 'all' || needs['label-gate'].outputs.depth >= 2) + continue-on-error: true + uses: ecmwf/ci-infrastructure/actions/resolve-deps@main + with: + manifest: .downstream/fdb/.ci/manifest.toml + current-branch: ${{ steps.pick-fdb.outputs.ref }} + pin: ${{ env.PINS }} + expected-artifacts: ${{ env.EXPECTED }} + matrix: build-hpc + token: ${{ steps.mint.outputs.token }} + rebuild-missing: 'true' + - name: Carry fdb's commits to the next consumer + if: steps.r-fdb.outcome == 'success' + env: + R_PINS: ${{ steps.r-fdb.outputs.pins }} + R_ARTIFACTS: ${{ steps.r-fdb.outputs.artifacts }} + run: 'echo "PINS=${R_PINS}" >> "$GITHUB_ENV" + + echo "EXPECTED=${EXPECTED} ${R_ARTIFACTS}" >> "$GITHUB_ENV"' + - id: pick-gribjump + if: (needs['label-gate'].outputs.depth == 'all' || needs['label-gate'].outputs.depth >= 3) + uses: ecmwf/ci-infrastructure/actions/pick-ref@main + with: + repo: ecmwf/gribjump + try-branch: ${{ needs.context.outputs.head-branch }} + fallback-ref: develop + token: ${{ steps.mint.outputs.token }} + - if: (needs['label-gate'].outputs.depth == 'all' || needs['label-gate'].outputs.depth >= 3) + uses: actions/checkout@v6 + with: + repository: ecmwf/gribjump + ref: ${{ steps.pick-gribjump.outputs.ref }} + token: ${{ steps.mint.outputs.token }} + persist-credentials: false + path: .downstream/gribjump + sparse-checkout: .ci + - name: Resolve gribjump + id: r-gribjump + if: (needs['label-gate'].outputs.depth == 'all' || needs['label-gate'].outputs.depth >= 3) + continue-on-error: true + uses: ecmwf/ci-infrastructure/actions/resolve-deps@main + with: + manifest: .downstream/gribjump/.ci/manifest.toml + current-branch: ${{ steps.pick-gribjump.outputs.ref }} + pin: ${{ env.PINS }} + expected-artifacts: ${{ env.EXPECTED }} + matrix: build-hpc + token: ${{ steps.mint.outputs.token }} + rebuild-missing: 'true' + - name: Carry gribjump's commits to the next consumer + if: steps.r-gribjump.outcome == 'success' + env: + R_PINS: ${{ steps.r-gribjump.outputs.pins }} + R_ARTIFACTS: ${{ steps.r-gribjump.outputs.artifacts }} + run: 'echo "PINS=${R_PINS}" >> "$GITHUB_ENV" + + echo "EXPECTED=${EXPECTED} ${R_ARTIFACTS}" >> "$GITHUB_ENV"' + - id: pins + run: echo "pins=${PINS}" >> "$GITHUB_OUTPUT" + - id: plans + env: + PLANS_0: ${{ steps.r-metkit.outputs.dispatch-plans || '[]' }} + PLANS_1: ${{ steps.r-fdb.outputs.dispatch-plans || '[]' }} + PLANS_2: ${{ steps.r-gribjump.outputs.dispatch-plans || '[]' }} + run: 'plans=$(printf ''%s\n'' "${PLANS_0}" "${PLANS_1}" "${PLANS_2}" | jq -cs ''add // []'') + + echo "dispatch-plans=${plans}" >> "$GITHUB_OUTPUT"' + + rebuild-producers: + needs: [ci-approval, context, label-gate, resolve] + runs-on: ubuntu-latest + steps: + - if: needs.resolve.outputs.dispatch-plans != '' && needs.resolve.outputs.dispatch-plans != '[]' + uses: ecmwf/ci-infrastructure/actions/dispatch-producers@main + with: + dispatch-plans: ${{ needs.resolve.outputs.dispatch-plans }} + repositories: ecbuild,eccodes,eccodes-python,eckit,fdb,findlibs,gribjump,metkit,odc,stack-dependencies + client-id: ${{ vars.CI_DISPATCHER_APP_CLIENT_ID }} + app-private-key: ${{ secrets.CI_DISPATCHER_APP_PRIVATE_KEY }} + if: ${{ needs['label-gate'].outputs.run == 'true' }} + + report-start: + if: ${{ (needs.context.outputs.ci-conclusion == 'success') && needs['label-gate'].outputs.run == 'true' }} + runs-on: ubuntu-latest + permissions: + statuses: write + steps: + - name: Post pending downstream status + env: + GH_TOKEN: ${{ github.token }} + run: | + gh api -X POST \ + "/repos/${{ github.repository }}/statuses/${{ needs.context.outputs.head-sha }}" \ + -f state=pending \ + -f context='downstream/hpc-atos' \ + -f target_url="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" \ + -f description='Downstream HPC tests running' + needs: [ci-approval, context, label-gate] + + report-ci-failure: + if: ${{ (needs.context.outputs.ci-conclusion != 'success' && needs.context.outputs.ci-conclusion != '') && needs['label-gate'].outputs.run == 'true' }} + runs-on: ubuntu-latest + permissions: + statuses: write + steps: + - name: Post downstream failure status + env: + GH_TOKEN: ${{ github.token }} + run: | + gh api -X POST \ + "/repos/${{ github.repository }}/statuses/${{ needs.context.outputs.head-sha }}" \ + -f state=failure \ + -f context='downstream/hpc-atos' \ + -f target_url="${{ needs.context.outputs.ci-url }}" \ + -f description="${{ needs.context.outputs.ci-summary }}; downstream HPC not run" + needs: [ci-approval, context, label-gate] + + fdb: + name: fdb + needs: [ci-approval, context, label-gate, validate, resolve, rebuild-producers, metkit] + if: ${{ (!cancelled() && !failure() && needs['validate'].result == 'success' && needs['resolve'].result == 'success' && needs['metkit'].result == 'success') && needs['label-gate'].outputs.run == 'true' && (needs['label-gate'].outputs.depth == 'all' || needs['label-gate'].outputs.depth >= 2) && !contains(needs['label-gate'].outputs.quarantined, ',fdb,') }} + uses: ecmwf/fdb/.github/workflows/cross-repo-trigger-hpc-atos.yml@develop + permissions: + actions: read + contents: read + with: + from-repo: ${{ github.repository }} + from-sha: ${{ needs.context.outputs.head-sha }} + from-jobs: '["odc/build-hpc"]' + branch: ${{ needs.context.outputs.head-branch }} + fallback-ref: develop + pin: ${{ needs.resolve.outputs.pins }} + resolved: ${{ needs.resolve.outputs.fdb }} + resolved-ref: ${{ needs.resolve.outputs.fdb-ref }} + secrets: inherit + + gribjump: + name: gribjump + needs: [ci-approval, context, label-gate, validate, resolve, rebuild-producers, fdb] + if: ${{ (!cancelled() && !failure() && needs['validate'].result == 'success' && needs['resolve'].result == 'success' && needs['fdb'].result == 'success') && needs['label-gate'].outputs.run == 'true' && (needs['label-gate'].outputs.depth == 'all' || needs['label-gate'].outputs.depth >= 3) && !contains(needs['label-gate'].outputs.quarantined, ',gribjump,') }} + uses: ecmwf/gribjump/.github/workflows/cross-repo-trigger-hpc-atos.yml@develop + permissions: + actions: read + contents: read + with: + from-repo: ${{ github.repository }} + from-sha: ${{ needs.context.outputs.head-sha }} + from-jobs: '["odc/build-hpc"]' + branch: ${{ needs.context.outputs.head-branch }} + fallback-ref: develop + pin: ${{ needs.resolve.outputs.pins }} + resolved: ${{ needs.resolve.outputs.gribjump }} + resolved-ref: ${{ needs.resolve.outputs.gribjump-ref }} + secrets: inherit + + metkit: + name: metkit + needs: [ci-approval, context, label-gate, validate, resolve, rebuild-producers] + if: ${{ (!cancelled() && !failure() && needs['validate'].result == 'success' && needs['resolve'].result == 'success') && needs['label-gate'].outputs.run == 'true' && (needs['label-gate'].outputs.depth == 'all' || needs['label-gate'].outputs.depth >= 1) && !contains(needs['label-gate'].outputs.quarantined, ',metkit,') }} + uses: ecmwf/metkit/.github/workflows/cross-repo-trigger-hpc-atos.yml@develop + permissions: + actions: read + contents: read + with: + from-repo: ${{ github.repository }} + from-sha: ${{ needs.context.outputs.head-sha }} + from-jobs: '["odc/build-hpc"]' + branch: ${{ needs.context.outputs.head-branch }} + fallback-ref: develop + pin: ${{ needs.resolve.outputs.pins }} + resolved: ${{ needs.resolve.outputs.metkit }} + resolved-ref: ${{ needs.resolve.outputs.metkit-ref }} + secrets: inherit + + report-result: + needs: [ci-approval, context, label-gate, validate, fdb, gribjump, metkit] + if: ${{ (always() && needs.context.outputs.ci-conclusion == 'success') && needs['label-gate'].outputs.run == 'true' }} + runs-on: ubuntu-latest + permissions: + statuses: write + steps: + - name: Post final downstream status + env: + GH_TOKEN: ${{ github.token }} + run: | + state=success + for r in ${{ needs.validate.result }} ${{ needs.fdb.result }} ${{ needs.gribjump.result }} ${{ needs.metkit.result }}; do + if [ "$r" = failure ] || [ "$r" = cancelled ]; then + state=failure + fi + done + depth="${{ needs['label-gate'].outputs.depth }}" + scope="" + if [ "$depth" != all ]; then scope=" (up to level $depth)"; fi + gh api -X POST \ + "/repos/${{ github.repository }}/statuses/${{ needs.context.outputs.head-sha }}" \ + -f state="$state" \ + -f context='downstream/hpc-atos' \ + -f target_url="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" \ + -f description="Downstream HPC tests $state$scope" diff --git a/.github/workflows/trigger-downstream.yml b/.github/workflows/trigger-downstream.yml index c733870c..22604a42 100644 --- a/.github/workflows/trigger-downstream.yml +++ b/.github/workflows/trigger-downstream.yml @@ -104,8 +104,18 @@ jobs: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} outputs: + metkit: ${{ steps.r-metkit.outcome == 'success' && steps.r-metkit.outputs.json || '' }} + metkit-ref: ${{ steps.r-metkit.outcome == 'success' && steps.r-metkit.outputs.own-sha || '' }} pyodc: ${{ steps.r-pyodc.outcome == 'success' && steps.r-pyodc.outputs.json || '' }} pyodc-ref: ${{ steps.r-pyodc.outcome == 'success' && steps.r-pyodc.outputs.own-sha || '' }} + fdb: ${{ steps.r-fdb.outcome == 'success' && steps.r-fdb.outputs.json || '' }} + fdb-ref: ${{ steps.r-fdb.outcome == 'success' && steps.r-fdb.outputs.own-sha || '' }} + gribjump: ${{ steps.r-gribjump.outcome == 'success' && steps.r-gribjump.outputs.json || '' }} + gribjump-ref: ${{ steps.r-gribjump.outcome == 'success' && steps.r-gribjump.outputs.own-sha || '' }} + multio: ${{ steps.r-multio.outcome == 'success' && steps.r-multio.outputs.json || '' }} + multio-ref: ${{ steps.r-multio.outcome == 'success' && steps.r-multio.outputs.own-sha || '' }} + polytope: ${{ steps.r-polytope.outcome == 'success' && steps.r-polytope.outputs.json || '' }} + polytope-ref: ${{ steps.r-polytope.outcome == 'success' && steps.r-polytope.outputs.own-sha || '' }} pins: ${{ steps.pins.outputs.pins }} dispatch-plans: ${{ steps.plans.outputs.dispatch-plans }} steps: @@ -114,7 +124,7 @@ jobs: with: client-id: ${{ vars.CI_READER_APP_CLIENT_ID }} private-key: ${{ secrets.CI_READER_APP_PRIVATE_KEY }} - repositories: ecbuild,eckit,findlibs,odc,pyodc,stack-dependencies + repositories: atlas,atlas-orca,conflator,ecbuild,eccodes,eccodes-python,eckit,fckit,fdb,findlibs,gribjump,metkit,mir,multio,odc,polytope,pyodc,stack-dependencies permissions: contents:read actions:read - name: Pin the commits the upstream's CI resolved env: @@ -122,6 +132,44 @@ jobs: HEAD_SHA: ${{ needs.context.outputs.head-sha }} CI_RUN_ID: ${{ needs.context.outputs.ci-run-id }} run: "set -euo pipefail\npins=\"${GITHUB_REPOSITORY}@${HEAD_SHA}\"\ndir=\"${RUNNER_TEMP}/resolved-pins\"\nif [ -n \"${CI_RUN_ID}\" ] && gh run download \"${CI_RUN_ID}\" --repo \"${GITHUB_REPOSITORY}\" \\\n --name resolved-pins --dir \"$dir\" 2>/dev/null; then\n while read -r pin; do\n if [[ \"$pin\" =~ ^[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+@[0-9a-f]{40}$ ]] && [[ \"$pin\" != \"${GITHUB_REPOSITORY}@\"* ]]; then\n pins=\"$pins $pin\"\n fi\n done < <(tr ' ' '\\n' < \"$dir/pins.txt\")\n echo \"Starting from the commits run ${CI_RUN_ID} resolved: $pins\"\nelse\n echo \"::notice::No resolved-pins artifact on CI run '${CI_RUN_ID}'; the other repos resolve at their branch tips.\"\nfi\necho \"PINS=$pins\" >> \"$GITHUB_ENV\"\necho \"EXPECTED=\" >> \"$GITHUB_ENV\"\n" + - id: pick-metkit + if: (needs['label-gate'].outputs.depth == 'all' || needs['label-gate'].outputs.depth >= 1) + uses: ecmwf/ci-infrastructure/actions/pick-ref@main + with: + repo: ecmwf/metkit + try-branch: ${{ needs.context.outputs.head-branch }} + fallback-ref: develop + token: ${{ steps.mint.outputs.token }} + - if: (needs['label-gate'].outputs.depth == 'all' || needs['label-gate'].outputs.depth >= 1) + uses: actions/checkout@v6 + with: + repository: ecmwf/metkit + ref: ${{ steps.pick-metkit.outputs.ref }} + token: ${{ steps.mint.outputs.token }} + persist-credentials: false + path: .downstream/metkit + sparse-checkout: .ci + - name: Resolve metkit + id: r-metkit + if: (needs['label-gate'].outputs.depth == 'all' || needs['label-gate'].outputs.depth >= 1) + continue-on-error: true + uses: ecmwf/ci-infrastructure/actions/resolve-deps@main + with: + manifest: .downstream/metkit/.ci/manifest.toml + current-branch: ${{ steps.pick-metkit.outputs.ref }} + pin: ${{ env.PINS }} + expected-artifacts: ${{ env.EXPECTED }} + matrix: build,python + token: ${{ steps.mint.outputs.token }} + rebuild-missing: 'true' + - name: Carry metkit's commits to the next consumer + if: steps.r-metkit.outcome == 'success' + env: + R_PINS: ${{ steps.r-metkit.outputs.pins }} + R_ARTIFACTS: ${{ steps.r-metkit.outputs.artifacts }} + run: 'echo "PINS=${R_PINS}" >> "$GITHUB_ENV" + + echo "EXPECTED=${EXPECTED} ${R_ARTIFACTS}" >> "$GITHUB_ENV"' - id: pick-pyodc if: (needs['label-gate'].outputs.depth == 'all' || needs['label-gate'].outputs.depth >= 1) uses: ecmwf/ci-infrastructure/actions/pick-ref@main @@ -159,13 +207,170 @@ jobs: R_ARTIFACTS: ${{ steps.r-pyodc.outputs.artifacts }} run: 'echo "PINS=${R_PINS}" >> "$GITHUB_ENV" + echo "EXPECTED=${EXPECTED} ${R_ARTIFACTS}" >> "$GITHUB_ENV"' + - id: pick-fdb + if: (needs['label-gate'].outputs.depth == 'all' || needs['label-gate'].outputs.depth >= 2) + uses: ecmwf/ci-infrastructure/actions/pick-ref@main + with: + repo: ecmwf/fdb + try-branch: ${{ needs.context.outputs.head-branch }} + fallback-ref: develop + token: ${{ steps.mint.outputs.token }} + - if: (needs['label-gate'].outputs.depth == 'all' || needs['label-gate'].outputs.depth >= 2) + uses: actions/checkout@v6 + with: + repository: ecmwf/fdb + ref: ${{ steps.pick-fdb.outputs.ref }} + token: ${{ steps.mint.outputs.token }} + persist-credentials: false + path: .downstream/fdb + sparse-checkout: .ci + - name: Resolve fdb + id: r-fdb + if: (needs['label-gate'].outputs.depth == 'all' || needs['label-gate'].outputs.depth >= 2) + continue-on-error: true + uses: ecmwf/ci-infrastructure/actions/resolve-deps@main + with: + manifest: .downstream/fdb/.ci/manifest.toml + current-branch: ${{ steps.pick-fdb.outputs.ref }} + pin: ${{ env.PINS }} + expected-artifacts: ${{ env.EXPECTED }} + matrix: build,python + token: ${{ steps.mint.outputs.token }} + rebuild-missing: 'true' + - name: Carry fdb's commits to the next consumer + if: steps.r-fdb.outcome == 'success' + env: + R_PINS: ${{ steps.r-fdb.outputs.pins }} + R_ARTIFACTS: ${{ steps.r-fdb.outputs.artifacts }} + run: 'echo "PINS=${R_PINS}" >> "$GITHUB_ENV" + + echo "EXPECTED=${EXPECTED} ${R_ARTIFACTS}" >> "$GITHUB_ENV"' + - id: pick-gribjump + if: (needs['label-gate'].outputs.depth == 'all' || needs['label-gate'].outputs.depth >= 3) + uses: ecmwf/ci-infrastructure/actions/pick-ref@main + with: + repo: ecmwf/gribjump + try-branch: ${{ needs.context.outputs.head-branch }} + fallback-ref: develop + token: ${{ steps.mint.outputs.token }} + - if: (needs['label-gate'].outputs.depth == 'all' || needs['label-gate'].outputs.depth >= 3) + uses: actions/checkout@v6 + with: + repository: ecmwf/gribjump + ref: ${{ steps.pick-gribjump.outputs.ref }} + token: ${{ steps.mint.outputs.token }} + persist-credentials: false + path: .downstream/gribjump + sparse-checkout: .ci + - name: Resolve gribjump + id: r-gribjump + if: (needs['label-gate'].outputs.depth == 'all' || needs['label-gate'].outputs.depth >= 3) + continue-on-error: true + uses: ecmwf/ci-infrastructure/actions/resolve-deps@main + with: + manifest: .downstream/gribjump/.ci/manifest.toml + current-branch: ${{ steps.pick-gribjump.outputs.ref }} + pin: ${{ env.PINS }} + expected-artifacts: ${{ env.EXPECTED }} + matrix: build,python + token: ${{ steps.mint.outputs.token }} + rebuild-missing: 'true' + - name: Carry gribjump's commits to the next consumer + if: steps.r-gribjump.outcome == 'success' + env: + R_PINS: ${{ steps.r-gribjump.outputs.pins }} + R_ARTIFACTS: ${{ steps.r-gribjump.outputs.artifacts }} + run: 'echo "PINS=${R_PINS}" >> "$GITHUB_ENV" + + echo "EXPECTED=${EXPECTED} ${R_ARTIFACTS}" >> "$GITHUB_ENV"' + - id: pick-multio + if: (needs['label-gate'].outputs.depth == 'all' || needs['label-gate'].outputs.depth >= 3) + uses: ecmwf/ci-infrastructure/actions/pick-ref@main + with: + repo: ecmwf/multio + try-branch: ${{ needs.context.outputs.head-branch }} + fallback-ref: develop + token: ${{ steps.mint.outputs.token }} + - if: (needs['label-gate'].outputs.depth == 'all' || needs['label-gate'].outputs.depth >= 3) + uses: actions/checkout@v6 + with: + repository: ecmwf/multio + ref: ${{ steps.pick-multio.outputs.ref }} + token: ${{ steps.mint.outputs.token }} + persist-credentials: false + path: .downstream/multio + sparse-checkout: .ci + - name: Resolve multio + id: r-multio + if: (needs['label-gate'].outputs.depth == 'all' || needs['label-gate'].outputs.depth >= 3) + continue-on-error: true + uses: ecmwf/ci-infrastructure/actions/resolve-deps@main + with: + manifest: .downstream/multio/.ci/manifest.toml + current-branch: ${{ steps.pick-multio.outputs.ref }} + pin: ${{ env.PINS }} + expected-artifacts: ${{ env.EXPECTED }} + matrix: build,python + token: ${{ steps.mint.outputs.token }} + rebuild-missing: 'true' + - name: Carry multio's commits to the next consumer + if: steps.r-multio.outcome == 'success' + env: + R_PINS: ${{ steps.r-multio.outputs.pins }} + R_ARTIFACTS: ${{ steps.r-multio.outputs.artifacts }} + run: 'echo "PINS=${R_PINS}" >> "$GITHUB_ENV" + + echo "EXPECTED=${EXPECTED} ${R_ARTIFACTS}" >> "$GITHUB_ENV"' + - id: pick-polytope + if: (needs['label-gate'].outputs.depth == 'all' || needs['label-gate'].outputs.depth >= 4) + uses: ecmwf/ci-infrastructure/actions/pick-ref@main + with: + repo: ecmwf/polytope + try-branch: ${{ needs.context.outputs.head-branch }} + fallback-ref: develop + token: ${{ steps.mint.outputs.token }} + - if: (needs['label-gate'].outputs.depth == 'all' || needs['label-gate'].outputs.depth >= 4) + uses: actions/checkout@v6 + with: + repository: ecmwf/polytope + ref: ${{ steps.pick-polytope.outputs.ref }} + token: ${{ steps.mint.outputs.token }} + persist-credentials: false + path: .downstream/polytope + sparse-checkout: .ci + - name: Resolve polytope + id: r-polytope + if: (needs['label-gate'].outputs.depth == 'all' || needs['label-gate'].outputs.depth >= 4) + continue-on-error: true + uses: ecmwf/ci-infrastructure/actions/resolve-deps@main + with: + manifest: .downstream/polytope/.ci/manifest.toml + current-branch: ${{ steps.pick-polytope.outputs.ref }} + pin: ${{ env.PINS }} + expected-artifacts: ${{ env.EXPECTED }} + matrix: test + token: ${{ steps.mint.outputs.token }} + rebuild-missing: 'true' + - name: Carry polytope's commits to the next consumer + if: steps.r-polytope.outcome == 'success' + env: + R_PINS: ${{ steps.r-polytope.outputs.pins }} + R_ARTIFACTS: ${{ steps.r-polytope.outputs.artifacts }} + run: 'echo "PINS=${R_PINS}" >> "$GITHUB_ENV" + echo "EXPECTED=${EXPECTED} ${R_ARTIFACTS}" >> "$GITHUB_ENV"' - id: pins run: echo "pins=${PINS}" >> "$GITHUB_OUTPUT" - id: plans env: - PLANS_0: ${{ steps.r-pyodc.outputs.dispatch-plans || '[]' }} - run: 'plans=$(printf ''%s\n'' "${PLANS_0}" | jq -cs ''add // []'') + PLANS_0: ${{ steps.r-metkit.outputs.dispatch-plans || '[]' }} + PLANS_1: ${{ steps.r-pyodc.outputs.dispatch-plans || '[]' }} + PLANS_2: ${{ steps.r-fdb.outputs.dispatch-plans || '[]' }} + PLANS_3: ${{ steps.r-gribjump.outputs.dispatch-plans || '[]' }} + PLANS_4: ${{ steps.r-multio.outputs.dispatch-plans || '[]' }} + PLANS_5: ${{ steps.r-polytope.outputs.dispatch-plans || '[]' }} + run: 'plans=$(printf ''%s\n'' "${PLANS_0}" "${PLANS_1}" "${PLANS_2}" "${PLANS_3}" "${PLANS_4}" "${PLANS_5}" | jq -cs ''add // []'') echo "dispatch-plans=${plans}" >> "$GITHUB_OUTPUT"' @@ -177,7 +382,7 @@ jobs: uses: ecmwf/ci-infrastructure/actions/dispatch-producers@main with: dispatch-plans: ${{ needs.resolve.outputs.dispatch-plans }} - repositories: ecbuild,eckit,findlibs,odc,pyodc,stack-dependencies + repositories: atlas,atlas-orca,conflator,ecbuild,eccodes,eccodes-python,eckit,fckit,fdb,findlibs,gribjump,metkit,mir,multio,odc,polytope,pyodc,stack-dependencies client-id: ${{ vars.CI_DISPATCHER_APP_CLIENT_ID }} app-private-key: ${{ secrets.CI_DISPATCHER_APP_PRIVATE_KEY }} if: ${{ needs['label-gate'].outputs.run == 'true' }} @@ -218,6 +423,129 @@ jobs: -f description="${{ needs.context.outputs.ci-summary }}; downstream runner not run" needs: [ci-approval, context, label-gate] + fdb: + name: fdb + needs: [ci-approval, context, label-gate, validate, resolve, rebuild-producers, metkit] + if: ${{ (!cancelled() && !failure() && needs['validate'].result == 'success' && needs['resolve'].result == 'success' && needs['metkit'].result == 'success') && needs['label-gate'].outputs.run == 'true' && (needs['label-gate'].outputs.depth == 'all' || needs['label-gate'].outputs.depth >= 2) && !contains(needs['label-gate'].outputs.quarantined, ',fdb,') }} + uses: ecmwf/fdb/.github/workflows/cross-repo-trigger.yml@develop + permissions: + actions: read + contents: read + with: + from-repo: ${{ github.repository }} + from-sha: ${{ needs.context.outputs.head-sha }} + from-jobs: '["odc/build"]' + branch: ${{ needs.context.outputs.head-branch }} + fallback-ref: develop + pin: ${{ needs.resolve.outputs.pins }} + resolved: ${{ needs.resolve.outputs.fdb }} + resolved-ref: ${{ needs.resolve.outputs.fdb-ref }} + secrets: inherit + + gribjump: + name: gribjump + needs: [ci-approval, context, label-gate, validate, resolve, rebuild-producers, fdb] + if: ${{ (!cancelled() && !failure() && needs['validate'].result == 'success' && needs['resolve'].result == 'success' && needs['fdb'].result == 'success') && needs['label-gate'].outputs.run == 'true' && (needs['label-gate'].outputs.depth == 'all' || needs['label-gate'].outputs.depth >= 3) && !contains(needs['label-gate'].outputs.quarantined, ',gribjump,') }} + uses: ecmwf/gribjump/.github/workflows/cross-repo-trigger.yml@develop + permissions: + actions: read + contents: read + with: + from-repo: ${{ github.repository }} + from-sha: ${{ needs.context.outputs.head-sha }} + from-jobs: '["odc/build"]' + branch: ${{ needs.context.outputs.head-branch }} + fallback-ref: develop + pin: ${{ needs.resolve.outputs.pins }} + resolved: ${{ needs.resolve.outputs.gribjump }} + resolved-ref: ${{ needs.resolve.outputs.gribjump-ref }} + secrets: inherit + + metkit: + name: metkit + needs: [ci-approval, context, label-gate, validate, resolve, rebuild-producers] + if: ${{ (!cancelled() && !failure() && needs['validate'].result == 'success' && needs['resolve'].result == 'success') && needs['label-gate'].outputs.run == 'true' && (needs['label-gate'].outputs.depth == 'all' || needs['label-gate'].outputs.depth >= 1) && !contains(needs['label-gate'].outputs.quarantined, ',metkit,') }} + uses: ecmwf/metkit/.github/workflows/cross-repo-trigger.yml@develop + permissions: + actions: read + contents: read + with: + from-repo: ${{ github.repository }} + from-sha: ${{ needs.context.outputs.head-sha }} + from-jobs: '["odc/build"]' + branch: ${{ needs.context.outputs.head-branch }} + fallback-ref: develop + pin: ${{ needs.resolve.outputs.pins }} + resolved: ${{ needs.resolve.outputs.metkit }} + resolved-ref: ${{ needs.resolve.outputs.metkit-ref }} + secrets: inherit + + multio: + name: multio + needs: [ci-approval, context, label-gate, validate, resolve, rebuild-producers, fdb] + if: ${{ (!cancelled() && !failure() && needs['validate'].result == 'success' && needs['resolve'].result == 'success' && needs['fdb'].result == 'success') && needs['label-gate'].outputs.run == 'true' && (needs['label-gate'].outputs.depth == 'all' || needs['label-gate'].outputs.depth >= 3) && !contains(needs['label-gate'].outputs.quarantined, ',multio,') }} + uses: ecmwf/multio/.github/workflows/cross-repo-trigger.yml@develop + permissions: + actions: read + contents: read + with: + from-repo: ${{ github.repository }} + from-sha: ${{ needs.context.outputs.head-sha }} + from-jobs: '["odc/build"]' + branch: ${{ needs.context.outputs.head-branch }} + fallback-ref: develop + pin: ${{ needs.resolve.outputs.pins }} + resolved: ${{ needs.resolve.outputs.multio }} + resolved-ref: ${{ needs.resolve.outputs.multio-ref }} + secrets: inherit + + pgen: + name: pgen + needs: [ci-approval, context, label-gate, validate, resolve, fdb] + runs-on: ubuntu-latest + steps: + - id: mint + uses: ecmwf/ci-infrastructure/actions/mint-token@main + with: + client-id: ${{ vars.CI_DISPATCHER_APP_CLIENT_ID }} + private-key: ${{ secrets.CI_DISPATCHER_APP_PRIVATE_KEY }} + repositories: pgen + permissions: actions:write + - name: Dispatch pgen (private consumer) + uses: ecmwf/ci-infrastructure/actions/dispatch-and-wait@main + with: + consumer-repo: ecmwf/pgen + ref: develop + from-repo: ${{ github.repository }} + from-sha: ${{ needs.context.outputs.head-sha }} + from-jobs: '["odc/build"]' + branch: ${{ needs.context.outputs.head-branch }} + fallback-ref: develop + pin: ${{ needs.resolve.outputs.pins }} + token: ${{ steps.mint.outputs.token }} + artifact-names: '' + wait-for-run-conclusion: 'true' + if: ${{ needs['label-gate'].outputs.run == 'true' && (needs['label-gate'].outputs.depth == 'all' || needs['label-gate'].outputs.depth >= 3) && !contains(needs['label-gate'].outputs.quarantined, ',pgen,') }} + + polytope: + name: polytope + needs: [ci-approval, context, label-gate, validate, resolve, rebuild-producers, gribjump] + if: ${{ (!cancelled() && !failure() && needs['validate'].result == 'success' && needs['resolve'].result == 'success' && needs['gribjump'].result == 'success') && needs['label-gate'].outputs.run == 'true' && (needs['label-gate'].outputs.depth == 'all' || needs['label-gate'].outputs.depth >= 4) && !contains(needs['label-gate'].outputs.quarantined, ',polytope,') }} + uses: ecmwf/polytope/.github/workflows/cross-repo-trigger.yml@develop + permissions: + actions: read + contents: read + with: + from-repo: ${{ github.repository }} + from-sha: ${{ needs.context.outputs.head-sha }} + from-jobs: '["odc/build"]' + branch: ${{ needs.context.outputs.head-branch }} + fallback-ref: develop + pin: ${{ needs.resolve.outputs.pins }} + resolved: ${{ needs.resolve.outputs.polytope }} + resolved-ref: ${{ needs.resolve.outputs.polytope-ref }} + secrets: inherit + pyodc: name: pyodc needs: [ci-approval, context, label-gate, validate, resolve, rebuild-producers] @@ -237,8 +565,48 @@ jobs: resolved-ref: ${{ needs.resolve.outputs.pyodc-ref }} secrets: inherit + zfdb: + name: zfdb + needs: [ci-approval, context, label-gate, validate, resolve, gribjump] + runs-on: ubuntu-latest + steps: + - id: mint + uses: ecmwf/ci-infrastructure/actions/mint-token@main + with: + client-id: ${{ vars.CI_DISPATCHER_APP_CLIENT_ID }} + private-key: ${{ secrets.CI_DISPATCHER_APP_PRIVATE_KEY }} + repositories: zfdb + permissions: actions:write + - name: Dispatch zfdb (private consumer) + uses: ecmwf/ci-infrastructure/actions/dispatch-and-wait@main + with: + consumer-repo: ecmwf/zfdb + ref: develop + from-repo: ${{ github.repository }} + from-sha: ${{ needs.context.outputs.head-sha }} + from-jobs: '["odc/build"]' + branch: ${{ needs.context.outputs.head-branch }} + fallback-ref: develop + pin: ${{ needs.resolve.outputs.pins }} + token: ${{ steps.mint.outputs.token }} + artifact-names: '' + wait-for-run-conclusion: 'true' + if: ${{ needs['label-gate'].outputs.run == 'true' && (needs['label-gate'].outputs.depth == 'all' || needs['label-gate'].outputs.depth >= 4) && !contains(needs['label-gate'].outputs.quarantined, ',zfdb,') }} + report-result: - needs: [ci-approval, context, label-gate, validate, pyodc] + needs: + - ci-approval + - context + - label-gate + - validate + - fdb + - gribjump + - metkit + - multio + - pgen + - polytope + - pyodc + - zfdb if: ${{ (always() && needs.context.outputs.ci-conclusion == 'success') && needs['label-gate'].outputs.run == 'true' }} runs-on: ubuntu-latest permissions: @@ -249,7 +617,7 @@ jobs: GH_TOKEN: ${{ github.token }} run: | state=success - for r in ${{ needs.validate.result }} ${{ needs.pyodc.result }}; do + for r in ${{ needs.validate.result }} ${{ needs.fdb.result }} ${{ needs.gribjump.result }} ${{ needs.metkit.result }} ${{ needs.multio.result }} ${{ needs.pgen.result }} ${{ needs.polytope.result }} ${{ needs.pyodc.result }} ${{ needs.zfdb.result }}; do if [ "$r" = failure ] || [ "$r" = cancelled ]; then state=failure fi diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d6a3b266..9218c3f5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -17,7 +17,7 @@ repos: types_or: [c, c++] - repo: https://github.com/ecmwf/ci-infrastructure - rev: 2255f0b9b6fee6cb12c49178b1552cce8061b1ef + rev: 0a32b5e84c3ad45393f4853d1d7825c249708744 hooks: - id: check-ci-approval - id: check-ci-result