Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerfile Home Permissions and Delivery Instructions #9

Merged
merged 3 commits into from
Nov 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ and uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

- Python 3.13 support
- Updated dockerimage to ensure on login the conda environment is activated
- Instructions in the README for testing outputs using the associated docker image
- Instructions in the README for OPERA delivery.
- A `.Dockerignore` file to remove extraneous files from the docker image
- Allow `/home/ops` directory in Docker image to be open to all users

## [0.0.2]

Expand Down
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ WORKDIR /home/ops
COPY --chown=dist_user:dist_user environment.yml /home/ops/dist-s1/environment.yml
COPY --chown=dist_user:dist_user . /home/ops/dist-s1

# Ensure all files are read/write by the user
RUN chmod -R 777 /home/ops

# Create the environment with mamba
RUN mamba env create -f /home/ops/dist-s1/environment.yml && \
conda clean -afy
Expand Down
33 changes: 20 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ It is worth noting that the SDS workflow (`dist-s1 run_sas`) is *not* user frien
### The `dist-s1 run_sas` Entrypoint

```
dist-s1 --runconfig_yml_path <path/to/runconfig.yml>
dist-s1 run_sas --runconfig_yml_path <path/to/runconfig.yml>
```

See `tests/test_main.py` for an example of how to use the CLI with sample data.
Expand All @@ -76,27 +76,34 @@ Notes:
Make sure you have Docker installed for [Mac](https://docs.docker.com/desktop/setup/install/mac-install/) or [Windows](https://docs.docker.com/desktop/setup/install/windows-install/). We call the docker image `dist_s1_img` for the remainder of this README.

```
docker build -f Dockerfile -t dist_s1_img .
docker build -f Dockerfile -t dist-s1 .
```

### Running the Container Interactively

To run the container interactively:
```
docker run -ti dist_s1_img
docker run -ti dist-s1
```
Within the container, you can run the CLI commands and the test suite.

### Inspecting Outputs from the Image

All the of the test data is currently stored in our test suite within this repostiroy and is run automatically with each PR/merge/release.
However, to allow for additional external/SDS testing via the published Docerk image, we share some of the relevant instructions.
We assume that a docker image (as above) has been built with the tag `dist_s1_img`.
Navigate to a new directory and run the following commands:
# Delivery Instructions

There are certain releases associated with OPERA project deliveries. Here we provide instructions for how to run and verify the DIST-S1 workflow.

We have included sample input data, associated a Docker image via the Github registry, and run tests via github actions all within this repository.

```
docker pull ghcr.io/opera-adt/dist-s1
```
If a specific version is required (or assumed for a delivery), then you use `docker pull ghcr.io/opera-adt/dist-s1:<version>` e.g.
```
# Copy the test data from the docker image to the current working directory
docker cp $(docker create dist_s1_img):/home/ops/dist-s1/tests ./tests
# Run the DIST-S1 workflow using the test data
docker run -v "$PWD/tests:/home/ops/dist-s1/tests" dist_s1_img bash -l -c "cd dist-s1/tests && dist-s1 run_sas --runconfig_yml_path test_data/10SGD_cropped/runconfig.yml"
docker pull ghcr.io/opera-adt/dist-s1:0.0.4
```
The command will pull the latest released version of the Docker image. To run the test suite, run:
```
docker run ghcr.io/opera-adt/dist-s1 bash -l -c 'cd dist-s1 && pytest tests'
```
You should see a `tests/` directory matching the one in this repository in your current working directory. Furthermore, there now should be a `tests/OPERA_L3_DIST-ALERT-S1_*/` directory containing the expected output of this test. This is still under development, but provides a useful way to inspect the eventual DIST-S1 output.