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

Update harmony-service lib and update docker platform to amd64 #33

Merged
merged 11 commits into from
Oct 16, 2024

Conversation

flamingbear
Copy link
Member

@flamingbear flamingbear commented Oct 6, 2024

Description

Updates the docker image platform to run on amd64

also bumps lib versions of pillow and rasterio hoping to fix DAS-2259 (spoiler alert, it did not)

Updates Harmony-service-lib to version 2

Jira Issue ID

N/A

Local Test Steps

check out the branch, build and run the tests.

❯ ./bin/build-image && ./bin/build-test && ./bin/run-test

bonus points for running regressions locally in Harmony-In-A-Box

PR Acceptance Checklist

  • [N/A] Jira ticket acceptance criteria met.
  • CHANGELOG.md updated to include high level summary of PR changes.
  • docker/service_version.txt updated if publishing a release.
  • [N/A] Tests added/updated and passing.
  • [N/A] Documentation updated (if needed).

@@ -7,6 +7,7 @@
# 2022-01-03: Updated Dockerfile path and added comments for tags.
# 2023-04-04: Updated for the Harmony Browse Image Generator (HyBIG).
# 2024-01-22: Updated image name to: ghcr.io/nasa/harmony-browse-image-generator.
# 2024-10-06: Updated to support amd64.
Copy link
Member Author

Choose a reason for hiding this comment

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

are these actually valuable or just something we keep doing?

Copy link
Member

Choose a reason for hiding this comment

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

That's a good question. I was wondering something similar when I was updating the HGA build-image script. Basically, we're just recreating the commit history in the shell script, so probably they are not uniquely valuable.

Perhaps the one minor value is where the script was originally copied from. But that said, we're trying to standardise, so that shouldn't really matter.

I'm entirely ambivalent beyond saying if we have these comments, they should be complete, or we should not have them. It would be a bit frustrating to have a log of changes to the file and then subsequent changes not captured in them.

Copy link
Member Author

Choose a reason for hiding this comment

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

Agree. I'll pull them next time I visit (if I remember)

@flamingbear
Copy link
Member Author

flamingbear commented Oct 8, 2024

I was able to run this against hiab locally (even if it was a bit of a slog) [before I updated harmony_service_lib though, I'm trying to do that now, but it should be fine]

@flamingbear flamingbear marked this pull request as ready for review October 8, 2024 16:30
Copy link
Collaborator

@lyonthefrog lyonthefrog left a comment

Choose a reason for hiding this comment

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

Update: Regression tests succeeded locally.

Ran the test successfully on my Intel machine and added a couple questions. I'm currently debugging issues with my local Harmony-in-a-Box so I wasn't able to run the regression tests.
image
Of course Owen still needs to verify that it works on his ARM64 laptop too, but I can approve from my end.

@@ -57,7 +57,7 @@
"metadata": {},
"outputs": [],
"source": [
"from harmony import Collection, Environment, Client, Request\n",
"from harmony_service_lib import Collection, Environment, Client, Request\n",
Copy link
Collaborator

Choose a reason for hiding this comment

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

So happy we can do this now. Do we need a ticket to update this for all of our regression notebooks, or just sneak it in as we go along?

Copy link
Member Author

Choose a reason for hiding this comment

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

You could write a ticket, but I'm just dropping it in where I can because those tickets will never get prioritized and if you want to wait until IP sprint I suppose you could.

Copy link
Collaborator

Choose a reason for hiding this comment

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

The elusive IP sprint. I'll just update when it comes up. If I update the granule used in the Trajectory Subsetter regression test, then that'll be a good time.

Copy link
Member

Choose a reason for hiding this comment

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

Just spotting this thread as I opened up the PR - don't the regression test notebooks use the harmony-py library, rather than the harmony-service-lib-py? (If so, that confirms just how much of a good change this renaming is!)

Copy link
Member Author

Choose a reason for hiding this comment

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

Well I wouldn't know, but that makes sense they would use harmony-py. This has confused me for the entire time I've been on this project.

.pre-commit-config.yaml Show resolved Hide resolved
I updated all the libs as part of the DAS-2259 ticket, but didn't test it..Oops
This reverts commit 7b9690a.
@flamingbear flamingbear added hacktoberfest-accepted good first issue Good for newcomers and removed good first issue Good for newcomers labels Oct 15, 2024
@flamingbear flamingbear changed the title Update lib version and update docker platform to amd64 Update harmony-service lib and update docker platform to amd64 Oct 15, 2024
Copy link
Member

@owenlittlejohns owenlittlejohns left a comment

Choose a reason for hiding this comment

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

I was able to build the image locally and the unit tests all passed. I tried running the HyBIG regression tests against my local image, and I'm seeing some interesting issues:

"2024-10-15 23:09:29,180 [ERROR] [harmony-service._download:258] Retrying failed download https://harmony.uat.earthdata.nasa.gov/service-results/harmony-uat-eedtest-data/C1256584478-EEDTEST/ASTGTMV003_N00E022_dem.tif?A-api-request-uuid=f63205c0-aa9c-43ec-beb5-2ecb18d9ed95\r\nTraceback (most recent call last):\r\n  File \"/usr/local/lib/python3.11/site-packages/harmony_service_lib/http.py\", line 231, in _download\r\n    raise Exception(f'Unable to download due to status code: {response.status_code} \\\r\nException: Unable to download due to status code: 400                         and content b''\r\n",

I'm not sure why Harmony is unable to download data from that S3 bucket (in it's own AWS account!). I don't think it's a problem with this PR, but maybe one of the @nasa/harmony-admins folks has an idea?

The only change I'm requesting in this review, though, is the reversion of the import change for harmony-py in the Jupyter notebook. Otherwise, this looks great.

@@ -7,6 +7,7 @@
# 2022-01-03: Updated Dockerfile path and added comments for tags.
# 2023-04-04: Updated for the Harmony Browse Image Generator (HyBIG).
# 2024-01-22: Updated image name to: ghcr.io/nasa/harmony-browse-image-generator.
# 2024-10-06: Updated to support amd64.
Copy link
Member

Choose a reason for hiding this comment

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

That's a good question. I was wondering something similar when I was updating the HGA build-image script. Basically, we're just recreating the commit history in the shell script, so probably they are not uniquely valuable.

Perhaps the one minor value is where the script was originally copied from. But that said, we're trying to standardise, so that shouldn't really matter.

I'm entirely ambivalent beyond saying if we have these comments, they should be complete, or we should not have them. It would be a bit frustrating to have a log of changes to the file and then subsequent changes not captured in them.

"# creates an output directory for the downloaded files\n",
"from pathlib import Path\n",
"\n",
"from harmony_service_lib import Client, Collection, Environment, Request\n",
Copy link
Member

Choose a reason for hiding this comment

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

Isn't this harmony-py? I think this one should stay as from harmony import ....

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not even joking how I can't keep them straight. ✅ afc0d89

Copy link
Collaborator

Choose a reason for hiding this comment

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

How did the tests pass then when we ran it? I totally see that Client/Collection/etc are in harmony-py, but how were these classes successfully imported?

Comment on lines +15 to +17
from harmony_service_lib import BaseHarmonyAdapter
from harmony_service_lib.message import Source as HarmonySource
from harmony_service_lib.message_utility import (
Copy link
Member

Choose a reason for hiding this comment

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

This makes me happy! I'm so grateful Danny pushed this change through.

@owenlittlejohns
Copy link
Member

I tried the failed download URL from above in my browser:

https://harmony.uat.earthdata.nasa.gov/service-results/harmony-uat-eedtest-data/C1256584478-EEDTEST/ASTGTMV003_N00E022_dem.tif

That also failed. Not sure if there's something quirky going on with my machine. 🤷

@flamingbear
Copy link
Member Author

@owenlittlejohns Made the changes requested, hopefully tomorrow whatever problem with cloudfront is resolved will let you verify

@owenlittlejohns
Copy link
Member

Okay - I reran the regression tests notebook and things worked for me there today. Not sure what fun was happening with CloudFront, but thank you to whoever/whatever fixed that. I think we're good to merge.

@flamingbear flamingbear merged commit 117b878 into main Oct 16, 2024
6 checks passed
@flamingbear flamingbear deleted the mhs/update-libs branch October 16, 2024 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants