Skip to content

Commit 1e96b85

Browse files
committed
Updated docs, added start_n_more
1 parent 953531c commit 1e96b85

File tree

4 files changed

+76
-36
lines changed

4 files changed

+76
-36
lines changed

aws/README.asc

Lines changed: 68 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
Swift cloud on Amazon Elastic Compute Cloud
22
-------------------------------------------
33

4-
54
Sign up online
65
^^^^^^^^^^^^^^
76

@@ -28,8 +27,7 @@ Secret access key example: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY +
2827
6. Click Download Credentials, and store the keys (a .csv file) in a secure location.
2928
3029
NOTE: Your secret key will no longer be available through the AWS Management Console;
31-
you will have the only copy. Keep it confidential in order to protect your account,
32-
and never email it.
30+
you will have the only copy. Keep it confidential in order to protect your account.
3331

3432
Setup local-machine
3533
^^^^^^^^^^^^^^^^^^^
@@ -41,36 +39,87 @@ git clone git@github.com:yadudoc/swift-on-cloud.git
4139
cd swift-on-cloud/aws
4240
-----
4341

44-
45-
* TODO
46-
4742
Manage you Cloud resources
4843
^^^^^^^^^^^^^^^^^^^^^^^^^^
4944

50-
* TODO
45+
Update the file swift-on-cloud/aws/configs in the cloned repository from the previous step,
46+
with the following information:
47+
* AWS_CREDENTIALS_FILE : Path to the credentials file downloaded in step 6 of _sign_up_online
48+
* AWS_WORKER_COUNT : Use this to specify the number of worker instances required.
49+
* AWS_KEYPAIR_NAME : Name of the keypair to use. If this keypair does not exist a keypair of the same name will be generated.
50+
* AWS_KEYPAIR_FILE : Path to the <keypair>.pem. If a keypair file of the specified name does not exist, a new one will be generated.
51+
* AWS_USERNAME : The username used for login to the cloud-instances. Set to the default "ec2-user" for Amazon Linux AMI.
52+
* AWS_REGION : Default=us-west-2 | Do NOT change
53+
* SECURITY_GROUP : Default=swift_security_group1
54+
* HEADNODE_IMAGE, WORKER_IMAGE : These are images used to boot up the headnode and workers.
55+
* HEADNODE_MACHINE_TYPE, WORKER_MACHINE_TYPE : VM types for workers and the headnode. Choose between :
56+
- t2.<micro/small/medium>, m3.<medium,large,xlarge,2xlarge> :For general purpose computing
57+
- c3.<,x,2x,4x,8x>large : Compute Optimised
58+
- g2.2xlarge : GPU Instances
59+
- r3.<,x,2x,4x,8x>large : Memory Optimised
60+
- i2.<x,2x,4x,8x>large, hs1.8xlarge : Storage Optimised
61+
62+
NOTE: Get details of instances and pricing http://aws.amazon.com/ec2/pricing[here]. The pricing varies
63+
between geographical locations so make sure you check for US West Oregon, which is the default.
64+
65+
NOTE: GCE_WORKER_COUNT directly affects the cost. If you require more than 22 nodes including the
66+
headnode, file a request to increase your resource quotas.
67+
68+
NOTE: Read more about AWS regions and availability zones http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html[here]
69+
70+
WARNING: Do *NOT* change the images for the worker and headnode to point at images which have not
71+
been explicitly setup with swift.
5172
5273
Start your cloud setup!
5374
^^^^^^^^^^^^^^^^^^^^^^^
5475
55-
* TODO
56-
57-
Run swift from your local machine
58-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
76+
Once you finish editing the configs file with your preferences, start the cloud instances
77+
by sourcing the setup script.
5978
60-
* TODO
79+
The setup script will setup firewall rules, copy over the required images and start a headnode
80+
and the requested number of worker instances.
6181
82+
[source, bash]
83+
-----
84+
# Must source the setup script.
85+
source setup.sh
86+
-----
6287
6388
Run the tutorial on the cloud
6489
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6590
66-
* TODO
91+
Once your cloud resources have been configured and setup, you can run the swift-cloud-tutorial
92+
directly from the cloud. The cloud resources created include a headnode, to which you would
93+
connect to, and the several nodes in worker roles which would do computations in parallel.
6794
95+
To run the tutorial, first connect to the headnode:
6896
69-
Miscellanious operations supported:
70-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7197
72-
* TODO
98+
[source, bash]
99+
-----
100+
# Connect to the Headnode
101+
connect headnode
102+
# This will have you logged in to the headnode on the cloud
103+
-----
104+
105+
106+
Run swift from your local machine
107+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
108+
109+
Now, once you've configured and started you cloud resources we can move on to trying the
110+
swift-cloud-tutorial. To run the cloud tutorial from your local machine :
73111
112+
[source,bash]
113+
-----
114+
cd swift-on-cloud/swift-cloud-tutorial
115+
source setup.sh
116+
-----
117+
118+
NOTE: You must source the setup.sh script.
119+
120+
121+
Miscellanious operations supported:
122+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
74123
75124
[source, bash]
76125
-----
@@ -118,4 +167,6 @@ start_n_more <Number of nodes>
118167
source setup.sh
119168
-----
120169
121-
Note: Creating an Image https://developers.google.com/compute/docs/images#creatingimage[Link]
170+
Note: To create your own customised images, you can connect to the swift instances (headnodes/workers) and
171+
modify them. Once done you can create your own images. Documentation on Amazon Machine Images is available
172+
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AMIs.html[here]

aws/aws.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ def start_worker(driver, configs, worker_names):
131131
# Setup userdata
132132
userdata = configurator.getstring("worker")
133133
userdata = userdata.replace("SET_HEADNODE_IP", headnode.public_ips[0])
134-
logging.info("Headnode connection url : ",headnode.public_ips[0])
135134
logging.debug("Worker userdata : %s", userdata)
136135

137136
list_nodes = []

aws/configs

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,22 @@
11
AWS_CREDENTIALS_FILE=~/.ssh/boto-test-credentials.csv
22

3-
#AWS_KEYPAIR_NAME=boto-test-pair
4-
#AWS_KEYPAIR_FILE=~/.ssh/boto-test-pair.pem
3+
# Set the number of worker nodes required
4+
AWS_WORKER_COUNT=5
55

66
# Update the following only if you want to use a specific keypair
77
AWS_KEYPAIR_NAME=swift-test-pair
88
AWS_KEYPAIR_FILE=~/.ssh/swift-test-pair.pem
99

10-
1110
#ec2-user is the default user on Amazon linux
12-
#AWS_USERNAME=ec2-user
11+
AWS_USERNAME=ec2-user
1312

1413
AWS_REGION=us-west-2
14+
SECURITY_GROUP=swift_security_group1
1515

1616
# Amazon linux x86_64 with Swift and JDK
1717
HEADNODE_IMAGE=ami-f1e896c1
18-
1918
HEADNODE_MACHINE_TYPE=t1.micro
2019

21-
AWS_WORKER_COUNT=5
22-
23-
SECURITY_GROUP=swift_security_group1
24-
20+
# Amazon linux x86_64 with Swift and JDK
21+
WORKER_IMAGE=ami-f1e896c1
2522
WORKER_MACHINE_TYPE=t1.micro
26-
# Ami for workers
27-
WORKER_IMAGE=ami-f1e896c1

aws/setup.sh

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,8 @@ start_n_more ()
6161
{
6262
ACTIVE=$(./aws.py list_resources | grep worker | wc -l)
6363
MORE=$1
64-
for i in $(seq $(($ACTIVE+1)) 1 $(($ACTIVE+$MORE)) )
65-
do
66-
echo "Starting worker $i"
67-
./aws.py start_worker swift-worker-$i &> $LOG &
68-
done
69-
wait
70-
./aws.py list_resources
64+
start_worker $(printf "swift-worker-%03d " $(seq $(($ACTIVE+1)) 1 $(($ACTIVE+$MORE)) ) )
65+
list_resources
7166
}
7267

7368
stop_headnode()

0 commit comments

Comments
 (0)