66Installation
77============
88
9- .. commented-out
10- A typical Deis deployment consists of a Deis `Controller`_ in charge of:
11-
12- * Processing :ref:`Client API <client>` calls
13- * Managing Chef :ref:`Nodes <node>`
14- * Managing Docker :ref:`Containers <container>`
15-
16-
179Follow the steps below to install your own Deis platform on EC2. To complete the
1810installation process, you will need `Git `_, `RubyGems `_, `Pip `_, the `Amazon EC2 API Tools `_,
1911`EC2 Credentials `_, and a Chef Server with a working `Knife `_ client.
@@ -25,8 +17,12 @@ installation process, you will need `Git`_, `RubyGems`_, `Pip`_, the `Amazon EC2
2517
2618.. code-block :: console
2719
28- $ git clone https://github.com/opdemand/deis.git
29- $ cd deis
20+ $ git clone https://github.com/opdemand/deis.git
21+ $ cd deis
22+
23+ Cloning the default master branch will provide you with the latest development version
24+ of Deis. If you want to deploy the latest stable release, make sure you checkout the
25+ most recent tag using ``git checkout vX.Y.Z ``.
3026
31272. Configure the Chef Server
3228----------------------------
@@ -37,9 +33,9 @@ Ruby dependencies.
3733
3834.. code-block :: console
3935
40- $ bundle install # install ruby dependencies
41- $ berks install # install cookbooks into your local berkshelf
42- $ berks upload # upload cookbooks to the chef server
36+ $ bundle install # install ruby dependencies
37+ $ berks install # install cookbooks into your local berkshelf
38+ $ berks upload # upload cookbooks to the chef server
4339
4440
4541 3. Provision a Deis Controller
@@ -50,123 +46,145 @@ The `Amazon EC2 API Tools`_ will be used to setup basic EC2 infrastructure. The
5046
5147.. code-block :: console
5248
53- $ contrib/provision-ec2-controller.sh
54- usage: contrib/provision-ec2-controller.sh [region]
55- $ contrib/provision-ec2-controller.sh us-west-2
56- Creating security group: deis-controller
57- + ec2-create-group deis-controller -d 'Created by Deis'
58- GROUP sg-7c40f317 deis-controller Created by Deis
59- + set +x
60- Authorizing TCP ports 22,80,443,514 from 0.0.0.0/0...
61- + ec2-authorize deis-controller -P tcp -p 22 -s 0.0.0.0/0
62- + ec2-authorize deis-controller -P tcp -p 80 -s 0.0.0.0/0
63- + ec2-authorize deis-controller -P tcp -p 443 -s 0.0.0.0/0
64- + ec2-authorize deis-controller -P tcp -p 514 -s 0.0.0.0/0
65- + set +x
66- Creating new SSH key: deis-controller
67- + ec2-create-keypair deis-controller
68- + chmod 600 /home/myuser/.ssh/deis-controller
69- + set +x
70- Saved to /home/myuser/.ssh/deis-controller
71- Created data_bag[deis-build]
72- Created data_bag[deis-formations]
73- Updated data_bag_item[deis-build::gitosis]
74- Provisioning deis-controller with knife ec2...
75- ...
76-
77- Once the deis-controller node exists on the Chef server, you must log in to
78- the WebUI add deis-controller to the `admins ` group. This is required so the
79- controller can delete node and client records during future
80- `layers:scale ` operations.
49+ $ contrib/provision-ec2-controller.sh
50+ usage: contrib/provision-ec2-controller.sh [region]
51+ $ contrib/provision-ec2-controller.sh us-west-2
52+ Creating security group: deis-controller
53+ + ec2-create-group deis-controller -d 'Created by Deis'
54+ GROUP sg-7c40f317 deis-controller Created by Deis
55+ + set +x
56+ Authorizing TCP ports 22,80,443,514 from 0.0.0.0/0...
57+ + ec2-authorize deis-controller -P tcp -p 22 -s 0.0.0.0/0
58+ + ec2-authorize deis-controller -P tcp -p 80 -s 0.0.0.0/0
59+ + ec2-authorize deis-controller -P tcp -p 443 -s 0.0.0.0/0
60+ + ec2-authorize deis-controller -P tcp -p 514 -s 0.0.0.0/0
61+ + set +x
62+ Creating new SSH key: deis-controller
63+ + ec2-create-keypair deis-controller
64+ + chmod 600 /home/myuser/.ssh/deis-controller
65+ + set +x
66+ Saved to /home/myuser/.ssh/deis-controller
67+ Created data_bag[deis-users]
68+ Created data_bag[deis-formations]
69+ Updated data_bag[deis-apps]
70+ Provisioning deis-controller with knife ec2...
71+ ...
72+
73+ Once the ``deis-controller `` node exists on the Chef server, you must log in to
74+ the WebUI add deis-controller to the ``admins `` group. This is required so the
75+ controller can delete node and client records during future scaling operations.
8176
8277
83784. Install the Deis Client
8479--------------------------
8580
86- Install the Deis client using `Pip `_. Registration will discover SSH keys
87- automatically and use the `standard environment variables `_ to configure the EC2 provider.
81+ Install the Deis client using `Pip `_ (for latest stable) or by linking
82+ ``<repo>/client/deis.py `` to ``/usr/local/bin/deis `` (for dev version).
83+ Registration will discover SSH keys automatically and use the
84+ `standard environment variables `_ to configure the EC2 provider.
8885
8986.. code-block :: console
9087
91- $ sudo pip install deis
92- $ deis register http://my-deis-controller.fqdn
93- username: myuser
94- password:
95- email: myuser@example.com
96- Registered myuser
97- Logged in as myuser
88+ $ sudo pip install deis
89+ $ deis register http://my-deis-controller.fqdn
90+ username: myuser
91+ password:
92+ email: myuser@example.com
93+ Registered myuser
94+ Logged in as myuser
9895
99- Found the following SSH public keys:
100- 1) id_rsa.pub
101- Which would you like to use with Deis? 1
102- Uploading /Users/myuser/.ssh/id_rsa.pub to Deis... done
96+ Found the following SSH public keys:
97+ 1) id_rsa.pub
98+ Which would you like to use with Deis? 1
99+ Uploading /Users/myuser/.ssh/id_rsa.pub to Deis... done
103100
104- Found EC2 credentials: AKIAJTVXXXXXXXXXXXXX
105- Import these credentials? (y/n) : y
106- Uploading EC2 credentials... done
101+ Found EC2 credentials: AKIAJTVXXXXXXXXXXXXX
102+ Import these credentials? (y/n) : y
103+ Uploading EC2 credentials... done
107104
108105
109106 5. Create & Scale a Formation
110107-----------------------------
111108
112- Find an application you’d like to deploy, or clone ` an example app `_.
113- Change into the application directory and use `` deis create `` to initialize a
114- new formation in a specific EC2 region. Use the `` deis layers:scale `` command
115- to provision nodes that will be dedicated to this formation .
109+ Use the Deis client to create a new formation named "dev" that
110+ has a default layer that serves as both runtime (hosts containers)
111+ and proxy (routes traffic to containers). Scale the default layer
112+ up to two nodes .
116113
117114.. code-block :: console
118115
119- $ cd <my-application-repo>
120- $ deis create --flavor=ec2-us-west-2
121- Creating formation... done, created peachy-waxworks
122- Git remote deis added
116+ $ deis formations:create dev --flavor=ec2-us-west-2
117+ Creating formation... done, created dev
118+
119+ Creating runtime layer... done in 1s
120+
121+ Use `deis nodes:scale dev runtime=1` to scale a basic formation
122+
123+ $ deis nodes:scale dev runtime=2
124+ Scaling nodes... but first, coffee!
125+ ...done in 251s
126+
127+ Use `deis create --formation=dev` to create an application
123128
124- Creating runtime layer... done
125- Creating proxy layer... done
126129
127- Use deis layers:scale proxy=1 runtime=1 to scale a basic formation
128-
129- $ deis layers:scale proxy=1 runtime=1
130- Scaling layers... but first, coffee!
131- ...done in 232s
132-
133- Use `git push deis master` to deploy to your formation
130+ 6. Deploy & Scale an Application
131+ --------------------------------
134132
133+ Find an application you’d like to deploy, or clone `an example app `_.
134+ Change into the application directory and use ``deis create --formation=dev ``
135+ to create a new application attached to the dev formation.
135136
136- 6. Deploy your Application
137- --------------------------
137+ To deploy the application, new ``git push deis master ``.
138+ Deis will automatically deploy Docker containers
139+ and configure Nginx proxies to route requests to your application.
138140
139- Use ``git push deis master `` to deploy your application. Deis will
140- automatically deploy Docker containers and configure Nginx proxies to
141- route requests to your application.
141+ Once your application is deployed, you use ``deis scale web=4 `` to
142+ scale up web containers. You can also use ``deis logs `` to view
143+ aggregated application logs, or ``deis run `` to run one-off admin
144+ commands inside your application.
142145
143146To learn more, use ``deis help `` or browse `the documentation `_.
144147
145148.. code-block :: console
146149
147- $ git push deis master
148- Counting objects: 146, done.
149- Delta compression using up to 8 threads.
150- Compressing objects: 100% (122/122), done.
151- Writing objects: 100% (146/146), 21.54 KiB, done.
152- Total 146 (delta 84), reused 47 (delta 22)
153- Node.js app detected
154- -----> Resolving engine versions
155- Using Node.js version: 0.10.15
156- Using npm version: 1.2.30
157- ...
158- -----> Building runtime environment
159- -----> Discovering process types
160- Procfile declares types -> web
161-
162- -----> Compiled slug size: 4.7 MB
163- Launching... done, v2
164-
165- -----> peachy-waxworks deployed to Deis
166- http://ec2-54-214-143-104.us-west-2.compute.amazonaws.com ...
167-
168- $ curl -s http://ec2-54-214-143-104.us-west-2.compute.amazonaws.com
169- Powered by Deis!
150+ $ deis create --formation=dev
151+ Creating application... done, created peachy-waxworks
152+ Git remote deis added
153+ $ git push deis master
154+ Counting objects: 146, done.
155+ Delta compression using up to 8 threads.
156+ Compressing objects: 100% (122/122), done.
157+ Writing objects: 100% (146/146), 21.54 KiB, done.
158+ Total 146 (delta 84), reused 47 (delta 22)
159+ Node.js app detected
160+ -----> Resolving engine versions
161+ Using Node.js version: 0.10.17
162+ Using npm version: 1.2.30
163+ ...
164+ -----> Building runtime environment
165+ -----> Discovering process types
166+ Procfile declares types -> web
167+
168+ -----> Compiled slug size: 4.7 MB
169+ Launching... done, v2
170+
171+ -----> peachy-waxworks deployed to Deis
172+ http://ec2-54-214-143-104.us-west-2.compute.amazonaws.com ...
173+
174+ $ curl -s http://ec2-54-214-143-104.us-west-2.compute.amazonaws.com
175+ Powered by Deis!
176+
177+ $ deis scale web=4
178+ Scaling containers... but first, coffee!
179+ done in 12s
180+
181+ === peachy-waxworks Containers
182+
183+ --- web: `node server.js`
184+ web.1 up 2013-09-23T19:02:30.745Z (dev-runtime-2)
185+ web.2 up 2013-09-23T19:36:48.741Z (dev-runtime-1)
186+ web.3 up 2013-09-23T19:36:48.758Z (dev-runtime-1)
187+ web.4 up 2013-09-23T19:36:48.771Z (dev-runtime-2)
170188
171189
172190 .. _`Git` : http://git-scm.com
0 commit comments