1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
|
%global _empty_manifest_terminate_build 0
Name: python-vdk-control-cli
Version: 1.3.870522728
Release: 1
Summary: VDK Control CLI allows user to create, delete, manage and their Data Jobs in Kubernetes runtime.
License: Apache Software License
URL: https://github.com/vmware/versatile-data-kit
Source0: https://mirrors.aliyun.com/pypi/web/packages/45/cf/46f3809ef17e53bc72c9611cfda57da6fad99216651c5aa01fca00e0a510/vdk-control-cli-1.3.870522728.tar.gz
BuildArch: noarch
%description
# Versatile Data Kit Control CLI
VDK Control CLI is meant for Data Engineers to use to manage the lifecycle of jobs - create, delete, deploy, configure Data Jobs.
To build or contribute, see [CONTRIBUTING.md](./CONTRIBUTING.md).
## Installation
Install VDK Control CLI with:
```bash
pip install vdk-control-cli
```
This will install console application called `vdkcli`
Then run help to see what it can do:
```bash
vdkcli --help
```
`vdkcli` is the name of the console application only when vdk-control-cli is installed autonomously. Typically,
it is a dependency of Versatile Data Kit and the console application is `vdk` (hence, all commands in error and help
messages in this project refer to `vdk`). Keep in mind that if you are using this project autonomously, you should
use `vdkcli` command instead of `vdk`.
### Environment variables:
* VDK_BASE_CONFIG_FOLDER - Override local base configuration folder (by default in $HOME folder). Inside it will create folder .vdk.internal.
CLI state may be kept there (login info). Use in case multiple users need to login (e.g in case of automation) on same machine.
* VDK_CONTROL_SERVICE_REST_API_URL - Default Control Service URL to use if not specified as command line argument
* VDK_API_TOKEN - Default API Token to use if another authentication has not been used with vdk login
* VDK_API_TOKEN_AUTHORIZATION_URL - Default API token URL to use if another authentication has not been used with vdk login.
### Security
If Control Service configured require authentication: vdk login must have finished successfully.
Or alternatively correct VDK_API_TOKEN_AUTHORIZATION_URL and VDK_API_TOKEN must be set correctly and will behave same as `vdk login -t api-token`.
If vdk login is used - it take priority over environment variables set VDK_API_TOKEN_AUTHORIZATION_URL and VDK_API_TOKEN
To clear previous login info (aka logout) use `vdk logout`.
In case of credentials type vdk login flow we start a process on port `31113` to receive the credentials.
If you already have process running on `31113` you can override the value.
To override the port set environmental variable `OAUTH_PORT` with free port which the client can use.
## Plugins
### Installing and Using plugins
Installing a third party plugin can be easily done with pip:
```bash
pip install vdk-control-cli-NAME
pip uninstall vdk-control-cli-NAME
```
If a plugin is installed, vdk automatically finds and integrates it.
### Write your own plugin
A plugin is python module that enhances or changes the behaviour of the vdk cli. <br>
A plugin contains one or multiple hook functions.
See all supported hook function specifications that can be implemented in [specs.py](src/vdk/api/control/plugin/specs.py)
In order to create a new plugin there are only 2 steps:<br>
* Create your implementation of the plugin's hook(s):
```python
# define hookimpl as follows (library requirement: pluggy)
hookimpl = pluggy.HookimplMarker("vdk_control_cli.plugin")
# though it's better to use `vdk.internal.control.plugin.markers.hookimpl` from vdk-control-cli python package
# name of function must match name of hookspec function
@hookimpl
def get_default_commands_options():
# your implementation here ; for example to set defaults for `vdk login --type --oauth2-authorization-url` command
default_options = {
"login": {
"auth_type": "api-token", # note values must be valid or the plugin may break the CLI, no checking is done at this point
"api_token_authorization_url": "http://localhost/authorize" # replace dashes with underscore for the argument name
}
}
return default_options
```
* Register as plugin by listing the plugin modules in vdk_control_cli.plugin entry_point in your setup.py:
```python
entry_points={ 'vdk_control_cli.plugin': ['name_of_plugin = myproject.pluginmodule'] }
```
<br>The plugin system is based on [pluggy.](https://pluggy.readthedocs.io/en/latest/index.html#implementations)
<br>SDK Extensibility design can be seen [here](https://github.com/vmware/versatile-data-kit/tree/main/specs)
## Authentication
In order to use credentials login type you need to create OAuth2 Application.
%package -n python3-vdk-control-cli
Summary: VDK Control CLI allows user to create, delete, manage and their Data Jobs in Kubernetes runtime.
Provides: python-vdk-control-cli
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pip
%description -n python3-vdk-control-cli
# Versatile Data Kit Control CLI
VDK Control CLI is meant for Data Engineers to use to manage the lifecycle of jobs - create, delete, deploy, configure Data Jobs.
To build or contribute, see [CONTRIBUTING.md](./CONTRIBUTING.md).
## Installation
Install VDK Control CLI with:
```bash
pip install vdk-control-cli
```
This will install console application called `vdkcli`
Then run help to see what it can do:
```bash
vdkcli --help
```
`vdkcli` is the name of the console application only when vdk-control-cli is installed autonomously. Typically,
it is a dependency of Versatile Data Kit and the console application is `vdk` (hence, all commands in error and help
messages in this project refer to `vdk`). Keep in mind that if you are using this project autonomously, you should
use `vdkcli` command instead of `vdk`.
### Environment variables:
* VDK_BASE_CONFIG_FOLDER - Override local base configuration folder (by default in $HOME folder). Inside it will create folder .vdk.internal.
CLI state may be kept there (login info). Use in case multiple users need to login (e.g in case of automation) on same machine.
* VDK_CONTROL_SERVICE_REST_API_URL - Default Control Service URL to use if not specified as command line argument
* VDK_API_TOKEN - Default API Token to use if another authentication has not been used with vdk login
* VDK_API_TOKEN_AUTHORIZATION_URL - Default API token URL to use if another authentication has not been used with vdk login.
### Security
If Control Service configured require authentication: vdk login must have finished successfully.
Or alternatively correct VDK_API_TOKEN_AUTHORIZATION_URL and VDK_API_TOKEN must be set correctly and will behave same as `vdk login -t api-token`.
If vdk login is used - it take priority over environment variables set VDK_API_TOKEN_AUTHORIZATION_URL and VDK_API_TOKEN
To clear previous login info (aka logout) use `vdk logout`.
In case of credentials type vdk login flow we start a process on port `31113` to receive the credentials.
If you already have process running on `31113` you can override the value.
To override the port set environmental variable `OAUTH_PORT` with free port which the client can use.
## Plugins
### Installing and Using plugins
Installing a third party plugin can be easily done with pip:
```bash
pip install vdk-control-cli-NAME
pip uninstall vdk-control-cli-NAME
```
If a plugin is installed, vdk automatically finds and integrates it.
### Write your own plugin
A plugin is python module that enhances or changes the behaviour of the vdk cli. <br>
A plugin contains one or multiple hook functions.
See all supported hook function specifications that can be implemented in [specs.py](src/vdk/api/control/plugin/specs.py)
In order to create a new plugin there are only 2 steps:<br>
* Create your implementation of the plugin's hook(s):
```python
# define hookimpl as follows (library requirement: pluggy)
hookimpl = pluggy.HookimplMarker("vdk_control_cli.plugin")
# though it's better to use `vdk.internal.control.plugin.markers.hookimpl` from vdk-control-cli python package
# name of function must match name of hookspec function
@hookimpl
def get_default_commands_options():
# your implementation here ; for example to set defaults for `vdk login --type --oauth2-authorization-url` command
default_options = {
"login": {
"auth_type": "api-token", # note values must be valid or the plugin may break the CLI, no checking is done at this point
"api_token_authorization_url": "http://localhost/authorize" # replace dashes with underscore for the argument name
}
}
return default_options
```
* Register as plugin by listing the plugin modules in vdk_control_cli.plugin entry_point in your setup.py:
```python
entry_points={ 'vdk_control_cli.plugin': ['name_of_plugin = myproject.pluginmodule'] }
```
<br>The plugin system is based on [pluggy.](https://pluggy.readthedocs.io/en/latest/index.html#implementations)
<br>SDK Extensibility design can be seen [here](https://github.com/vmware/versatile-data-kit/tree/main/specs)
## Authentication
In order to use credentials login type you need to create OAuth2 Application.
%package help
Summary: Development documents and examples for vdk-control-cli
Provides: python3-vdk-control-cli-doc
%description help
# Versatile Data Kit Control CLI
VDK Control CLI is meant for Data Engineers to use to manage the lifecycle of jobs - create, delete, deploy, configure Data Jobs.
To build or contribute, see [CONTRIBUTING.md](./CONTRIBUTING.md).
## Installation
Install VDK Control CLI with:
```bash
pip install vdk-control-cli
```
This will install console application called `vdkcli`
Then run help to see what it can do:
```bash
vdkcli --help
```
`vdkcli` is the name of the console application only when vdk-control-cli is installed autonomously. Typically,
it is a dependency of Versatile Data Kit and the console application is `vdk` (hence, all commands in error and help
messages in this project refer to `vdk`). Keep in mind that if you are using this project autonomously, you should
use `vdkcli` command instead of `vdk`.
### Environment variables:
* VDK_BASE_CONFIG_FOLDER - Override local base configuration folder (by default in $HOME folder). Inside it will create folder .vdk.internal.
CLI state may be kept there (login info). Use in case multiple users need to login (e.g in case of automation) on same machine.
* VDK_CONTROL_SERVICE_REST_API_URL - Default Control Service URL to use if not specified as command line argument
* VDK_API_TOKEN - Default API Token to use if another authentication has not been used with vdk login
* VDK_API_TOKEN_AUTHORIZATION_URL - Default API token URL to use if another authentication has not been used with vdk login.
### Security
If Control Service configured require authentication: vdk login must have finished successfully.
Or alternatively correct VDK_API_TOKEN_AUTHORIZATION_URL and VDK_API_TOKEN must be set correctly and will behave same as `vdk login -t api-token`.
If vdk login is used - it take priority over environment variables set VDK_API_TOKEN_AUTHORIZATION_URL and VDK_API_TOKEN
To clear previous login info (aka logout) use `vdk logout`.
In case of credentials type vdk login flow we start a process on port `31113` to receive the credentials.
If you already have process running on `31113` you can override the value.
To override the port set environmental variable `OAUTH_PORT` with free port which the client can use.
## Plugins
### Installing and Using plugins
Installing a third party plugin can be easily done with pip:
```bash
pip install vdk-control-cli-NAME
pip uninstall vdk-control-cli-NAME
```
If a plugin is installed, vdk automatically finds and integrates it.
### Write your own plugin
A plugin is python module that enhances or changes the behaviour of the vdk cli. <br>
A plugin contains one or multiple hook functions.
See all supported hook function specifications that can be implemented in [specs.py](src/vdk/api/control/plugin/specs.py)
In order to create a new plugin there are only 2 steps:<br>
* Create your implementation of the plugin's hook(s):
```python
# define hookimpl as follows (library requirement: pluggy)
hookimpl = pluggy.HookimplMarker("vdk_control_cli.plugin")
# though it's better to use `vdk.internal.control.plugin.markers.hookimpl` from vdk-control-cli python package
# name of function must match name of hookspec function
@hookimpl
def get_default_commands_options():
# your implementation here ; for example to set defaults for `vdk login --type --oauth2-authorization-url` command
default_options = {
"login": {
"auth_type": "api-token", # note values must be valid or the plugin may break the CLI, no checking is done at this point
"api_token_authorization_url": "http://localhost/authorize" # replace dashes with underscore for the argument name
}
}
return default_options
```
* Register as plugin by listing the plugin modules in vdk_control_cli.plugin entry_point in your setup.py:
```python
entry_points={ 'vdk_control_cli.plugin': ['name_of_plugin = myproject.pluginmodule'] }
```
<br>The plugin system is based on [pluggy.](https://pluggy.readthedocs.io/en/latest/index.html#implementations)
<br>SDK Extensibility design can be seen [here](https://github.com/vmware/versatile-data-kit/tree/main/specs)
## Authentication
In order to use credentials login type you need to create OAuth2 Application.
%prep
%autosetup -n vdk-control-cli-1.3.870522728
%build
%py3_build
%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
find usr/lib -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
find usr/lib64 -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
find usr/bin -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
find usr/sbin -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
find usr/share/man -type f -printf "\"/%h/%f.gz\"\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .
%files -n python3-vdk-control-cli -f filelist.lst
%dir %{python3_sitelib}/*
%files help -f doclist.lst
%{_docdir}/*
%changelog
* Thu Jun 08 2023 Python_Bot <Python_Bot@openeuler.org> - 1.3.870522728-1
- Package Spec generated
|