Skip to content
This repository has been archived by the owner on Oct 24, 2020. It is now read-only.

Commit

Permalink
feat: setup environment data from the test plan
Browse files Browse the repository at this point in the history
Environment data from a test plan is passed into the container as
loads-broker passed it.

Closes #25
  • Loading branch information
bbangert committed Mar 16, 2017
1 parent 047a7fa commit 7e2ad2d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
Empty file added CHANGELOG.md
Empty file.
13 changes: 7 additions & 6 deletions ardere/aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,12 @@ def create_service(self, step):
"additional_command_args"]
shell_command3 = ['sh', '-c', '{}'.format(shell_command2)]

# Prep the env vars
env_vars = [{"name": "WAITFORCLUSTER", "value": shell_script}]
for env_var in step.get("environment_data", []):
name, value = env_var.split("=", 1)
env_vars.append({"name": name, "value": value})

# ECS wants a family name for task definitions, no spaces, 255 chars
family_name = step["name"] + "-" + self._plan_uuid
task_response = self._ecs_client.register_task_definition(
Expand All @@ -153,12 +159,7 @@ def create_service(self, step):
"cpu": step["cpu_units"],
# using only memoryReservation sets no hard limit
"memoryReservation": 256,
"environment": [
{
"name": "WAITFORCLUSTER",
"value": shell_script
}
],
"environment": env_vars,
"entryPoint": shell_command3
}
],
Expand Down
3 changes: 3 additions & 0 deletions tests/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
"instance_type": "t2.medium",
"run_max_time": 140,
"cpu_units": 2048,
"environment_data": [
"SOME_VAR=great-value"
],
"container_name": "bbangert/ap-loadtester:latest",
"additional_command_args": "./apenv/bin/aplt_testplan wss://autopush.stage.mozaws.net 'aplt.scenarios:notification_forever,1000,1,0'"
}
Expand Down

0 comments on commit 7e2ad2d

Please sign in to comment.