Skip to content

Commit

Permalink
Docker Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
manishvenu committed Dec 12, 2024
1 parent f3b251a commit 4315b54
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
35 changes: 35 additions & 0 deletions docs/docker_image_testing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Docker Image & Github Testing (For contributors)

RM6 uses a docker image in github actions for holding large data. It wasn't directly being used, but for downloading the curvilinear grid for testing, we are using it. This document is a list of helpful commands to work on it.

The link to the image is here:
https://github.com/COSIMA/regional-mom6/pkgs/container/regional-test-env

For local development of the image to add data to it for testing, first pull it.
```docker pull ghcr.io/cosima/regional-test-env:updated```

Then to do testing of the image, we cd into our cloned version of RM6, and run this command. It mounts our code in the /workspace directory.:
```docker run -it --rm \ -v $(pwd):/workspace \ -w /workspace \ ghcr.io/cosima/regional-test-env:updated \ /bin/bash```

The -it flag is for shell access, and the workspace stuff is to get our local code in the container.
You have to download conda, python, pip, and all that business to properly run the tests.

Getting to adding the data, you should create a folder and add both the data you want to add and a file simple called "Dockerfile". In Dockerfile, we'll get the original image, then copy the data we need to the data folder.

```
# Use the base image
FROM ghcr.io/cosima/regional-test-env:<tag>
# Copy your local file into the /data directory in the container
COPY <file> /data/<file>
```

Then, we need to build the image, tag it, and push it

```
docker build -t my-custom-image . # IN THE DIRECTORY WITH THE DOCKERFILE
docker tag my-custom-image ghcr.io/cosima/regional-test-env:<new_tag>
docker ghcr.io/cosima/regional-test-env:<new_tag>
```


3 changes: 2 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,10 @@ The bibtex entry for the paper is:
installation
demos
mom6-file-structure-primer
angle_calc
api
contributing
angle_calc
docker_image_testing


Indices and tables
Expand Down

0 comments on commit 4315b54

Please sign in to comment.