Skip to content

Merge pull request #53 from hdpriest-ui/main #18

Merge pull request #53 from hdpriest-ui/main

Merge pull request #53 from hdpriest-ui/main #18

name: Test Example 2a (Conda)
# Runs the 2a grass example end-to-end using a pre-built pecan-all conda
# environment for R (no Apptainer), with Slurm dispatch for ensemble members.
# This workflow does not build the environment — it must already exist at
# $RUNNER_TOOL_CACHE/pecan-all-<version> on the runner.
# Requires a self-hosted runner with Slurm and the aws CLI.
on:
workflow_dispatch:
inputs:
pecan_env_version:
description: 'pecan-all conda env version (e.g. 1.16)'
default: '1.16'
required: false
push:
branches: [main]
paths:
- 'examples/2a_grass/**'
- 'workflow/**'
- 'tools/**'
- 'magic-ensemble'
- '.github/workflows/test-example-2a-conda.yml'
- '.github/ci/example_2a_conda_config.yaml'
- '.github/ci/site_info_2a.csv'
env:
PECAN_ENV_VERSION: ${{ github.event.inputs.pecan_env_version || '1.16' }}
CONFIG: .github/ci/example_2a_conda_config.yaml
jobs:
run:
name: 2a Grass (conda, Slurm)
runs-on: self-hosted
timeout-minutes: 480
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: garage
steps:
- uses: actions/checkout@v4
with:
submodules: false
- name: Locate conda environment
run: |
PECAN_ENV_PATH="${RUNNER_TOOL_CACHE}/pecan-all-${PECAN_ENV_VERSION}"
if [[ ! -d "${PECAN_ENV_PATH}" ]]; then
echo "::error::No pecan-all conda environment found for version ${PECAN_ENV_VERSION} at ${PECAN_ENV_PATH}."
echo "Set it up there before dispatching this workflow with pecan_env_version=${PECAN_ENV_VERSION}."
exit 1
fi
echo "Using pecan-all ${PECAN_ENV_VERSION} at ${PECAN_ENV_PATH}"
echo "PECAN_ENV_PATH=${PECAN_ENV_PATH}" >> "$GITHUB_ENV"
echo "RETICULATE_PYTHON=${PECAN_ENV_PATH}/bin/python" >> "$GITHUB_ENV"
- name: Get demo data
run: |
set +u
eval "$(conda shell.bash hook)"
conda activate "${PECAN_ENV_PATH}"
set -u
./magic-ensemble get-demo-data --verbose --config "$CONFIG"
- name: Prepare
run: |
set +u
eval "$(conda shell.bash hook)"
conda activate "${PECAN_ENV_PATH}"
set -u
./magic-ensemble prepare-example-2a --verbose --config "$CONFIG"
- name: Run ensembles
run: |
set +u
eval "$(conda shell.bash hook)"
conda activate "${PECAN_ENV_PATH}"
set -u
./magic-ensemble run-ensembles --verbose --config "$CONFIG"
- name: Cleanup
if: always()
run: rm -rf ci-2a-conda-rundir