Skip to content

Commit b108ef3

Browse files
committed
Merge branch 'b4b-dev' into ciso_b4b_changes_to_ctsm5.4
2 parents 88a963c + fabf7e4 commit b108ef3

File tree

492 files changed

+22333
-4781
lines changed

Some content is hidden

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

492 files changed

+22333
-4781
lines changed

.git-blame-ignore-revs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,16 @@ e8fc526e0d7818d45f171488c78392c4ff63902a
6262
890b4633c5477dc074f79c69c40d650196337591
6363
1972cef6bba0d97169b30a53f540d56bcbd97281
6464
cdf40d265cc82775607a1bf25f5f527bacc97405
65+
251e389b361ba673b508e07d04ddcc06b2681989
66+
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+

.github/workflows/black.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.
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
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# Based on 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: Build and publish ctsm-docs Docker image
3+
4+
on:
5+
# Run this whenever a change to certain files gets pushed to master
6+
push:
7+
branches: ['master']
8+
paths:
9+
- 'doc/ctsm-docs_container/**'
10+
- '!doc/ctsm-docs_container/README.md'
11+
12+
# Run this whenever it's manually called
13+
workflow_dispatch:
14+
15+
jobs:
16+
# This first job checks that the container can be built, and that we can use it to build the docs without error.
17+
build-image-and-test-docs:
18+
name: Build image and test docs
19+
uses: ./.github/workflows/docker-image-common.yml
20+
secrets: inherit
21+
22+
# This second job actually builds and publishes the container.
23+
push-and-attest:
24+
name: Publish and attest
25+
runs-on: ubuntu-latest
26+
27+
# Wait to run this job until after build-image-and-test-docs. If that job fails, something might be wrong with the container, so don't try this one. (It might also have failed because of something wrong with doc-builder or the documentation.)
28+
needs: build-image-and-test-docs
29+
30+
# Variables output by the build-image-and-test-docs job.
31+
env:
32+
REGISTRY: ${{ needs.build-image-and-test-docs.outputs.REGISTRY }}
33+
IMAGE_NAME: ${{ needs.build-image-and-test-docs.outputs.IMAGE_NAME }}
34+
VERSION_TAG: ${{ needs.build-image-and-test-docs.outputs.version_tag }}
35+
36+
# Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job.
37+
permissions:
38+
contents: read
39+
packages: write
40+
attestations: write
41+
id-token: write
42+
43+
steps:
44+
- name: Checkout repository
45+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
46+
47+
# 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.
48+
- name: Log in to the Container registry
49+
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
50+
with:
51+
registry: ${{ env.REGISTRY }}
52+
username: ${{ github.actor }}
53+
password: ${{ secrets.GITHUB_TOKEN }}
54+
55+
# This step sets up Docker Buildx, which is needed for the multi-platform build in the next step
56+
# https://docs.docker.com/build/ci/github-actions/multi-platform/
57+
# v3.1.0
58+
- name: Set up Docker Buildx
59+
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2
60+
61+
# This step uses the `docker/build-push-action` action to build the image, based on the ctsm-docs `Dockerfile`.
62+
# 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.
63+
# 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.
65+
# v6.15.0
66+
- name: Push Docker image
67+
id: push
68+
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4
69+
with:
70+
context: doc/ctsm-docs_container
71+
platforms: linux/amd64,linux/arm64
72+
push: true
73+
load: false
74+
tags: |
75+
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
76+
${{ env.VERSION_TAG }}
77+
labels: ""
78+
79+
# 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).
80+
- name: Generate artifact attestation
81+
uses: actions/attest-build-provenance@e8998f949152b193b063cb0ec769d69d929409be # v2
82+
with:
83+
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
84+
subject-digest: ${{ steps.push.outputs.digest }}
85+
push-to-registry: true
86+
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# 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: Build and test ctsm-docs container
3+
4+
# Configures this workflow to run every time a change in the Docker container setup is pushed or included in a PR
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+
- 'doc/ctsm-docs_container/**'
11+
- '!doc/ctsm-docs_container/README.md'
12+
- '.github/workflows/docker-image-common.yml'
13+
14+
pull_request:
15+
# Run on pull requests that change the listed files
16+
paths:
17+
- 'doc/ctsm-docs_container/**'
18+
- '!doc/ctsm-docs_container/README.md'
19+
- '.github/workflows/docker-image-common.yml'
20+
21+
workflow_dispatch:
22+
23+
# There is a single job in this workflow. It's configured to run on the latest available version of Ubuntu.
24+
jobs:
25+
build-image-and-test-docs:
26+
name: Build image and test docs
27+
uses: ./.github/workflows/docker-image-common.yml
28+
secrets: inherit
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: Workflow used by docker-image workflows
2+
3+
on:
4+
workflow_call:
5+
outputs:
6+
REGISTRY:
7+
description: "Container registry"
8+
value: ${{ jobs.build-image-and-test-docs.outputs.REGISTRY }}
9+
IMAGE_NAME:
10+
description: "Docker image name"
11+
value: ${{ jobs.build-image-and-test-docs.outputs.IMAGE_NAME }}
12+
version_tag:
13+
description: "Version tag from Dockerfile"
14+
value: ${{ jobs.check-version.outputs.VERSION_TAG }}
15+
16+
# Defines custom environment variables for the workflow.
17+
env:
18+
REGISTRY: ghcr.io
19+
IMAGE_BASENAME: ctsm-docs
20+
REPO: ${{ github.repository }}
21+
22+
# There is a single job in this workflow. It's configured to run on the latest available version of Ubuntu.
23+
jobs:
24+
build-image-and-test-docs:
25+
runs-on: ubuntu-latest
26+
# Variables that might be needed by the calling workflow
27+
outputs:
28+
REGISTRY: ${{ env.REGISTRY }}
29+
IMAGE_NAME: ${{ steps.set-image-name.outputs.IMAGE_NAME }}
30+
# Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job.
31+
permissions:
32+
contents: read
33+
34+
steps:
35+
36+
- name: Checkout repository
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
46+
47+
# 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.
48+
- name: Log in to the Container registry
49+
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
50+
with:
51+
registry: ${{ env.REGISTRY }}
52+
username: ${{ github.actor }}
53+
password: ${{ secrets.GITHUB_TOKEN }}
54+
55+
# 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. The `id` "meta" allows the output of this step to be referenced in a subsequent step. The `images` value provides the base name for the tags and labels.
56+
- name: Extract metadata (tags, labels) for Docker
57+
id: meta
58+
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
59+
with:
60+
images: ${{ env.REGISTRY }}/${{ steps.set-image-name.outputs.IMAGE_NAME }}
61+
62+
# This step uses the `docker/build-push-action` action to build the image, based on the ctsm-docs `Dockerfile`.
63+
# 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.
64+
# It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step.
65+
# v6.15.0
66+
- name: Build Docker image
67+
id: build-image
68+
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4
69+
with:
70+
context: doc/ctsm-docs_container
71+
push: false
72+
load: true
73+
tags: ${{ steps.meta.outputs.tags }}
74+
labels: ${{ steps.meta.outputs.labels }}
75+
76+
# Check out all submodules because we might :literalinclude: something from one
77+
- name: Checkout all submodules
78+
run: |
79+
bin/git-fleximod update -o
80+
81+
- name: Set image tag for docs build
82+
id: set-image-tag
83+
run: |
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)
87+
id: build-docs
88+
run: |
89+
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 }}

0 commit comments

Comments
 (0)