This is a minimal library for handling EC2 instances and uploading and downloading files to S3.
pip3 install waws
After the installation you need to configure:
waws --configure
import waws
s3 = waws.BucketManager()
# Upload files
s3.upload_file(
file_name="test.txt",
local_path="some/local/path",
remote_path="SOME/S3/PATH",
bucket_name="some_bucket_name"
)
# Download files
s3.download_file(
file_name="test.txt",
local_path="some/local/path",
remote_path="SOME/S3/PATH",
bucket_name="some_bucket_name"
)
import waws
inst = waws.InstanceManager()
inst.upload_to_EC2(folder_file_name="CODE_FOLDER", local_path="./training", optionalRemotePath="EXPERIMENT2", instance="sunshine-1")
inst.download_from_EC2(folder_file_name="CODE_FOLDER", local_path="./training", optional_remote_path="EXPERIMENT2", instance="sunshine-1")
waws --help
# Todo with S3
waws --uploadS3 -b wluper-retrograph -f FILE -l LOCALPATH
waws --downloadS3 -b wluper-retrograph -f FILE -l LOCALPATH
#Todo with EC2
waws --start -i sunshine-1
waws --connect -i sunshine-1
waws --list
waws --listS3
waws --docker_uploadEC2 -i sunshine-1 -f FOLDER -l LOCALPATH
waws --docker_downloadEC2 -i sunshine-1 -f FOLDER -l LOCALPATH
waws --docker_attach
waws -i INSTANCE_NAME -f FILE_NAME -l LOCAL_PATH -r REMOTE_PATH -b BUCKET_NAME