From 546e9a26d781595d019560f68d195b9ea45e20f6 Mon Sep 17 00:00:00 2001 From: "Joshua A. Anderson" Date: Wed, 19 Jun 2024 14:15:27 -0400 Subject: [PATCH 1/3] Migrate from docker images to micromamba. --- .github/workflows/unit-test.yaml | 41 +++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 11 deletions(-) diff --git a/.github/workflows/unit-test.yaml b/.github/workflows/unit-test.yaml index 52fcd61..00f81ab 100644 --- a/.github/workflows/unit-test.yaml +++ b/.github/workflows/unit-test.yaml @@ -9,19 +9,21 @@ env: ############################################################################################# # HOOMD-blue version to build. - HOOMD_BLUE_VERSION: 4.7.0 + HOOMD_BLUE_VERSION: trunk-minor # prevent deadlocked MPI tests from causing the job to cancel MPIEXEC_TIMEOUT: 3000 # allow mpirun to execute as root in the tests OMPI_ALLOW_RUN_AS_ROOT: 1 OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1 # allow openmpi to oversubscribe cores - OMPI_MCA_rmaps_base_oversubscribe: 1 + PRTE_MCA_rmaps_default_mapping_policy: ":oversubscribe" + OMPI_MCA_rmaps_base_oversubscribe: "true" # prevent errors from mis-configured openib systems OMPI_MCA_btl: "vader,self" - # import HOOMD out of the build directory - PYTHONPATH: ${{ github.workspace }}/install - + # skip running the CPU tests in GPU builds + _HOOMD_SKIP_CPU_TESTS_WHEN_GPUS_PRESENT_: 1 + # Require GPU tests in GPU builds. + _HOOMD_REQUIRE_GPU_TESTS_IN_GPU_BUILDS_: 1 concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -41,9 +43,9 @@ defaults: jobs: build_test: name: Build and test [${{ matrix.name }}] - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 container: - image: glotzerlab/ci:2023.11.27-cuda120_gcc11_py310 + image: nvidia/cuda:12.5.0-devel-ubuntu22.04 strategy: fail-fast: false matrix: @@ -67,15 +69,32 @@ jobs: uses: actions/cache/restore@v4 with: path: install - key: hoomd-blue-${{ env.HOOMD_BLUE_VERSION }}-2023.11.27-cuda120_gcc11_py310-mpi-${{ matrix.enable_mpi }}-gpu-${{ matrix.enable_gpu }} + key: hoomd-blue-${{ env.HOOMD_BLUE_VERSION }}-${{ matrix.enable_mpi }}-gpu-${{ matrix.enable_gpu }} + - name: Install git + run: | + apt-get update + apt-get install git --yes - name: Checkout HOOMD-blue - if: steps.cache.outputs.cache-hit != 'true' uses: actions/checkout@v4 with: repository: glotzerlab/hoomd-blue path: hoomd-blue submodules: true - ref: v${{ env.HOOMD_BLUE_VERSION }} + ref: ${{ env.HOOMD_BLUE_VERSION }} + - name: Create Python Environment + uses: mamba-org/setup-micromamba@v1 + with: + environment-name: test + environment-file: hoomd-blue/.github/workflows/environments/py312-conda-lock.yml + micromamba-root-path: ${{ github.workspace }}/micromamba + + - name: Configure conda environment variables + run: | + echo "PYTHONPATH=$GITHUB_WORKSPACE/install" >> $GITHUB_ENV + echo "CONDA_PREFIX=$MAMBA_ROOT_PREFIX/envs/test" >> $GITHUB_ENV + echo "CMAKE_PREFIX_PATH=$MAMBA_ROOT_PREFIX/envs/test" >> $GITHUB_ENV + echo "$MAMBA_ROOT_PREFIX/envs/test/bin" >> $GITHUB_PATH + - name: Configure HOOMD-blue if: steps.cache.outputs.cache-hit != 'true' run: | @@ -100,7 +119,7 @@ jobs: uses: actions/cache/save@v4 with: path: install - key: hoomd-blue-${{ env.HOOMD_BLUE_VERSION }}-2023.11.27-cuda120_gcc11_py310-mpi-${{ matrix.enable_mpi }}-gpu-${{ matrix.enable_gpu }} + key: hoomd-blue-${{ env.HOOMD_BLUE_VERSION }}-${{ job.container.image }}-${{ matrix.enable_mpi }}-gpu-${{ matrix.enable_gpu }} - name: Checkout component uses: actions/checkout@v4 From 688f4a520645780a2aa43e700baed72580f000f5 Mon Sep 17 00:00:00 2001 From: "Joshua A. Anderson" Date: Thu, 11 Jul 2024 09:38:29 -0400 Subject: [PATCH 2/3] Explain that developers need to enable GitHub actions on forks. --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 161655d..423c670 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,7 @@ Once installed, the template is available for import via: ``` import hoomd.template ``` +(replace `template` with the `COMPONENT_NAME` you set in `src/CMakeLists.txt`). ## Creating a new component @@ -47,7 +48,8 @@ To create a new component: When you push your changes to GitHub, the [unit test workflow](.github/workflows/unit-test.yaml) compile your code on the CPU (with and without MPI) and on the GPU (with and without MPI). The workflow also executes the unit tests on the CPU. You should run GPU unit tests locally, as GitHub -does not provide free GPU runners for GitHub Actions. +does not provide free GPU runners for GitHub Actions. As a one time step, you need to navigate to +the "Actions" tab of your repository and confirm that GitHub should execute actions for your fork. When you push a new tag, the [release workflow](.github/workflows/release.yaml) will create a new GitHub release with automatically generated release notes. From 47021c9561d38a3c352b940a39342dfa3bbf34af Mon Sep 17 00:00:00 2001 From: "Joshua A. Anderson" Date: Mon, 15 Jul 2024 11:03:35 -0400 Subject: [PATCH 3/3] Test with 4.8.0 --- .github/workflows/unit-test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unit-test.yaml b/.github/workflows/unit-test.yaml index 00f81ab..0960be2 100644 --- a/.github/workflows/unit-test.yaml +++ b/.github/workflows/unit-test.yaml @@ -9,7 +9,7 @@ env: ############################################################################################# # HOOMD-blue version to build. - HOOMD_BLUE_VERSION: trunk-minor + HOOMD_BLUE_VERSION: v4.8.0 # prevent deadlocked MPI tests from causing the job to cancel MPIEXEC_TIMEOUT: 3000 # allow mpirun to execute as root in the tests