@@ -0,0 +1,2629 @@
+#!/usr/bin/env python%0A%0Aimport os%0Aimport boto3%0Afrom argparse import ArgumentParser%0Aimport csv%0Aimport sys%0A%0Asys.path.insert(0, '../')%0A%0A%0Adef uploadS3(bucket, data, public_access_key, secret_access_key):%0A    s3 = boto3.client('s3', aws_access_key_id=public_access_key, aws_secret_access_key=secret_access_key)%0A    s3.upload_file(data, bucket, data)%0A%0A%0Adef submitJob(bucket, data, public_access_key, secret_access_key, myJobName):%0A    batch = boto3.client('batch', aws_access_key_id=public_access_key, aws_secret_access_key=secret_access_key, region_name='us-east-1')%0A    myJobQueue = 'testqueue'%0A    myJobDefinition = 'testdefinition'%0A    myCommandOverride = %5Bbucket, data%5D%0A    myEnvironmentOverride = %5B%7B'name': 'AWS_ACCESS_KEY_ID', 'value': public_access_key%7D,%0A                             %7B'name': 'AWS_SECRET_ACCESS_KEY', 'value': secret_access_key%7D,%0A                             %7B'name': 'AWS_DEFAULT_REGION', 'value': 'us-east-1'%7D%5D%0A    response = batch.submit_job(jobName=myJobName, jobQueue=myJobQueue, jobDefinition=myJobDefinition,%0A                                containerOverrides=%7B'command': myCommandOverride, 'environment': myEnvironmentOverride%7D)%0A    return response%0A%0A%0Adef checkJobStatus(public_access_key, secret_access_key, jobId):%0A    batch = boto3.client('batch', aws_access_key_id=public_access_key, aws_secret_access_key=secret_access_key, region_name='us-east-1')%0A    return batch.describe_jobs(jobs=%5BjobId%5D)%5B'jobs'%5D%5B0%5D%5B'status'%5D%0A%0A%0Adef main():%0A    parser = ArgumentParser(description=%22This is a test%22)%0A    parser.add_argument('--bucket',%0A                        help='The S3 bucket with the input dataset formatted according to the BIDS standard.')%0A    parser.add_argument('--credentials', help='AWS formatted csv of credentials.')%0A    parser.add_argument('--data', help='The data file to upload to the specified S3 bucket')%0A    result = parser.parse_args()%0A%0A    bucket = str(result.bucket)%0A    credentials = str(result.credentials)%0A    data = str(result.data)%0A%0A    credfile = open(credentials, 'rb')%0A    reader = csv.reader(credfile)%0A    rowcounter = 0%0A    for row in reader:%0A        if rowcounter == 0:%0A            public_access_key = str(row%5B0%5D)%0A            secret_access_key = str(row%5B1%5D)%0A        rowcounter = rowcounter + 1%0A%0A    uploadS3(bucket, data, public_access_key, secret_access_key)%0A    response = submitJob(bucket, data, public_access_key, secret_access_key, %22testjob%22)%0A%0A    jobId = response%5B'jobId'%5D%0A    print(%22JobID = %22 + jobId)%0A    while (checkJobStatus(public_access_key, secret_access_key, jobId) != 'SUCCEEDED'):%0A        pass%0A    print(%22Job successful!%22)%0A%0A%0Aif __name__ == %22__main__%22:%0A    main()%0A

Create clviz_cloud.py