Skip to content

Commit

Permalink
HARMONY-864: Begin updates to README run commands
Browse files Browse the repository at this point in the history
  • Loading branch information
vinnyinverso committed Jan 4, 2024
1 parent 7c3e8e4 commit 30e0b5b
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ and update the `.env` with the correct values.

#### Python & Project Dependencies (Optional)

If you would like to do local development outside of Docker, install Python (3.7.4), and create a Python virtual environment.
If you would like to do local development outside of Docker, install Python (3.9), and create a Python virtual environment.

Install project dependencies:

Expand All @@ -52,7 +52,7 @@ Install project dependencies:

If you'd rather not build the image locally (as instructed below), you can simply pull the latest image:

$ docker pull harmonyservices/netcdf-to-zarr
$ docker pull ghcr.io/nasa/harmony-netcdf-to-zarr

Some of the [Makefile](./Makefile) targets referenced below include an optional argument that allows us to use a local copy of
`harmony-service-lib-py` (which is useful for concurrent development):
Expand Down
4 changes: 2 additions & 2 deletions bin/run-in-docker
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ if [ -f .env ]; then
args="$args --env-file=.env"
fi

cmd="python3 -m harmony_netcdf_to_zarr --harmony-action invoke --harmony-input '$($scriptdir/replace.sh $@)'"
cmd="FALLBACK_AUTHN_ENABLED=true python3 -m harmony_netcdf_to_zarr --harmony-action invoke --harmony-metadata-dir example --harmony-sources example/catalog0.json --harmony-input '$($scriptdir/replace.sh $@)'"

if [[ ! -z "${LOCAL_SVCLIB_DIR}" ]]
then
LOCAL_SVCLIB_DIR=$(readpath $LOCAL_SVCLIB_DIR)
svclib_volume="-v ${LOCAL_SVCLIB_DIR}:/opt/harmony-service-lib-py"
cmd="pip install --user -e /opt/harmony-service-lib-py && python3 -m harmony_netcdf_to_zarr --harmony-action invoke --harmony-input '$($scriptdir/replace.sh $@)'"
cmd="pip install --user -e /opt/harmony-service-lib-py && FALLBACK_AUTHN_ENABLED=true python3 -m harmony_netcdf_to_zarr --harmony-action invoke --harmony-metadata-dir example --harmony-sources example/catalog0.json --harmony-input '$($scriptdir/replace.sh $@)'"
fi

docker run --rm -it \
Expand Down
18 changes: 18 additions & 0 deletions example/catalog0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"stac_version": "1.0.0-beta.2",
"stac_extensions": [],
"id": "3f6ceb37-0d8e-4f3c-91bc-79fdca9c4bbf",
"links": [
{
"rel": "harmony_source",
"href": "https://cmr.uat.earthdata.nasa.gov/search/concepts/C1233860183-EEDTEST"
},
{
"rel": "item",
"href": "./granule_G1233860471-EEDTEST_0000000.json",
"type": "application/json",
"title": "000_00_000_africa"
}
],
"description": "CMR collection C1233860183-EEDTEST, granule G1233860471-EEDTEST"
}
1 change: 1 addition & 0 deletions example/dotenv
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ USE_LOCALSTACK=true
SHARED_SECRET_KEY=_THIS_IS_MY_32_CHARS_SECRET_KEY_

# Set to 'true' if running Docker in Docker and the docker daemon is somewhere other than the current context
# Leave blank, i.e. DIND= if not running Docker in Docker
DIND=true

# Indicates where docker commands should find the docker daemon
Expand Down
55 changes: 55 additions & 0 deletions example/granule_G1233860471-EEDTEST_0000000.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"stac_version": "1.0.0-beta.2",
"stac_extensions": [],
"id": "8572fdd0-071e-4a23-b703-14e8aa154ee6",
"type": "Feature",
"links": [],
"properties": {
"start_datetime": "2019-12-31T00:00:00.000Z",
"end_datetime": "2019-12-31T07:59:59.000Z",
"datetime": "2019-12-31T00:00:00.000Z"
},
"bbox": [
-30.356735,
-41.67082,
67.09637,
47.372707
],
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
-30.356735,
-41.67082
],
[
-30.356735,
47.372707
],
[
67.09637,
47.372707
],
[
67.09637,
-41.67082
],
[
-30.356735,
-41.67082
]
]
]
},
"assets": {
"data": {
"href": "https://harmony.uat.earthdata.nasa.gov/service-results/harmony-uat-eedtest-data/C1233860183-EEDTEST/nc/000_00_000_africa.nc",
"title": "000_00_000_africa.nc",
"type": "application/x-netcdf",
"roles": [
"data"
]
}
}
}
1 change: 1 addition & 0 deletions example/harmony-operation.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"user": "jdoe",
"format": {"mime": "application/x-zarr"},
"callback": "http://localhost/some-path",
"stagingLocation": "s3://${STAGING_BUCKET}/public/harmony/netcdf-to-zarr/example-uuid/",
"sources": [
Expand Down
2 changes: 1 addition & 1 deletion harmony_netcdf_to_zarr/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import sys

if sys.version_info[0] != 3 or sys.version_info[1] < 6:
if sys.version_info[0] != 3 or sys.version_info[1] < 9:
raise Exception('You must use Python 3.6 or later')

import argparse
Expand Down

0 comments on commit 30e0b5b

Please sign in to comment.