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

HARMONY-1949: Allow None catalog to be passed to service; Remove deprecated code. #52

Merged
merged 5 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
21 changes: 7 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,12 @@ interop and upgrades. To work with Harmony, services must:
supported way to receive messages, though HTTP is likely to follow. `harmony.cli`
provides helpers for setting up CLI parsing while being unobtrusive to non-Harmony
CLIs that may also need to exist.
2. Extend `harmony.BaseHarmonyAdapter` and implement the `#invoke` to
adapt the incoming Harmony message to a service call and adapt the service
result to call to one of the adapter's `#completed_with_*` methods. The adapter
class provides helper methods for retrieving data, staging results, and cleaning
up temporary files, though these can be overridden or ignored if a service
needs different behavior, e.g. if it operates on data in situ and does not
want to download the remote file.
2. Extend `harmony.BaseHarmonyAdapter` and either override `#invoke` to process
the message or override `#process_item` to process each individual STAC item
provided in the input STAC catalog. The adapter class provides helper methods
for retrieving data, staging results, and cleaning up temporary files, though
these can be overridden or ignored if a service needs different behavior, e.g.
if it operates on data in situ and does not want to download the remote file.

A full example of these two requirements with use of helpers can be found in
[example/example_service.py](example/example_service.py). Also see
Expand Down Expand Up @@ -86,16 +85,10 @@ OPTIONAL:
* `USE_LOCALSTACK`: (Development) If 'true' will perform S3 calls against localstack rather
than AWS
* `LOCALSTACK_HOST`: (Development) If `USE_LOCALSTACK` `true` and this is set, will
establish `boto` client connections for S3 & SQS operations using this hostname.
establish `boto` client connections for S3 operations using this hostname.
* `TEXT_LOGGER`: (Default: True) Setting this to true will cause all
log messages to use a text string format. By default log
messages will be formatted as JSON.
* `HEALTH_CHECK_PATH`: Set this to the path where the health check file should be stored. This
file's mtime is set to the current time whenever a successful attempt is made to to read the
message queue (whether or not a message is retrieved). This file can be used by a container's
health check command. The container is considered unhealthy if the mtime of the file is old -
where 'old' is configurable in the service container. If this variable is not set the path
defaults to '/tmp/health.txt'.
* `MAX_DOWNLOAD_RETRIES`: Number of times to retry HTTP download calls that fail due to transient errors.

OPTIONAL -- Use with CAUTION:
Expand Down
7 changes: 6 additions & 1 deletion dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,10 @@ pytest-mock ~=3.5
python-language-server ~= 0.35
responses ~=0.22.0
pycodestyle >= 2.9.1
safety ~= 3.2.7
setuptools == 70.0.0

# Pin safety down to work around the compatibility issue with Python 3.13
# See: https://github.com/pyupio/safety/issues/620
# Update safety version when the issue is resolved.
safety-schemas == 0.0.5
safety == 3.2.3
Loading
Loading