From 142ce3f7f8835c073579238923a3eacc2fece35b Mon Sep 17 00:00:00 2001 From: benjaminjones Date: Fri, 18 Mar 2022 12:28:13 -0400 Subject: [PATCH 1/2] setup of mock work gen --- mock_work_generator.py | 0 work_generator.md | 11 +++++++++++ 2 files changed, 11 insertions(+) create mode 100644 mock_work_generator.py create mode 100644 work_generator.md diff --git a/mock_work_generator.py b/mock_work_generator.py new file mode 100644 index 0000000..e69de29 diff --git a/work_generator.md b/work_generator.md new file mode 100644 index 0000000..6f19d92 --- /dev/null +++ b/work_generator.md @@ -0,0 +1,11 @@ +### Work Generator Experiment Tasks +Work generator should add a job type to all future jobs and future proof dockets documents and comments and the new job type called attachments + +## Data/Redis +* Redis stores stuff in memory but it remembers it by rwriting to a dumb.rdb +* If restart redis if it finds dump then it reloads to memory +* If we can somehow write to a redis database redis writes a dump.rdb manually put it in ~data/redis next time system starts +* It will load those values into memory and achieve goal + +# Program +* Write a program that will generate jobs and put it into a redis database From 48ac66fcaf17fb183ff8dc468bdeecb9e36163d8 Mon Sep 17 00:00:00 2001 From: maxwellschuman Date: Fri, 1 Apr 2022 13:56:39 -0400 Subject: [PATCH 2/2] most of what we need to upload attachents --- s3tutorial.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 s3tutorial.py diff --git a/s3tutorial.py b/s3tutorial.py new file mode 100644 index 0000000..ae66bb3 --- /dev/null +++ b/s3tutorial.py @@ -0,0 +1,33 @@ +from http import client +import os +import boto3 +import botocore.exceptions as ClientError + +access_key = '...' +access_secret = '...' +bucket_name = '...' + + +# Connect to S3 Server + +client_s3 = boto3.client( + 's3', + aws_access_key_id = access_key, + aws_secret_access_key = access_secret +) + +# Upload Files to S3 bucket + +for file in os.listdir(...): + if not file.startswith('~'): + try: + client_s3.upload_file( + + ) + + except ClientError as e: + print('Credential is incorrect') + print(e) + + except Exception as e: + print(e) \ No newline at end of file