Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
configuration
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
configuration
Commits
5fb78b90
Commit
5fb78b90
authored
Jan 30, 2014
by
Feanil Patel
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #726 from edx/feanil/mckinsey_abbey
Feanil/mckinsey abbey
parents
5c25ac72
26ed997e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
170 additions
and
52 deletions
+170
-52
cloudformation_templates/edx-reference-architecture.json
+157
-31
util/vpc-tools/abbey.py
+13
-21
No files found.
cloudformation_templates/edx-reference-architecture.json
View file @
5fb78b90
...
...
@@ -631,7 +631,7 @@
},
"Tags"
:[
{
"Key"
:
"
Application
"
,
"Key"
:
"
play
"
,
"Value"
:
"edxapp"
},
{
...
...
@@ -676,7 +676,7 @@
},
"Tags"
:[
{
"Key"
:
"
Application
"
,
"Key"
:
"
play
"
,
"Value"
:
"edxapp"
},
{
...
...
@@ -721,7 +721,7 @@
},
"Tags"
:[
{
"Key"
:
"
Application
"
,
"Key"
:
"
play
"
,
"Value"
:
"xqueue"
},
{
...
...
@@ -766,7 +766,7 @@
},
"Tags"
:[
{
"Key"
:
"
Application
"
,
"Key"
:
"
play
"
,
"Value"
:
"xqueue"
},
{
...
...
@@ -811,8 +811,8 @@
},
"Tags"
:[
{
"Key"
:
"
Application
"
,
"Value"
:
"
RabbitMQ
"
"Key"
:
"
play
"
,
"Value"
:
"
rabbitmq
"
},
{
"Key"
:
"Network"
,
...
...
@@ -856,8 +856,8 @@
},
"Tags"
:[
{
"Key"
:
"
Application
"
,
"Value"
:
"
RabbitMQ
"
"Key"
:
"
play
"
,
"Value"
:
"
rabbitmq
"
},
{
"Key"
:
"Network"
,
...
...
@@ -901,7 +901,7 @@
},
"Tags"
:[
{
"Key"
:
"
Application
"
,
"Key"
:
"
play
"
,
"Value"
:
"xserver"
},
{
...
...
@@ -946,7 +946,7 @@
},
"Tags"
:[
{
"Key"
:
"
Application
"
,
"Key"
:
"
play
"
,
"Value"
:
"xserver"
},
{
...
...
@@ -1119,7 +1119,7 @@
},
"Tags"
:[
{
"Key"
:
"
Application
"
,
"Key"
:
"
play
"
,
"Value"
:
"worker"
},
{
...
...
@@ -1164,7 +1164,7 @@
},
"Tags"
:[
{
"Key"
:
"
Application
"
,
"Key"
:
"
play
"
,
"Value"
:
"worker"
},
{
...
...
@@ -1210,7 +1210,7 @@
"Tags"
:[
{
"Key"
:
"Application"
,
"Value"
:
"
forum
"
"Value"
:
"
elasticsearch
"
},
{
"Key"
:
"Network"
,
...
...
@@ -1255,7 +1255,7 @@
"Tags"
:[
{
"Key"
:
"Application"
,
"Value"
:
"
forum
"
"Value"
:
"
elasticsearch
"
},
{
"Key"
:
"Network"
,
...
...
@@ -1299,7 +1299,7 @@
},
"Tags"
:[
{
"Key"
:
"
Application
"
,
"Key"
:
"
play
"
,
"Value"
:
"forum"
},
{
...
...
@@ -1344,7 +1344,7 @@
},
"Tags"
:[
{
"Key"
:
"
Application
"
,
"Key"
:
"
play
"
,
"Value"
:
"forum"
},
{
...
...
@@ -3262,6 +3262,24 @@
},
"CidrIp"
:
"0.0.0.0/0"
}
],
"Tags"
:[
{
"Key"
:
"play"
,
"Value"
:
"edxapp"
},
{
"Key"
:
"environment"
,
"Value"
:{
"Ref"
:
"EnvironmentTag"
}
},
{
"Key"
:
"deployment"
,
"Value"
:{
"Ref"
:
"DeploymentTag"
}
}
]
}
},
...
...
@@ -3597,6 +3615,24 @@
"ToPort"
:
{
"Ref"
:
"XqueueServerPort"
},
"CidrIp"
:
"0.0.0.0/0"
}
],
"Tags"
:[
{
"Key"
:
"play"
,
"Value"
:
"xqueue"
},
{
"Key"
:
"environment"
,
"Value"
:{
"Ref"
:
"EnvironmentTag"
}
},
{
"Key"
:
"deployment"
,
"Value"
:{
"Ref"
:
"DeploymentTag"
}
}
]
}
},
...
...
@@ -3925,32 +3961,32 @@
"FromPort"
:
"5672"
,
"ToPort"
:
"5672"
,
"SourceSecurityGroupId"
:
{
"Ref"
:
"RabbitMQELBSecurityGroup"
}
"Ref"
:
"RabbitMQELBSecurityGroup"
}
},
{
"IpProtocol"
:
"tcp"
,
"FromPort"
:
"6163"
,
"ToPort"
:
"6163"
,
"SourceSecurityGroupId"
:
{
"Ref"
:
"RabbitMQELBSecurityGroup"
}
"Ref"
:
"RabbitMQELBSecurityGroup"
}
},
{
"IpProtocol"
:
"tcp"
,
"FromPort"
:
"5672"
,
"ToPort"
:
"5672"
,
"SourceSecurityGroupId"
:
{
"Ref"
:
"XqueueServerSecurityGroup"
}
"Ref"
:
"XqueueServerSecurityGroup"
}
},
{
"IpProtocol"
:
"tcp"
,
"FromPort"
:
"6163"
,
"ToPort"
:
"6163"
,
"SourceSecurityGroupId"
:
{
"Ref"
:
"XqueueServerSecurityGroup"
}
"Ref"
:
"XqueueServerSecurityGroup"
}
},
{
"IpProtocol"
:
"tcp"
,
...
...
@@ -3963,8 +3999,26 @@
"FromPort"
:
"15672"
,
"ToPort"
:
"15672"
,
"SourceSecurityGroupId"
:
{
"Ref"
:
"BastionSecurityGroup"
}
"Ref"
:
"BastionSecurityGroup"
}
}
],
"Tags"
:[
{
"Key"
:
"play"
,
"Value"
:
"rabbitmq"
},
{
"Key"
:
"environment"
,
"Value"
:{
"Ref"
:
"EnvironmentTag"
}
},
{
"Key"
:
"deployment"
,
"Value"
:{
"Ref"
:
"DeploymentTag"
}
}
]
}
...
...
@@ -3985,7 +4039,7 @@
"XServer"
:{
"Type"
:
"AWS::AutoScaling::LaunchConfiguration"
,
"Properties"
:{
"IamInstanceProfile"
:{
"Ref"
:
"XServerInstanceProfile"
},
"IamInstanceProfile"
:{
"Ref"
:
"XServerInstanceProfile"
},
"SecurityGroups"
:[
{
"Ref"
:
"XServerSecurityGroup"
...
...
@@ -4290,8 +4344,26 @@
"FromPort"
:
"80"
,
"ToPort"
:
"80"
,
"SourceSecurityGroupId"
:
{
"Ref"
:
"XServerELBSecurityGroup"
}
"Ref"
:
"XServerELBSecurityGroup"
}
}
],
"Tags"
:[
{
"Key"
:
"play"
,
"Value"
:
"xserver"
},
{
"Key"
:
"environment"
,
"Value"
:{
"Ref"
:
"EnvironmentTag"
}
},
{
"Key"
:
"deployment"
,
"Value"
:{
"Ref"
:
"DeploymentTag"
}
}
]
}
...
...
@@ -4675,6 +4747,24 @@
"Ref"
:
"SSHLocation"
}
}
],
"Tags"
:[
{
"Key"
:
"play"
,
"Value"
:
"worker"
},
{
"Key"
:
"environment"
,
"Value"
:{
"Ref"
:
"EnvironmentTag"
}
},
{
"Key"
:
"deployment"
,
"Value"
:{
"Ref"
:
"DeploymentTag"
}
}
]
}
},
...
...
@@ -5263,8 +5353,26 @@
"FromPort"
:
{
"Ref"
:
"ForumServerPort"
},
"ToPort"
:
{
"Ref"
:
"ForumServerPort"
},
"SourceSecurityGroupId"
:
{
"Ref"
:
"ForumELBSecurityGroup"
}
"Ref"
:
"ForumELBSecurityGroup"
}
}
],
"Tags"
:[
{
"Key"
:
"play"
,
"Value"
:
"forum"
},
{
"Key"
:
"environment"
,
"Value"
:{
"Ref"
:
"EnvironmentTag"
}
},
{
"Key"
:
"deployment"
,
"Value"
:{
"Ref"
:
"DeploymentTag"
}
}
]
}
...
...
@@ -5609,6 +5717,24 @@
]
}
}
],
"Tags"
:[
{
"Key"
:
"play"
,
"Value"
:
"mongo"
},
{
"Key"
:
"environment"
,
"Value"
:{
"Ref"
:
"EnvironmentTag"
}
},
{
"Key"
:
"deployment"
,
"Value"
:{
"Ref"
:
"DeploymentTag"
}
}
]
}
},
...
...
util/vpc-tools/abbey.py
View file @
5fb78b90
...
...
@@ -172,8 +172,6 @@ def parse_args():
parser
.
add_argument
(
'-t'
,
'--instance-type'
,
required
=
False
,
default
=
"m1.large"
,
help
=
"instance type to launch"
)
parser
.
add_argument
(
"--security-group"
,
required
=
False
,
default
=
"abbey"
,
help
=
"Security group to use"
)
parser
.
add_argument
(
"--role-name"
,
required
=
False
,
default
=
"abbey"
,
help
=
"IAM role name to use (must exist)"
)
...
...
@@ -198,27 +196,22 @@ def parse_args():
return
parser
.
parse_args
()
def
get_instance_sec_group
(
vpc_id
,
security_group
):
def
get_instance_sec_group
(
vpc_id
):
security_group_id
=
None
grp_details
=
ec2
.
get_all_security_groups
(
filters
=
{
'vpc_id'
:
vpc_id
'vpc_id'
:
vpc_id
,
'tag:play'
:
args
.
play
}
)
for
grp
in
grp_details
:
if
grp
.
name
==
security_group
:
security_group_id
=
grp
.
id
break
if
not
security_group_id
:
print
"Unable to lookup id for security group {}"
.
format
(
security_group
)
sys
.
exit
(
1
)
if
len
(
grp_details
)
<
1
:
sys
.
stderr
.
write
(
"ERROR: Expected atleast one security group, got {}
\n
"
.
format
(
len
(
grp_details
)))
return
security_group_
id
return
grp_details
[
0
]
.
id
def
create_instance_args
():
...
...
@@ -233,16 +226,16 @@ def create_instance_args():
subnet
=
vpc
.
get_all_subnets
(
filters
=
{
'tag:aws:cloudformation:stack-name'
:
stack_name
,
'tag:
Application'
:
args
.
application
}
'tag:
play'
:
args
.
play
}
)
if
len
(
subnet
)
!=
1
:
sys
.
stderr
.
write
(
"ERROR: Expected
1 admin
subnet, got {}
\n
"
.
format
(
if
len
(
subnet
)
<
1
:
sys
.
stderr
.
write
(
"ERROR: Expected
at least one
subnet, got {}
\n
"
.
format
(
len
(
subnet
)))
sys
.
exit
(
1
)
subnet_id
=
subnet
[
0
]
.
id
vpc_id
=
subnet
[
0
]
.
vpc_id
security_group_id
=
get_instance_sec_group
(
vpc_id
,
args
.
security_group
)
security_group_id
=
get_instance_sec_group
(
vpc_id
)
if
args
.
identity
:
config_secure
=
'true'
...
...
@@ -271,7 +264,6 @@ git_repo="https://github.com/edx/$git_repo_name"
git_repo_secure="{configuration_secure_repo}"
git_repo_secure_name="{configuration_secure_repo_basename}"
secure_vars_file="$base_dir/$git_repo_secure_name/{secure_vars}"
common_vars_file="$base_dir/$git_repo_secure_name/ansible/vars/common/common.yml"
instance_id=
\\
$(curl http://169.254.169.254/latest/meta-data/instance-id 2>/dev/null)
instance_ip=
\\
...
...
@@ -345,8 +337,8 @@ sudo pip install -r requirements.txt
cd $playbook_dir
ansible-playbook -vvvv -c local -i "localhost," $play.yml -e@$extra_vars
-e@$common_vars_file
ansible-playbook -vvvv -c local -i "localhost," stop_all_edx_services.yml -e@$extra_vars
-e@$common_vars_file
ansible-playbook -vvvv -c local -i "localhost," $play.yml -e@$extra_vars
ansible-playbook -vvvv -c local -i "localhost," stop_all_edx_services.yml -e@$extra_vars
rm -rf $base_dir
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment