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

Unable to download HDF5 file when invoking Tidy3D from AWS Lambda function #1094

Closed
rashidnhm opened this issue Aug 24, 2023 · 3 comments
Closed
Labels
Bug something isnt working

Comments

@rashidnhm
Copy link

Describe the bug
Tidy3D is unable to download HDF5 in intermediate location as directories in AWS Lambda function are read-only by default.

In previous versions of tidy3d, the HDF5 was downloaded directly to the to_file which the user could provide. See Here.

However, in v2.4.0rc2, this behavior is different. The HDF5 file is downloaded to an intermediate location before being copied over to the user provided to_file location. See Here

This causes an error when attempting to do this on an AWS Lambda function since Tidy3D does not have write access to the directory.

To Reproduce
Steps to reproduce the behavior:

  • Invoke tidy3d.web.simulation_task.get_simulation_json from any lambda function

Expected behavior
Since the intermediate file is required for decompression, the expected behaviour would be to allow the user to pass the location of the intermediate file as a function parameter, and having a default if the parameter is not set by the user.

The intermediate file location parameter can be provided by the user when invoking this function .. then propagated down by Tidy3d to the other required functions.

Screenshots
Can be provided if needed.

Additional context
Let me know if any further context is required.

@momchil-flex
Copy link
Collaborator

Thanks! We are on it!

@momchil-flex momchil-flex added the Bug something isnt working label Aug 24, 2023
@momchil-flex
Copy link
Collaborator

We are planning to use a tempfile, which we already do in other places of the code, including uploading a task - so it seems to work fine on lambda. I would just suggest that you make sure you have enough temp storage on lambda, by default it seems to be 512MB which should be enough (output data does not go through temp file, only simulation definition files do), but keep in mind to expand if needed.

#1099

@momchil-flex
Copy link
Collaborator

Fixed in #1100

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug something isnt working
Projects
None yet
Development

No branches or pull requests

2 participants