diff --git a/.github/workflows/main_unit_tests.yml b/.github/workflows/main_unit_tests.yml deleted file mode 100644 index cf8ace3d..00000000 --- a/.github/workflows/main_unit_tests.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: "Main unit tests" -on: - pull_request: - types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled] - -jobs: - main_unit_tests: - runs-on: ubuntu-latest - steps: - - name: Checkout Pace repository - uses: actions/checkout@v3.5.2 - with: - submodules: 'recursive' - - name: Step Python 3.8.12 - uses: actions/setup-python@v4.6.0 - with: - python-version: '3.8.12' - - name: Install OpenMPI & Boost for gt4py - run: | - sudo apt-get install libopenmpi-dev libboost1.74-dev - - name: Install Python packages - run: | - python -m pip install --upgrade pip setuptools wheel - pip install -r requirements_dev.txt -c constraints.txt - - name: Clone datafiles - run: | - mkdir -p tests/main/input && cd tests/main/input - git clone -b store_files https://github.com/mlee03/pace.git tmp && mv tmp/*.nc . && rm -rf tmp - - name: Run all main tests - run: | - pytest -x tests/main diff --git a/.github/workflows/main_unit_tests_mpich.yaml b/.github/workflows/main_unit_tests_mpich.yaml new file mode 100644 index 00000000..ee469b7a --- /dev/null +++ b/.github/workflows/main_unit_tests_mpich.yaml @@ -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 diff --git a/.github/workflows/main_unit_tests_openmpi.yaml b/.github/workflows/main_unit_tests_openmpi.yaml new file mode 100644 index 00000000..edb9b0f0 --- /dev/null +++ b/.github/workflows/main_unit_tests_openmpi.yaml @@ -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 diff --git a/README.md b/README.md index 0643c01f..959e4404 100644 --- a/README.md +++ b/README.md @@ -123,7 +123,7 @@ 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 @@ -131,3 +131,47 @@ This repository was first developed at [AI2](https://github.com/ai2cm/pace) and [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 +```