drove-cli 0.0.1__tar.gz
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.
- drove_cli-0.0.1/PKG-INFO +787 -0
- drove_cli-0.0.1/README.md +754 -0
- drove_cli-0.0.1/drove.py +53 -0
- drove_cli-0.0.1/drovecli.py +37 -0
- drove_cli-0.0.1/droveclient.py +192 -0
- drove_cli-0.0.1/droveutils.py +91 -0
- drove_cli-0.0.1/plugins/__init__.py +47 -0
- drove_cli-0.0.1/plugins/appinstances.py +169 -0
- drove_cli-0.0.1/plugins/applications.py +233 -0
- drove_cli-0.0.1/plugins/cluster.py +116 -0
- drove_cli-0.0.1/plugins/executors.py +129 -0
- drove_cli-0.0.1/plugins/tasks.py +155 -0
- drove_cli-0.0.1/pyproject.toml +35 -0
drove_cli-0.0.1/PKG-INFO
ADDED
|
@@ -0,0 +1,787 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: drove-cli
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: Drove Command Line Interface
|
|
5
|
+
Home-page: https://github.com/PhonePe/drove-cli
|
|
6
|
+
License: Apache-2.0
|
|
7
|
+
Keywords: container,docker,podman,distributed-systems,container-orchestrator
|
|
8
|
+
Author: Santanu Sinha
|
|
9
|
+
Author-email: santanu.sinha@gmail.com
|
|
10
|
+
Maintainer: Santanu Sinha
|
|
11
|
+
Maintainer-email: santanu.sinha@gmail.com
|
|
12
|
+
Requires-Python: >=3.7,<4.0
|
|
13
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Intended Audience :: System Administrators
|
|
16
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
24
|
+
Classifier: Topic :: System :: Clustering
|
|
25
|
+
Classifier: Topic :: System :: Distributed Computing
|
|
26
|
+
Requires-Dist: requests (>=2.31.0,<3.0.0)
|
|
27
|
+
Requires-Dist: tabulate (>=0.9.0,<0.10.0)
|
|
28
|
+
Requires-Dist: tenacity (>=8.2.3,<9.0.0)
|
|
29
|
+
Requires-Dist: urllib3 (>=2.0.7,<3.0.0)
|
|
30
|
+
Project-URL: Repository, https://github.com/PhonePe/drove-cli
|
|
31
|
+
Description-Content-Type: text/markdown
|
|
32
|
+
|
|
33
|
+
# Drove CLI
|
|
34
|
+
|
|
35
|
+
Command line interface for the Drove Container Orchestrator.
|
|
36
|
+
|
|
37
|
+
# Getting Started
|
|
38
|
+
|
|
39
|
+
## Installation
|
|
40
|
+
|
|
41
|
+
You can install the cli from from PyPI.
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
pip install drove-cli
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Reactivate/deactivate virtual environment based on the need to utilize drove cli.
|
|
48
|
+
|
|
49
|
+
## Running using docker
|
|
50
|
+
The cli is pushed as a docker for easy access. This also elimintates the need for having python etc setup on your system.
|
|
51
|
+
|
|
52
|
+
1) Pull the image:
|
|
53
|
+
```shell
|
|
54
|
+
docker pull ghcr.io/PhonePe/drove-cli:latest
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
2) Create a shell script called `drove` with the following content:
|
|
58
|
+
|
|
59
|
+
```shell
|
|
60
|
+
#! /bin/sh
|
|
61
|
+
docker run \
|
|
62
|
+
--rm --interactive --tty --network host \
|
|
63
|
+
--name drove-cli -v ${HOME}/.drove:/root/.drove:ro \
|
|
64
|
+
ghcr.io/PhonePe/drove-cli:latest "$@"
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
3) Make the script executable
|
|
69
|
+
```shell
|
|
70
|
+
chmod a+x drove
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
4) Put the path to this script in your `~/.bashrc`.
|
|
74
|
+
|
|
75
|
+
```shell
|
|
76
|
+
export PATH="${PATH}:/path/to/your/script"
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
5) Logout/login or run `. ~/.bashrc` to load the new [path]
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
6) Run drove cli
|
|
83
|
+
```
|
|
84
|
+
drove -h
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Requirements
|
|
88
|
+
The CLI is written in Python 3x
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
## Accessing the Documentation
|
|
92
|
+
The arguments needed by the script are self documenting. Please use `-h` or `--help` in different sections and sub-sections of the CLI to get descriptions of commands, sub-commands, their arguments and options.
|
|
93
|
+
|
|
94
|
+
To see basic help:
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
$ drove -h
|
|
98
|
+
|
|
99
|
+
usage: drove [-h] [--file FILE] [--cluster CLUSTER] [--endpoint ENDPOINT] [--auth-header AUTH_HEADER] [--insecure INSECURE] [--username USERNAME] [--password PASSWORD] [--debug]
|
|
100
|
+
{executor,cluster,apps,appinstances,tasks} ...
|
|
101
|
+
|
|
102
|
+
positional arguments:
|
|
103
|
+
{executor,cluster,apps,appinstances,tasks}
|
|
104
|
+
Available plugins
|
|
105
|
+
executor Drove cluster executor related commands
|
|
106
|
+
cluster Drove cluster related commands
|
|
107
|
+
apps Drove application related commands
|
|
108
|
+
appinstances Drove application instance related commands
|
|
109
|
+
tasks Drove task related commands
|
|
110
|
+
|
|
111
|
+
options:
|
|
112
|
+
-h, --help show this help message and exit
|
|
113
|
+
--file FILE, -f FILE Configuration file for drove client
|
|
114
|
+
--cluster CLUSTER, -c CLUSTER
|
|
115
|
+
Cluster name as specified in config file
|
|
116
|
+
--endpoint ENDPOINT, -e ENDPOINT
|
|
117
|
+
Drove endpoint. (For example: https://drove.test.com)
|
|
118
|
+
--auth-header AUTH_HEADER, -t AUTH_HEADER
|
|
119
|
+
Authorization header value for the provided drove endpoint
|
|
120
|
+
--insecure INSECURE, -i INSECURE
|
|
121
|
+
Do not verify SSL cert for server
|
|
122
|
+
--username USERNAME, -u USERNAME
|
|
123
|
+
Drove cluster username
|
|
124
|
+
--password PASSWORD, -p PASSWORD
|
|
125
|
+
Drove cluster password
|
|
126
|
+
--debug, -d Print details of errors
|
|
127
|
+
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
To see documentation for a command/section:
|
|
131
|
+
```
|
|
132
|
+
$ drove cluster -h
|
|
133
|
+
usage: drove cluster [-h] {ping,summary,leader,endpoints,events} ...
|
|
134
|
+
|
|
135
|
+
positional arguments:
|
|
136
|
+
{ping,summary,leader,endpoints,events}
|
|
137
|
+
Available commands for cluster management
|
|
138
|
+
ping Ping the cluster
|
|
139
|
+
summary Show cluster summary
|
|
140
|
+
leader Show leader for cluster
|
|
141
|
+
endpoints Show all exposed endpoints
|
|
142
|
+
events Events on the cluster
|
|
143
|
+
|
|
144
|
+
optional arguments:
|
|
145
|
+
-h, --help show this help message and exit
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
To further drill down into options for a sub-command/subsection:
|
|
149
|
+
```
|
|
150
|
+
$ drove cluster events -h
|
|
151
|
+
usage: drove cluster events [-h] [--follow] [--type TYPE] [--count COUNT] [--textfmt TEXTFMT]
|
|
152
|
+
|
|
153
|
+
optional arguments:
|
|
154
|
+
-h, --help show this help message and exit
|
|
155
|
+
--follow, -f Follow events (Press CTRL-C to kill)
|
|
156
|
+
--type TYPE, -t TYPE Output events of only the matching type
|
|
157
|
+
--count COUNT, -c COUNT
|
|
158
|
+
Fetch <count> events at a time.
|
|
159
|
+
--textfmt TEXTFMT, -s TEXTFMT
|
|
160
|
+
Use the format string to print message
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
# Connecting to the Drove cluster
|
|
164
|
+
|
|
165
|
+
In order to use the CLI, we need to provide coordinates to the cluster to connect to. This can be done in the following manner:
|
|
166
|
+
|
|
167
|
+
## Drove CLI config file
|
|
168
|
+
The config file can be located in the following paths:
|
|
169
|
+
* `.drove` file in your home directory (Typically used for the default cluster you frequently connect to)
|
|
170
|
+
* A file in any path that can be passed as a parameter to the CLI with the `-f FILE` option
|
|
171
|
+
|
|
172
|
+
### Config File format
|
|
173
|
+
This file is in ini format and is arranged in sections.
|
|
174
|
+
|
|
175
|
+
```ini
|
|
176
|
+
[DEFAULT]
|
|
177
|
+
...
|
|
178
|
+
stage_token = <token1>
|
|
179
|
+
prod_token = <token2>
|
|
180
|
+
|
|
181
|
+
[local]
|
|
182
|
+
endpoint = http://localhost:10000
|
|
183
|
+
username = admin
|
|
184
|
+
password = admin
|
|
185
|
+
|
|
186
|
+
[stage]
|
|
187
|
+
endpoint = https://stage.testdrove.io
|
|
188
|
+
auth_header = %(stage_token)s
|
|
189
|
+
|
|
190
|
+
[production]
|
|
191
|
+
endpoint = https://prod.testdrove.io
|
|
192
|
+
auth_header = %(prod_token)s
|
|
193
|
+
|
|
194
|
+
..
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
The `DEFAULT` section can be used to define common variables like Insecure etc. The `local`, `stage`, `production` etc are names for inidividual clusters and these sections can be used to define configuration for individual clusters. Cluster name is referred to in the command line by using the `-c` command line option.\
|
|
198
|
+
*Interpolation* of values is supported and can be acieved by using `%(variable_name)s` references.
|
|
199
|
+
|
|
200
|
+
> * Note: The `DEFAULT` section is mandatory
|
|
201
|
+
> * Note: The `s` at the end of `%(var)s` is mandatory for interpolation
|
|
202
|
+
|
|
203
|
+
### Contents of a Section
|
|
204
|
+
```
|
|
205
|
+
endpoint = https://yourcluster.yourdomain.com # Endpoint for cluster
|
|
206
|
+
insecure = true
|
|
207
|
+
username = <your_username>
|
|
208
|
+
password = <your_password>
|
|
209
|
+
auth_header= <Authorization value here if using header based auth>
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
Authentication priority:
|
|
213
|
+
* If both `username` and `password` are provided, basic auth is used.
|
|
214
|
+
* If a value is provided in the `auth_header` parameter, it is passed as the value for the `Authorization` header in the upstream HTTP calls to the Drove server verbatim.
|
|
215
|
+
* If neither, no auth is set
|
|
216
|
+
|
|
217
|
+
> NOTE: Use the `insecure` option to skip certificate checks on the server endpoint (comes in handy for internal domains)
|
|
218
|
+
|
|
219
|
+
To use a custom config file, invoke drove in the following form:
|
|
220
|
+
|
|
221
|
+
```
|
|
222
|
+
$ drove -f custom.conf ...
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
This will connect to the cluster if an endpoint is mentioned in the `DEFAULT` section.
|
|
226
|
+
|
|
227
|
+
```
|
|
228
|
+
$ drove -f custom.conf -c stage ...
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
This will connect to the cluster whose config is mentioned in the `[stage]` config section.
|
|
232
|
+
|
|
233
|
+
```
|
|
234
|
+
$ drove -c stage ...
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
This will connect to the cluster whose config is mentioned in the `[stage]` config section in `$HOME/.drove` config file.
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
## Command line options
|
|
241
|
+
Pass the endpoint and other options using `--endpoint|-e` etc etc. Options can be obtained using `-h` as mentioned above. Invocation will be in the form:
|
|
242
|
+
|
|
243
|
+
```
|
|
244
|
+
$ drove -e http://localhost:10000 -u guest -p guest ...
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
## CLI format
|
|
248
|
+
The following cli format is followed:
|
|
249
|
+
|
|
250
|
+
```
|
|
251
|
+
usage: drove [-h] [--file FILE] [--cluster CLUSTER] [--endpoint ENDPOINT] [--auth-header AUTH_HEADER] [--insecure INSECURE] [--username USERNAME] [--password PASSWORD] [--debug]
|
|
252
|
+
{executor,cluster,apps,appinstances,tasks} ...
|
|
253
|
+
```
|
|
254
|
+
### Basic Arguments
|
|
255
|
+
```
|
|
256
|
+
-h, --help show this help message and exit
|
|
257
|
+
--file FILE, -f FILE Configuration file for drove client
|
|
258
|
+
--cluster CLUSTER, -c CLUSTER
|
|
259
|
+
Cluster name as specified in config file
|
|
260
|
+
--endpoint ENDPOINT, -e ENDPOINT
|
|
261
|
+
Drove endpoint. (For example: https://drove.test.com)
|
|
262
|
+
--auth-header AUTH_HEADER, -t AUTH_HEADER
|
|
263
|
+
Authorization header value for the provided drove endpoint
|
|
264
|
+
--insecure INSECURE, -i INSECURE
|
|
265
|
+
Do not verify SSL cert for server
|
|
266
|
+
--username USERNAME, -u USERNAME
|
|
267
|
+
Drove cluster username
|
|
268
|
+
--password PASSWORD, -p PASSWORD
|
|
269
|
+
Drove cluster password
|
|
270
|
+
--debug, -d Print details of errors
|
|
271
|
+
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
## Commands
|
|
275
|
+
Commands in drove are meant to address specific functionality. They can be summarized as follows:
|
|
276
|
+
```
|
|
277
|
+
executor Drove cluster executor related commands
|
|
278
|
+
cluster Drove cluster related commands
|
|
279
|
+
apps Drove application related commands
|
|
280
|
+
appinstances Drove application instance related commands
|
|
281
|
+
tasks Drove task related commands
|
|
282
|
+
```
|
|
283
|
+
### executor
|
|
284
|
+
---
|
|
285
|
+
Drove cluster executor related commands
|
|
286
|
+
|
|
287
|
+
```
|
|
288
|
+
drove executor [-h] {list,info,appinstances,tasks} ...
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
#### Sub-commands
|
|
292
|
+
|
|
293
|
+
##### list
|
|
294
|
+
|
|
295
|
+
List all executors
|
|
296
|
+
|
|
297
|
+
```
|
|
298
|
+
drove executor list [-h]
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
##### info
|
|
302
|
+
|
|
303
|
+
Show details about executor
|
|
304
|
+
|
|
305
|
+
```
|
|
306
|
+
drove executor info [-h] executor-id
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
###### Positional Arguments
|
|
310
|
+
|
|
311
|
+
`executor-id` - Executor id for which info is to be shown
|
|
312
|
+
|
|
313
|
+
##### appinstances
|
|
314
|
+
|
|
315
|
+
Show app instances running on this executor
|
|
316
|
+
|
|
317
|
+
```
|
|
318
|
+
drove executor appinstances [-h] [--sort {0,1,2,3,4,5}] [--reverse] executor-id
|
|
319
|
+
```
|
|
320
|
+
###### Positional Arguments
|
|
321
|
+
|
|
322
|
+
`executor-id` - Executor id for which info is to be shown
|
|
323
|
+
|
|
324
|
+
###### Arguments
|
|
325
|
+
|
|
326
|
+
```
|
|
327
|
+
--sort {0,1,2,3,4,5}, -s {0,1,2,3,4,5}
|
|
328
|
+
Sort output by column
|
|
329
|
+
--reverse, -r Sort in reverse order
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
##### tasks
|
|
333
|
+
|
|
334
|
+
Show tasks running on this executor
|
|
335
|
+
|
|
336
|
+
```
|
|
337
|
+
drove executor tasks [-h] [--sort {0,1,2,3,4,5}] [--reverse] executor-id
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
###### Positional Arguments
|
|
341
|
+
|
|
342
|
+
`executor-id` - Executor id for which info is to be shown
|
|
343
|
+
|
|
344
|
+
###### Named Arguments
|
|
345
|
+
```
|
|
346
|
+
--sort {0,1,2,3,4,5}, -s {0,1,2,3,4,5}
|
|
347
|
+
Sort output by column
|
|
348
|
+
--reverse, -r Sort in reverse order
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
|
|
352
|
+
### cluster
|
|
353
|
+
---
|
|
354
|
+
Drove cluster related commands
|
|
355
|
+
|
|
356
|
+
```
|
|
357
|
+
drove cluster [-h] {ping,summary,leader,endpoints,events} ...
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
#### Sub-commands
|
|
361
|
+
|
|
362
|
+
##### ping
|
|
363
|
+
|
|
364
|
+
Ping the cluster
|
|
365
|
+
|
|
366
|
+
```
|
|
367
|
+
drove cluster ping [-h]
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
##### summary
|
|
371
|
+
|
|
372
|
+
Show cluster summary
|
|
373
|
+
|
|
374
|
+
```
|
|
375
|
+
drove cluster summary [-h]
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
##### leader
|
|
379
|
+
|
|
380
|
+
Show leader for cluster
|
|
381
|
+
```
|
|
382
|
+
drove cluster leader [-h]
|
|
383
|
+
```
|
|
384
|
+
##### endpoints
|
|
385
|
+
|
|
386
|
+
Show all exposed endpoints
|
|
387
|
+
```
|
|
388
|
+
drove cluster endpoints [-h] [--vhost VHOST]
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
###### Named Arguments
|
|
392
|
+
|
|
393
|
+
```
|
|
394
|
+
--vhost VHOST, -v VHOST
|
|
395
|
+
Show details only for the specific vhost
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
##### events
|
|
399
|
+
|
|
400
|
+
Events on the cluster
|
|
401
|
+
|
|
402
|
+
```
|
|
403
|
+
drove cluster events [-h] [--follow] [--type TYPE] [--count COUNT] [--textfmt TEXTFMT]
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
###### Named Arguments
|
|
407
|
+
|
|
408
|
+
```
|
|
409
|
+
--follow, -f Follow events (Press CTRL-C to kill)
|
|
410
|
+
--type TYPE, -t TYPE Output events of only the matching type
|
|
411
|
+
--count COUNT, -c COUNT
|
|
412
|
+
Fetch <count> events at a time.
|
|
413
|
+
--textfmt TEXTFMT, -s TEXTFMT
|
|
414
|
+
Use the format string to print message
|
|
415
|
+
Default: “{type: <25} | {id: <36} | {time: <20} | {metadata}”
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
### apps
|
|
419
|
+
---
|
|
420
|
+
Drove application related commands
|
|
421
|
+
|
|
422
|
+
```
|
|
423
|
+
drove apps [-h] {list,summary,spec,create,destroy,deploy,scale,suspend,restart,cancelop} ...
|
|
424
|
+
```
|
|
425
|
+
#### Sub-commands
|
|
426
|
+
|
|
427
|
+
##### list
|
|
428
|
+
|
|
429
|
+
List all applications
|
|
430
|
+
|
|
431
|
+
```
|
|
432
|
+
drove apps list [-h] [--sort {0,1,2,3,4,5,6,7,8}] [--reverse]
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
###### Named Arguments
|
|
436
|
+
|
|
437
|
+
```
|
|
438
|
+
--sort {0,1,2,3,4,5,6,7,8}, -s {0,1,2,3,4,5,6,7,8}
|
|
439
|
+
Sort output by column
|
|
440
|
+
--reverse, -r Sort in reverse order
|
|
441
|
+
```
|
|
442
|
+
|
|
443
|
+
##### summary
|
|
444
|
+
|
|
445
|
+
Show a summary for an application
|
|
446
|
+
```
|
|
447
|
+
drove apps summary [-h] app-id
|
|
448
|
+
```
|
|
449
|
+
###### Positional Arguments
|
|
450
|
+
|
|
451
|
+
`app-id` - Application ID
|
|
452
|
+
|
|
453
|
+
##### spec
|
|
454
|
+
|
|
455
|
+
Print the raw json spec for an application
|
|
456
|
+
```
|
|
457
|
+
drove apps spec [-h] app-id
|
|
458
|
+
```
|
|
459
|
+
###### Positional Arguments
|
|
460
|
+
|
|
461
|
+
`app-id` - Application ID
|
|
462
|
+
|
|
463
|
+
##### create
|
|
464
|
+
|
|
465
|
+
Create application on cluster
|
|
466
|
+
```
|
|
467
|
+
drove apps create [-h] spec-file
|
|
468
|
+
```
|
|
469
|
+
###### Positional Arguments
|
|
470
|
+
|
|
471
|
+
`spec-file` - JSON spec file for the application
|
|
472
|
+
|
|
473
|
+
##### destroy
|
|
474
|
+
|
|
475
|
+
Destroy an app with zero instances
|
|
476
|
+
```
|
|
477
|
+
drove apps destroy [-h] app-id
|
|
478
|
+
```
|
|
479
|
+
###### Positional Arguments
|
|
480
|
+
|
|
481
|
+
`app-id` - Application ID
|
|
482
|
+
|
|
483
|
+
##### deploy
|
|
484
|
+
|
|
485
|
+
Deploy new app instances.
|
|
486
|
+
```
|
|
487
|
+
drove apps deploy [-h] [--parallelism PARALLELISM] [--timeout TIMEOUT] app-id instances
|
|
488
|
+
```
|
|
489
|
+
###### Positional Arguments
|
|
490
|
+
|
|
491
|
+
`app-id` - Application ID\
|
|
492
|
+
`instances` - Number of new instances to be created
|
|
493
|
+
|
|
494
|
+
###### Named Arguments
|
|
495
|
+
|
|
496
|
+
```
|
|
497
|
+
--parallelism PARALLELISM, -p PARALLELISM
|
|
498
|
+
Number of parallel threads to be used to execute operation (default: 1)
|
|
499
|
+
--timeout TIMEOUT, -t TIMEOUT
|
|
500
|
+
Timeout for the operation on the cluster (default: 5 minutes)
|
|
501
|
+
--wait, -w Wait to ensure instance count is reached
|
|
502
|
+
```
|
|
503
|
+
##### scale
|
|
504
|
+
|
|
505
|
+
Scale app to required instances. Will increase or decrease instances on the cluster to match this number
|
|
506
|
+
|
|
507
|
+
```
|
|
508
|
+
drove apps scale [-h] [--parallelism PARALLELISM] [--timeout TIMEOUT] app-id instances
|
|
509
|
+
```
|
|
510
|
+
###### Positional Arguments
|
|
511
|
+
|
|
512
|
+
`app-id` - Application ID\
|
|
513
|
+
`instances` - Number of instances. Setting this to 0 will suspend the app
|
|
514
|
+
|
|
515
|
+
###### Named Arguments
|
|
516
|
+
|
|
517
|
+
```
|
|
518
|
+
--parallelism PARALLELISM, -p PARALLELISM
|
|
519
|
+
Number of parallel threads to be used to execute operation (default: 1)
|
|
520
|
+
--timeout TIMEOUT, -t TIMEOUT
|
|
521
|
+
Timeout for the operation on the cluster (default: 5 minutes)
|
|
522
|
+
--wait, -w Wait to ensure instance count is reached
|
|
523
|
+
```
|
|
524
|
+
|
|
525
|
+
##### suspend
|
|
526
|
+
|
|
527
|
+
Suspend the app
|
|
528
|
+
```
|
|
529
|
+
drove apps suspend [-h] [--parallelism PARALLELISM] [--timeout TIMEOUT] app-id
|
|
530
|
+
```
|
|
531
|
+
###### Positional Arguments[¶](#Positional%20Arguments_repeat9 "Link to this heading")
|
|
532
|
+
|
|
533
|
+
`app-id` - Application ID
|
|
534
|
+
|
|
535
|
+
###### Named Arguments
|
|
536
|
+
|
|
537
|
+
```
|
|
538
|
+
--parallelism PARALLELISM, -p PARALLELISM
|
|
539
|
+
Number of parallel threads to be used to execute operation (default: 1)
|
|
540
|
+
--timeout TIMEOUT, -t TIMEOUT
|
|
541
|
+
Timeout for the operation on the cluster (default: 5 minutes)
|
|
542
|
+
--wait, -w Wait to ensure all instances are suspended
|
|
543
|
+
```
|
|
544
|
+
|
|
545
|
+
##### restart
|
|
546
|
+
|
|
547
|
+
Restart am existing app instances.
|
|
548
|
+
|
|
549
|
+
```
|
|
550
|
+
drove apps restart [-h] [--parallelism PARALLELISM] [--timeout TIMEOUT] app-id
|
|
551
|
+
```
|
|
552
|
+
|
|
553
|
+
###### Positional Arguments
|
|
554
|
+
|
|
555
|
+
`app-id` - Application ID
|
|
556
|
+
|
|
557
|
+
###### Named Arguments
|
|
558
|
+
```
|
|
559
|
+
--parallelism PARALLELISM, -p PARALLELISM
|
|
560
|
+
Number of parallel threads to be used to execute operation (default: 1)
|
|
561
|
+
--timeout TIMEOUT, -t TIMEOUT
|
|
562
|
+
Timeout for the operation on the cluster (default: 5 minutes)
|
|
563
|
+
--wait, -w Wait to ensure all instances are replaced
|
|
564
|
+
```
|
|
565
|
+
##### cancelop
|
|
566
|
+
|
|
567
|
+
Cancel current operation
|
|
568
|
+
```
|
|
569
|
+
drove apps cancelop [-h] app-id
|
|
570
|
+
```
|
|
571
|
+
###### Positional Arguments
|
|
572
|
+
`app-id` - Application ID
|
|
573
|
+
|
|
574
|
+
### appinstances
|
|
575
|
+
---
|
|
576
|
+
Drove application instance related commands
|
|
577
|
+
```
|
|
578
|
+
drove appinstances [-h] {list,info,logs,tail,download,replace,kill} ...
|
|
579
|
+
```
|
|
580
|
+
#### Sub-commands
|
|
581
|
+
|
|
582
|
+
##### list
|
|
583
|
+
|
|
584
|
+
List all application instances
|
|
585
|
+
```
|
|
586
|
+
drove appinstances list [-h] [--old] [--sort {0,1,2,3,4,5}] [--reverse] app-id
|
|
587
|
+
```
|
|
588
|
+
###### Positional Arguments
|
|
589
|
+
`app-id` - Application ID
|
|
590
|
+
|
|
591
|
+
###### Named Arguments
|
|
592
|
+
|
|
593
|
+
```
|
|
594
|
+
--parallelism PARALLELISM, -p PARALLELISM
|
|
595
|
+
Number of parallel threads to be used to execute operation (default: 1)
|
|
596
|
+
--timeout TIMEOUT, -t TIMEOUT
|
|
597
|
+
Timeout for the operation on the cluster (default: 5 minutes)
|
|
598
|
+
```
|
|
599
|
+
##### info
|
|
600
|
+
|
|
601
|
+
Print details for an application instance
|
|
602
|
+
```
|
|
603
|
+
drove appinstances info [-h] app-id instance-id
|
|
604
|
+
```
|
|
605
|
+
###### Positional Arguments
|
|
606
|
+
`app-id` - Application ID\
|
|
607
|
+
`instance-id` - Application Instance ID
|
|
608
|
+
|
|
609
|
+
##### logs
|
|
610
|
+
|
|
611
|
+
Print list of logs for application instance
|
|
612
|
+
```
|
|
613
|
+
drove appinstances logs [-h] app-id instance-id
|
|
614
|
+
```
|
|
615
|
+
###### Positional Arguments
|
|
616
|
+
|
|
617
|
+
`app-id` - Application ID\
|
|
618
|
+
`instance-id` - Application Instance ID
|
|
619
|
+
|
|
620
|
+
##### tail
|
|
621
|
+
|
|
622
|
+
Tail log for application instance
|
|
623
|
+
```
|
|
624
|
+
drove appinstances tail [-h] [--file FILE] app-id instance-id
|
|
625
|
+
```
|
|
626
|
+
###### Positional Arguments
|
|
627
|
+
|
|
628
|
+
`app-id` - Application ID\
|
|
629
|
+
`instance-id` - Application Instance ID
|
|
630
|
+
|
|
631
|
+
###### Named Arguments
|
|
632
|
+
|
|
633
|
+
```
|
|
634
|
+
--log LOG, -l LOG Log filename to tail. Default is to tail output.log
|
|
635
|
+
```
|
|
636
|
+
|
|
637
|
+
##### download
|
|
638
|
+
|
|
639
|
+
Download log for application instance
|
|
640
|
+
```
|
|
641
|
+
drove appinstances download [-h] [--out OUT] app-id instance-id file
|
|
642
|
+
```
|
|
643
|
+
###### Positional Arguments
|
|
644
|
+
|
|
645
|
+
`app-id` - Application ID\
|
|
646
|
+
`instance-id` - Application Instance ID\
|
|
647
|
+
`file` - Log filename to download
|
|
648
|
+
|
|
649
|
+
###### Named Arguments
|
|
650
|
+
```
|
|
651
|
+
--out, -o Filename to download to. Default is the same filename as provided.
|
|
652
|
+
```
|
|
653
|
+
##### replace
|
|
654
|
+
|
|
655
|
+
Replace specific app instances with fresh instances
|
|
656
|
+
```
|
|
657
|
+
drove appinstances replace [-h] [--parallelism PARALLELISM] [--timeout TIMEOUT] app-id instance-id [instance-id ...]
|
|
658
|
+
```
|
|
659
|
+
###### Positional Arguments
|
|
660
|
+
`app-id` - Application ID\
|
|
661
|
+
`instance-id` - Application Instance IDs
|
|
662
|
+
|
|
663
|
+
###### Named Arguments
|
|
664
|
+
```
|
|
665
|
+
--parallelism PARALLELISM, -p PARALLELISM
|
|
666
|
+
Number of parallel threads to be used to execute operation (default: 1)
|
|
667
|
+
--timeout TIMEOUT, -t TIMEOUT
|
|
668
|
+
Timeout for the operation on the cluster (default: 5 minutes)
|
|
669
|
+
--wait, -w Wait to ensure all instances are replaced
|
|
670
|
+
```
|
|
671
|
+
|
|
672
|
+
##### kill
|
|
673
|
+
|
|
674
|
+
Kill specific app instances
|
|
675
|
+
```
|
|
676
|
+
drove appinstances kill [-h] [--parallelism PARALLELISM] [--timeout TIMEOUT] app-id instance-id [instance-id ...]
|
|
677
|
+
```
|
|
678
|
+
###### Positional Arguments
|
|
679
|
+
`app-id` - Application ID\
|
|
680
|
+
`instance-id` - Application Instance IDs
|
|
681
|
+
|
|
682
|
+
###### Named Arguments
|
|
683
|
+
|
|
684
|
+
```
|
|
685
|
+
--parallelism PARALLELISM, -p PARALLELISM
|
|
686
|
+
Number of parallel threads to be used to execute operation
|
|
687
|
+
--timeout TIMEOUT, -t TIMEOUT
|
|
688
|
+
Timeout for the operation on the cluster (default: 5 minutes)
|
|
689
|
+
--wait, -w Wait to ensure all instances are killed
|
|
690
|
+
```
|
|
691
|
+
### tasks
|
|
692
|
+
---
|
|
693
|
+
Drove task related commands
|
|
694
|
+
```
|
|
695
|
+
drove tasks [-h] {create,kill,list,show,logs,tail,download} ...
|
|
696
|
+
```
|
|
697
|
+
#### Sub-commands
|
|
698
|
+
|
|
699
|
+
##### create
|
|
700
|
+
|
|
701
|
+
Create a task on cluster
|
|
702
|
+
```
|
|
703
|
+
drove tasks create [-h] spec-file
|
|
704
|
+
```
|
|
705
|
+
###### Positional Arguments
|
|
706
|
+
|
|
707
|
+
`spec-file` - JSON spec file for the task
|
|
708
|
+
|
|
709
|
+
##### kill
|
|
710
|
+
|
|
711
|
+
Kill a running task
|
|
712
|
+
```
|
|
713
|
+
drove tasks kill [-h] source-app-name task-id
|
|
714
|
+
```
|
|
715
|
+
###### Positional Arguments
|
|
716
|
+
|
|
717
|
+
`source-app-name` - Source app name as specified in spec\
|
|
718
|
+
`task-id` - ID of the task as specified in the spec
|
|
719
|
+
|
|
720
|
+
##### list
|
|
721
|
+
|
|
722
|
+
List all active tasks
|
|
723
|
+
```
|
|
724
|
+
drove tasks list [-h] [--app APP] [--sort {0,1,2,3,4,5,6,7,8}] [--reverse]
|
|
725
|
+
```
|
|
726
|
+
###### Named Arguments
|
|
727
|
+
```
|
|
728
|
+
--app APP, -a APP Show tasks only for the given source app
|
|
729
|
+
--sort {0,1,2,3,4,5,6,7,8}, -s {0,1,2,3,4,5,6,7,8}
|
|
730
|
+
Sort output by column
|
|
731
|
+
--reverse, -r Sort in reverse order
|
|
732
|
+
```
|
|
733
|
+
##### show
|
|
734
|
+
|
|
735
|
+
Shows details about a task
|
|
736
|
+
```
|
|
737
|
+
drove tasks show [-h] source-app task-id
|
|
738
|
+
```
|
|
739
|
+
###### Positional Arguments
|
|
740
|
+
`source-app` - Name of the Drove application that started the task\
|
|
741
|
+
`task-id` - Task ID
|
|
742
|
+
|
|
743
|
+
##### logs
|
|
744
|
+
|
|
745
|
+
Print list of logs for task
|
|
746
|
+
```
|
|
747
|
+
drove tasks logs [-h] source-app task-id
|
|
748
|
+
```
|
|
749
|
+
###### Positional Arguments
|
|
750
|
+
`source-app` - Name of the Drove application that started the task\
|
|
751
|
+
`task-id` - Task ID
|
|
752
|
+
|
|
753
|
+
##### tail
|
|
754
|
+
|
|
755
|
+
Tail log for task
|
|
756
|
+
```
|
|
757
|
+
drove tasks tail [-h] [--file FILE] source-app task-id
|
|
758
|
+
```
|
|
759
|
+
###### Positional Arguments
|
|
760
|
+
`source-app` - Name of the Drove application that started the task\
|
|
761
|
+
`task-id` - Task ID
|
|
762
|
+
|
|
763
|
+
###### Named Arguments
|
|
764
|
+
|
|
765
|
+
```
|
|
766
|
+
--file FILE, -f FILE Log filename to tail. Default is to tail output.log
|
|
767
|
+
```
|
|
768
|
+
##### download
|
|
769
|
+
|
|
770
|
+
Download log for task
|
|
771
|
+
|
|
772
|
+
```
|
|
773
|
+
drove tasks download [-h] [--out OUT] source-app task-id file
|
|
774
|
+
```
|
|
775
|
+
###### Positional Arguments
|
|
776
|
+
`source-app` - Name of the Drove application that started the task\
|
|
777
|
+
`task-id` - Task ID\
|
|
778
|
+
`file` - Log filename to download
|
|
779
|
+
|
|
780
|
+
###### Named Arguments
|
|
781
|
+
|
|
782
|
+
```
|
|
783
|
+
--out OUT, -o OUT Filename to download to. Default is the same filename as provided.
|
|
784
|
+
```
|
|
785
|
+
|
|
786
|
+
©2024, Santanu Sinha.
|
|
787
|
+
|