Skip to content

ctsm_pylib container? #3239

@samsrabin

Description

@samsrabin

We have a few GitHub workflow jobs that require the use of ctsm_pylib. Whenever those run, they have to download the packages and install the environment—there's no way to cache it. This counts towards the ESCOMP org's bandwidth billing.

It would be cheaper (and maybe faster) to have a ctsm_pylib container that the jobs could run in. As far as I can tell, as long as that container is public and hosted on GitHub Container Registry (as our ctsm-docs container is), this would not count toward our bandwidth usage.

On the other hand, if we're close to having self-hosted GitHub runners, it's possible the ctsm_pylib environment could be cached on those, avoiding this issue—at least for people with permissions to use those runners.


I've had a stab at this, the results of which you can see on the PR at samsrabin#13.

The container and Python unit testing work on my Mac. From the top level of a CTSM checkout, open an interactive terminal in the container like so:

podman run --rm -it -v $PWD:/home/mambauser ghcr.io/samsrabin/ctsm/ctsm_pylib-container:latest bash

Then, in the container, do:

cd python
./run_ctsm_py_tests -u

and it should work. (Although depending on your CTSM version you may have some failing/erroring tests.)

However, I can't get it to work in the GitHub workflow. Once that's working, it'd be nice to try minimizing the image size using Alpine Linux instead of what comes with the default micromamba image (I think Arch). We would also want to have a dual arm64/amd64 image as well; the current one (dd25c67e7ed6) is just arm64.

Metadata

Metadata

Assignees

No one assigned

    Labels

    b4bbit-for-bitdevopsDevelopment Operations to improve development throughput, E.g., adding GitHub Workflowsenhancementnew capability or improved behavior of existing capabilitypriority: lowBackground task that doesn't need to be done right away.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions