-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from danyoungday/remove-download-sdk
Moved SDK to S3 and changed download script to load it from the bucket
- Loading branch information
Showing
5 changed files
with
44 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
""" | ||
Setup script to load the En-ROADS SDK from the S3 bucket. This is used for app deployment and testing. | ||
Note: This script requires access to the private S3 bucket where the SDK is stored. The SDK is not currently available | ||
for general use. If you would like to run the full project, see the README in order to contact a member of Project | ||
Resilience. | ||
""" | ||
import os | ||
import zipfile | ||
|
||
import boto3 | ||
|
||
|
||
def main(): | ||
""" | ||
Downloads En-ROADS SDK from the S3 bucket and extracts it. | ||
If the sdk already exists, we do nothing. | ||
If we already have the zip file but no SDK, we just extract the zip file. | ||
""" | ||
sdk_name = "en-roads-sdk-v24.6.0-beta1" | ||
sdk_path = "enroadspy/" | ||
zip_path = sdk_path + "/" + sdk_name + ".zip" | ||
|
||
if os.path.exists(sdk_path + "/" + sdk_name): | ||
print("SDK already exists.") | ||
return | ||
|
||
if not os.path.exists(zip_path): | ||
s3 = boto3.client('s3') | ||
s3.download_file("ai-for-good", sdk_name + ".zip", zip_path) | ||
|
||
with zipfile.ZipFile(zip_path, "r") as zip_ref: | ||
zip_ref.extractall(sdk_path) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
boto3==1.35.60 | ||
dash==2.17.1 | ||
dash-bootstrap-components==1.6.0 | ||
dill==0.3.8 | ||
|