Skip to content
Merged
Show file tree
Hide file tree
Changes from 74 commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
fd35a74
mksurfdata_esmf: Error in Makefile if not built.
samsrabin Apr 8, 2025
f88209e
mksurfdata_esmf: Check $PROJECT before ~/.cesm_proj.
samsrabin Apr 8, 2025
9a10623
test_unit_subset_data: Add 2 bounds tests
samsrabin Apr 30, 2025
dfa1d1b
Longitude: Add comparison operators.
samsrabin Apr 30, 2025
88d6f65
subset_data: Don't fail missing but unused cfg sections.
samsrabin May 1, 2025
7856583
Add test_sys_subset_data.py.
samsrabin May 1, 2025
21fde41
Longitude: Add tests of _check_lon_type*() functions.
samsrabin May 1, 2025
00023d2
Longitude: Work for lists/arrays.
samsrabin May 1, 2025
9c0af2d
Longitude: Add some test asserts.
samsrabin May 1, 2025
3a3832f
Longitude: Add lon_type() getter.
samsrabin May 1, 2025
dfd6997
RegionalCase: Refactor to make subset_lon_lat.
samsrabin May 1, 2025
4ff12b1
RegionalCase: Convert file lons to Longitude.
samsrabin May 1, 2025
6f90990
Add 2 tests to test_sys_subset_data.py.
samsrabin May 1, 2025
8797c44
RegionalCase: Add unit test of _subset_lon_lat().
samsrabin May 1, 2025
3b7a287
Reformat with black.
samsrabin May 1, 2025
c69864e
Add previous commit to .git-blame-ignore-revs.
samsrabin May 1, 2025
1a8d4f6
Resolve pylint complaints.
samsrabin May 1, 2025
8cfc703
Longitude: Delete unused convert_number_to_lon().
samsrabin May 1, 2025
5b3d2f4
Improve some comments.
samsrabin May 7, 2025
ec18184
Improve check_other_is_lontype() description.
samsrabin May 7, 2025
63a89e5
Move Longitude.__eq__().
samsrabin May 7, 2025
7f376a4
Break a ternary if-else into a block.
samsrabin May 7, 2025
10e2c39
test_subset_lon_lat test: Refactor and improve commenting.
samsrabin May 8, 2025
dad44d1
test_sys_subset_data.py: Add standard CTSM unit-testing bits.
samsrabin May 8, 2025
a40322e
test_subset_data_reg_amazon: Compare output files to expected.
samsrabin May 9, 2025
9123bca
Fix a couple of things in documentation conf.py.
samsrabin May 9, 2025
86c6058
Merge tag 'ctsm5.3.043' into merge-master-20250509
slevis-lmwg May 9, 2025
3df302f
Merge pull request #3124 from slevis-lmwg/merge-master-20250509
slevis-lmwg May 9, 2025
9b3698b
Makefile: If mksurfdata exe doesn't exist, build it.
samsrabin May 12, 2025
41ae069
Merge pull request #3122 from samsrabin/docs-hotfix
samsrabin May 12, 2025
74e4e5e
Python Makefile: Fail pylint if score < 10.
samsrabin May 12, 2025
3dd489a
Format with black.
samsrabin May 12, 2025
6fb226d
Add previous commit to .git-blame-ignore-revs.
samsrabin May 12, 2025
22a8273
utils.py: Define find_one_file_matching_pattern().
samsrabin May 12, 2025
01dfd88
Merge tag 'ctsm5.3.043' into subset-data-lon-3093
samsrabin May 12, 2025
742cfa6
Reformat with black.
samsrabin May 12, 2025
1f75ca9
Add previous commit to .git-blame-ignore-revs.
samsrabin May 12, 2025
67bfa6a
ctsm-docs build/publish workflow now includes version tag.
samsrabin May 13, 2025
51974c9
ctsm-docs container build/publish workflow: Include "latest" tag.
samsrabin May 13, 2025
0fe1e87
ctsm-docs container: Fail publish if version tag exists.
samsrabin May 13, 2025
6b2c83c
Don't trigger Docker image workflows if only README changes.
samsrabin May 13, 2025
63cb052
Correct a comment in a GH workflow.
samsrabin May 13, 2025
dd730c2
Check version in Dockerfile as part of docker-image-common.yml.
samsrabin May 13, 2025
fd6d7c9
Ensure repo in IMAGE_NAME is always lowercase, per Docker rule.
samsrabin May 13, 2025
c591a7c
docker-image-get-version: Enable running on workflow dispatch.
samsrabin May 13, 2025
5e07fd5
docker-image-get-version.yml: Minor improvements.
samsrabin May 13, 2025
fcc5664
Avoid tagging container with IMAGE_TAG (e.g., "master").
samsrabin May 13, 2025
de2609f
ctsm-docs container README: Add auto-publishing info.
samsrabin May 13, 2025
5fc5022
ctsm-docs container README: Minor improvements.
samsrabin May 13, 2025
5536915
Update a Workflow comment.
samsrabin May 13, 2025
3fa2980
Merge branch 'b4b-dev' into subset-data-lon-3093
samsrabin May 15, 2025
7fe40b6
Merge pull request #3100 from samsrabin/subset-data-lon-3093
samsrabin May 15, 2025
0fa056f
Merge branch 'b4b-dev' into mksurfdata_esmf-makfile-qol
samsrabin May 15, 2025
4c62715
Merge pull request #3056 from samsrabin/mksurfdata_esmf-makfile-qol
samsrabin May 15, 2025
c7f47b6
Merge pull request #3128 from samsrabin/ctsm-docs-version-tagging
samsrabin May 16, 2025
b940927
Skip docs.yml workflow if only irrelevant files are changed.
samsrabin May 20, 2025
1daa3b5
ChangeLog edit to test that docs.yml doesn't get run.
samsrabin May 20, 2025
6bdace0
Revert "ChangeLog edit to test that docs.yml doesn't get run."
samsrabin May 20, 2025
e1dab25
Merge pull request #3138 from samsrabin/dont-build-docs-for-changelog
samsrabin May 20, 2025
eadc78f
docker-image-common.yml: Delete image_tag output.
samsrabin May 20, 2025
38ffb63
docker-image-common.yml set-image-tag: Add a way to get first tag
samsrabin May 20, 2025
5c338a1
docker-image-build.yml: Fix trigger paths.
samsrabin May 20, 2025
5363855
Make it so workflows don't run just because of a new tag.
samsrabin May 20, 2025
e3d27fd
Add/improve some workflow on: comments.
samsrabin May 20, 2025
beebd92
Merge pull request #3140 from samsrabin/simplify-docker-image-common
samsrabin May 20, 2025
e36d30c
Merge pull request #3143 from samsrabin/dont-run-wf-on-tag-creation
samsrabin May 21, 2025
0fdaed9
Rename "other" template to make room.
samsrabin May 22, 2025
59093a8
Add issue template for docs.
samsrabin May 22, 2025
c87bdd5
Use headings instead of bold.
samsrabin May 22, 2025
6bf7ff3
Delete "documentation" from "other" template description.
samsrabin May 22, 2025
f1f4b6a
Merge pull request #3144 from samsrabin/add-docs-issue-template
samsrabin May 22, 2025
75383e2
Merge remote-tracking branch 'rgknox/fates-init-itype' into b4b-dev-m…
samsrabin May 24, 2025
bb576a9
Merge branch 'b4b-dev' into b4b-dev-merge-20250524
samsrabin May 24, 2025
4bba736
Merge tag 'ctsm5.3.046' into b4b-dev-merge-20250524
samsrabin May 26, 2025
35705b2
Update ChangeLog/ChangeSum.
samsrabin May 26, 2025
f6fd0d3
Update ChangeLog.
samsrabin May 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,6 @@ e8fc526e0d7818d45f171488c78392c4ff63902a
cdf40d265cc82775607a1bf25f5f527bacc97405
251e389b361ba673b508e07d04ddcc06b2681989
8ec50135eca1b99c8b903ecdaa1bd436644688bd
3b7a2876933263f8986e4069f5d23bd45635756f
3dd489af7ebe06566e2c6a1c7ade18550f1eb4ba
742cfa606039ab89602fde5fef46458516f56fd4
24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATE/03_documentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: Documentation
about: Something should be added to or fixed in the documentation

---


### What sort(s) of issue is this?
- [ ] Something is missing.
- [ ] Something is (or might be) incorrect.
- [ ] Something is confusing.
- [ ] Something is broken.

### What part(s) of the documentation does this concern?
- [ ] [Technical Note](https://escomp.github.io/ctsm-docs/versions/master/html/tech_note/index.html) (science and design of the model)
- [ ] [User's Guide](https://escomp.github.io/ctsm-docs/versions/master/html/users_guide/index.html) (using the model and related tools)
- [ ] Somewhere else (e.g., README file, tool help text, or code comment): _Please specify_
- [ ] I don't know

### Describe the issue
A clear and concise description of what is missing or wrong.

### Additional context (optional)
Add any other context or screenshots about the issue here.
7 changes: 0 additions & 7 deletions .github/ISSUE_TEMPLATE/03_other.md

This file was deleted.

7 changes: 7 additions & 0 deletions .github/ISSUE_TEMPLATE/04_other.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
name: Other
about: Other issues (enhancement, cleanup, etc.)

---


13 changes: 8 additions & 5 deletions .github/workflows/docker-image-build-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
name: Build and publish ctsm-docs Docker image

on:
# Run this whenever something gets pushed to master
# Run this whenever a change to certain files gets pushed to master
push:
branches: ['master']
paths:
- 'doc/ctsm-docs_container/Dockerfile'
- 'doc/ctsm-docs_container/requirements.txt'
- 'doc/ctsm-docs_container/**'
- '!doc/ctsm-docs_container/README.md'

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

# Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job.
permissions:
Expand Down Expand Up @@ -61,6 +61,7 @@ jobs:
# This step uses the `docker/build-push-action` action to build the image, based on the ctsm-docs `Dockerfile`.
# 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.
# It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step.
# Note that we should avoid relying on the "latest" tag for anything, but it's good practice to have one.
# v6.15.0
- name: Push Docker image
id: push
Expand All @@ -70,7 +71,9 @@ jobs:
platforms: linux/amd64,linux/arm64
push: true
load: false
tags: ${{ env.IMAGE_TAG }}
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
${{ env.VERSION_TAG }}
labels: ""

# 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).
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/docker-image-build.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
# 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)
name: Test building ctsm-docs Docker image and using it to build the docs

# Configures this workflow to run every time a change in the Docker container setup is pushed to the master branch
# Configures this workflow to run every time a change in the Docker container setup is pushed or included in a PR
on:
push:
# 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.
branches: ['*']
paths:
- 'doc/ctsm-docs_container/**'
- '!doc/ctsm-docs_container/README.md'
- '.github/workflows/docker-image-ctsm-docs-build.yml'
- '.github/workflows/docker-image-build-common.yml'
- '.github/workflows/docker-image-common.yml'

pull_request:
# Run on pull requests that change the listed files
paths:
- 'doc/ctsm-docs_container/**'
- '!doc/ctsm-docs_container/README.md'
- '.github/workflows/docker-image-ctsm-docs-build.yml'
- '.github/workflows/docker-image-build-common.yml'
- '.github/workflows/docker-image-common.yml'

workflow_dispatch:

Expand Down
35 changes: 25 additions & 10 deletions .github/workflows/docker-image-common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ on:
IMAGE_NAME:
description: "Docker image name"
value: ${{ jobs.build-image-and-test-docs.outputs.IMAGE_NAME }}
image_tag:
description: "First image tag"
value: ${{ jobs.build-image-and-test-docs.outputs.image_tag }}
version_tag:
description: "Version tag from Dockerfile"
value: ${{ jobs.check-version.outputs.VERSION_TAG }}

# 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.
# Defines custom environment variables for the workflow.
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}/ctsm-docs
IMAGE_BASENAME: ctsm-docs
REPO: ${{ github.repository }}

# There is a single job in this workflow. It's configured to run on the latest available version of Ubuntu.
jobs:
Expand All @@ -25,8 +26,7 @@ jobs:
# Variables that might be needed by the calling workflow
outputs:
REGISTRY: ${{ env.REGISTRY }}
IMAGE_NAME: ${{ env.IMAGE_NAME }}
image_tag: ${{ steps.set-image-tag.outputs.IMAGE_TAG }}
IMAGE_NAME: ${{ steps.set-image-name.outputs.IMAGE_NAME }}
# Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job.
permissions:
contents: read
Expand All @@ -39,6 +39,14 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

# 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.
- name: Get image name with lowercase repo
id: set-image-name
run: |
lowercase_repo=$(echo $REPO | tr '[:upper:]' '[:lower:]')
echo "IMAGE_NAME=${lowercase_repo}/${IMAGE_BASENAME}" >> $GITHUB_ENV
echo "IMAGE_NAME=${lowercase_repo}/${IMAGE_BASENAME}" >> $GITHUB_OUTPUT

# 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.
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
Expand All @@ -52,7 +60,7 @@ jobs:
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
images: ${{ env.REGISTRY }}/${{ steps.set-image-name.outputs.IMAGE_NAME }}

# This step uses the `docker/build-push-action` action to build the image, based on the ctsm-docs `Dockerfile`.
# 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.
Expand All @@ -75,9 +83,16 @@ jobs:
- name: Set image tag for docs build
id: set-image-tag
run: |
echo "IMAGE_TAG=$(echo '${{ steps.meta.outputs.tags }}' | cut -d',' -f1)" >> $GITHUB_ENV
echo "IMAGE_TAG=$(echo '${{ steps.meta.outputs.tags }}' | cut -d',' -f1)" >> $GITHUB_OUTPUT
echo "IMAGE_TAG=$(echo '${{ steps.meta.outputs.tags }}' | head -n 1 | cut -d',' -f1)" >> $GITHUB_ENV
- name: Build docs using container
id: build-docs
run: |
cd doc && ./build_docs -b ${PWD}/_build -c -d -i $IMAGE_TAG


check-version:
needs: build-image-and-test-docs
uses: ./.github/workflows/docker-image-get-version.yml
with:
registry: ${{ needs.build-image-and-test-docs.outputs.REGISTRY }}
image_name: ${{ needs.build-image-and-test-docs.outputs.IMAGE_NAME }}
72 changes: 72 additions & 0 deletions .github/workflows/docker-image-get-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Get and check version specified in a Dockerfile

on:
workflow_call:
inputs:
registry:
required: true # Require any workflows calling this one to provide input
type: string
default: 'ghcr.io' # Provide default so this workflow works standalone too
image_name:
required: true # Require any workflows calling this one to provide input
type: string
default: 'escomp/ctsm/ctsm-docs' # Provide default so this workflow works standalone too
outputs:
VERSION_TAG:
description: "Tag to be pushed to container registry"
value: ${{ jobs.get-check-version.outputs.VERSION_TAG }}
workflow_dispatch:
inputs:
registry:
description: 'Container registry'
required: false
type: string
default: 'ghcr.io'
image_name:
description: 'Image name'
required: false
type: string
default: 'escomp/ctsm/ctsm-docs'

# There is a single job in this workflow. It's configured to run on the latest available version of Ubuntu.
jobs:
get-check-version:
name: Get version number from Dockerfile and check it
runs-on: ubuntu-latest
outputs:
VERSION_TAG: ${{ steps.get-check-version.outputs.version_tag }}
# Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job.
permissions:
contents: read
packages: read

steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Get version number from Dockerfile and check it
id: get-check-version
run: |
set -e
set -o pipefail
set -u
VERSION="$(doc/ctsm-docs_container/get_version.sh)"
VERSION_TAG="${{ inputs.registry }}/${{ inputs.image_name }}:${VERSION}"
# Store the manifest inspect result and output
set +e
INSPECT_RESULT="$(docker manifest inspect "$VERSION_TAG" 2>&1)"
INSPECT_STATUS=$?
set -e
if [[ "${INSPECT_RESULT}" == *"schemaVersion"* ]]; then
echo "Tag $VERSION_TAG already exists!" >&2
exit 123
elif [[ "${INSPECT_RESULT}" != "manifest unknown" ]]; then
# "manifest unknown" means the tag doesn't exist, which is what we want
echo -e "Error checking manifest for $VERSION_TAG:\n${INSPECT_RESULT}" >&2
exit $INSPECT_STATUS
fi
echo "Setting version_tag to $VERSION_TAG"
echo "version_tag=$VERSION_TAG" >> $GITHUB_OUTPUT
3 changes: 3 additions & 0 deletions .github/workflows/docs-ctsm_pylib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@ name: Test building docs with ctsm_pylib

on:
push:
# 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.
branches: ['*']
paths:
- 'python/conda_env_ctsm_py.txt'

pull_request:
# Run on pull requests that change the listed files
paths:
- 'python/conda_env_ctsm_py.txt'

Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,21 @@ name: Test building docs when they're updated

on:
push:
# 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.
branches: ['*']
paths:
- 'doc/**'
- '!doc/*ChangeLog*'
- '!doc/*ChangeSum*'
- '!doc/UpdateChangelog.pl'

pull_request:
# Run on pull requests that change the listed files
paths:
- 'doc/**'
- '!doc/*ChangeLog*'
- '!doc/*ChangeSum*'
- '!doc/UpdateChangelog.pl'

workflow_dispatch:

Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/fleximod_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ name: git-fleximod test
# Test git-fleximod update and cleanliness
# Based closely on workflow from CESM repo
#
on: [push, pull_request]
on:
push:
# Run when a change to any is pushed to any branch. Without the "branches:" line, for some reason this will be run whenever a tag is pushed, even if no files are changed.
branches: ['*']
pull_request:

jobs:
fleximod-test:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/formatting_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@ name: Check Python formatting

on:
push:
# 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.
branches: ['*']
paths:
- 'python/**'
- 'cime_config/SystemTests/**'
- 'cime_config/buildlib/**'
- 'cime_config/buildnml/**'
pull_request:
# Run on pull requests that change the listed files
paths:
- 'python/**'
- 'cime_config/SystemTests/**'
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
*.nc
# but don't ignore netcdf files here:
!/python/ctsm/test/testinputs/*.nc
!/python/ctsm/test/testinputs/**/*.nc

# editor files
*.swp
Expand Down
3 changes: 2 additions & 1 deletion doc/ctsm-docs_container/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ WORKDIR /home/user
CMD ["/bin/bash", "-l"]

LABEL org.opencontainers.image.title="Container for building CTSM documentation"
LABEL org.opencontainers.image.source=https://github.com/ESCOMP/CTSM
LABEL org.opencontainers.image.source=https://github.com/ESCOMP/CTSM
LABEL org.opencontainers.image.version="v1.0.2"
Loading
Loading