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

Create Cloud-build tutorial triggers #647

Merged
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
6 changes: 3 additions & 3 deletions lib/ramble/docs/tutorials/10_using_modifiers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ To discover which modifiers are available, execute:

.. code-block:: console
$ ramble mods list
$ ramble list --type modifiers
Which might output the following:

Expand All @@ -82,7 +82,7 @@ about the ``lscpu`` modifier, execute:

.. code-block:: console
$ ramble mods info lscpu
$ ramble info --type modifiers lscpu
This modifier adds the execution of ``lscpu`` to each experiment in a workspace
(to capture additional platform level details, such as the CPU model), and
Expand Down Expand Up @@ -157,7 +157,7 @@ To get information about the ``intel-aps`` modifier, execute:

.. code-block:: console
$ ramble mods info intel-aps
$ ramble info --type modifiers intel-aps
In the output from this command, you should see a ``mode`` named ``mpi``. One
additional difference relateive to ``lscpu`` is that the ``Software Specs:``
Expand Down
85 changes: 85 additions & 0 deletions share/ramble/cloud-build/tutorials/ramble-tutorial-10.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Copyright 2022-2024 The Ramble Authors
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# https://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your
# option. This file may not be copied, modified, or distributed
# except according to those terms.


steps:
- name: gcr.io/cloud-builders/git
args:
- fetch
- '--unshallow'
id: ramble-clone
- name: us-central1-docker.pkg.dev/$PROJECT_ID/ramble-repo/ramble-${_BASE_IMG}-${_BASE_VER}-spack${_SPACK_REF}-python${_PYTHON_VER}:latest
args:
- '-c'
- |
cd /workspace

export PATH=$$(. /opt/spack/share/spack/setup-env.sh && spack location -i miniconda3)/bin:$${PATH}

. /opt/spack/share/spack/setup-env.sh
. /workspace/share/ramble/setup-env.sh

echo "Spack version is $(spack --version)"
echo "Python version is $(python3 --version)"

spack mirror add ci_cache ${_CI_CACHE}
spack buildcache keys --install --trust

set -e

ramble workspace create -d modifiers_wrf -c /workspace/examples/tutorial_10_lscpu_config.yaml

ramble workspace activate ./modifiers_wrf

# Cloud build VMs only have 4 cores
ramble config add "variables:processes_per_node:4"

ramble list --type modifiers

ramble info --type modifiers lscpu

ramble workspace info

ramble workspace setup --where '{n_nodes} == 1'

ramble on --where '{n_nodes} == 1'

ramble workspace analyze --where '{n_nodes} == 1'

ramble info --type modifiers intel-aps

cp /workspace/examples/tutorial_10_aps_error_config.yaml modifiers_wrf/configs/ramble.yaml

set +e

# Expected to error
ramble workspace setup --dry-run

set -e

cp /workspace/examples/tutorial_10_aps_final_config.yaml modifiers_wrf/configs/ramble.yaml

# Cloud build VMs only have 4 cores
ramble config add "variables:processes_per_node:4"

ramble workspace setup --where '{n_nodes} == 1'
ramble on --where '{n_nodes} == 1'
ramble workspace analyze --where '{n_nodes} == 1'

ramble workspace deactivate
id: ramble-tutorial-test
entrypoint: /bin/bash
substitutions:
_SPACK_REF: v0.21.2
_PYTHON_VER: 3.11.6
_BASE_IMG: centos
_BASE_VER: '7'
_CI_CACHE: gs://spack/latest
timeout: 1500s
options:
machineType: N1_HIGHCPU_8
68 changes: 68 additions & 0 deletions share/ramble/cloud-build/tutorials/ramble-tutorial-11.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Copyright 2022-2024 The Ramble Authors
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# https://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your
# option. This file may not be copied, modified, or distributed
# except according to those terms.


steps:
- name: gcr.io/cloud-builders/git
args:
- fetch
- '--unshallow'
id: ramble-clone
- name: us-central1-docker.pkg.dev/$PROJECT_ID/ramble-repo/ramble-${_BASE_IMG}-${_BASE_VER}-spack${_SPACK_REF}-python${_PYTHON_VER}:latest
args:
- '-c'
- |
cd /workspace

export PATH=$$(. /opt/spack/share/spack/setup-env.sh && spack location -i miniconda3)/bin:$${PATH}

. /opt/spack/share/spack/setup-env.sh
. /workspace/share/ramble/setup-env.sh

echo "Spack version is $(spack --version)"
echo "Python version is $(python3 --version)"

spack mirror add ci_cache ${_CI_CACHE}
spack buildcache keys --install --trust

set -e

ramble workspace create -d internals_wrf -c /workspace/examples/tutorial_11_new_exec_config.yaml

ramble workspace activate ./internals_wrf

ramble workspace info

ramble workspace setup --dry-run

grep "date +" internals_wrf/experiments/wrfv4/CONUS_12km/scaling_1/execute_experiment

cp /workspace/examples/tutorial_11_exec_order_config.yaml internals_wrf/configs/ramble.yaml

ramble workspace setup --dry-run

grep "date +" internals_wrf/experiments/wrfv4/CONUS_12km/scaling_1/execute_experiment

cp /workspace/examples/tutorial_11_exec_injection_config.yaml internals_wrf/configs/ramble.yaml

ramble workspace setup --dry-run

grep "date +" internals_wrf/experiments/wrfv4/CONUS_12km/scaling_1/execute_experiment

ramble workspace deactivate
id: ramble-tutorial-test
entrypoint: /bin/bash
substitutions:
_SPACK_REF: v0.21.2
_PYTHON_VER: 3.11.6
_BASE_IMG: centos
_BASE_VER: '7'
_CI_CACHE: gs://spack/latest
timeout: 1500s
options:
machineType: N1_HIGHCPU_8
54 changes: 54 additions & 0 deletions share/ramble/cloud-build/tutorials/ramble-tutorial-2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Copyright 2022-2024 The Ramble Authors
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# https://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your
# option. This file may not be copied, modified, or distributed
# except according to those terms.


steps:
- name: gcr.io/cloud-builders/git
args:
- fetch
- '--unshallow'
id: ramble-clone
- name: us-central1-docker.pkg.dev/$PROJECT_ID/ramble-repo/ramble-${_BASE_IMG}-${_BASE_VER}-spack${_SPACK_REF}-python${_PYTHON_VER}:latest
args:
- '-c'
- |
cd /workspace

export PATH=$$(. /opt/spack/share/spack/setup-env.sh && spack location -i miniconda3)/bin:$${PATH}

. /opt/spack/share/spack/setup-env.sh
. /workspace/share/ramble/setup-env.sh

echo "Spack version is $(spack --version)"
echo "Python version is $(python3 --version)"

spack mirror add ci_cache ${_CI_CACHE}
spack buildcache keys --install --trust

set -e

ramble info gromacs

ramble workspace create -d basic_gromacs -c /workspace/examples/basic_gromacs_config.yaml

ramble workspace activate ./basic_gromacs

ramble workspace setup --dry-run

ramble workspace deactivate
id: ramble-tutorial-test
entrypoint: /bin/bash
substitutions:
_SPACK_REF: v0.21.2
_PYTHON_VER: 3.11.6
_BASE_IMG: centos
_BASE_VER: '7'
_CI_CACHE: gs://spack/latest
timeout: 1500s
options:
machineType: N1_HIGHCPU_8
58 changes: 58 additions & 0 deletions share/ramble/cloud-build/tutorials/ramble-tutorial-3.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Copyright 2022-2024 The Ramble Authors
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# https://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your
# option. This file may not be copied, modified, or distributed
# except according to those terms.


steps:
- name: gcr.io/cloud-builders/git
args:
- fetch
- '--unshallow'
id: ramble-clone
- name: us-central1-docker.pkg.dev/$PROJECT_ID/ramble-repo/ramble-${_BASE_IMG}-${_BASE_VER}-spack${_SPACK_REF}-python${_PYTHON_VER}:latest
args:
- '-c'
- |
cd /workspace

export PATH=$$(. /opt/spack/share/spack/setup-env.sh && spack location -i miniconda3)/bin:$${PATH}

. /opt/spack/share/spack/setup-env.sh
. /workspace/share/ramble/setup-env.sh

echo "Spack version is $(spack --version)"
echo "Python version is $(python3 --version)"

spack mirror add ci_cache ${_CI_CACHE}
spack buildcache keys --install --trust

set -e

ramble workspace create basic_gromacs -c /workspace/examples/basic_gromacs_config.yaml

ramble workspace activate basic_gromacs

ramble workspace info

ramble workspace info --expansions

ramble info gromacs

ramble workspace setup --dry-run

ramble workspace deactivate
id: ramble-tutorial-test
entrypoint: /bin/bash
substitutions:
_SPACK_REF: v0.21.2
_PYTHON_VER: 3.11.6
_BASE_IMG: centos
_BASE_VER: '7'
_CI_CACHE: gs://spack/latest
timeout: 1500s
options:
machineType: N1_HIGHCPU_8
63 changes: 63 additions & 0 deletions share/ramble/cloud-build/tutorials/ramble-tutorial-4.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Copyright 2022-2024 The Ramble Authors
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# https://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your
# option. This file may not be copied, modified, or distributed
# except according to those terms.


steps:
- name: gcr.io/cloud-builders/git
args:
- fetch
- '--unshallow'
id: ramble-clone
- name: us-central1-docker.pkg.dev/$PROJECT_ID/ramble-repo/ramble-${_BASE_IMG}-${_BASE_VER}-spack${_SPACK_REF}-python${_PYTHON_VER}:latest
args:
- '-c'
- |
cd /workspace

export PATH=$$(. /opt/spack/share/spack/setup-env.sh && spack location -i miniconda3)/bin:$${PATH}

. /opt/spack/share/spack/setup-env.sh
. /workspace/share/ramble/setup-env.sh

echo "Spack version is $(spack --version)"
echo "Python version is $(python3 --version)"

spack mirror add ci_cache ${_CI_CACHE}
spack buildcache keys --install --trust

set -e

ramble workspace create -d basic_gromacs -c /workspace/examples/basic_gromacs_config.yaml -a

ramble workspace info

ramble workspace info --expansions

ramble workspace info -vvv

cp /workspace/examples/vector_matrix_gromacs_config.yaml basic_gromacs/config/ramble.yaml

ramble workspace setup

ramble on

ramble workspace analyze

ramble workspace deactivate

id: ramble-tutorial-test
entrypoint: /bin/bash
substitutions:
_SPACK_REF: v0.21.2
_PYTHON_VER: 3.11.6
_BASE_IMG: centos
_BASE_VER: '7'
_CI_CACHE: gs://spack/latest
timeout: 7200s
options:
machineType: N1_HIGHCPU_8
Loading