Skip to content

Commit 918552b

Browse files
author
Matthew Fisher
committed
Merge pull request #813 from deis/rename-containers
refactor(client): rename containers to ps
2 parents 507d0fb + 3ddbccf commit 918552b

6 files changed

Lines changed: 37 additions & 38 deletions

File tree

client/deis.py

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
1515
apps manage applications used to provide services
1616
clusters manage clusters used to host applications
17-
containers manage containers used to handle requests and jobs
17+
ps manage processes inside an app container
1818
config manage environment variables that define app config
1919
builds manage builds created using `git push`
2020
releases manage releases of an application
@@ -25,7 +25,7 @@
2525
Developer shortcut commands::
2626
2727
create create a new application
28-
scale scale containers by type (web=2, worker=1)
28+
scale scale processes by type (web=2, worker=1)
2929
info view information about the current app
3030
open open a URL to the app in a browser
3131
logs view aggregated log info for the app
@@ -549,7 +549,7 @@ def apps_info(self, args):
549549
print("=== {} Application".format(app))
550550
print(json.dumps(response.json(), indent=2))
551551
print()
552-
self.containers_list(args)
552+
self.ps_list(args)
553553
print()
554554
else:
555555
raise ResponseError(response)
@@ -1055,24 +1055,24 @@ def config_unset(self, args):
10551055
else:
10561056
raise ResponseError(response)
10571057

1058-
def containers(self, args):
1058+
def ps(self, args):
10591059
"""
1060-
Valid commands for containers:
1060+
Valid commands for processes:
10611061
1062-
containers:list list application containers
1063-
containers:scale scale app containers (e.g. web=4 worker=2)
1062+
ps:list list application processes
1063+
ps:scale scale processes (e.g. web=4 worker=2)
10641064
10651065
Use `deis help [command]` to learn more
10661066
"""
1067-
sys.argv[1] = 'containers:list'
1068-
args = docopt(self.containers_list.__doc__)
1069-
return self.containers_list(args)
1067+
sys.argv[1] = 'ps:list'
1068+
args = docopt(self.ps_list.__doc__)
1069+
return self.ps_list(args)
10701070

1071-
def containers_list(self, args, app=None):
1071+
def ps_list(self, args, app=None):
10721072
"""
1073-
List containers servicing an application
1073+
List processes servicing an application
10741074
1075-
Usage: deis containers:list [--app=<app>]
1075+
Usage: deis ps:list [--app=<app>]
10761076
"""
10771077
if not app:
10781078
app = args.get('--app')
@@ -1082,10 +1082,10 @@ def containers_list(self, args, app=None):
10821082
"/api/apps/{}/containers".format(app))
10831083
if response.status_code != requests.codes.ok: # @UndefinedVariable
10841084
raise ResponseError(response)
1085-
containers = response.json()
1086-
print("=== {} Containers".format(app))
1085+
processes = response.json()
1086+
print("=== {} Processes".format(app))
10871087
c_map = {}
1088-
for item in containers['results']:
1088+
for item in processes['results']:
10891089
c_map.setdefault(item['type'], []).append(item)
10901090
print()
10911091
for c_type in c_map.keys():
@@ -1094,13 +1094,13 @@ def containers_list(self, args, app=None):
10941094
print("{type}.{num} {state} ({release})".format(**c))
10951095
print()
10961096

1097-
def containers_scale(self, args):
1097+
def ps_scale(self, args):
10981098
"""
1099-
Scale an application's containers by type
1099+
Scale an application's processes by type
11001100
1101-
Example: deis containers:scale web=4 worker=2
1101+
Example: deis ps:scale web=4 worker=2
11021102
1103-
Usage: deis containers:scale <type=num>... [--app=<app>]
1103+
Usage: deis ps:scale <type=num>... [--app=<app>]
11041104
"""
11051105
app = args.get('--app')
11061106
if not app:
@@ -1109,7 +1109,7 @@ def containers_scale(self, args):
11091109
for type_num in args.get('<type=num>'):
11101110
typ, count = type_num.split('=')
11111111
body.update({typ: int(count)})
1112-
print('Scaling containers... but first, coffee!')
1112+
print('Scaling processes... but first, coffee!')
11131113
try:
11141114
progress = TextProgress()
11151115
progress.start()
@@ -1122,7 +1122,7 @@ def containers_scale(self, args):
11221122
progress.join()
11231123
if response.status_code == requests.codes.no_content: # @UndefinedVariable
11241124
print('done in {}s\n'.format(int(time.time() - before)))
1125-
self.containers_list({}, app)
1125+
self.ps_list({}, app)
11261126
else:
11271127
raise ResponseError(response)
11281128

@@ -1568,8 +1568,7 @@ def shortcuts(self, args):
15681568
('register', 'auth:register'),
15691569
('login', 'auth:login'),
15701570
('logout', 'auth:logout'),
1571-
('ps', 'containers:list'),
1572-
('scale', 'containers:scale'),
1571+
('scale', 'ps:scale'),
15731572
('rollback', 'releases:rollback'),
15741573
('sharing', 'perms:list'),
15751574
('sharing:list', 'perms:list'),

docs/client/containers.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
:title: Containers
2-
:description: Learn how to list and scale Deis containers for an application using the Deis client.
1+
:title: Processes
2+
:description: Learn how to list and scale Deis processes for an application using the Deis client.
33

44

5-
containers
6-
==========
5+
processes
6+
=========
77

8-
.. automethod:: client.deis.DeisClient.containers_list
9-
.. automethod:: client.deis.DeisClient.containers_scale
8+
.. automethod:: client.deis.DeisClient.ps_list
9+
.. automethod:: client.deis.DeisClient.ps_scale
1010

docs/client/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Client Reference
2828
keys
2929

3030
apps
31-
containers
31+
ps
3232
config
3333
builds
3434
releases

docs/client/scale.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
:title: Scale
2-
:description: Learn how to scale containers for a Deis application using the Deis client.
2+
:description: Learn how to scale processes for a Deis application using the Deis client.
33

44

55
scale
66
=====
77

8-
.. automethod:: client.deis.DeisClient.containers_scale
8+
.. automethod:: client.deis.DeisClient.ps_scale
99
:noindex:

docs/developer/manage-application.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ that power your app.
3232
.. code-block:: console
3333
3434
$ deis scale web=8
35-
Scaling containers... but first, coffee!
35+
Scaling processes... but first, coffee!
3636
done in 20s
3737
38-
=== peachy-waxworks Containers
38+
=== peachy-waxworks Processes
3939
4040
--- web: `java -cp target/classes:target/dependency/* HelloWorld`
4141
web.1 up 2013-12-03T00:00:25.836Z (dev-runtime-1)

docs/gettingstarted/concepts.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ CoreOS
4646
needed by modern infrastructure stacks and targeted at massive
4747
server deployments.
4848

49-
Deis applications are containers running on CoreOS machines, which can
49+
Deis applications are processes running on CoreOS machines, which can
5050
be private or public cloud instances, or bare metal. CoreOS clusters
5151
allow Deis to host applications and services at scale with
5252
high resilience.
@@ -75,7 +75,7 @@ An :ref:`application`, or app, lives on a :ref:`cluster`, where it uses
7575
deployed git repository.
7676

7777
Developers use :ref:`Applications <application>` to push code, change
78-
configuration, scale containers, view logs, or run admin commands --
78+
configuration, scale processes, view logs, or run admin commands --
7979
regardless of the cluster's underlying infrastructure.
8080

8181
.. _concepts_build_release_run:
@@ -99,7 +99,7 @@ changed, making it easy to rollback code and configuration.
9999
Run Stage
100100
^^^^^^^^^
101101
The run stage shells out jobs to the scheduler. The scheduler is in control of balancing the
102-
containers evenly across the cluster, as well as the announcers and the loggers for each
102+
processes evenly across the cluster, as well as the announcers and the loggers for each
103103
application. The scheduler uses SSH to submit jobs to each node in the cluster and updates
104104
the proxy component between releases, making zero downtime deployments possible.
105105

0 commit comments

Comments
 (0)