drove-cli 0.0.4__tar.gz → 0.0.6__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.
@@ -0,0 +1,166 @@
1
+ Metadata-Version: 2.4
2
+ Name: drove-cli
3
+ Version: 0.0.6
4
+ Summary: Drove Command Line Interface
5
+ License: Apache-2.0
6
+ Keywords: container,docker,podman,distributed-systems,container-orchestrator
7
+ Author: Santanu Sinha
8
+ Author-email: santanu.sinha@gmail.com
9
+ Maintainer: Santanu Sinha
10
+ Maintainer-email: santanu.sinha@gmail.com
11
+ Requires-Python: >=3.7,<4.0
12
+ Classifier: Development Status :: 5 - Production/Stable
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Intended Audience :: System Administrators
15
+ Classifier: License :: OSI Approved :: Apache Software License
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.7
18
+ Classifier: Programming Language :: Python :: 3.8
19
+ Classifier: Programming Language :: Python :: 3.9
20
+ Classifier: Programming Language :: Python :: 3.10
21
+ Classifier: Programming Language :: Python :: 3.11
22
+ Classifier: Programming Language :: Python :: 3.12
23
+ Classifier: Programming Language :: Python :: 3.13
24
+ Classifier: Programming Language :: Python :: 3.14
25
+ Classifier: Topic :: System :: Clustering
26
+ Classifier: Topic :: System :: Distributed Computing
27
+ Requires-Dist: requests (>=2.31.0,<3.0.0)
28
+ Requires-Dist: tabulate (>=0.9.0,<0.10.0)
29
+ Requires-Dist: tenacity (>=8.2.3,<9.0.0)
30
+ Requires-Dist: urllib3 (>=2.0.7,<3.0.0)
31
+ Project-URL: Repository, https://github.com/PhonePe/drove-cli
32
+ Description-Content-Type: text/markdown
33
+
34
+ # Drove CLI
35
+
36
+ Command-line interface for the [Drove Container Orchestrator](https://github.com/PhonePe/drove-orchestrator).
37
+
38
+ ## Installation
39
+
40
+ ### Using pip
41
+
42
+ ```bash
43
+ pip install drove-cli
44
+ ```
45
+
46
+ ### Using pip (virtual environment)
47
+
48
+ ```bash
49
+ python3 -m venv ~/.venvs/drove-cli
50
+ source ~/.venvs/drove-cli/bin/activate
51
+ pip install drove-cli
52
+ ```
53
+
54
+ To activate in a new shell:
55
+ ```bash
56
+ source ~/.venvs/drove-cli/bin/activate
57
+ ```
58
+
59
+ ### Using Docker
60
+
61
+ ```bash
62
+ docker pull ghcr.io/phonepe/drove-cli:latest
63
+ ```
64
+
65
+ Create a wrapper script for convenience:
66
+
67
+ ```bash
68
+ cat > ~/bin/drove << 'EOF'
69
+ #!/bin/sh
70
+ docker run --rm -it --network host \
71
+ -v ${HOME}/.drove:/root/.drove:ro \
72
+ ghcr.io/phonepe/drove-cli:latest "$@"
73
+ EOF
74
+ chmod +x ~/bin/drove
75
+ ```
76
+
77
+ ## Upgrade
78
+
79
+ ### Using pip
80
+
81
+ ```bash
82
+ pip install -U drove-cli
83
+ ```
84
+
85
+ ### Using Docker
86
+
87
+ ```bash
88
+ docker pull ghcr.io/phonepe/drove-cli:latest
89
+ ```
90
+
91
+ ## Configuration
92
+
93
+ Create `~/.drove` with your cluster configuration:
94
+
95
+ ```ini
96
+ [DEFAULT]
97
+ stage_token = <your-stage-token>
98
+ prod_token = <your-prod-token>
99
+
100
+ [local]
101
+ endpoint = http://localhost:10000
102
+ username = admin
103
+ password = admin
104
+
105
+ [stage]
106
+ endpoint = https://drove.stage.example.com
107
+ auth_header = %(stage_token)s
108
+
109
+ [prod]
110
+ endpoint = https://drove.prod.example.com
111
+ auth_header = %(prod_token)s
112
+ ```
113
+
114
+ ## Quick Start
115
+
116
+ ```bash
117
+ # Verify connection
118
+ drove -c prod cluster ping
119
+
120
+ # View cluster status
121
+ drove -c prod cluster summary
122
+
123
+ # List applications
124
+ drove -c prod apps list
125
+
126
+ # Get application info
127
+ drove -c prod apps info <app-name>
128
+ ```
129
+
130
+ ## Commands
131
+
132
+ | Command | Description |
133
+ |---------|-----------------------------------------------------------------------|
134
+ | `appinstances` | Application instance operations |
135
+ | `apps` | Application lifecycle Management (list, info, deploy, scale, suspend) |
136
+ | `cluster` | Cluster operations (ping, summary, leader, maintenance) |
137
+ | `config` | CLI configuration management |
138
+ | `describe` | Show detailed information about a resource |
139
+ | `executor` | Executor management |
140
+ | `localservices` | Local service management |
141
+ | `lsinstances` | Local service instance operations |
142
+ | `tasks` | One-off task execution |
143
+
144
+ Use `drove -h` or `drove <command> -h` for detailed help.
145
+
146
+ ## Global Options
147
+
148
+ ```
149
+ -f, --file FILE Configuration file (default: ~/.drove)
150
+ -c, --cluster CLUSTER Cluster name from config file
151
+ -e, --endpoint URL Drove endpoint URL
152
+ -t, --auth-header HDR Authorization header value
153
+ -u, --username USER Cluster username
154
+ -p, --password PASS Cluster password
155
+ -i, --insecure Skip SSL verification
156
+ -d, --debug Print error details
157
+ ```
158
+
159
+ ## Documentation
160
+
161
+ Full documentation is available at **[phonepe.github.io/drove-orchestrator](https://phonepe.github.io/drove-orchestrator/cli/)**
162
+
163
+ ## License
164
+
165
+ © 2024 Santanu Sinha | Apache 2.0
166
+
@@ -0,0 +1,132 @@
1
+ # Drove CLI
2
+
3
+ Command-line interface for the [Drove Container Orchestrator](https://github.com/PhonePe/drove-orchestrator).
4
+
5
+ ## Installation
6
+
7
+ ### Using pip
8
+
9
+ ```bash
10
+ pip install drove-cli
11
+ ```
12
+
13
+ ### Using pip (virtual environment)
14
+
15
+ ```bash
16
+ python3 -m venv ~/.venvs/drove-cli
17
+ source ~/.venvs/drove-cli/bin/activate
18
+ pip install drove-cli
19
+ ```
20
+
21
+ To activate in a new shell:
22
+ ```bash
23
+ source ~/.venvs/drove-cli/bin/activate
24
+ ```
25
+
26
+ ### Using Docker
27
+
28
+ ```bash
29
+ docker pull ghcr.io/phonepe/drove-cli:latest
30
+ ```
31
+
32
+ Create a wrapper script for convenience:
33
+
34
+ ```bash
35
+ cat > ~/bin/drove << 'EOF'
36
+ #!/bin/sh
37
+ docker run --rm -it --network host \
38
+ -v ${HOME}/.drove:/root/.drove:ro \
39
+ ghcr.io/phonepe/drove-cli:latest "$@"
40
+ EOF
41
+ chmod +x ~/bin/drove
42
+ ```
43
+
44
+ ## Upgrade
45
+
46
+ ### Using pip
47
+
48
+ ```bash
49
+ pip install -U drove-cli
50
+ ```
51
+
52
+ ### Using Docker
53
+
54
+ ```bash
55
+ docker pull ghcr.io/phonepe/drove-cli:latest
56
+ ```
57
+
58
+ ## Configuration
59
+
60
+ Create `~/.drove` with your cluster configuration:
61
+
62
+ ```ini
63
+ [DEFAULT]
64
+ stage_token = <your-stage-token>
65
+ prod_token = <your-prod-token>
66
+
67
+ [local]
68
+ endpoint = http://localhost:10000
69
+ username = admin
70
+ password = admin
71
+
72
+ [stage]
73
+ endpoint = https://drove.stage.example.com
74
+ auth_header = %(stage_token)s
75
+
76
+ [prod]
77
+ endpoint = https://drove.prod.example.com
78
+ auth_header = %(prod_token)s
79
+ ```
80
+
81
+ ## Quick Start
82
+
83
+ ```bash
84
+ # Verify connection
85
+ drove -c prod cluster ping
86
+
87
+ # View cluster status
88
+ drove -c prod cluster summary
89
+
90
+ # List applications
91
+ drove -c prod apps list
92
+
93
+ # Get application info
94
+ drove -c prod apps info <app-name>
95
+ ```
96
+
97
+ ## Commands
98
+
99
+ | Command | Description |
100
+ |---------|-----------------------------------------------------------------------|
101
+ | `appinstances` | Application instance operations |
102
+ | `apps` | Application lifecycle Management (list, info, deploy, scale, suspend) |
103
+ | `cluster` | Cluster operations (ping, summary, leader, maintenance) |
104
+ | `config` | CLI configuration management |
105
+ | `describe` | Show detailed information about a resource |
106
+ | `executor` | Executor management |
107
+ | `localservices` | Local service management |
108
+ | `lsinstances` | Local service instance operations |
109
+ | `tasks` | One-off task execution |
110
+
111
+ Use `drove -h` or `drove <command> -h` for detailed help.
112
+
113
+ ## Global Options
114
+
115
+ ```
116
+ -f, --file FILE Configuration file (default: ~/.drove)
117
+ -c, --cluster CLUSTER Cluster name from config file
118
+ -e, --endpoint URL Drove endpoint URL
119
+ -t, --auth-header HDR Authorization header value
120
+ -u, --username USER Cluster username
121
+ -p, --password PASS Cluster password
122
+ -i, --insecure Skip SSL verification
123
+ -d, --debug Print error details
124
+ ```
125
+
126
+ ## Documentation
127
+
128
+ Full documentation is available at **[phonepe.github.io/drove-orchestrator](https://phonepe.github.io/drove-orchestrator/cli/)**
129
+
130
+ ## License
131
+
132
+ © 2024 Santanu Sinha | Apache 2.0
@@ -20,7 +20,7 @@ class Applications(plugins.DrovePlugin):
20
20
  sub_parser = commands.add_parser("list", help="List all application instances")
21
21
  sub_parser.add_argument("app_id", metavar="app-id", help="Application ID")
22
22
  sub_parser.add_argument("--old", "-o", help="Show old instances", action="store_true")
23
- sub_parser.add_argument("--sort", "-s", help="Sort output by column", type=int, choices=range(0, 6), default = 0)
23
+ sub_parser.add_argument("--sort", "-s", help="Sort output by column", type=int, choices=range(0, 7), default = 0)
24
24
  sub_parser.add_argument("--reverse", "-r", help="Sort in reverse order", action="store_true")
25
25
  sub_parser.set_defaults(func=self.list_instances)
26
26
 
@@ -76,15 +76,20 @@ class Applications(plugins.DrovePlugin):
76
76
  api = "/apis/v1/applications/{app_id}/instances/old"
77
77
  data = self.drove_client.get(api.format(app_id = options.app_id))
78
78
  #headers = ["Instance ID", "Executor", "CPU", "Memory(MB)", "State", "Error Message", "Created", "Last Updated"]
79
- headers = ["Instance ID", "Executor Host", "State", "Error Message", "Created", "Last Updated"]
79
+ headers = ["Instance ID", "Executor Host", "Ports", "State", "Error Message", "Created", "Last Updated"]
80
80
  rows = []
81
81
  for instance in data:
82
82
  instance_row = []
83
83
  instance_row.append(instance["instanceId"])
84
- try:
85
- instance_row.append(instance["localInfo"]["hostname"])
86
- except KeyError:
87
- instance_row.append("")
84
+ local_info = instance.get("localInfo", {})
85
+ instance_row.append(local_info.get("hostname", ""))
86
+ ports = local_info.get("ports", {})
87
+ ports_str = ",".join(
88
+ "{}:{}".format(key, value["hostPort"])
89
+ for key, value in ports.items()
90
+ if "hostPort" in value
91
+ )
92
+ instance_row.append(ports_str)
88
93
  instance_row.append(instance["state"])
89
94
  instance_row.append(instance["errorMessage"])
90
95
  instance_row.append(droveutils.to_date(instance["created"]))