Skip to content

Commit 54902c4

Browse files
committed
Merge pull request #189 from opdemand/doc-updates
Doc updates post application refactoring
2 parents 6e532cd + 369ac79 commit 54902c4

42 files changed

Lines changed: 483 additions & 405 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 44 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ $ git clone https://github.com/opdemand/deis.git
5151
$ cd deis
5252
```
5353

54+
Cloning the default master branch will provide you with the latest development version
55+
of Deis. If you want to deploy the latest stable release, make sure you checkout the
56+
most recent tag using ``git checkout vX.Y.Z``.
57+
5458
### 2. Configure the Chef Server
5559

5660
Deis requires a Chef Server. [Sign up for a free Hosted Chef account](https://getchef.opscode.com/signup) if you don’t have one. You’ll also need a Ruby runtime with RubyGems in order to install the required Ruby dependencies.
@@ -67,11 +71,11 @@ The [Amazon EC2 API Tools](http://aws.amazon.com/developertools/351) will be use
6771

6872
$ contrib/provision-ec2-controller.sh
6973

70-
Once the `deis-controller` node exists on the Chef server, you *must* log in to the WebUI add deis-controller to the `admins` group. This is required so the controller can delete the node and client records for any nodes bootstrapped during future `layers:scale` operations.
74+
Once the `deis-controller` node exists on the Chef server, you *must* log in to the WebUI add deis-controller to the `admins` group. This is required so the controller can delete node and client records during future scaling operations.
7175

7276
### 4. Install the Deis Client
7377

74-
Install the Deis client using [Pip](http://www.pip-installer.org/en/latest/installing.html). Registration will discover SSH keys automatically and use the [standard environment variables](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/SettingUp_CommandLine.html#set_aws_credentials_linux) to configure the EC2 provider.
78+
Install the Deis client using [Pip](http://www.pip-installer.org/en/latest/installing.html) (for latest stable) or by linking `<repo>/client/deis.py` to `/usr/local/bin/deis` (for dev version). Registration will discover SSH keys automatically and use the [standard environment variables](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/SettingUp_CommandLine.html#set_aws_credentials_linux) to configure the EC2 provider.
7579

7680
```bash
7781
$ sudo pip install deis
@@ -94,29 +98,41 @@ Uploading EC2 credentials... done
9498

9599
### 5. Create & Scale a Formation
96100

97-
Find an application you’d like to deploy, or clone [an example app](https://github.com/opdemand/example-nodejs-express). Change into the application directory and use `deis create` to initialize a new formation in a specific EC2 region. Use the `deis layers:scale` command to provision nodes that will be dedicated to this formation.
101+
Use the Deis client to create a new formation named "dev" that
102+
has a default layer that serves as both runtime (hosts containers)
103+
and proxy (routes traffic to containers). Scale the default layer
104+
up to two nodes.
98105

99106
```bash
100-
$ cd <my-application-repo>
101-
$ deis create --flavor=ec2-us-west-2
102-
Creating formation... done, created peachy-waxworks
103-
Git remote deis added
107+
$ deis formations:create dev --flavor=ec2-us-west-2
108+
Creating formation... done, created dev
104109

105-
Creating runtime layer... done
106-
Creating proxy layer... done
110+
Creating runtime layer... done in 1s
107111

108-
Use deis layers:scale proxy=1 runtime=1 to scale a basic formation
112+
Use `deis nodes:scale dev runtime=1` to scale a basic formation
109113

110-
$ deis layers:scale proxy=1 runtime=1
111-
Scaling layers... but first, coffee!
112-
...done in 232s
114+
$ deis nodes:scale dev runtime=2
115+
Scaling nodes... but first, coffee!
116+
...done in 251s
113117

114-
Use `git push deis master` to deploy to your formation
118+
Use `deis create --formation=dev` to create an application
115119
```
116120

117-
### 6. Deploy your Application
121+
### 6. Deploy & Scale an Application
122+
123+
Change into your application directory and use ``deis create --formation=dev``
124+
to create a new application attached to the dev formation.
125+
126+
To deploy the application, use `git push deis master`.
127+
Deis will automatically deploy Docker containers
128+
and configure Nginx proxies to route requests to your application.
118129

119-
Use `git push deis master` to deploy your application. Deis will automatically deploy Docker containers and configure Nginx proxies to route requests to your application. To learn more, use `deis help` or browse [the documentation](http://docs.deis.io).
130+
Once your application is deployed, you use ``deis scale web=4`` to
131+
scale up web containers. You can also use ``deis logs`` to view
132+
aggregated application logs, or ``deis run`` to run one-off admin
133+
commands inside your application.
134+
135+
To learn more, use `deis help` or browse [the documentation](http://docs.deis.io).
120136

121137
```bash
122138
$ git push deis master
@@ -142,6 +158,18 @@ Total 146 (delta 84), reused 47 (delta 22)
142158

143159
$ curl -s http://ec2-198.51.100.36.us-west-2.compute.amazonaws.com
144160
Powered by Deis!
161+
162+
$ deis scale web=4
163+
Scaling containers... but first, coffee!
164+
done in 12s
165+
166+
=== peachy-waxworks Containers
167+
168+
--- web: `node server.js`
169+
web.1 up 2013-09-23T19:02:30.745Z (dev-runtime-2)
170+
web.2 up 2013-09-23T19:36:48.741Z (dev-runtime-1)
171+
web.3 up 2013-09-23T19:36:48.758Z (dev-runtime-1)
172+
web.4 up 2013-09-23T19:36:48.771Z (dev-runtime-2)
145173
```
146174

147175
## Credits

api/fields.py

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77

88
from django import forms
99
from django.db import models
10-
from json_field import JSONField
11-
from yamlfield.fields import YAMLField
1210

1311

1412
class UuidField(models.CharField):
@@ -53,60 +51,6 @@ def formfield(self, **kwargs):
5351
return super(UuidField, self).formfield(**kwargs)
5452

5553

56-
class EnvVarsField(JSONField):
57-
58-
"""
59-
A text field that accepts a JSON object, coercing its keys to uppercase.
60-
"""
61-
pass
62-
63-
64-
class DataBagField(JSONField):
65-
"""
66-
A text field that accepts a JSON object, used for storing Chef data bags.
67-
"""
68-
pass
69-
70-
71-
class ProcfileField(JSONField):
72-
"""
73-
A text field that accepts a JSON object, used for Procfile data.
74-
"""
75-
pass
76-
77-
78-
class CredentialsField(JSONField):
79-
"""
80-
A text field that accepts a JSON object, used for storing provider
81-
API Credentials.
82-
"""
83-
pass
84-
85-
86-
class ParamsField(JSONField):
87-
"""
88-
A text field that accepts a JSON object, used for storing provider
89-
API Parameters.
90-
"""
91-
pass
92-
93-
94-
class CloudInitField(YAMLField):
95-
"""
96-
A text field that accepts a YAML object, used for storing cloud-init
97-
boostrapping scripts.
98-
"""
99-
pass
100-
101-
102-
class NodeStatusField(JSONField):
103-
"""
104-
A text field that accepts a YAML object, used for storing cloud-init
105-
boostrapping scripts.
106-
"""
107-
pass
108-
109-
11054
try:
11155
from south.modelsinspector import add_introspection_rules
11256
# Tell the South schema migration tool to handle our custom fields.

api/models.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
from django.dispatch import receiver
2020
from django.dispatch.dispatcher import Signal
2121
from django.utils.encoding import python_2_unicode_compatible
22+
from json_field.fields import JSONField # @UnusedImport
2223

2324
from api import fields, tasks
2425
from provider import import_provider_module
@@ -111,7 +112,7 @@ class Provider(UuidAuditedModel):
111112
owner = models.ForeignKey(settings.AUTH_USER_MODEL)
112113
id = models.SlugField(max_length=64)
113114
type = models.SlugField(max_length=16, choices=PROVIDERS)
114-
creds = fields.CredentialsField(blank=True)
115+
creds = JSONField(blank=True)
115116

116117
class Meta:
117118
unique_together = (('owner', 'id'),)
@@ -148,7 +149,7 @@ class Flavor(UuidAuditedModel):
148149
owner = models.ForeignKey(settings.AUTH_USER_MODEL)
149150
id = models.SlugField(max_length=64)
150151
provider = models.ForeignKey('Provider')
151-
params = fields.ParamsField(blank=True)
152+
params = JSONField(blank=True)
152153

153154
class Meta:
154155
unique_together = (('owner', 'id'),)
@@ -167,7 +168,7 @@ class Formation(UuidAuditedModel):
167168
owner = models.ForeignKey(settings.AUTH_USER_MODEL)
168169
id = models.SlugField(max_length=64, unique=True)
169170
domain = models.CharField(max_length=128, blank=True, null=True)
170-
nodes = fields.JSONField(default='{}', blank=True)
171+
nodes = JSONField(default='{}', blank=True)
171172

172173
class Meta:
173174
unique_together = (('owner', 'id'),)
@@ -256,7 +257,7 @@ class Layer(UuidAuditedModel):
256257
ssh_port = models.SmallIntegerField(default=22)
257258

258259
# example: {'run_list': [deis::runtime'], 'environment': 'dev'}
259-
config = fields.JSONField(default='{}', blank=True)
260+
config = JSONField(default='{}', blank=True)
260261

261262
class Meta:
262263
unique_together = (('formation', 'id'),)
@@ -390,7 +391,7 @@ class Node(UuidAuditedModel):
390391

391392
provider_id = models.SlugField(max_length=64, blank=True, null=True)
392393
fqdn = models.CharField(max_length=256, blank=True, null=True)
393-
status = fields.NodeStatusField(blank=True, null=True)
394+
status = JSONField(blank=True, null=True)
394395

395396
class Meta:
396397
unique_together = (('formation', 'id'),)
@@ -438,7 +439,7 @@ class App(UuidAuditedModel):
438439
id = models.SlugField(max_length=64, unique=True)
439440
formation = models.ForeignKey('Formation')
440441

441-
containers = fields.JSONField(default='{}', blank=True)
442+
containers = JSONField(default='{}', blank=True)
442443

443444
def __str__(self):
444445
return self.id
@@ -666,7 +667,7 @@ class Config(UuidAuditedModel):
666667
app = models.ForeignKey('App')
667668
version = models.PositiveIntegerField()
668669

669-
values = fields.EnvVarsField(default='{}', blank=True)
670+
values = JSONField(default='{}', blank=True)
670671

671672
class Meta:
672673
get_latest_by = 'created'
@@ -690,9 +691,9 @@ class Build(UuidAuditedModel):
690691

691692
image = models.CharField(max_length=256, default='deis/buildstep')
692693

693-
procfile = fields.ProcfileField(blank=True)
694+
procfile = JSONField(blank=True)
694695
dockerfile = models.TextField(blank=True)
695-
config = fields.EnvVarsField(blank=True)
696+
config = JSONField(blank=True)
696697

697698
url = models.URLField('URL')
698699
size = models.IntegerField(blank=True, null=True)

0 commit comments

Comments
 (0)