-
Notifications
You must be signed in to change notification settings - Fork 1
Conversation
netCDF4 1.6 and above are required to work on Apple Silicon Macs. While we're at it, run poetry update to update the rest of our dependencies.
We want to be able to distinguish between s3 and local files so have decide to use URI's to indicate which storage backend to use. The S3 implementation is just a stub at this point but the file:// handling should work.
Installing Poetry via pipx before installing Python 3.9 was resulting in Poetry using the default version of Python (in this 3.8) instead of the required Python 3.9. This was causing errors when using newer language features.
This reverts commit 43a0c46. Turns out, we need poetry installed in order to use the cache when setting up Python in later steps.
Otherwise, Poetry uses the default Python 3.8 environment on the runner.
Each step runs in its own process in GitHub Actions so environment changes are not preserved between steps. I may need to add this to the `poetry run ...` commands as well. I hope it's unnecessary. Apparently Poetry has some "well-known" issues with correctly detecting the desired Python version. See: * Poetry issue: python-poetry/poetry#655 * setup-python workaround: actions/setup-python#374 (comment)
It sounds like Poetry will grab the Python env from the cache. The cached python is incorrect so hopefully this will result in the correct Python version. See: actions/setup-python#374 (comment)
I ended up needing to use fsspec's simple cache to download the files to local disk as xarray doesn't support reading netcdf directly from object storage - only zarr formatted datasets.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks OK. If you want to merge this and swing back around for more tests, that seems reasonable. If this means we can actually run the demo from AWS instead of from a local copy, I’d love to do that.
# and a file that's not there. It raises a ValueError even for missing | ||
# files. We raise a FileNotFoundError to make debugging easier. | ||
if not bucket.exists(diag_file): | ||
print(f"No such file: '{str(diag_file)}'") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m pretty sure we have logging configured, so this would be better as
print(f"No such file: '{str(diag_file)}'") | |
current_app.logger.error(f"No such file: '{str(diag_file)}'") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, that's a great catch. Thanks! I'll go ahead and switch those to logging statements.
Resolve conlicts with the poetry.lock file
We want the app in a demo-able state so we'll work on testing the S3 functionality in a new PR as it will require some more involved test setup.
Thanks, Evan. I've gone ahead and updated the bare This should let us run the demo from AWS instead of a local version of the site. I've been chatting with the VLab folks to set up permission for the API pod to access our S3 bucket in AWS. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 👍🏻
Minimum allowed line rate is |
Add a protocol to the URIs in order to distinguish if the program should be looking on the local disk or on an S3 bucket for our data files.
Closes #80