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

DAS-2034 - Remove custom retry logic from HOSS in favour of harmony-service-lib. #4

Merged
merged 4 commits into from
Dec 20, 2023

Conversation

owenlittlejohns
Copy link
Member

@owenlittlejohns owenlittlejohns commented Dec 20, 2023

Description

This ticket removes custom retry logic for downloading a file from OPeNDAP. The harmony-service-lib also has retry logic, as does each step in a Harmony workflow. All three of these retry types currently can lead to 150 attempts to download a file, which is currently causing issues for OPeNDAP with the GHRSST MUR data.

Jira Issue ID

DAS-2034.

Local Test Steps

  • Build this branch locally using:
./bin/build-image
  • Restart your local Harmony instance:
# If Harmony is already running:
kubectl delete ns harmony

# In the Harmony repository:
./bin/bootstrap-harmony
  • Run through the tests in the HOSS regression test notebook (for local testing, you'll need to run the notebook in your browser, not via the run_notebooks.sh script). This will also mean setting harmony_host_url = 'http://localhost:3000' in the notebook. The tests should pass.
  • Bonus check - the logs for shape file subsets contain logging indicating that a shape file has been downloaded. The logging can be accessed via the http://localhost:3000/workflow-ui endpoint, and the test to check uses the collection concept ID 'C1245618475-EEDTEST' and has three steps in the workflow: query-cmr, harmony-opendap-subsetter and maskfill. The loggin will contain a line similar to:
"2023-12-20 03:51:10,810 [INFO] [harmony-service.get_request_shape_file:61] Downloading request shape file\r\n",

PR Acceptance Checklist

  • Jira ticket acceptance criteria met.
  • CHANGELOG.md updated to include high level summary of PR changes.
  • VERSION updated if publishing a release.
  • Tests added/updated and passing.
  • Documentation updated (if needed).

@@ -58,6 +58,7 @@ def get_request_shape_file(message: Message, working_dir: str,
raise UnsupportedShapeFileFormat(message.subset.shape.type)

shape_file_url = message.subset.shape.process('href')
adapter_logger.info('Downloading request shape file')
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initially I included the path to the shape file, but this is somewhat meaningless as Harmony creates a temporary file, which obfuscates any original user naming convention (the file name is essentially a generated ID).

@owenlittlejohns
Copy link
Member Author

@lyonthefrog - I couldn't add you to the HOSS reviewers (you may need to tweak your NAMS request to include this repo). But I thought you would want to track this as someone also working on HOSS now.

@jgallagher59701 and @ndp-opendap - for your awareness. (I'm getting a little ahead of ticket process here, but wanted to start getting this change propagated out as a quick win to help reduce load on OPeNDAP)

Copy link
Member

@flamingbear flamingbear left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me. I was able to run the regression test locally without issue. I'll approve, but there is one comment to fix in the tests before you merge.

Comment on lines -162 to -167


def rgetattr(input_object, requested_attribute, *args):
""" This is a recursive version of the inbuilt `getattr` method, such that
it can be called to retrieve nested attributes. For example:
the Message.subset.shape within the input Harmony message.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, I saw this yesterday browsing the code.

@@ -92,10 +91,18 @@ def test_download_url(self, mock_util_download):
mock_util_download.side_effect = [self.harmony_500_error,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This subtest name is incorrect now.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. I updated that test name (and also the doc string for the overall test that mentioned retries would be tested)

@owenlittlejohns owenlittlejohns merged commit 3ba073f into main Dec 20, 2023
3 checks passed
@owenlittlejohns owenlittlejohns deleted the DAS-2034-remove-custom-retry-logic branch December 20, 2023 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants