Skip to content
Snippets Groups Projects
Unverified Commit 9337963c authored by Michael Youngstrom's avatar Michael Youngstrom Committed by GitHub
Browse files

Merge pull request #18562 from edx/youngstrom/xdist-container-setup

Add prepare_xdist_nodes script and git ignore xdist txt files
parents 78fb0c13 28d0c4cb
Branches
Tags
No related merge requests found
......@@ -74,6 +74,7 @@ reports/
jscover.log
jscover.log.*
.pytest_cache/
pytest_container*.txt
.tddium*
common/test/data/test_unicode/static/
test_root/courses/
......
#!/bin/bash
set -e
python scripts/xdist/pytest_container_manager.py -a up -n ${XDIST_NUM_CONTAINERS} \
-t ${XDIST_CONTAINER_TASK_NAME} \
-s ${XDIST_CONTAINER_SUBNET} \
-sg ${XDIST_CONTAINER_SECURITY_GROUP}
ip_list=$(<pytest_container_ip_list.txt)
for ip in $ip_list
do
container_reqs_cmd="ssh ubuntu@$ip 'cd /edx/app/edxapp/edx-platform;
git pull -q; git checkout -q ${XDIST_GIT_BRANCH};
source /edx/app/edxapp/edxapp_env; pip install -qr requirements/edx/testing.txt' & "
cmd=$cmd$container_reqs_cmd
done
cmd=$cmd"wait"
echo "Executing commmand: $cmd"
eval $cmd
......@@ -18,7 +18,7 @@ class PytestContainerManager():
self.ecs = boto3.client('ecs', region)
self.cluster_name = cluster
def spin_up_containers(self, number_of_containers, task_name, subnets, security_groups, public_ip_enabled, launch_type):
def spin_up_containers(self, number_of_containers, task_name, subnets, security_groups, public_ip, launch_type):
"""
Spins up containers and generates two .txt files, one containing the IP
addresses of the new containers, the other containing their task_arns.
......@@ -51,7 +51,7 @@ class PytestContainerManager():
'awsvpcConfiguration': {
'subnets': subnets,
'securityGroups': security_groups,
'assignPublicIp': public_ip_enabled
'assignPublicIp': public_ip
}
},
taskDefinition=task_definition
......@@ -156,7 +156,7 @@ if __name__ == "__main__":
parser.add_argument('--security_groups', '-sg', nargs='+', default=None,
help="List of security groups to apply to the containers")
parser.add_argument('--public_ip_enabled', choices=['ENABLED', 'DISABLED'],
parser.add_argument('--public_ip', choices=['ENABLED', 'DISABLED'],
default='DISABLED', help="Whether the containers should have a public IP")
parser.add_argument('--launch_type', default='FARGATE', choices=['EC2', 'FARGATE'],
......@@ -178,7 +178,7 @@ if __name__ == "__main__":
args.task_name,
args.subnets,
args.security_groups,
args.public_ip_enabled,
args.public_ip,
args.launch_type
)
elif args.action == 'down':
......
......@@ -44,6 +44,11 @@ passenv =
SHARD
SKIP_NPM_INSTALL
TEST_SUITE
XDIST_CONTAINER_SECURITY_GROUP
XDIST_CONTAINER_SUBNET
XDIST_CONTAINER_TASK_NAME
XDIST_GIT_BRANCH
XDIST_NUM_CONTAINERS
deps =
django18: Django>=1.8,<1.9
django19: Django>=1.9,<1.10
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment