Skip to content

Commit

Permalink
Use github.actor to store and retrieve container
Browse files Browse the repository at this point in the history
  • Loading branch information
twsearle committed Aug 1, 2024
1 parent 72dd763 commit 0beb5ff
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build_ci_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
# workflow builds.
env:
REGISTRY: ghcr.io
IMAGE_NAME: darth/orca-jedi/ci-almalinux9
IMAGE_NAME: ${{ github.actor }}/orca-jedi/ci-almalinux9

jobs:
build-and-push-image:
Expand All @@ -36,7 +36,7 @@ jobs:
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GH_PAT }}
password: ${{ secrets.GITHUB_TOKEN }}
# This step uses
# [docker/metadata-action](https://github.com/docker/metadata-action#about)
# to extract tags and labels that will be applied to the specified image.
Expand Down
33 changes: 21 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ on:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
issues: read
pull-requests: read
packages: read
steps:
- name: checkout current repo
uses: actions/checkout@v3
Expand All @@ -21,47 +26,51 @@ jobs:
path: ci/jedicmake
repository: JCSDA-internal/jedi-cmake
submodules: true
token: ${{ secrets.GH_PAT }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: checkout oops
uses: actions/checkout@v3
with:
path: ci/oops
repository: JCSDA-internal/oops
token: ${{ secrets.GH_PAT }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: checkout ioda
uses: actions/checkout@v3
with:
path: ci/ioda
repository: JCSDA-internal/ioda
token: ${{ secrets.GH_PAT }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: checkout ufo
uses: actions/checkout@v3
with:
path: ci/ufo
repository: JCSDA-internal/ufo
token: ${{ secrets.GH_PAT }}

- name: checkout atlas-orca
uses: actions/checkout@v3
with:
path: ci/atlas-orca
repository: ECMWF/atlas-orca
token: ${{ secrets.GITHUB_TOKEN }}

- name: checkout atlas-data
uses: actions/checkout@v3
with:
path: ci/atlas-data
repository: MetOffice/atlas-data
lfs: true
token: ${{ secrets.GH_PAT }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: darth
password: ${{ secrets.GITHUB_TOKEN }}

- name: Pull Docker image
run: docker pull ghcr.io/darth/orca-jedi/ci-almalinux9:develop

- name: build and test
run: |
docker run --rm \
--entrypoint=/usr/local/src/orca-jedi/ci/build-and-test.sh \
--workdir=/usr/local/src/orca-jedi/ci \
--volume $PWD:/usr/local/src/orca-jedi \
'jcsda/docker-gnu-openmpi-dev:latest'
ghcr.io/${{ github.actor }}/orca-jedi/ci-almalinux9:v1.2.0
1 change: 0 additions & 1 deletion ci/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ if(NOT DEFINED jedicmake_DIR)
set(jedicmake_DIR "${CMAKE_BINARY_DIR}/jedicmake")
endif()

add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/atlas-orca" EXCLUDE_FROM_ALL)
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/oops" EXCLUDE_FROM_ALL)
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/ioda" EXCLUDE_FROM_ALL)
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/ufo" EXCLUDE_FROM_ALL)
Expand Down
20 changes: 14 additions & 6 deletions ci/build-and-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,20 @@ trap finally EXIT

cd "${WORKD}"

source /opt/spack-environment/activate.sh
if [[ -f /opt/spack-environment/activate.sh ]]; then
source /opt/spack-environment/activate.sh
fi

# -- Enable OpenMPI over subscription -----------------------------------------
if command -v ompi_info &>/dev/null; then
echo "Check support for MPI_THREAD_MULTIPLE"
ompi_info | grep -i 'thread support'
ompi_vn=$(ompi_info | awk '/Ident string:/ {print $3}')
case $ompi_vn in
4.*) export OMPI_MCA_rmaps_base_oversubscribe=1 ;;
5.*) export PRTE_MCA_rmaps_default_mapping_policy=:oversubscribe ;;
esac
fi

echo "
-------------------------------
Expand All @@ -41,11 +54,6 @@ ln -s '..' "${HERE}/orca-jedi"
ecbuild -S "${HERE}"
make -j "${NPROC}"

if [[ ! -f share/plugins/atlas-orca.yml ]]; then
echo "ERROR atlas-orca.yml not found!" | tee >(cat >&2)
exit 1
fi

env OMPI_ALLOW_RUN_AS_ROOT=1 OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 \
ATLAS_TRACE=1 ATLAS_DEBUG=1 \
LD_LIBRARY_PATH="${HERE}/lib:${LD_LIBRARY_PATH}" \
Expand Down

0 comments on commit 0beb5ff

Please sign in to comment.