AWS executor: update changed protocol
@@ -26,7 +26,7 @@ sys.dont_write_bytecode = True # prevent creation of .pyc files
REQUEST_URL = {
"create": "{0}{1}/execution/create",
"upload": "{0}{1}/upload/{2}?file={3}",
- "launchBatch": "{0}{1}/execution/{2}/launchBatch?verifier={3}&verifierS3={4}&tasks={5}&tasksS3={6}&commands={7}",
+ "launchBatch": "{0}{1}/execution/{2}/launchBatch?verifier={3}&verifierS3={4}&tasks={5}&tasksS3={6}&commandsS3={7}",
"progressBatch": "{0}{1}/execution/{2}/progressBatch",
"results": "{0}{1}/execution/{2}/results",
"clean": "{0}{1}/clean",
@@ -142,6 +142,27 @@ def execute_benchmark(benchmark, output_handler):
)
_exitWhenRequestFailed(http_request)
+ # Upload commands
+ commands_file_name = "commands.json"
+ url = REQUEST_URL["upload"].format(
+ aws_endpoint, aws_token, requestId, commands_file_name
+ )
+ logging.debug("Sending http-request for uploading commands: \n%s", url)
+ http_request = requests.get(url)
+ _exitWhenRequestFailed(http_request)
+
+ msg = http_request.json()
+ commands_upload_url = msg["uploadUrl"]
+ commands_s3_key = msg["S3Key"]
+
+ payload = json.dumps(awsInput)
+ headers = {"Content-Type": "application/json"}
+ logging.info("Uploading the commands to AWS...")
+ http_request = requests.request(
+ "PUT", commands_upload_url, headers=headers, data=payload
+ )
+ _exitWhenRequestFailed(http_request)
+
# Launch
url = REQUEST_URL["launchBatch"].format(
aws_endpoint,
@@ -151,7 +172,7 @@ def execute_benchmark(benchmark, output_handler):
verifier_s3_key,
tasks_aws_public_url,
tasks_s3_key,
- json.dumps(awsInput),
+ commands_s3_key,
)
logging.debug("Sending http-request for launch: \n%s", url)
http_request = requests.get(url)
