|
| 1 | +# Copyright 2022-2024 The Ramble Authors |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or |
| 4 | +# https://www.apache.org/licenses/LICENSE-2.0> or the MIT license |
| 5 | +# <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your |
| 6 | +# option. This file may not be copied, modified, or distributed |
| 7 | +# except according to those terms. |
| 8 | + |
| 9 | + |
| 10 | +steps: |
| 11 | + - name: gcr.io/cloud-builders/git |
| 12 | + args: |
| 13 | + - fetch |
| 14 | + - '--unshallow' |
| 15 | + id: ramble-clone |
| 16 | + - name: us-central1-docker.pkg.dev/$PROJECT_ID/ramble-repo/ramble-${_BASE_IMG}-${_BASE_VER}-spack${_SPACK_REF}-python${_PYTHON_VER}:latest |
| 17 | + args: |
| 18 | + - '-c' |
| 19 | + - | |
| 20 | + cd /workspace |
| 21 | +
|
| 22 | + export PATH=$$(. /opt/spack/share/spack/setup-env.sh && spack location -i miniconda3)/bin:$${PATH} |
| 23 | +
|
| 24 | + . /opt/spack/share/spack/setup-env.sh |
| 25 | + . /workspace/share/ramble/setup-env.sh |
| 26 | +
|
| 27 | + echo "Spack version is $(spack --version)" |
| 28 | + echo "Python version is $(python3 --version)" |
| 29 | +
|
| 30 | + spack mirror add ci_cache ${_CI_CACHE} |
| 31 | + spack buildcache keys --install --trust |
| 32 | +
|
| 33 | + set -e |
| 34 | +
|
| 35 | + ramble workspace create -d modifiers_wrf -c /workspace/examples/tutorial_10_lscpu_config.yaml |
| 36 | +
|
| 37 | + ramble workspace activate ./modifiers_wrf |
| 38 | +
|
| 39 | + # Cloud build VMs only have 4 cores |
| 40 | + ramble config add "variables:processes_per_node:4" |
| 41 | +
|
| 42 | + ramble list --type modifiers |
| 43 | +
|
| 44 | + ramble info --type modifiers lscpu |
| 45 | +
|
| 46 | + ramble workspace info |
| 47 | +
|
| 48 | + ramble workspace setup --where '{n_nodes} == 1' |
| 49 | +
|
| 50 | + ramble on --where '{n_nodes} == 1' |
| 51 | + |
| 52 | + ramble workspace analyze --where '{n_nodes} == 1' |
| 53 | +
|
| 54 | + ramble info --type modifiers intel-aps |
| 55 | +
|
| 56 | + cp /workspace/examples/tutorial_10_aps_error_config.yaml modifiers_wrf/configs/ramble.yaml |
| 57 | +
|
| 58 | + set +e |
| 59 | +
|
| 60 | + # Expected to error |
| 61 | + ramble workspace setup --dry-run |
| 62 | +
|
| 63 | + set -e |
| 64 | +
|
| 65 | + cp /workspace/examples/tutorial_10_aps_final_config.yaml modifiers_wrf/configs/ramble.yaml |
| 66 | +
|
| 67 | + # Cloud build VMs only have 4 cores |
| 68 | + ramble config add "variables:processes_per_node:4" |
| 69 | +
|
| 70 | + ramble workspace setup --where '{n_nodes} == 1' |
| 71 | + ramble on --where '{n_nodes} == 1' |
| 72 | + ramble workspace analyze --where '{n_nodes} == 1' |
| 73 | +
|
| 74 | + ramble workspace deactivate |
| 75 | + id: ramble-tutorial-test |
| 76 | + entrypoint: /bin/bash |
| 77 | +substitutions: |
| 78 | + _SPACK_REF: v0.21.2 |
| 79 | + _PYTHON_VER: 3.11.6 |
| 80 | + _BASE_IMG: centos |
| 81 | + _BASE_VER: '7' |
| 82 | + _CI_CACHE: gs://spack/latest |
| 83 | +timeout: 1500s |
| 84 | +options: |
| 85 | + machineType: N1_HIGHCPU_8 |
0 commit comments