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

Feature/pyflow #47

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
77 changes: 77 additions & 0 deletions .github/workflows/downstream-ci-hpc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@ name: downstream-ci-hpc
pyfdb:
required: false
type: string
pyflow:
required: false
type: string
pyflow-wellies:
required: false
type: string
pyodc:
required: false
type: string
Expand Down Expand Up @@ -148,6 +154,10 @@ jobs:
plume_matrix: ${{ steps.setup.outputs.plume }}
pyfdb: ${{ steps.prepare-inputs.outputs.pyfdb }}
pyfdb_matrix: ${{ steps.setup.outputs.pyfdb }}
pyflow: ${{ steps.prepare-inputs.outputs.pyflow }}
pyflow_matrix: ${{ steps.setup.outputs.pyflow }}
pyflow-wellies: ${{ steps.prepare-inputs.outputs.pyflow-wellies }}
pyflow-wellies_matrix: ${{ steps.setup.outputs.pyflow-wellies }}
pyodc: ${{ steps.prepare-inputs.outputs.pyodc }}
pyodc_matrix: ${{ steps.setup.outputs.pyodc }}
skinnywms: ${{ steps.prepare-inputs.outputs.skinnywms }}
Expand Down Expand Up @@ -186,6 +196,8 @@ jobs:
echo pdbufr="${{ inputs.pdbufr }}" >> $GITHUB_OUTPUT
echo plume="${{ inputs.plume }}" >> $GITHUB_OUTPUT
echo pyfdb="${{ inputs.pyfdb }}" >> $GITHUB_OUTPUT
echo pyflow="${{ inputs.pyflow }}" >> $GITHUB_OUTPUT
echo pyflow-wellies="${{ inputs.pyflow-wellies }}" >> $GITHUB_OUTPUT
echo pyodc="${{ inputs.pyodc }}" >> $GITHUB_OUTPUT
echo skinnywms="${{ inputs.skinnywms }}" >> $GITHUB_OUTPUT
echo thermofeel="${{ inputs.thermofeel }}" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -362,6 +374,20 @@ jobs:
develop_branch: develop
input: ${{ steps.prepare-inputs.outputs.pyfdb }}
optional_matrix: null
ecmwf/pyflow:
path: .github/ci-hpc-config.yml
python: true
master_branch: master
develop_branch: develop
input: ${{ steps.prepare-inputs.outputs.pyflow }}
optional_matrix: null
ecmwf/pyflow-wellies:
path: .github/ci-hpc-config.yml
python: true
master_branch: master
develop_branch: develop
input: ${{ steps.prepare-inputs.outputs.pyflow-wellies }}
optional_matrix: null
ecmwf/pyodc:
path: .github/ci-hpc-config.yml
python: true
Expand Down Expand Up @@ -1112,6 +1138,57 @@ jobs:
${{ needs.setup.outputs.eccodes }}
${{ needs.setup.outputs.eckit }}
python_dependencies: ''
pyflow:
name: pyflow
needs:
- ecflow
- setup
if: ${{ (always() && !cancelled()) && contains(join(needs.*.result, ','), 'success') && needs.setup.outputs.pyflow_matrix && (needs.setup.outputs.ecflow || needs.setup.outputs.pyflow) }}
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.setup.outputs.pyflow_matrix) }}
env:
DEP_TREE: ${{ needs.setup.outputs.dep_tree }}
runs-on:
- self-hosted
- linux
- hpc
steps:
- uses: ecmwf-actions/reusable-workflows/ci-hpc@v2
with:
github_user: ${{ secrets.BUILD_PACKAGE_HPC_GITHUB_USER }}
github_token: ${{ secrets.GH_REPO_READ_TOKEN }}
troika_user: ${{ secrets.HPC_CI_SSH_USER }}
repository: ${{ matrix.owner_repo_ref }}
build_config: ${{ matrix.config_path }}
dependencies: ${{ needs.setup.outputs.ecflow }}
python_dependencies: ''
pyflow-wellies:
name: pyflow-wellies
needs:
- pyflow
- ecflow
- setup
if: ${{ (always() && !cancelled()) && contains(join(needs.*.result, ','), 'success') && needs.setup.outputs.pyflow-wellies_matrix && (needs.setup.outputs.pyflow || needs.setup.outputs.ecflow || needs.setup.outputs.pyflow-wellies) }}
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.setup.outputs.pyflow-wellies_matrix) }}
env:
DEP_TREE: ${{ needs.setup.outputs.dep_tree }}
runs-on:
- self-hosted
- linux
- hpc
steps:
- uses: ecmwf-actions/reusable-workflows/ci-hpc@v2
with:
github_user: ${{ secrets.BUILD_PACKAGE_HPC_GITHUB_USER }}
github_token: ${{ secrets.GH_REPO_READ_TOKEN }}
troika_user: ${{ secrets.HPC_CI_SSH_USER }}
repository: ${{ matrix.owner_repo_ref }}
build_config: ${{ matrix.config_path }}
dependencies: ${{ needs.setup.outputs.ecflow }}
python_dependencies: ${{ needs.setup.outputs.pyflow }}
pyodc:
name: pyodc
needs:
Expand Down
98 changes: 98 additions & 0 deletions .github/workflows/downstream-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ name: downstream-ci
pyfdb:
required: false
type: string
pyflow:
required: false
type: string
pyflow-wellies:
required: false
type: string
pyodc:
required: false
type: string
Expand Down Expand Up @@ -164,6 +170,10 @@ jobs:
plume_matrix: ${{ steps.setup.outputs.plume }}
pyfdb: ${{ steps.prepare-inputs.outputs.pyfdb }}
pyfdb_matrix: ${{ steps.setup.outputs.pyfdb }}
pyflow: ${{ steps.prepare-inputs.outputs.pyflow }}
pyflow_matrix: ${{ steps.setup.outputs.pyflow }}
pyflow-wellies: ${{ steps.prepare-inputs.outputs.pyflow-wellies }}
pyflow-wellies_matrix: ${{ steps.setup.outputs.pyflow-wellies }}
pyodc: ${{ steps.prepare-inputs.outputs.pyodc }}
pyodc_matrix: ${{ steps.setup.outputs.pyodc }}
skinnywms: ${{ steps.prepare-inputs.outputs.skinnywms }}
Expand Down Expand Up @@ -204,6 +214,8 @@ jobs:
echo pdbufr="${{ inputs.pdbufr }}" >> $GITHUB_OUTPUT
echo plume="${{ inputs.plume }}" >> $GITHUB_OUTPUT
echo pyfdb="${{ inputs.pyfdb }}" >> $GITHUB_OUTPUT
echo pyflow="${{ inputs.pyflow }}" >> $GITHUB_OUTPUT
echo pyflow-wellies="${{ inputs.pyflow-wellies }}" >> $GITHUB_OUTPUT
echo pyodc="${{ inputs.pyodc }}" >> $GITHUB_OUTPUT
echo skinnywms="${{ inputs.skinnywms }}" >> $GITHUB_OUTPUT
echo thermofeel="${{ inputs.thermofeel }}" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -380,6 +392,20 @@ jobs:
develop_branch: develop
input: ${{ steps.prepare-inputs.outputs.pyfdb }}
optional_matrix: null
ecmwf/pyflow:
path: .github/ci-config.yml
python: true
master_branch: master
develop_branch: develop
input: ${{ steps.prepare-inputs.outputs.pyflow }}
optional_matrix: null
ecmwf/pyflow-wellies:
path: .github/ci-config.yml
python: true
master_branch: master
develop_branch: develop
input: ${{ steps.prepare-inputs.outputs.pyflow-wellies }}
optional_matrix: null
ecmwf/pyodc:
path: .github/ci-config.yml
python: true
Expand Down Expand Up @@ -648,6 +674,7 @@ jobs:
- uses: ecmwf-actions/reusable-workflows/ci-python@v2
with:
lib_path: ${{ steps.build-deps.outputs.lib_path }}
bin_paths: ${{ steps.build-deps.outputs.bin_paths }}
python_dependencies: ${{ needs.setup.outputs.eccodes-python }}
github_token: ${{ secrets.GH_REPO_READ_TOKEN }}
requirements_path: ci/requirements-tests.in
Expand Down Expand Up @@ -694,6 +721,7 @@ jobs:
- uses: ecmwf-actions/reusable-workflows/ci-python@v2
with:
lib_path: ${{ steps.build-deps.outputs.lib_path }}
bin_paths: ${{ steps.build-deps.outputs.bin_paths }}
python_dependencies: |-
${{ needs.setup.outputs.earthkit-data }}
${{ needs.setup.outputs.cfgrib }}
Expand Down Expand Up @@ -748,6 +776,7 @@ jobs:
- uses: ecmwf-actions/reusable-workflows/ci-python@v2
with:
lib_path: ${{ steps.build-deps.outputs.lib_path }}
bin_paths: ${{ steps.build-deps.outputs.bin_paths }}
python_dependencies: |-
${{ needs.setup.outputs.cfgrib }}
${{ needs.setup.outputs.multiurl }}
Expand Down Expand Up @@ -878,6 +907,7 @@ jobs:
- uses: ecmwf-actions/reusable-workflows/ci-python@v2
with:
lib_path: ${{ steps.build-deps.outputs.lib_path }}
bin_paths: ${{ steps.build-deps.outputs.bin_paths }}
python_dependencies: ''
github_token: ${{ secrets.GH_REPO_READ_TOKEN }}
codecov_upload: ${{ needs.setup.outputs.trigger_repo == github.job && inputs.codecov_upload && needs.setup.outputs.py_codecov_platform == matrix.name }}
Expand Down Expand Up @@ -1190,6 +1220,7 @@ jobs:
- uses: ecmwf-actions/reusable-workflows/ci-python@v2
with:
lib_path: ${{ steps.build-deps.outputs.lib_path }}
bin_paths: ${{ steps.build-deps.outputs.bin_paths }}
python_dependencies: ${{ needs.setup.outputs.eccodes-python }}
github_token: ${{ secrets.GH_REPO_READ_TOKEN }}
requirements_path: tests/downstream-ci-requirements.txt
Expand Down Expand Up @@ -1264,10 +1295,76 @@ jobs:
- uses: ecmwf-actions/reusable-workflows/ci-python@v2
with:
lib_path: ${{ steps.build-deps.outputs.lib_path }}
bin_paths: ${{ steps.build-deps.outputs.bin_paths }}
python_dependencies: ''
github_token: ${{ secrets.GH_REPO_READ_TOKEN }}
codecov_upload: ${{ needs.setup.outputs.trigger_repo == github.job && inputs.codecov_upload && needs.setup.outputs.py_codecov_platform == matrix.name }}
codecov_token: ${{ secrets.CODECOV_UPLOAD_TOKEN }}
pyflow:
name: pyflow
needs:
- ecflow
- setup
- python-qa
if: ${{ (always() && !cancelled()) && contains(join(needs.*.result, ','), 'success') && needs.setup.outputs.pyflow_matrix && (needs.setup.outputs.ecflow || needs.setup.outputs.pyflow) }}
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.setup.outputs.pyflow_matrix) }}
env:
DEP_TREE: ${{ needs.setup.outputs.dep_tree }}
runs-on: ${{ matrix.labels }}
steps:
- name: Build dependencies
id: build-deps
uses: ecmwf-actions/reusable-workflows/build-package-with-config@v2
with:
repository: ${{ matrix.owner_repo_ref }}
codecov_upload: false
build_package_inputs: 'repository: ${{ matrix.owner_repo_ref }}'
build_config: ${{ matrix.config_path }}
build_dependencies: ${{ needs.setup.outputs.ecflow }}
github_token: ${{ secrets.GH_REPO_READ_TOKEN }}
- uses: ecmwf-actions/reusable-workflows/ci-python@v2
with:
lib_path: ${{ steps.build-deps.outputs.lib_path }}
bin_paths: ${{ steps.build-deps.outputs.bin_paths }}
python_dependencies: ''
github_token: ${{ secrets.GH_REPO_READ_TOKEN }}
codecov_upload: ${{ needs.setup.outputs.trigger_repo == github.job && inputs.codecov_upload && needs.setup.outputs.py_codecov_platform == matrix.name }}
codecov_token: ${{ secrets.CODECOV_UPLOAD_TOKEN }}
pyflow-wellies:
name: pyflow-wellies
needs:
- pyflow
- ecflow
- setup
- python-qa
if: ${{ (always() && !cancelled()) && contains(join(needs.*.result, ','), 'success') && needs.setup.outputs.pyflow-wellies_matrix && (needs.setup.outputs.pyflow || needs.setup.outputs.ecflow || needs.setup.outputs.pyflow-wellies) }}
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.setup.outputs.pyflow-wellies_matrix) }}
env:
DEP_TREE: ${{ needs.setup.outputs.dep_tree }}
runs-on: ${{ matrix.labels }}
steps:
- name: Build dependencies
id: build-deps
uses: ecmwf-actions/reusable-workflows/build-package-with-config@v2
with:
repository: ${{ matrix.owner_repo_ref }}
codecov_upload: false
build_package_inputs: 'repository: ${{ matrix.owner_repo_ref }}'
build_config: ${{ matrix.config_path }}
build_dependencies: ${{ needs.setup.outputs.ecflow }}
github_token: ${{ secrets.GH_REPO_READ_TOKEN }}
- uses: ecmwf-actions/reusable-workflows/ci-python@v2
with:
lib_path: ${{ steps.build-deps.outputs.lib_path }}
bin_paths: ${{ steps.build-deps.outputs.bin_paths }}
python_dependencies: ${{ needs.setup.outputs.pyflow }}
github_token: ${{ secrets.GH_REPO_READ_TOKEN }}
codecov_upload: ${{ needs.setup.outputs.trigger_repo == github.job && inputs.codecov_upload && needs.setup.outputs.py_codecov_platform == matrix.name }}
codecov_token: ${{ secrets.CODECOV_UPLOAD_TOKEN }}
pyodc:
name: pyodc
needs:
Expand Down Expand Up @@ -1298,6 +1395,7 @@ jobs:
- uses: ecmwf-actions/reusable-workflows/ci-python@v2
with:
lib_path: ${{ steps.build-deps.outputs.lib_path }}
bin_paths: ${{ steps.build-deps.outputs.bin_paths }}
python_dependencies: ''
github_token: ${{ secrets.GH_REPO_READ_TOKEN }}
codecov_upload: ${{ needs.setup.outputs.trigger_repo == github.job && inputs.codecov_upload && needs.setup.outputs.py_codecov_platform == matrix.name }}
Expand Down
15 changes: 15 additions & 0 deletions dependency_tree.yml
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,21 @@ pyfdb:
{"type":"local","engine":"toc","schema":"${{ github.workspace }}/tests/default_fdb_schema","spaces":[{"handler":"Default","roots":[{"path":"${{ github.workspace }}/data/fdb"}]}]}
mkdir:
- data/fdb

pyflow:
type: python
master_branch: master
deps:
- ecflow
# downstream-ci:
# env:
# ECFLOW_DIR: /opt/actions-runner/work/_work/_temp/install/ecflow

pyflow-wellies:
type: python
deps:
- pyflow

pyodc:
type: python
deps:
Expand Down
3 changes: 3 additions & 0 deletions generate-workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,9 @@ def generate_package_jobs(self, dep_tree: dict):
"lib_path": (
"${{ steps.build-deps.outputs.lib_path }}"
),
"bin_paths": (
"${{ steps.build-deps.outputs.bin_paths }}"
),
"python_dependencies": "\n".join(python_deps),
"github_token": "${{ secrets.GH_REPO_READ_TOKEN }}",
},
Expand Down