Skip to content

Commit a197c85

Browse files
committed
Merge branch 'develop' into feature/add_simple_dirac_3dvar
2 parents fa7c893 + 0f16f83 commit a197c85

File tree

6 files changed

+456
-29
lines changed

6 files changed

+456
-29
lines changed

.github/workflows/build_ci_image.yml

+90
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: Create and publish the CI docker image
2+
3+
# Configures this workflow to run when triggered.
4+
on:
5+
push:
6+
tags:
7+
- v**
8+
workflow_dispatch:
9+
10+
# Defines two custom environment variables for the workflow. These are used for
11+
# the Container registry domain, and a name for the Docker image that this
12+
# workflow builds.
13+
env:
14+
REGISTRY: ghcr.io
15+
IMAGE_NAME: twsearle/orca-jedi/ci-almalinux9
16+
17+
jobs:
18+
build-and-push-image:
19+
runs-on: ubuntu-latest
20+
# Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job.
21+
permissions:
22+
contents: read
23+
packages: write
24+
attestations: write
25+
id-token: write
26+
#
27+
steps:
28+
- name: Checkout repository
29+
uses: actions/checkout@v4
30+
# Uses the `docker/login-action` action to log in to the Container
31+
# registry registry using the account and password that will publish the
32+
# packages. Once published, the packages are scoped to the account
33+
# defined here.
34+
- name: Log in to the Container registry
35+
uses: docker/login-action@v3
36+
with:
37+
registry: ${{ env.REGISTRY }}
38+
username: twsearle
39+
password: ${{ secrets.GHCR_PAT }}
40+
- name: Set up Docker Buildx
41+
uses: docker/setup-buildx-action@v3
42+
# This step uses
43+
# [docker/metadata-action](https://github.com/docker/metadata-action#about)
44+
# to extract tags and labels that will be applied to the specified image.
45+
# The `id` "meta" allows the output of this step to be referenced in a
46+
# subsequent step. The `images` value provides the base name for the tags
47+
# and labels.
48+
- name: Extract metadata (tags, labels) for Docker
49+
id: meta
50+
uses: docker/metadata-action@v5
51+
with:
52+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
53+
- name: Install hpccm
54+
run: |
55+
python3 -m pip install hpccm
56+
- name: Recipe to Dockerfile
57+
run: |
58+
hpccm --recipe ./ci/hpccm_recipe_almalinux9.py >./Dockerfile
59+
# This step uses the `docker/build-push-action` action to build the
60+
# image, based on your repository's `Dockerfile`. If the build succeeds,
61+
# it pushes the image to GitHub Packages. It uses the `context`
62+
# parameter to define the build's context as the set of files located in
63+
# the specified path. For more information, see
64+
# "[Usage](https://github.com/docker/build-push-action#usage)" in the
65+
# README of the `docker/build-push-action` repository. It uses the
66+
# `tags` and `labels` parameters to tag and label the image with the
67+
# output from the "meta" step.
68+
- name: Build and push Docker image
69+
id: push
70+
uses: docker/build-push-action@v6
71+
with:
72+
context: .
73+
cache-from: type=gha
74+
cache-to: type=gha,mode=max`
75+
push: true
76+
tags: ${{ steps.meta.outputs.tags }}
77+
labels: ${{ steps.meta.outputs.labels }}
78+
79+
80+
# This step generates an artifact attestation for the image, which is an
81+
# unforgeable statement about where and how it was built. It increases
82+
# supply chain security for people who consume the image. For more
83+
# information, see
84+
# "[AUTOTITLE](/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds)."
85+
- name: Generate artifact attestation
86+
uses: actions/attest-build-provenance@v1
87+
with:
88+
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
89+
subject-digest: ${{ steps.push.outputs.digest }}
90+
push-to-registry: true

.github/workflows/ci.yml

+19-13
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ on:
55
branches: [develop]
66
pull_request:
77
branches: [develop]
8-
8+
env:
9+
REGISTRY: ghcr.io
10+
IMAGE_NAME: twsearle/orca-jedi/ci-almalinux9:v1.2.0
911
jobs:
1012
build:
1113
runs-on: ubuntu-latest
@@ -21,14 +23,14 @@ jobs:
2123
path: ci/jedicmake
2224
repository: JCSDA-internal/jedi-cmake
2325
submodules: true
24-
token: ${{ secrets.GH_PAT }}
26+
token: ${{ secrets.GHCR_PAT }}
2527

2628
- name: checkout oops
2729
uses: actions/checkout@v3
2830
with:
2931
path: ci/oops
3032
repository: JCSDA-internal/oops
31-
token: ${{ secrets.GH_PAT }}
33+
token: ${{ secrets.GHCR_PAT }}
3234

3335
- name: checkout saber
3436
uses: actions/checkout@v3
@@ -42,33 +44,37 @@ jobs:
4244
with:
4345
path: ci/ioda
4446
repository: JCSDA-internal/ioda
45-
token: ${{ secrets.GH_PAT }}
47+
token: ${{ secrets.GHCR_PAT }}
4648

4749
- name: checkout ufo
4850
uses: actions/checkout@v3
4951
with:
5052
path: ci/ufo
5153
repository: JCSDA-internal/ufo
52-
token: ${{ secrets.GH_PAT }}
53-
54-
- name: checkout atlas-orca
55-
uses: actions/checkout@v3
56-
with:
57-
path: ci/atlas-orca
58-
repository: ECMWF/atlas-orca
54+
token: ${{ secrets.GHCR_PAT }}
5955

6056
- name: checkout atlas-data
6157
uses: actions/checkout@v3
6258
with:
6359
path: ci/atlas-data
6460
repository: MetOffice/atlas-data
6561
lfs: true
66-
token: ${{ secrets.GH_PAT }}
62+
token: ${{ secrets.GHCR_PAT }}
63+
64+
- name: Log in to GitHub Container Registry
65+
uses: docker/login-action@v3
66+
with:
67+
registry: ${{ env.REGISTRY }}
68+
username: twsearle
69+
password: ${{ secrets.GHCR_PAT }}
70+
71+
- name: Pull Docker image
72+
run: docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
6773

6874
- name: build and test
6975
run: |
7076
docker run --rm \
7177
--entrypoint=/usr/local/src/orca-jedi/ci/build-and-test.sh \
7278
--workdir=/usr/local/src/orca-jedi/ci \
7379
--volume $PWD:/usr/local/src/orca-jedi \
74-
'jcsda/docker-gnu-openmpi-dev:latest'
80+
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

ci/CMakeLists.txt

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ if(NOT DEFINED jedicmake_DIR)
1717
set(jedicmake_DIR "${CMAKE_BINARY_DIR}/jedicmake")
1818
endif()
1919

20-
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/atlas-orca" EXCLUDE_FROM_ALL)
2120
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/oops" EXCLUDE_FROM_ALL)
2221
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/saber")
2322
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/ioda" EXCLUDE_FROM_ALL)

ci/build-and-test.sh

+18-7
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,34 @@ trap finally EXIT
2020

2121
cd "${WORKD}"
2222

23-
source /opt/spack-environment/activate.sh
23+
if [[ -f /opt/spack-environment/activate.sh ]]; then
24+
source /opt/spack-environment/activate.sh
25+
fi
26+
27+
# -- Enable OpenMPI over subscription -----------------------------------------
28+
if command -v ompi_info &>/dev/null; then
29+
echo "Check support for MPI_THREAD_MULTIPLE"
30+
ompi_info | grep -i 'thread support'
31+
ompi_vn=$(ompi_info | awk '/Ident string:/ {print $3}')
32+
case $ompi_vn in
33+
4.*) export OMPI_MCA_rmaps_base_oversubscribe=1 ;;
34+
5.*) export PRTE_MCA_rmaps_default_mapping_policy=:oversubscribe ;;
35+
esac
36+
fi
37+
38+
atlas_orca_v=$(atlas --info |
39+
sed -n 's/ *atlas-orca version (\([0-9]*\.[0-9]*\.[0-9]*\)).*/\1/p')
2440

2541
echo "
2642
-------------------------------
2743
gcc version $(gcc -dumpversion ||:)
2844
$(ecbuild --version ||:)
2945
atlas version $(atlas --version ||:)
46+
atlas-orca version ${atlas_orca_v:-:}
3047
eckit version $(eckit-version ||:)
3148
ectrans version $(ectrans --version ||:)
3249
fckit version $(fckit --version ||:)
3350
fiat version $(fiat --version ||:)
34-
lz4 version $(lz4 --version ||:)
3551
odc version $(odc --version ||:)
3652
-------------------------------
3753
"
@@ -41,11 +57,6 @@ ln -s '..' "${HERE}/orca-jedi"
4157
ecbuild -S "${HERE}"
4258
make -j "${NPROC}"
4359

44-
if [[ ! -f share/plugins/atlas-orca.yml ]]; then
45-
echo "ERROR atlas-orca.yml not found!" | tee >(cat >&2)
46-
exit 1
47-
fi
48-
4960
env OMPI_ALLOW_RUN_AS_ROOT=1 OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 \
5061
ATLAS_TRACE=1 ATLAS_DEBUG=1 \
5162
LD_LIBRARY_PATH="${HERE}/lib:${LD_LIBRARY_PATH}" \

0 commit comments

Comments
 (0)