from utils import timestring from boto import sqs, ec2, s3 from boto import Config import json from time import sleep, time import os # Assuming that the testing system has the AWS config already set. try: proc_name = "aws_ska_test_worker_" + timestring() region = "us-west-2" # Read in credentials config = Config() config.load_credential_file(os.path.join(os.path.expanduser("~"),".aws/credentials")) info = config.items("default")[2:] key = info[0][1] secret = info[1][1] # Create a test file and upload to S3 if not os.path.exists("tests/test.txt"): test_string = "ALLGLORYTOTHEHYPNOTOAD" with open("tests/test.txt", "w") as f: f.write(test_string) print("Uploading to S3") upload_to_s3(proc_name, "tests/test.txt", key_prefix="data/", aws_access={"aws_access_key_id": key,
from utils import timestring from boto import sqs, ec2, s3 from boto import Config import json from time import sleep, time import os # Assuming that the testing system has the AWS config already set. try: proc_name = "aws_ska_test_worker_" + timestring() region = "us-west-2" # Read in credentials config = Config() config.load_credential_file(os.path.expanduser("~/.aws/credentials")) info = config.items("default")[2:] key = info[0][1] secret = info[1][1] # Create a test file and upload to S3 if not os.path.exists("tests/test.txt"): test_string = "ALLGLORYTOTHEHYPNOTOAD" with open("tests/test.txt", "w") as f: f.write(test_string) print("Uploading to S3") upload_to_s3(proc_name, "tests/test.txt",
from aws_exec import run from utils import convert_param_format from boto import Config data_path = sys.argv[1] # Make a new output folder tstamp = datetime.now().strftime('%Y-%m-%d_%H-%M-%S') output_folder = os.path.join(data_path, "output_{}".format(tstamp)) print("Starting at: " + human_time()) try: config = Config() config.load_credential_file(os.path.join(os.path.expanduser("~"), ".aws/credentials")) info = config.items("default")[2:] key = info[0][1] secret = info[1][1] aws_params = {'key': key, 'secret': secret, 'region': 'us-west-2', 'image_id': 'ami-b7fc75d7', # use ami-cb6e75aa to pull scripts from e-koch's fork 'security_groups': 'launch-wizard-1', 'instance_type': 'm3.large'} params = convert_param_format("param.txt", to="dict") # Add in the user parameters. params["user_email"] = "*****@*****.**" params["user_name"] = "Dill Pickle"