appscake 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/views/_ec2.erb ADDED
@@ -0,0 +1,129 @@
1
+ <form method="POST" id="iaas_ec2_form" action="iaas_ec2.do" enctype="multipart/form-data" class="well form-horizontal span12">
2
+ <legend>AppScale Deployment for IaaS (EC2)</legend>
3
+ <ul>
4
+ <li>
5
+ Before you can deploy AppScale on Amazon EC2, you must have a valid Amazon AWS
6
+ account. Your Amazon AWS/EC2 credentials (access key, secret key, primary key and
7
+ X509 certificate) need to be entered in this form. Therefore if you don't have an
8
+ AWS account yet, or if you don't have your AWS/EC2 credentials with you, please
9
+ head over to <a href="http://aws.amazon.com/">AWS homepage</a> and get the necessary
10
+ accounts and credentials set up.
11
+ </li>
12
+ <li style="color: red;">All fields on this form are required.</li>
13
+ </ul>
14
+ <hr/>
15
+ <div class="control-group">
16
+ <label class="control-label" for="min">Minimum Instances <span class="required">*</span></label>
17
+ <div class="controls">
18
+ <input name="min" id="min" type="text" value="1"/>
19
+ <span class="help-block">
20
+ Minimum number of EC2 instances that should be used for this AppScale
21
+ deployment.
22
+ </span>
23
+ </div>
24
+ </div>
25
+ <div class="control-group">
26
+ <label class="control-label" for="max">Maximum Instances <span class="required">*</span></label>
27
+ <div class="controls">
28
+ <input name="max" id="max" type="text" value="1"/>
29
+ <span class="help-block">
30
+ Maximum number of EC2 instances that should be used for this AppScale
31
+ deployment.
32
+ </span>
33
+ </div>
34
+ </div>
35
+ <div class="control-group">
36
+ <label class="control-label" for="ami">AMI ID <span class="required">*</span></label>
37
+ <div class="controls">
38
+ <input name="ami" id="ami" type="text" placeholder="Enter AMI ID"/>
39
+ <span class="help-block">
40
+ Identifier of the Amazon Machine Image (AMI) that should be used to
41
+ spawn the required cloud VMs.
42
+ </span>
43
+ </div>
44
+ </div>
45
+ <div class="control-group">
46
+ <label class="control-label" for="instance_type">Instance Type <span class="required">*</span></label>
47
+ <div class="controls">
48
+ <select name="instance_type">
49
+ <option value="m1.large">m1.large (Large)</option>
50
+ <option value="m1.xlarge">m1.xlarge (Extra Large)</option>
51
+ <option value="c1.xlarge">c1.xlarge (High CPU Extra Large)</option>
52
+ </select>
53
+ <span class="help-block">
54
+ Select an EC2 instance type that meets your computation resource
55
+ requirements. Click <a href="http://aws.amazon.com/ec2/instance-types/">
56
+ here</a> for resource and pricing information on each instance type.
57
+ </span>
58
+ </div>
59
+ </div>
60
+ <div class="control-group">
61
+ <label class="control-label" for="region">Region <span class="required">*</span></label>
62
+ <div class="controls">
63
+ <select name="region">
64
+ <option value="us-east-1">US East (Northern Virginia)</option>
65
+ <option value="us-west-1">US West (Oregon)</option>
66
+ <option value="us-west-2">US West (Northern California)</option>
67
+ </select>
68
+ <span class="help-block">
69
+ Select an EC2 availability region. All the EC2 VM instances used
70
+ for this AppScale deployment will be spawned within the selected
71
+ region.
72
+ </span>
73
+ </div>
74
+ </div>
75
+ <hr/>
76
+ <div class="control-group">
77
+ <label class="control-label" for="username">Amazon Username <span class="required">*</span></label>
78
+ <div class="controls">
79
+ <input name="username" id="username" type="text" placeholder="Enter Username"/>
80
+ <span class="help-block">
81
+ Specify your Amazon username. This is the username you generally
82
+ use to login to any Amazon or AWS related website.
83
+ </span>
84
+ </div>
85
+ </div>
86
+ <div class="control-group">
87
+ <label class="control-label" for="private_key">EC2 Private Key <span class="required">*</span></label>
88
+ <div class="controls">
89
+ <input name="private_key" id="private_key" type="file"/>
90
+ <span class="help-block">
91
+ Upload your EC2 private key in PEM format. If you don't have an EC2
92
+ private key, you can download one from your AWS Security Credentials page.
93
+ </span>
94
+ </div>
95
+ </div>
96
+ <div class="control-group">
97
+ <label class="control-label" for="cert">EC2 X509 Certificate <span class="required">*</span></label>
98
+ <div class="controls">
99
+ <input name="cert" id="cert" type="file"/>
100
+ <span class="help-block">
101
+ Upload your EC2 X509 certificate in PEM format. If you don't have an EC2
102
+ certificate, you can download one from your AWS Security Credentials page.
103
+ </span>
104
+ </div>
105
+ </div>
106
+ <div class="control-group">
107
+ <label class="control-label" for="access_key">EC2 Access Key <span class="required">*</span></label>
108
+ <div class="controls">
109
+ <input name="access_key" id="access_key" type="text" placeholder="Enter Access Key"/>
110
+ <span class="help-block">
111
+ Specify your EC2 access key. If you don't have an access key, you
112
+ may generate one at the AWS Security Credentials page.
113
+ </span>
114
+ </div>
115
+ </div>
116
+ <div class="control-group">
117
+ <label class="control-label" for="secret_key">EC2 Secret Key <span class="required">*</span></label>
118
+ <div class="controls">
119
+ <input name="secret_key" id="secret_key" type="password" placeholder="Enter Secret Key"/>
120
+ <span class="help-block">
121
+ Specify your EC2 secret key. If you don't have a secret key, you
122
+ may generate one at the AWS Security Credentials page.
123
+ </span>
124
+ </div>
125
+ </div>
126
+ <hr/>
127
+ <% @prefix = 'ec2' %>
128
+ <%= erb:_common %>
129
+ </form>
@@ -0,0 +1,34 @@
1
+ <form method="POST" action="virtual.do" class="well form-horizontal span12" id="virtual_form">
2
+ <legend>AppScale Deployment for Virtualized Cluster (Xen/KVM)</legend>
3
+ <ul>
4
+ <li>
5
+ All the machines/VMs you intend to use in this deployment must be already
6
+ up and running.
7
+ </li>
8
+ <li style="color: red;">All fields on this form are required.</li>
9
+ </ul>
10
+ <hr/>
11
+ <div class="control-group">
12
+ <label class="control-label" for="ips">Server Configuration (ips.yaml) <span class="required">*</span></label>
13
+ <div class="controls">
14
+ <textarea name="ips" id="ips" rows="10" cols="50" class="span6"></textarea>
15
+ <span class="help-block">
16
+ List of IP addresses and their corresponding roles in the standard YAML
17
+ format. Make sure that all critical roles are assigned to an IP address.
18
+ All the specified hosts should be already up and running.
19
+ </span>
20
+ </div>
21
+ </div>
22
+ <div class="control-group">
23
+ <label class="control-label" for="root_password">Root Password <span class="required">*</span></label>
24
+ <div class="controls">
25
+ <input name="root_password" id="root_password" type="password" placeholder="Confirm Password"/>
26
+ <span class="help-block">
27
+ Unix/Linux root passwords for the machines/VMs. The same root password
28
+ should work on all the machines/VMs specified in ips.yaml.
29
+ </span>
30
+ </div>
31
+ </div>
32
+ <% @prefix = 'virtual' %>
33
+ <%= erb:_common %>
34
+ </form>
data/views/error.erb ADDED
@@ -0,0 +1,29 @@
1
+ <html>
2
+ <head>
3
+ <title>AppsCake - Error</title>
4
+ <link href="css/bootstrap.min.css" rel="stylesheet">
5
+ </head>
6
+ <body>
7
+ <script src="js/bootstrap.min.js"></script>
8
+ <div class="container">
9
+ <div class="page-header">
10
+ <h1>AppsCake <small>Makes deploying AppScale a piece of cake!</small></h1>
11
+ </div>
12
+ <div class="row">
13
+ <div id="content" class="span12 well">
14
+ <h3>AppsCake Error!</h3>
15
+ <p>
16
+ AppsCake has detected an error with your request. Please check the
17
+ error details below, go back and re-submit the form with the correct
18
+ information.
19
+ </p>
20
+ <ul>
21
+ <li><strong>Error Message:</strong> <%= @title %></li>
22
+ <li><strong>Details:</strong> <%= @error %></li>
23
+ </ul>
24
+ <button class="btn btn-primary" onclick="javascript: history.go(-1)">Go Back</button>
25
+ </div>
26
+ </div>
27
+ </div>
28
+ </body>
29
+ </html>
data/views/index.erb ADDED
@@ -0,0 +1,56 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>AppsCake - The AppScale Bootstrapper</title>
5
+ <link href="css/bootstrap.min.css" rel="stylesheet">
6
+ </head>
7
+ <body>
8
+ <script src="js/bootstrap.min.js"></script>
9
+ <script src="js/jquery-1.7.1.min.js"></script>
10
+ <script src="js/jquery.validate.min.js"></script>
11
+ <script src="js/appscake_validator.js"></script>
12
+ <script>
13
+ function showForm(selector) {
14
+ document.getElementById('virtual').setAttribute('style', 'display:none')
15
+ document.getElementById('iaas_ec2').setAttribute('style', 'display:none')
16
+
17
+ var selected = document.getElementById(selector.value);
18
+ selected.setAttribute('style', '');
19
+ }
20
+ </script>
21
+ <div class="container">
22
+ <div class="page-header">
23
+ <h1>AppsCake <small>Makes deploying AppScale a piece of cake!</small></h1>
24
+ </div>
25
+ <div class="row">
26
+ <div id="content" class="span12">
27
+ <form class="well span12">
28
+ <legend>Select Deployment Environment</legend>
29
+ <select onchange="showForm(this)" id="infra.selector">
30
+ <option value="virtual">Virtualized Cluster (Xen/KVM)</option>
31
+ <option value="iaas_ec2">IaaS (EC2)</option>
32
+ </select>
33
+ <span class="help-block">
34
+ Choose the cloud infrastructure setup on which you wish to
35
+ deploy AppScale.
36
+ </span>
37
+ </form>
38
+ <div id="virtual">
39
+ <td>
40
+ <%= erb :_virtual %>
41
+ </td>
42
+ </div>
43
+ <div id="iaas_ec2">
44
+ <td>
45
+ <%= erb :_ec2 %>
46
+ </td>
47
+ </div>
48
+ </div>
49
+ </div>
50
+ </div>
51
+ <script>
52
+ var selector = document.getElementById('infra.selector');
53
+ showForm(selector);
54
+ </script>
55
+ </body>
56
+ </html>
data/views/success.erb ADDED
@@ -0,0 +1,24 @@
1
+ <html>
2
+ <head>
3
+ <title>AppsCake - Launch Successful</title>
4
+ <link href="css/bootstrap.min.css" rel="stylesheet">
5
+ </head>
6
+ <body>
7
+ <script src="js/bootstrap.min.js"></script>
8
+ <div class="container">
9
+ <div class="page-header">
10
+ <h1>AppsCake <small>Makes deploying AppScale a piece of cake!</small></h1>
11
+ </div>
12
+ <div class="row">
13
+ <div id="content" class="span12 well">
14
+ <h3>Your AppScale Cloud is Being Deployed</h3>
15
+ <p>Your deployment timestamp: <%= @timestamp %></p>
16
+ <p>Your deployment process ID: <%= @pid %></p>
17
+ <p>You can check the progress of the deployment at <a href="view_logs?ts=<%= @timestamp %>">cloud deployment log</a></p>
18
+ <%= @html %>
19
+ <button class="btn btn-primary" onclick="javascript: document.location.href='/'">Back to Home</button>
20
+ </div>
21
+ </div>
22
+ </div>
23
+ </body>
24
+ </html>
@@ -0,0 +1,166 @@
1
+ <html>
2
+ <head>
3
+ <title>AppsCake - Cloud Deployment Log</title>
4
+ <link href="css/bootstrap.min.css" rel="stylesheet">
5
+ </head>
6
+ <body>
7
+ <script src="js/bootstrap.min.js"></script>
8
+ <script>
9
+ /*
10
+ * Auto refresh this page
11
+ * (Free script taken with thanks from javascriptkit.com)
12
+ */
13
+ var limit="0:30"
14
+
15
+ if (document.images){
16
+ var parselimit=limit.split(":")
17
+ parselimit = parselimit[0] * 60 + parselimit[1] * 1
18
+ }
19
+ function beginrefresh(){
20
+ if (!document.images)
21
+ return
22
+ if (parselimit==1)
23
+ window.location.reload()
24
+ else{
25
+ parselimit-=1
26
+ curmin=Math.floor(parselimit/60)
27
+ cursec=parselimit%60
28
+ if (curmin!=0)
29
+ curtime = curmin + " minutes and " + cursec + " seconds left until page refresh!"
30
+ else
31
+ curtime = "Refreshing this page in " + cursec + " seconds"
32
+ document.getElementById("next_refresh").textContent = curtime
33
+ window.status=curtime
34
+ setTimeout("beginrefresh()",1000)
35
+ }
36
+ }
37
+ </script>
38
+ <%
39
+ file_name = File.join(File.expand_path(File.dirname(__FILE__)), "..",
40
+ "logs", "deploy-" + @timestamp + ".log")
41
+ content_loaded = false
42
+ if File.exists?(file_name)
43
+ file = File.new(file_name, "r")
44
+ content = ""
45
+ while (line = file.gets)
46
+ content += line
47
+ end
48
+ file.close
49
+ content_loaded = true
50
+ else
51
+ content = "Unable to locate deployment log with timestamp: " + @timestamp
52
+ end
53
+
54
+ step1 = content.include?("Generating public/private rsa key pair.") ? "Done" : "Pending"
55
+ step2 = content.include?("Executing ssh-copy-id") ? "Done" : "Pending"
56
+ if step1 == "Pending" and step2 == "Done"
57
+ step1 = "Skipped"
58
+ end
59
+ step3 = content.include?("Head node successfully created") ? "Done" : "Pending"
60
+ if step3 == "Done"
61
+ if step1 == "Pending"
62
+ step1 = "Skipped"
63
+ end
64
+ if step2 == "Pending"
65
+ step2 = "Skipped"
66
+ end
67
+ end
68
+ step4 = content.include?("AppController just started") ? "Done" : "Pending"
69
+ step5 = content.include?("Your user account has been created successfully.") ? "Done" : "Pending"
70
+ step6 = content.include?("Please wait for your app to start up") ? "Done" : "Pending"
71
+ step7 = content.include?("The status of your AppScale instance is at the following URL") ? "Done" : "Pending"
72
+ if step7 == "Done" and step6 == "Pending"
73
+ step6 = "Skipped"
74
+ end
75
+
76
+ status = "In Progress"
77
+ if step7 == "Done"
78
+ status = "Finished"
79
+ elsif content.include?("__ERROR__")
80
+ status = "Failed"
81
+ elsif !content_loaded
82
+ status = "Invalid Request (Unable to Locate the Specified Log)"
83
+ step1 = step2 = step3 = step4 = step5 = step6 = step7 = "?"
84
+ end
85
+
86
+ progress = "0%"
87
+ if step7 == "Done"
88
+ progress = "100%"
89
+ elsif step6 == "Done"
90
+ progress = "90%"
91
+ elsif step5 == "Done"
92
+ progress = "70%"
93
+ elsif step4 == "Done"
94
+ progress = "40%"
95
+ elsif step3 == "Done"
96
+ progress = "30%"
97
+ elsif step2 == "Done"
98
+ progress = "20%"
99
+ elsif step1 == "Done"
100
+ progress = "10%"
101
+ end
102
+ %>
103
+ <%
104
+ if status != "Failed" and !status.include?("Invalid Request")
105
+ %>
106
+ <script type="text/javascript">window.onload=beginrefresh</script>
107
+ <%
108
+ end
109
+ %>
110
+ <div class="container">
111
+ <div class="page-header">
112
+ <h1>AppsCake <small>Makes deploying AppScale a piece of cake!</small></h1>
113
+ </div>
114
+ <div class="span10 well">
115
+ <h3>Status: <%= status %></h3>
116
+ <p><small id="next_refresh"></small></p>
117
+ <div class="progress progress-striped">
118
+ <div class="bar" style="width: <%= progress %>;"></div>
119
+ </div>
120
+ <button class="btn btn-primary" onclick="javascript: window.location.reload()">Refresh</button>
121
+ <button class="btn btn-primary" onclick="javascript: window.location.href='/'">Home</button>
122
+ </div>
123
+ <div class="span10 well">
124
+ <h3>Deployment Stages</h3>
125
+ <table class="table table-striped">
126
+ <tr id="step1">
127
+ <td>Generate cryptographic keys (Xen/KVM Only)</td>
128
+ <td><%=step1%></td>
129
+ </tr>
130
+ <tr id="step2">
131
+ <td>Distribute keys among the nodes (Xen/KVM Only)</td>
132
+ <td><%=step2%></td>
133
+ </tr>
134
+ <tr id="step3">
135
+ <td>Start the head node</td>
136
+ <td><%=step3%></td>
137
+ </tr>
138
+ <tr id="step4">
139
+ <td>Start AppController on head node</td>
140
+ <td><%=step4%></td>
141
+ </tr>
142
+ <tr id="step5">
143
+ <td>Create AppScale administrator account</td>
144
+ <td><%=step5%></td>
145
+ </tr>
146
+ <tr id="step6">
147
+ <td>Deploy target application</td>
148
+ <td><%=step6%></td>
149
+ </tr>
150
+ <tr id="step7">
151
+ <td>Finalize deployment</td>
152
+ <td><%=step7%></td>
153
+ </tr>
154
+ </table>
155
+ </div>
156
+ <div id="content" class="span10 well">
157
+ <h3>Cloud Deployment Log - <%= @timestamp %></h3>
158
+ <textarea rows="15" class="span10" id="log_text" readonly><%= content %></textarea>
159
+ </div>
160
+ </div>
161
+ <script type="text/javascript">
162
+ var textarea = document.getElementById('log_text');
163
+ textarea.scrollTop = textarea.scrollHeight;
164
+ </script>
165
+ </body>
166
+ </html>
metadata CHANGED
@@ -1,21 +1,21 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appscake
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 27
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 1
10
- version: 0.0.1
9
+ - 2
10
+ version: 0.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Hiranya Jayathilaka
14
- autorequire:
14
+ autorequire: appscake_utils
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-09-25 00:00:00 Z
18
+ date: 2012-09-28 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: net-ssh
@@ -42,7 +42,39 @@ extensions: []
42
42
  extra_rdoc_files: []
43
43
 
44
44
  files:
45
+ - README.txt
46
+ - LICENSE.txt
47
+ - Rakefile
48
+ - lib/appscake_utils.rb
45
49
  - bin/appscake
50
+ - certificates/cert-appscake.pem
51
+ - certificates/pk-appscake.pem
52
+ - views/error.erb
53
+ - views/_common.erb
54
+ - views/_virtual.erb
55
+ - views/index.erb
56
+ - views/success.erb
57
+ - views/_ec2.erb
58
+ - views/view_log.erb
59
+ - public/bootstrap/js/bootstrap.js
60
+ - public/bootstrap/js/bootstrap.min.js
61
+ - public/bootstrap/img/glyphicons-halflings-white.png
62
+ - public/bootstrap/img/glyphicons-halflings.png
63
+ - public/bootstrap/css/bootstrap-responsive.css
64
+ - public/bootstrap/css/bootstrap.min.css
65
+ - public/bootstrap/css/bootstrap.css
66
+ - public/bootstrap/css/bootstrap-responsive.min.css
67
+ - public/js/jquery.validate.min.js
68
+ - public/js/jquery-1.7.1.min.js
69
+ - public/js/bootstrap.js
70
+ - public/js/appscake_validator.js
71
+ - public/js/bootstrap.min.js
72
+ - public/img/glyphicons-halflings-white.png
73
+ - public/img/glyphicons-halflings.png
74
+ - public/css/bootstrap-responsive.css
75
+ - public/css/bootstrap.min.css
76
+ - public/css/bootstrap.css
77
+ - public/css/bootstrap-responsive.min.css
46
78
  homepage: http://appscale.cs.ucsb.edu
47
79
  licenses: []
48
80