drove-cli 0.0.2__tar.gz → 0.0.3__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.2 → drove_cli-0.0.3}/PKG-INFO +312 -19
- {drove_cli-0.0.2 → drove_cli-0.0.3}/README.md +308 -16
- {drove_cli-0.0.2 → drove_cli-0.0.3}/drove.py +1 -1
- {drove_cli-0.0.2 → drove_cli-0.0.3}/droveclient.py +26 -14
- {drove_cli-0.0.2 → drove_cli-0.0.3}/plugins/applications.py +1 -1
- {drove_cli-0.0.2 → drove_cli-0.0.3}/plugins/cluster.py +4 -4
- {drove_cli-0.0.2 → drove_cli-0.0.3}/plugins/executors.py +31 -1
- drove_cli-0.0.3/plugins/localserviceinstances.py +170 -0
- drove_cli-0.0.3/plugins/localservices.py +192 -0
- {drove_cli-0.0.2 → drove_cli-0.0.3}/pyproject.toml +1 -1
- {drove_cli-0.0.2 → drove_cli-0.0.3}/drovecli.py +0 -0
- {drove_cli-0.0.2 → drove_cli-0.0.3}/droveutils.py +0 -0
- {drove_cli-0.0.2 → drove_cli-0.0.3}/plugins/__init__.py +0 -0
- {drove_cli-0.0.2 → drove_cli-0.0.3}/plugins/appinstances.py +0 -0
- {drove_cli-0.0.2 → drove_cli-0.0.3}/plugins/tasks.py +0 -0
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: drove-cli
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.3
|
|
4
4
|
Summary: Drove Command Line Interface
|
|
5
|
-
Home-page: https://github.com/PhonePe/drove-cli
|
|
6
5
|
License: Apache-2.0
|
|
7
6
|
Keywords: container,docker,podman,distributed-systems,container-orchestrator
|
|
8
7
|
Author: Santanu Sinha
|
|
@@ -21,6 +20,8 @@ Classifier: Programming Language :: Python :: 3.9
|
|
|
21
20
|
Classifier: Programming Language :: Python :: 3.10
|
|
22
21
|
Classifier: Programming Language :: Python :: 3.11
|
|
23
22
|
Classifier: Programming Language :: Python :: 3.12
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
24
25
|
Classifier: Topic :: System :: Clustering
|
|
25
26
|
Classifier: Topic :: System :: Distributed Computing
|
|
26
27
|
Requires-Dist: requests (>=2.31.0,<3.0.0)
|
|
@@ -38,16 +39,37 @@ Command line interface for the Drove Container Orchestrator.
|
|
|
38
39
|
|
|
39
40
|
## Installation
|
|
40
41
|
|
|
41
|
-
You can install the
|
|
42
|
+
You can install the CLI from PyPI.
|
|
42
43
|
|
|
43
44
|
```bash
|
|
44
45
|
pip install drove-cli
|
|
45
46
|
```
|
|
46
47
|
|
|
47
|
-
|
|
48
|
+
### To install in a virtual env
|
|
49
|
+
|
|
50
|
+
Create virtual environment
|
|
51
|
+
```bash
|
|
52
|
+
mkdir -p ${HOME}/venvs
|
|
53
|
+
cd ${HOME}/venvs
|
|
54
|
+
python3 -m venv drove_cli
|
|
55
|
+
cd drove_cli
|
|
56
|
+
source bin/activate
|
|
57
|
+
pip install drove-cli
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
To activate in another shell:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
source ${HOME}/venvs/drove_cli/bin/activate
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
To deactivate the venv (run when in activated environment):
|
|
67
|
+
```bash
|
|
68
|
+
deactivate
|
|
69
|
+
```
|
|
48
70
|
|
|
49
71
|
## Running using docker
|
|
50
|
-
The cli is pushed as a docker for easy access. This also
|
|
72
|
+
The cli is pushed as a docker for easy access. This also eliminates the need for having python etc setup on your system.
|
|
51
73
|
|
|
52
74
|
1) Pull the image:
|
|
53
75
|
```shell
|
|
@@ -96,17 +118,20 @@ To see basic help:
|
|
|
96
118
|
|
|
97
119
|
$ drove -h
|
|
98
120
|
|
|
99
|
-
usage: drove [-h] [--file FILE] [--cluster CLUSTER] [--endpoint ENDPOINT] [--auth-header AUTH_HEADER] [--insecure
|
|
100
|
-
{executor,cluster,apps,appinstances,tasks} ...
|
|
121
|
+
usage: drove [-h] [--file FILE] [--cluster CLUSTER] [--endpoint ENDPOINT] [--auth-header AUTH_HEADER] [--insecure] [--username USERNAME] [--password PASSWORD] [--debug]
|
|
122
|
+
{lsinstances,executor,cluster,apps,appinstances,tasks,localservices} ...
|
|
123
|
+
|
|
101
124
|
|
|
102
125
|
positional arguments:
|
|
103
|
-
{executor,cluster,apps,appinstances,tasks}
|
|
126
|
+
{lsinstances,executor,cluster,apps,appinstances,tasks,localservices}
|
|
104
127
|
Available plugins
|
|
128
|
+
lsinstances Drove local service instance related commands
|
|
105
129
|
executor Drove cluster executor related commands
|
|
106
130
|
cluster Drove cluster related commands
|
|
107
131
|
apps Drove application related commands
|
|
108
132
|
appinstances Drove application instance related commands
|
|
109
133
|
tasks Drove task related commands
|
|
134
|
+
localservices Drove local service related commands
|
|
110
135
|
|
|
111
136
|
options:
|
|
112
137
|
-h, --help show this help message and exit
|
|
@@ -117,8 +142,7 @@ options:
|
|
|
117
142
|
Drove endpoint. (For example: https://drove.test.com)
|
|
118
143
|
--auth-header AUTH_HEADER, -t AUTH_HEADER
|
|
119
144
|
Authorization header value for the provided drove endpoint
|
|
120
|
-
--insecure
|
|
121
|
-
Do not verify SSL cert for server
|
|
145
|
+
--insecure, -i Do not verify SSL cert for server
|
|
122
146
|
--username USERNAME, -u USERNAME
|
|
123
147
|
Drove cluster username
|
|
124
148
|
--password PASSWORD, -p PASSWORD
|
|
@@ -196,8 +220,8 @@ auth_header = %(prod_token)s
|
|
|
196
220
|
..
|
|
197
221
|
```
|
|
198
222
|
|
|
199
|
-
The `DEFAULT` section can be used to define common variables like Insecure etc. The `local`, `stage`, `production` etc are names for
|
|
200
|
-
*Interpolation* of values is supported and can be
|
|
223
|
+
The `DEFAULT` section can be used to define common variables like Insecure etc. The `local`, `stage`, `production` etc are names for individual 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.\
|
|
224
|
+
*Interpolation* of values is supported and can be achieved by using `%(variable_name)s` references.
|
|
201
225
|
|
|
202
226
|
> * Note: The `DEFAULT` section is mandatory
|
|
203
227
|
> * Note: The `s` at the end of `%(var)s` is mandatory for interpolation
|
|
@@ -247,10 +271,10 @@ $ drove -e http://localhost:10000 -u guest -p guest ...
|
|
|
247
271
|
```
|
|
248
272
|
|
|
249
273
|
## CLI format
|
|
250
|
-
The following
|
|
274
|
+
The following CLI format is followed:
|
|
251
275
|
|
|
252
276
|
```
|
|
253
|
-
usage: drove [-h] [--file FILE] [--cluster CLUSTER] [--endpoint ENDPOINT] [--auth-header AUTH_HEADER] [--insecure
|
|
277
|
+
usage: drove [-h] [--file FILE] [--cluster CLUSTER] [--endpoint ENDPOINT] [--auth-header AUTH_HEADER] [--insecure] [--username USERNAME] [--password PASSWORD] [--debug]
|
|
254
278
|
{executor,cluster,apps,appinstances,tasks} ...
|
|
255
279
|
```
|
|
256
280
|
### Basic Arguments
|
|
@@ -263,8 +287,7 @@ usage: drove [-h] [--file FILE] [--cluster CLUSTER] [--endpoint ENDPOINT] [--aut
|
|
|
263
287
|
Drove endpoint. (For example: https://drove.test.com)
|
|
264
288
|
--auth-header AUTH_HEADER, -t AUTH_HEADER
|
|
265
289
|
Authorization header value for the provided drove endpoint
|
|
266
|
-
--insecure
|
|
267
|
-
Do not verify SSL cert for server
|
|
290
|
+
--insecure, -i Do not verify SSL cert for server
|
|
268
291
|
--username USERNAME, -u USERNAME
|
|
269
292
|
Drove cluster username
|
|
270
293
|
--password PASSWORD, -p PASSWORD
|
|
@@ -280,6 +303,7 @@ Commands in drove are meant to address specific functionality. They can be summa
|
|
|
280
303
|
info Show details about executor
|
|
281
304
|
appinstances Show app instances running on this executor
|
|
282
305
|
tasks Show tasks running on this executor
|
|
306
|
+
lsinstances Show local service instances running on this executor
|
|
283
307
|
blacklist Blacklist executors
|
|
284
308
|
unblacklist Un-blacklist executors
|
|
285
309
|
```
|
|
@@ -351,6 +375,25 @@ drove executor tasks [-h] [--sort {0,1,2,3,4,5}] [--reverse] executor-id
|
|
|
351
375
|
--reverse, -r Sort in reverse order
|
|
352
376
|
```
|
|
353
377
|
|
|
378
|
+
##### lsinstances
|
|
379
|
+
|
|
380
|
+
Show local service instances running on this executor
|
|
381
|
+
|
|
382
|
+
```shell
|
|
383
|
+
drove executor lsinstances [-h] [--sort {0,1,2,3,4,5}] [--reverse] executor-id
|
|
384
|
+
```
|
|
385
|
+
###### Positional Arguments
|
|
386
|
+
|
|
387
|
+
`executor-id` - Executor id for which info is to be shown
|
|
388
|
+
|
|
389
|
+
###### Arguments
|
|
390
|
+
|
|
391
|
+
```
|
|
392
|
+
--sort {0,1,2,3,4,5}, -s {0,1,2,3,4,5}
|
|
393
|
+
Sort output by column
|
|
394
|
+
--reverse, -r Sort in reverse order
|
|
395
|
+
```
|
|
396
|
+
|
|
354
397
|
##### blacklist
|
|
355
398
|
|
|
356
399
|
Take executors out of rotation.
|
|
@@ -368,12 +411,12 @@ drove executor blacklist executor-id [executor-id ...]
|
|
|
368
411
|
Bring blacklisted executors back into rotation.
|
|
369
412
|
|
|
370
413
|
```shell
|
|
371
|
-
drove executor
|
|
414
|
+
drove executor unblacklist executor-id [executor-id ...]
|
|
372
415
|
```
|
|
373
416
|
|
|
374
417
|
###### Positional Arguments
|
|
375
418
|
|
|
376
|
-
`executor-id` - List of executor ids to be
|
|
419
|
+
`executor-id` - List of executor ids to be brought in to the rotation. At least one is mandatory.
|
|
377
420
|
|
|
378
421
|
### cluster
|
|
379
422
|
---
|
|
@@ -820,6 +863,256 @@ drove tasks download [-h] [--out OUT] source-app task-id file
|
|
|
820
863
|
```
|
|
821
864
|
--out OUT, -o OUT Filename to download to. Default is the same filename as provided.
|
|
822
865
|
```
|
|
866
|
+
### localservices
|
|
867
|
+
---
|
|
868
|
+
Drove local service related commands
|
|
869
|
+
|
|
870
|
+
```shell
|
|
871
|
+
drove localservices [-h] {list,summary,spec,create,destroy,activate,deactivate,restart,cancelop} ...
|
|
872
|
+
```
|
|
873
|
+
#### Sub-commands
|
|
874
|
+
|
|
875
|
+
##### list
|
|
876
|
+
|
|
877
|
+
List all local services
|
|
878
|
+
|
|
879
|
+
```shell
|
|
880
|
+
drove localservices list [-h] [--sort {0,1,2,3,4,5,6,7,8}] [--reverse]
|
|
881
|
+
```
|
|
882
|
+
|
|
883
|
+
###### Named Arguments
|
|
884
|
+
|
|
885
|
+
```
|
|
886
|
+
--sort {0,1,2,3,4,5,6,7,8}, -s {0,1,2,3,4,5,6,7,8}
|
|
887
|
+
Sort output by column
|
|
888
|
+
--reverse, -r Sort in reverse order
|
|
889
|
+
```
|
|
890
|
+
|
|
891
|
+
##### summary
|
|
892
|
+
|
|
893
|
+
Show a summary for a local service
|
|
894
|
+
```shell
|
|
895
|
+
drove localservices summary [-h] service-id
|
|
896
|
+
```
|
|
897
|
+
###### Positional Arguments
|
|
898
|
+
|
|
899
|
+
`service-id` - Local Service ID
|
|
900
|
+
|
|
901
|
+
##### spec
|
|
902
|
+
|
|
903
|
+
Print the raw json spec for a local service
|
|
904
|
+
```shell
|
|
905
|
+
drove localservices spec [-h] service-id
|
|
906
|
+
```
|
|
907
|
+
###### Positional Arguments
|
|
908
|
+
|
|
909
|
+
`service-id` - Local Service ID
|
|
910
|
+
|
|
911
|
+
##### create
|
|
912
|
+
|
|
913
|
+
Create local service on cluster
|
|
914
|
+
```shell
|
|
915
|
+
drove localservices create [-h] spec-file
|
|
916
|
+
```
|
|
917
|
+
###### Positional Arguments
|
|
918
|
+
|
|
919
|
+
`spec-file` - JSON spec file for the local service
|
|
920
|
+
|
|
921
|
+
##### destroy
|
|
922
|
+
|
|
923
|
+
Destroy an inactive local service
|
|
924
|
+
|
|
925
|
+
```shell
|
|
926
|
+
drove localservices destroy [-h] service-id
|
|
927
|
+
```
|
|
928
|
+
###### Positional Arguments
|
|
929
|
+
|
|
930
|
+
`service-id` - Local Service ID
|
|
931
|
+
|
|
932
|
+
|
|
933
|
+
##### activate
|
|
934
|
+
|
|
935
|
+
Activate a local service
|
|
936
|
+
|
|
937
|
+
```shell
|
|
938
|
+
drove localservices activate [-h] service-id
|
|
939
|
+
```
|
|
940
|
+
###### Positional Arguments
|
|
941
|
+
|
|
942
|
+
`service-id` - Local Service ID
|
|
943
|
+
|
|
944
|
+
##### deactivate
|
|
945
|
+
|
|
946
|
+
Deactivate a local service
|
|
947
|
+
|
|
948
|
+
```shell
|
|
949
|
+
drove localservices deactivate [-h] service-id
|
|
950
|
+
```
|
|
951
|
+
###### Positional Arguments
|
|
952
|
+
|
|
953
|
+
`service-id` - Local Service ID
|
|
954
|
+
|
|
955
|
+
##### update
|
|
956
|
+
|
|
957
|
+
Deactivate a local service
|
|
958
|
+
|
|
959
|
+
```shell
|
|
960
|
+
drove localservices update [-h] service-id count
|
|
961
|
+
```
|
|
962
|
+
###### Positional Arguments
|
|
963
|
+
|
|
964
|
+
`service-id` - Local Service ID
|
|
965
|
+
`count` - Number of instances per executor
|
|
966
|
+
|
|
967
|
+
##### restart
|
|
968
|
+
|
|
969
|
+
Restart a local service.
|
|
970
|
+
|
|
971
|
+
```shell
|
|
972
|
+
drove localservices restart [-h] [--stop] [--parallelism PARALLELISM] [--timeout TIMEOUT] [--wait] service-id
|
|
973
|
+
```
|
|
974
|
+
|
|
975
|
+
###### Positional Arguments
|
|
976
|
+
|
|
977
|
+
`service-id` - Local Service ID
|
|
978
|
+
|
|
979
|
+
###### Named Arguments
|
|
980
|
+
```
|
|
981
|
+
--stop, -s Stop current instance before spinning up new ones
|
|
982
|
+
--parallelism PARALLELISM, -p PARALLELISM
|
|
983
|
+
Number of parallel threads to be used to execute operation
|
|
984
|
+
--timeout TIMEOUT, -t TIMEOUT
|
|
985
|
+
Timeout for the operation on the cluster
|
|
986
|
+
--wait, -w Wait to ensure all instances are replaced
|
|
987
|
+
```
|
|
988
|
+
##### cancelop
|
|
989
|
+
|
|
990
|
+
Cancel current operation
|
|
991
|
+
```shell
|
|
992
|
+
drove localservices cancelop [-h] service-id
|
|
993
|
+
```
|
|
994
|
+
###### Positional Arguments
|
|
995
|
+
`service-id` - Service ID
|
|
996
|
+
|
|
997
|
+
### lsinstances
|
|
998
|
+
---
|
|
999
|
+
Drove local service instance related commands
|
|
1000
|
+
|
|
1001
|
+
```shell
|
|
1002
|
+
drove lsinstances [-h] {list,info,logs,tail,download,replace,kill} ...
|
|
1003
|
+
```
|
|
1004
|
+
#### Sub-commands
|
|
1005
|
+
|
|
1006
|
+
##### list
|
|
1007
|
+
|
|
1008
|
+
List all local service instances
|
|
1009
|
+
```shell
|
|
1010
|
+
drove lsinstances list [-h] [--old] [--sort {0,1,2,3,4,5}] [--reverse] service-id
|
|
1011
|
+
```
|
|
1012
|
+
###### Positional Arguments
|
|
1013
|
+
`service-id` - Local Service ID
|
|
1014
|
+
|
|
1015
|
+
###### Named Arguments
|
|
1016
|
+
|
|
1017
|
+
```
|
|
1018
|
+
--parallelism PARALLELISM, -p PARALLELISM
|
|
1019
|
+
Number of parallel threads to be used to execute operation (default: 1)
|
|
1020
|
+
--timeout TIMEOUT, -t TIMEOUT
|
|
1021
|
+
Timeout for the operation on the cluster (default: 5 minutes)
|
|
1022
|
+
```
|
|
1023
|
+
##### info
|
|
1024
|
+
|
|
1025
|
+
Print details for an local service instance
|
|
1026
|
+
```shell
|
|
1027
|
+
drove lsinstances info [-h] service-id instance-id
|
|
1028
|
+
```
|
|
1029
|
+
###### Positional Arguments
|
|
1030
|
+
`service-id` - Local Service ID\
|
|
1031
|
+
`instance-id` - Local Service Instance ID
|
|
1032
|
+
|
|
1033
|
+
##### logs
|
|
1034
|
+
|
|
1035
|
+
Print list of logs for local service instance
|
|
1036
|
+
```shell
|
|
1037
|
+
drove lsinstances logs [-h] service-id instance-id
|
|
1038
|
+
```
|
|
1039
|
+
###### Positional Arguments
|
|
1040
|
+
|
|
1041
|
+
`service-id` - Local Service ID\
|
|
1042
|
+
`instance-id` - Local Service Instance ID
|
|
1043
|
+
|
|
1044
|
+
##### tail
|
|
1045
|
+
|
|
1046
|
+
Tail log for local service instance
|
|
1047
|
+
```shell
|
|
1048
|
+
drove lsinstances tail [-h] [--file FILE] service-id instance-id
|
|
1049
|
+
```
|
|
1050
|
+
###### Positional Arguments
|
|
1051
|
+
|
|
1052
|
+
`service-id` - Local Service ID
|
|
1053
|
+
`instance-id` - Local Service Instance ID
|
|
1054
|
+
|
|
1055
|
+
###### Named Arguments
|
|
1056
|
+
|
|
1057
|
+
```
|
|
1058
|
+
--log LOG, -l LOG Log filename to tail. Default is to tail output.log
|
|
1059
|
+
```
|
|
1060
|
+
|
|
1061
|
+
##### download
|
|
1062
|
+
|
|
1063
|
+
Download log for local service instance
|
|
1064
|
+
```shell
|
|
1065
|
+
drove lsinstances download [-h] [--out OUT] service-id instance-id file
|
|
1066
|
+
```
|
|
1067
|
+
###### Positional Arguments
|
|
1068
|
+
|
|
1069
|
+
`service-id` - Local Service ID
|
|
1070
|
+
`instance-id` - Local Service Instance ID
|
|
1071
|
+
`file` - Log filename to download
|
|
1072
|
+
|
|
1073
|
+
###### Named Arguments
|
|
1074
|
+
```
|
|
1075
|
+
--out, -o Filename to download to. Default is the same filename as provided.
|
|
1076
|
+
```
|
|
1077
|
+
##### replace
|
|
1078
|
+
|
|
1079
|
+
Replace specific local service instances with fresh instances
|
|
1080
|
+
```shell
|
|
1081
|
+
drove lsinstances replace [-h] [--stop] [--parallelism PARALLELISM] [--timeout TIMEOUT] [--wait] service-id instance-id [instance-id ...]
|
|
1082
|
+
```
|
|
1083
|
+
###### Positional Arguments
|
|
1084
|
+
`service-id` - Local Service ID
|
|
1085
|
+
`instance-id` - Local Service Instance IDs
|
|
1086
|
+
|
|
1087
|
+
###### Named Arguments
|
|
1088
|
+
```
|
|
1089
|
+
--stop, -s Stop the instance before spinning up a new one
|
|
1090
|
+
--parallelism PARALLELISM, -p PARALLELISM
|
|
1091
|
+
Number of parallel threads to be used to execute operation
|
|
1092
|
+
--timeout TIMEOUT, -t TIMEOUT
|
|
1093
|
+
Timeout for the operation on the cluster
|
|
1094
|
+
--wait, -w Wait to ensure all instances are replaced
|
|
1095
|
+
```
|
|
1096
|
+
|
|
1097
|
+
##### kill
|
|
1098
|
+
|
|
1099
|
+
Kill specific local service instances
|
|
1100
|
+
```shell
|
|
1101
|
+
drove lsinstances kill [-h] [--parallelism PARALLELISM] [--timeout TIMEOUT] service-id instance-id [instance-id ...]
|
|
1102
|
+
```
|
|
1103
|
+
###### Positional Arguments
|
|
1104
|
+
`service-id` - Local Service ID
|
|
1105
|
+
`instance-id` - Local Service Instance IDs
|
|
1106
|
+
|
|
1107
|
+
###### Named Arguments
|
|
1108
|
+
|
|
1109
|
+
```
|
|
1110
|
+
--parallelism PARALLELISM, -p PARALLELISM
|
|
1111
|
+
Number of parallel threads to be used to execute operation
|
|
1112
|
+
--timeout TIMEOUT, -t TIMEOUT
|
|
1113
|
+
Timeout for the operation on the cluster (default: 5 minutes)
|
|
1114
|
+
--wait, -w Wait to ensure all instances are killed
|
|
1115
|
+
```
|
|
823
1116
|
|
|
824
1117
|
©2024, Santanu Sinha.
|
|
825
1118
|
|