Skip to content

Commit

Permalink
pace container CI (#68)
Browse files Browse the repository at this point in the history
* edited yaml

* fix spacing in yaml

* add run

* fix container address

* fix container address

* try again

* try again

* testing

* change checkout version

* fix checkout

* fix checkout

* oops no git in container

* oops no git in container

* oops github

* submodule woes

* home

* home

* remove init

* dubious ownership

* testing checkout

* whereami

* whereami

* whereami

* whereami

* new container

* change working directory

* new container

* git issues

* git issues

* git issues

* omg git

* omg git

* new container

* conda activate

* use conda

* conda init bash

* conda again

* conda inited already

* try again

* constraints.txt

* test

* pip3

* get the right python version

* consolidate runs

* consolidate runs

* remove cd

* test pace:test

* fix spacing

* test checkout path

* test working directory

* test working directory

* test working directory

* change ordering

* update grid unit test

* modify eta test

* update yaml file

* oops nevermind nevermind

* restore yaml file

* add Dockerfile

* use script to run tests

* fix typo s

* chmod typo

* change registry

* add concurrency, copied from fms

* typo

* remove push

* unmake unecessary changes

* test

* lint

* xfail update

* Update .gitmodules

* edit README.md

* update tests and readme

* add push

* fix home

* fix home

* add dockerfile

* fix mistakes on Docerkfile

* additional dockerfiles

* openmpi

* test

* add mpich

* try again

* remove test_scripts dir

* update to test with openmpi and mpich

* finally

* noaa to readme

* type missed [

* update to reality

---------

Co-authored-by: mlee03 <[email protected]>
  • Loading branch information
mlee03 and mlee03 authored Apr 12, 2024
1 parent 972711e commit 67277dc
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 32 deletions.
31 changes: 0 additions & 31 deletions .github/workflows/main_unit_tests.yml

This file was deleted.

26 changes: 26 additions & 0 deletions .github/workflows/main_unit_tests_mpich.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: "Main unit tests with mpich"
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled]

# cancel running jobs if theres a newer push
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
main_unit_tests:
runs-on: ubuntu-latest
container:
image: ghcr.io/noaa-gfdl/pace_mpich:3.8
steps:
- name: Checkout Pace repository
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: setup env and run tests (test)
run: |
cp /home/scripts/setup_env.sh . && chmod +x setup_env.sh
cp /home/scripts/run_tests.sh . && chmod +x run_tests.sh
./setup_env.sh
./run_tests.sh
26 changes: 26 additions & 0 deletions .github/workflows/main_unit_tests_openmpi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: "Main unit tests with openmpi"
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled]

# cancel running jobs if theres a newer push
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
main_unit_tests:
runs-on: ubuntu-latest
container:
image: ghcr.io/noaa-gfdl/pace_openmpi:3.8
steps:
- name: Checkout Pace repository
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: setup env and run tests
run: |
cp /home/scripts/setup_env.sh . && chmod +x setup_env.sh
cp /home/scripts/run_tests.sh . && chmod +x run_tests.sh
./setup_env.sh
./run_tests.sh
46 changes: 45 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,55 @@ mpirun --mca btl_vader_single_copy_mechanism none -n 6 python3 -m pace.driver.ru

This repository was first developed at [AI2](https://github.com/ai2cm/pace) and the institute conserves an archived copy with the latest state before the NOAA took over.

[contributors-shield]: https://img.shields.io/github/contributors/ai2cm/pace.svg
[contributors-shield]: https://img.shields.io/github/contributors/NOAA-GFDL/pace.svg
[contributors-url]: https://github.com/NOAA-GFDL/pace/graphs/contributors
[stars-shield]: https://img.shields.io/github/stars/NOAA-GFDL/pace.svg
[stars-url]: https://github.com/NOAA-GFDL/pace/stargazers
[issues-shield]: https://img.shields.io/github/issues/NOAA-GFDL/pace.svg
[issues-url]: https://github.com/NOAA-GFDL/pace/issues
[license-shield]: https://img.shields.io/github/license/NOAA-GFDL/pace.svg
[license-url]: https://github.com/NOAA-GFDL/pace/blob/main/LICENSE.md

## Running pace in containers
Docker images exist in the Github Container Registry associated with the NOAA-GFDL organization.
These images are publicly accessible and can be used to run a Docker container to work with pace.
The following are directions on how to setup the pace conda environment interactively in a container.

The latest images can be pulled with the Docker as shown below or
with any other container management tools:

```shell
docker pull ghcr.io/noaa-gfdl/pace_mpich:3.8
```
for MPICH installation of MPI; and
```shell
docker pull ghcr.io/noaa-gfdl/pace_openmpi:3.8
```
for OpenMPI installation of MPI.

If permission issues arise during the pull, a Github personal token
may be required. The steps to create a personal token is found
[here](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens)

Once the token has been generated, the image can be pulled for example with with:
```shell
docker login --username GITHUB_USERNAME --password TOKEN
docker pull ghcr.io/noaa-gfdl/pace_mpich:3.8
```

Any container management tools compatible with Docker images can be used
to run the container interactively from the pulled image.
With Docker, the following command runs the container interactively.
```shell
docker run -it pace_mpich:3.8
```

In the container, the default `base` conda environment is already activated.
The `pace` conda environment can be created by following the steps below:

```shell
git clone --recursive -b develop https://github.com/NOAA-GFDL/pace.git pace
cd pace
cp /home/scripts/setup_env.sh . && chmod +x setup_env.sh
source ./setup_env.sh
```

0 comments on commit 67277dc

Please sign in to comment.