Skip to content

Commit 9193e61

Browse files
authored
Merge pull request #170 from mvdebolskiy/updt-noresm-to-5.3.084
Updt noresm to ESCOMP/ctsm5.3.085
2 parents e55589f + b7cc536 commit 9193e61

395 files changed

Lines changed: 19435 additions & 4812 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.git-blame-ignore-revs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,14 @@ e8fc526e0d7818d45f171488c78392c4ff63902a
6464
cdf40d265cc82775607a1bf25f5f527bacc97405
6565
251e389b361ba673b508e07d04ddcc06b2681989
6666
8ec50135eca1b99c8b903ecdaa1bd436644688bd
67+
3b7a2876933263f8986e4069f5d23bd45635756f
68+
3dd489af7ebe06566e2c6a1c7ade18550f1eb4ba
69+
742cfa606039ab89602fde5fef46458516f56fd4
70+
4ad46f46de7dde753b4653c15f05326f55116b73
71+
75db098206b064b8b7b2a0604d3f0bf8fdb950cc
72+
84609494b54ea9732f64add43b2f1dd035632b4c
73+
7eb17f3ef0b9829fb55e0e3d7f02e157b0e41cfb
74+
62d7711506a0fb9a3ad138ceceffbac1b79a6caa
75+
49ad0f7ebe0b07459abc00a5c33c55a646f1e7e0
76+
ac03492012837799b7111607188acff9f739044a
77+
d858665d799690d73b56bcb961684382551193f4
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
name: Documentation
3+
about: Something should be added to or fixed in the documentation
4+
5+
---
6+
7+
8+
### What sort(s) of documentation issue is this?
9+
- [ ] Something is missing.
10+
- [ ] Something is (or might be) incorrect or outdated.
11+
- [ ] Something is confusing.
12+
- [ ] Something is broken.
13+
14+
### What part(s) of the documentation does this concern?
15+
- [ ] [Technical Note](https://escomp.github.io/CTSM/tech_note/index.html) (science and design of the model)
16+
- [ ] [User's Guide](https://escomp.github.io/CTSM/users_guide/index.html) (using the model and related tools)
17+
- [ ] Somewhere else (e.g., README file, tool help text, or code comment): _Please specify_
18+
- [ ] I don't know
19+
20+
### Describe the issue
21+
A clear and concise description of what is missing or wrong.
22+
23+
### Additional context (optional)
24+
Add any other context or screenshots about the issue here.

.github/ISSUE_TEMPLATE/03_other.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/04_other.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
name: Other
3+
about: Other issues (enhancement, cleanup, etc.)
4+
5+
---
6+
7+
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
# Check that clm6* compset aliases return CLM6* longnames
5+
6+
# Change to top level of clone
7+
cd "$(git rev-parse --show-toplevel)"
8+
9+
# Check that query_config can run without error
10+
cime/scripts/query_config --compsets 1>/dev/null
11+
12+
# Find bad compsets
13+
OLD_IFS=$IFS
14+
IFS='\n'
15+
set +e
16+
# Relies on case sensitivity here: Alias should have Clm6 and longname should have CLM6
17+
bad_compsets="$(cime/scripts/query_config --compsets | sort | uniq | grep Clm6 | grep -v CLM6)"
18+
set -e
19+
if [[ "${bad_compsets}" != "" ]]; then
20+
echo "One or more compsets with Clm6 alias but not CLM6 longname:" >&2
21+
echo $bad_compsets >&2
22+
exit 1
23+
fi
24+
25+
exit 0
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Check that clm6* compset aliases return CLM6* longnames
2+
# Only check files in our repo that AREN'T in submodules
3+
# Use a Python command to check each file because xmllint isn't available on GH runners
4+
5+
on:
6+
push:
7+
# Run when a change to these files is pushed to any branch. Without the "branches:" line, for some reason this will be run whenever a tag is pushed, even if the listed files aren't changed.
8+
branches: ['*']
9+
paths:
10+
- '.github/workflows/check-clm6-aliases.sh'
11+
- 'cime/**'
12+
- 'cime_config/config_compsets.xml'
13+
14+
pull_request:
15+
# Run on pull requests that change the listed files
16+
paths:
17+
- '.github/workflows/check-clm6-aliases.sh'
18+
- 'cime/**'
19+
- 'cime_config/config_compsets.xml'
20+
21+
workflow_dispatch:
22+
23+
jobs:
24+
check-clm6-aliases:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout repository
28+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
29+
30+
- name: Checkout submodules
31+
run: |
32+
bin/git-fleximod update
33+
34+
- name: Install xmllint for CIME
35+
run: |
36+
sudo apt-get update && sudo apt-get install --no-install-recommends -y libxml2-utils
37+
38+
- name: Check aliases
39+
run: |
40+
.github/workflows/check-clm6-aliases.sh

.github/workflows/docker-image-build-publish.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
name: Build and publish ctsm-docs Docker image
33

44
on:
5-
# Run this whenever something gets pushed to master
5+
# Run this whenever a change to certain files gets pushed to master
66
push:
77
branches: ['master']
88
paths:
9-
- 'doc/ctsm-docs_container/Dockerfile'
10-
- 'doc/ctsm-docs_container/requirements.txt'
9+
- 'doc/ctsm-docs_container/**'
10+
- '!doc/ctsm-docs_container/README.md'
1111

1212
# Run this whenever it's manually called
1313
workflow_dispatch:
@@ -31,7 +31,7 @@ jobs:
3131
env:
3232
REGISTRY: ${{ needs.build-image-and-test-docs.outputs.REGISTRY }}
3333
IMAGE_NAME: ${{ needs.build-image-and-test-docs.outputs.IMAGE_NAME }}
34-
IMAGE_TAG: ${{ needs.build-image-and-test-docs.outputs.image_tag }}
34+
VERSION_TAG: ${{ needs.build-image-and-test-docs.outputs.version_tag }}
3535

3636
# Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job.
3737
permissions:
@@ -42,7 +42,7 @@ jobs:
4242

4343
steps:
4444
- name: Checkout repository
45-
uses: actions/checkout@v4
45+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4646

4747
# Uses the `docker/login-action` action to log in to the Container registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here.
4848
- name: Log in to the Container registry
@@ -61,6 +61,7 @@ jobs:
6161
# This step uses the `docker/build-push-action` action to build the image, based on the ctsm-docs `Dockerfile`.
6262
# It uses the `context` parameter to define the build's context as the set of files located in the specified path. For more information, see [Usage](https://github.com/docker/build-push-action#usage) in the README of the `docker/build-push-action` repository.
6363
# It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step.
64+
# Note that we should avoid relying on the "latest" tag for anything, but it's good practice to have one.
6465
# v6.15.0
6566
- name: Push Docker image
6667
id: push
@@ -70,12 +71,14 @@ jobs:
7071
platforms: linux/amd64,linux/arm64
7172
push: true
7273
load: false
73-
tags: ${{ env.IMAGE_TAG }}
74+
tags: |
75+
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
76+
${{ env.VERSION_TAG }}
7477
labels: ""
7578

7679
# This step generates an artifact attestation for the image, which is an unforgeable statement about where and how it was built. It increases supply chain security for people who consume the image. For more information, see [Using artifact attestations to establish provenance for builds](/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds).
7780
- name: Generate artifact attestation
78-
uses: actions/attest-build-provenance@v2
81+
uses: actions/attest-build-provenance@e8998f949152b193b063cb0ec769d69d929409be # v2
7982
with:
8083
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
8184
subject-digest: ${{ steps.push.outputs.digest }}
Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,29 @@
11
# Modified from https://docs.github.com/en/packages/managing-github-packages-using-github-actions-workflows/publishing-and-installing-a-package-with-github-actions#publishing-a-package-using-an-action (last accessed 2025-05-09)
2-
name: Test building ctsm-docs Docker image and using it to build the docs
2+
name: Build and test ctsm-docs container
33

4-
# Configures this workflow to run every time a change in the Docker container setup is pushed to the master branch
4+
# Configures this workflow to run every time a change in the Docker container setup is pushed or included in a PR
55
on:
66
push:
7+
# Run when a change to these files is pushed to any branch. Without the "branches:" line, for some reason this will be run whenever a tag is pushed, even if the listed files aren't changed.
8+
branches: ['*']
79
paths:
810
- 'doc/ctsm-docs_container/**'
9-
- '.github/workflows/docker-image-ctsm-docs-build.yml'
10-
- '.github/workflows/docker-image-build-common.yml'
11+
- '!doc/ctsm-docs_container/README.md'
12+
- '.github/workflows/docker-image-common.yml'
1113

1214
pull_request:
15+
# Run on pull requests that change the listed files
1316
paths:
1417
- 'doc/ctsm-docs_container/**'
15-
- '.github/workflows/docker-image-ctsm-docs-build.yml'
16-
- '.github/workflows/docker-image-build-common.yml'
18+
- '!doc/ctsm-docs_container/README.md'
19+
- '.github/workflows/docker-image-common.yml'
1720

1821
workflow_dispatch:
1922

2023
# There is a single job in this workflow. It's configured to run on the latest available version of Ubuntu.
2124
jobs:
2225
build-image-and-test-docs:
26+
if: ${{ ! github.repository == 'ESCOMP/CTSM' }}
2327
name: Build image and test docs
2428
uses: ./.github/workflows/docker-image-common.yml
2529
secrets: inherit

.github/workflows/docker-image-common.yml

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,15 @@ on:
99
IMAGE_NAME:
1010
description: "Docker image name"
1111
value: ${{ jobs.build-image-and-test-docs.outputs.IMAGE_NAME }}
12-
image_tag:
13-
description: "First image tag"
14-
value: ${{ jobs.build-image-and-test-docs.outputs.image_tag }}
12+
version_tag:
13+
description: "Version tag from Dockerfile"
14+
value: ${{ jobs.check-version.outputs.VERSION_TAG }}
1515

16-
# Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds.
16+
# Defines custom environment variables for the workflow.
1717
env:
1818
REGISTRY: ghcr.io
19-
IMAGE_NAME: ${{ github.repository }}/ctsm-docs
19+
IMAGE_BASENAME: ctsm-docs
20+
REPO: ${{ github.repository }}
2021

2122
# There is a single job in this workflow. It's configured to run on the latest available version of Ubuntu.
2223
jobs:
@@ -25,19 +26,23 @@ jobs:
2526
# Variables that might be needed by the calling workflow
2627
outputs:
2728
REGISTRY: ${{ env.REGISTRY }}
28-
IMAGE_NAME: ${{ env.IMAGE_NAME }}
29-
image_tag: ${{ steps.set-image-tag.outputs.IMAGE_TAG }}
29+
IMAGE_NAME: ${{ steps.set-image-name.outputs.IMAGE_NAME }}
3030
# Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job.
3131
permissions:
3232
contents: read
33-
packages: write
34-
attestations: write
35-
id-token: write
3633

3734
steps:
3835

3936
- name: Checkout repository
40-
uses: actions/checkout@v4
37+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
38+
39+
# Ensure that the repository part of IMAGE_NAME is lowercase. This is needed because Docker requires image names to be entirely lowercase. Note that the *image name* part, set as IMAGE_BASENAME in the env block above, is *not* converted. This will cause the check-version job to fail if the IMAGE_BASENAME contains capitals. We don't want to silently fix that here; rather, we require the user to specify a lowercase IMAGE_BASENAME.
40+
- name: Get image name with lowercase repo
41+
id: set-image-name
42+
run: |
43+
lowercase_repo=$(echo $REPO | tr '[:upper:]' '[:lower:]')
44+
echo "IMAGE_NAME=${lowercase_repo}/${IMAGE_BASENAME}" >> $GITHUB_ENV
45+
echo "IMAGE_NAME=${lowercase_repo}/${IMAGE_BASENAME}" >> $GITHUB_OUTPUT
4146
4247
# Uses the `docker/login-action` action to log in to the Container registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here.
4348
- name: Log in to the Container registry
@@ -52,7 +57,7 @@ jobs:
5257
id: meta
5358
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
5459
with:
55-
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
60+
images: ${{ env.REGISTRY }}/${{ steps.set-image-name.outputs.IMAGE_NAME }}
5661

5762
# This step uses the `docker/build-push-action` action to build the image, based on the ctsm-docs `Dockerfile`.
5863
# It uses the `context` parameter to define the build's context as the set of files located in the specified path. For more information, see [Usage](https://github.com/docker/build-push-action#usage) in the README of the `docker/build-push-action` repository.
@@ -68,16 +73,25 @@ jobs:
6873
tags: ${{ steps.meta.outputs.tags }}
6974
labels: ${{ steps.meta.outputs.labels }}
7075

71-
# Try building our docs using the new container
72-
- name: Checkout doc-builder external
76+
# Check out all submodules because we might :literalinclude: something from one
77+
- name: Checkout all submodules
7378
run: |
74-
bin/git-fleximod update doc-builder
79+
bin/git-fleximod update -o
80+
7581
- name: Set image tag for docs build
7682
id: set-image-tag
7783
run: |
78-
echo "IMAGE_TAG=$(echo '${{ steps.meta.outputs.tags }}' | cut -d',' -f1)" >> $GITHUB_ENV
79-
echo "IMAGE_TAG=$(echo '${{ steps.meta.outputs.tags }}' | cut -d',' -f1)" >> $GITHUB_OUTPUT
80-
- name: Build docs using container
84+
echo "IMAGE_TAG=$(echo '${{ steps.meta.outputs.tags }}' | head -n 1 | cut -d',' -f1)" >> $GITHUB_ENV
85+
86+
- name: Build docs using Docker (Podman has trouble on GitHub runners)
8187
id: build-docs
8288
run: |
8389
cd doc && ./build_docs -b ${PWD}/_build -c -d -i $IMAGE_TAG
90+
91+
92+
check-version:
93+
needs: build-image-and-test-docs
94+
uses: ./.github/workflows/docker-image-get-version.yml
95+
with:
96+
registry: ${{ needs.build-image-and-test-docs.outputs.REGISTRY }}
97+
image_name: ${{ needs.build-image-and-test-docs.outputs.IMAGE_NAME }}
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Get and check version specified in a Dockerfile
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
registry:
7+
required: true # Require any workflows calling this one to provide input
8+
type: string
9+
default: 'ghcr.io' # Provide default so this workflow works standalone too
10+
image_name:
11+
required: true # Require any workflows calling this one to provide input
12+
type: string
13+
default: 'escomp/ctsm/ctsm-docs' # Provide default so this workflow works standalone too
14+
outputs:
15+
VERSION_TAG:
16+
description: "Tag to be pushed to container registry"
17+
value: ${{ jobs.get-check-version.outputs.VERSION_TAG }}
18+
workflow_dispatch:
19+
inputs:
20+
registry:
21+
description: 'Container registry'
22+
required: false
23+
type: string
24+
default: 'ghcr.io'
25+
image_name:
26+
description: 'Image name'
27+
required: false
28+
type: string
29+
default: 'escomp/ctsm/ctsm-docs'
30+
31+
# There is a single job in this workflow. It's configured to run on the latest available version of Ubuntu.
32+
jobs:
33+
get-check-version:
34+
name: Get version number from Dockerfile and check it
35+
runs-on: ubuntu-latest
36+
outputs:
37+
VERSION_TAG: ${{ steps.get-check-version.outputs.version_tag }}
38+
# Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job.
39+
permissions:
40+
contents: read
41+
packages: read
42+
43+
steps:
44+
- name: Check out repository
45+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
46+
47+
- name: Get version number from Dockerfile and check it
48+
id: get-check-version
49+
run: |
50+
set -e
51+
set -o pipefail
52+
set -u
53+
VERSION="$(doc/ctsm-docs_container/get_version.sh)"
54+
VERSION_TAG="${{ inputs.registry }}/${{ inputs.image_name }}:${VERSION}"
55+
56+
# Store the manifest inspect result and output
57+
set +e
58+
INSPECT_RESULT="$(docker manifest inspect "$VERSION_TAG" 2>&1)"
59+
INSPECT_STATUS=$?
60+
set -e
61+
62+
if [[ "${INSPECT_RESULT}" == *"schemaVersion"* ]]; then
63+
echo "Tag $VERSION_TAG already exists!" >&2
64+
exit 123
65+
elif [[ "${INSPECT_RESULT}" != "manifest unknown" ]]; then
66+
# "manifest unknown" means the tag doesn't exist, which is what we want
67+
echo -e "Error checking manifest for $VERSION_TAG:\n${INSPECT_RESULT}" >&2
68+
exit $INSPECT_STATUS
69+
fi
70+
71+
echo "Setting version_tag to $VERSION_TAG"
72+
echo "version_tag=$VERSION_TAG" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)