Skip to content

Commit

Permalink
update reamde with CLI commands and general usage notes
Browse files Browse the repository at this point in the history
  • Loading branch information
fmigneault committed Nov 16, 2023
1 parent e588338 commit 3ac36d1
Showing 1 changed file with 38 additions and 3 deletions.
41 changes: 38 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

![Latest Version](https://img.shields.io/badge/latest%20version-0.3.0-blue?logo=github)
![Commits Since Latest](https://img.shields.io/github/commits-since/crim-ca/stac-populator/0.3.0.svg?logo=github)
![GitHub License](https://img.shields.io/github/license/crim-ca/stac-populator)

This repository contains a framework [STACpopulator](STACpopulator)
that can be used to implement concrete populators (see [implementations](STACpopulator/implementations))
Expand Down Expand Up @@ -40,16 +41,44 @@ pip install .[dev]
make install-dev
```

You can also employ the pre-built Docker:
You should then be able to call the STAC populator CLI with following commands:

```shell
# obtain the installed version of the STAC populator
stac-popultaor --version

# obtain general help about available commands
stac-popultaor --help

# obtain general help about available STAC populator implementations
stac-popultaor run --help

# obtain help specifically for the execution of a STAC populator implementation
stac-popultaor run [implementation] --help
```

You can also employ the pre-built Docker, which can be called as follows,
where `[command]` corresponds to any of the above example operations.

```shell
docker run -ti ghcr.io/crim-ca/stac-populator:0.3.0 [command]
```

*Note*: <br>
If files needs to provided as input or obtained as output for using a command with `docker`, you will need to either
mount files individually or mount a workspace directory using `-v {local-path}:{docker-path}` inside the Docker
container to make them accessible to the command.

## Testing

The provided [`docker-compose`](docker/docker-compose.yml) configuration file can be used to launch a test STAC server.
For example, the [CMIP6_UofT][CMIP6_UofT] script can be run as:
Consider using `make docker-start` to start this server, and `make docker-stop` to stop it.
Alternatively, you can also use your own STAC server accessible from any remote location.

To run the STAC populator, follow the steps from [Installation and Execution](#installation-and-execution).

Alternatively, you can call the relevant populator Python scripts individually.
For example, using the [CMIP6_UofT][CMIP6_UofT] implementation, the script can be run as:

```shell
python STACpopulator/implementations/CMIP6_UofT/add_CMIP6.py \
Expand All @@ -58,5 +87,11 @@ python STACpopulator/implementations/CMIP6_UofT/add_CMIP6.py \
"STACpopulator/implementations/CMIP6_UofT/collection_config.yml"
```

*Note*:
*Note*: <br>
In the script above, a sample THREDDS catalog URL is employed and not one relevant to the global scale CMIP6 data.

For more tests validation, you can also run the test suite with coverage analysis.

```shell
make test-cov
```

0 comments on commit 3ac36d1

Please sign in to comment.