Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
248 changes: 248 additions & 0 deletions .github/workflows/cross-repo-trigger-hpc-atos.yml
Original file line number Diff line number Diff line change
@@ -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 }}
4 changes: 2 additions & 2 deletions .github/workflows/pr-label-downstream-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
29 changes: 29 additions & 0 deletions .github/workflows/pr-label-hpc-ci.yml
Original file line number Diff line number Diff line change
@@ -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 }}
Loading
Loading