openstudio-aws 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05896fabcda97abcb347532edcfc7a177c498815
|
4
|
+
data.tar.gz: 920f0bd7ebe65eaede3f224555a04b8a177ef8dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6cec51f927a1027f54fac563961a3df91286aa5c6490147187b091887594c9b27f144aa735b95ab72ad684a7d388a58e5c2715270da71ff7806b007c8e53e44b
|
7
|
+
data.tar.gz: ed92542a65387c426876960918dc7497600675aa5c9729ce1927e3262a6d5c52fa3f5861b4f2ae285744f861beeb3264883911eb96dccc1529f11c110b4896dd
|
data/lib/openstudio/aws/aws.rb
CHANGED
@@ -138,7 +138,7 @@ module OpenStudio
|
|
138
138
|
def create_workers(number_of_instances, options = {}, _user_id = 'unknown_user')
|
139
139
|
defaults = {
|
140
140
|
instance_type: 'm2.4xlarge',
|
141
|
-
security_group: 'openstudio-
|
141
|
+
security_group: 'openstudio-server-sg-v1',
|
142
142
|
image_id: @default_amis[:server],
|
143
143
|
user_id: 'unknown_user',
|
144
144
|
|
@@ -1,10 +1,11 @@
|
|
1
|
-
#!/bin/
|
2
|
-
|
3
|
-
# NOTE: This file is now the main script -- OpenStudio's version is now out of date
|
1
|
+
#!/bin/bash
|
4
2
|
|
5
3
|
# AWS Server Bootstrap File
|
6
4
|
# This script is used to configure the AWS boxes
|
7
5
|
|
6
|
+
# Unlock the user account
|
7
|
+
sudo passwd -u ubuntu
|
8
|
+
|
8
9
|
# Change Host File Entries
|
9
10
|
ENTRY="localhost localhost master"
|
10
11
|
FILE=/etc/hosts
|
@@ -14,9 +15,6 @@ else
|
|
14
15
|
sh -c "echo $ENTRY >> /etc/hosts"
|
15
16
|
fi
|
16
17
|
|
17
|
-
rm -rf /mnt
|
18
|
-
mkdir /mnt
|
19
|
-
|
20
18
|
# copy all the setup scripts to the appropriate home directory
|
21
19
|
# the scripts are called by the AWS connector for passwordless ssh config
|
22
20
|
cp /data/launch-instance/setup* /home/ubuntu/
|
@@ -27,17 +25,36 @@ chown ubuntu:ubuntu /home/ubuntu/setup*
|
|
27
25
|
service delayed_job stop
|
28
26
|
service apache2 stop
|
29
27
|
service mongodb stop
|
28
|
+
service mongod stop
|
30
29
|
|
31
30
|
# remove mongo db & add it back
|
32
31
|
mkdir -p /mnt/mongodb/data
|
33
32
|
chown mongodb:nogroup /mnt/mongodb/data
|
34
33
|
rm -rf /var/lib/mongodb
|
35
34
|
|
36
|
-
# restart mongo
|
35
|
+
# restart mongo - old images has mongodb as the service. New ones use mongod
|
37
36
|
service mongodb start
|
37
|
+
service mongod start
|
38
|
+
|
38
39
|
# delay the continuation because mongo is a forked process and when it initializes
|
39
40
|
# it has to create the preallocated journal files (takes ~ 90 seconds on a slower system)
|
40
|
-
|
41
|
+
# Wait until mongo logs that it's ready (or timeout after 120s)
|
42
|
+
COUNTER=0
|
43
|
+
MONGOLOG=/var/log/mongo/mongod.log
|
44
|
+
|
45
|
+
# Clear out the log first
|
46
|
+
cat /dev/null > $MONGOLOG
|
47
|
+
|
48
|
+
grep -q 'waiting for connections on port' $MONGOLOG
|
49
|
+
while [[ $? -ne 0 && $COUNTER -lt 120 ]] ; do
|
50
|
+
sleep 2
|
51
|
+
let COUNTER+=2
|
52
|
+
echo "Waiting for mongo to initialize... ($COUNTER seconds so far)"
|
53
|
+
grep -q 'waiting for connections on port' $MONGOLOG
|
54
|
+
done
|
55
|
+
|
56
|
+
# Now we know mongo is ready and can continue with other commands
|
57
|
+
echo "Mongo is ready. Moving on..."
|
41
58
|
|
42
59
|
# restart the rails application
|
43
60
|
service apache2 stop
|
@@ -81,10 +98,6 @@ service Rserve restart
|
|
81
98
|
# restart delayed jobs
|
82
99
|
service delayed_job start
|
83
100
|
|
84
|
-
# Delay 1 minutes to make sure everything had tme to start.
|
85
|
-
# This is a hack, sorry.
|
86
|
-
sleep 1m
|
87
|
-
|
88
101
|
#file flag the user_data has completed
|
89
102
|
cat /dev/null > /home/ubuntu/user_data_done
|
90
103
|
|
@@ -1,9 +1,11 @@
|
|
1
|
-
#!/bin/
|
2
|
-
# NOTE: This file is now the main script to configure AWS workers
|
1
|
+
#!/bin/bash
|
3
2
|
|
4
3
|
# AWS Worker Bootstrap File
|
5
4
|
# File used to configure worker nodes on AWS
|
6
5
|
|
6
|
+
# Unlock the user account
|
7
|
+
sudo passwd -u ubuntu
|
8
|
+
|
7
9
|
# Change Host File Entries
|
8
10
|
ENTRY="SERVER_IP SERVER_HOSTNAME SERVER_ALIAS"
|
9
11
|
FILE=/etc/hosts
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: openstudio-aws
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nicholas Long
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-10-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-scp
|