Skip to content

Commit 30f6bf6

Browse files
authored
update python sdk files with latest changes (#770)
* update python sdk files with latest changes * catch sdk drift
1 parent df00820 commit 30f6bf6

File tree

57 files changed

+2678
-3229
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+2678
-3229
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,9 @@ var/
140140
pip-log.txt
141141
pip-delete-this-directory.txt
142142

143+
# github workflows
144+
sdk/python/.github
145+
143146
# Unit test / coverage reports
144147
htmlcov/
145148
.tox/

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ test-python-sdk:
134134

135135
.PHONY: verify
136136
verify: vet fmt-verify ci-lint manifests generate toc-verify generate-apiref
137-
git --no-pager diff --exit-code config api client-go
137+
git --no-pager diff --exit-code config api client-go sdk
138138

139139

140140
##@ Build
@@ -305,4 +305,4 @@ generate-apiref: genref
305305
GENREF = $(PROJECT_DIR)/bin/genref
306306
.PHONY: genref
307307
genref: ## Download genref locally if necessary.
308-
@GOBIN=$(PROJECT_DIR)/bin $(GO_CMD) install github.com/kubernetes-sigs/reference-docs/[email protected]
308+
@GOBIN=$(PROJECT_DIR)/bin $(GO_CMD) install github.com/kubernetes-sigs/reference-docs/[email protected]

sdk/python/.gitlab-ci.yml

+19-21
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,31 @@
1+
# NOTE: This file is auto generated by OpenAPI Generator.
2+
# URL: https://openapi-generator.tech
3+
#
14
# ref: https://docs.gitlab.com/ee/ci/README.html
5+
# ref: https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Python.gitlab-ci.yml
26

37
stages:
48
- test
59

6-
.nosetest:
10+
.pytest:
711
stage: test
812
script:
913
- pip install -r requirements.txt
1014
- pip install -r test-requirements.txt
1115
- pytest --cov=jobset
1216

13-
nosetest-2.7:
14-
extends: .nosetest
15-
image: python:2.7-alpine
16-
nosetest-3.3:
17-
extends: .nosetest
18-
image: python:3.3-alpine
19-
nosetest-3.4:
20-
extends: .nosetest
21-
image: python:3.4-alpine
22-
nosetest-3.5:
23-
extends: .nosetest
24-
image: python:3.5-alpine
25-
nosetest-3.6:
26-
extends: .nosetest
27-
image: python:3.6-alpine
28-
nosetest-3.7:
29-
extends: .nosetest
30-
image: python:3.7-alpine
31-
nosetest-3.8:
32-
extends: .nosetest
17+
pytest-3.8:
18+
extends: .pytest
3319
image: python:3.8-alpine
20+
pytest-3.9:
21+
extends: .pytest
22+
image: python:3.9-alpine
23+
pytest-3.10:
24+
extends: .pytest
25+
image: python:3.10-alpine
26+
pytest-3.11:
27+
extends: .pytest
28+
image: python:3.11-alpine
29+
pytest-3.12:
30+
extends: .pytest
31+
image: python:3.12-alpine

sdk/python/.openapi-generator/FILES

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
.github/workflows/python.yml
2+
.gitignore
3+
.gitlab-ci.yml
4+
.travis.yml
5+
README.md
6+
docs/JobsetV1alpha2Coordinator.md
7+
docs/JobsetV1alpha2FailurePolicy.md
8+
docs/JobsetV1alpha2FailurePolicyRule.md
9+
docs/JobsetV1alpha2JobSet.md
10+
docs/JobsetV1alpha2JobSetList.md
11+
docs/JobsetV1alpha2JobSetSpec.md
12+
docs/JobsetV1alpha2JobSetStatus.md
13+
docs/JobsetV1alpha2Network.md
14+
docs/JobsetV1alpha2ReplicatedJob.md
15+
docs/JobsetV1alpha2ReplicatedJobStatus.md
16+
docs/JobsetV1alpha2StartupPolicy.md
17+
docs/JobsetV1alpha2SuccessPolicy.md
18+
git_push.sh
19+
jobset/__init__.py
20+
jobset/api/__init__.py
21+
jobset/api_client.py
22+
jobset/api_response.py
23+
jobset/configuration.py
24+
jobset/exceptions.py
25+
jobset/models/__init__.py
26+
jobset/models/jobset_v1alpha2_coordinator.py
27+
jobset/models/jobset_v1alpha2_failure_policy.py
28+
jobset/models/jobset_v1alpha2_failure_policy_rule.py
29+
jobset/models/jobset_v1alpha2_job_set.py
30+
jobset/models/jobset_v1alpha2_job_set_list.py
31+
jobset/models/jobset_v1alpha2_job_set_spec.py
32+
jobset/models/jobset_v1alpha2_job_set_status.py
33+
jobset/models/jobset_v1alpha2_network.py
34+
jobset/models/jobset_v1alpha2_replicated_job.py
35+
jobset/models/jobset_v1alpha2_replicated_job_status.py
36+
jobset/models/jobset_v1alpha2_startup_policy.py
37+
jobset/models/jobset_v1alpha2_success_policy.py
38+
jobset/py.typed
39+
jobset/rest.py
40+
pyproject.toml
41+
requirements.txt
42+
setup.cfg
43+
setup.py
44+
test-requirements.txt
45+
test/__init__.py
46+
test/test_jobset_v1alpha2_coordinator.py
47+
test/test_jobset_v1alpha2_failure_policy.py
48+
test/test_jobset_v1alpha2_failure_policy_rule.py
49+
test/test_jobset_v1alpha2_job_set.py
50+
test/test_jobset_v1alpha2_job_set_list.py
51+
test/test_jobset_v1alpha2_job_set_spec.py
52+
test/test_jobset_v1alpha2_job_set_status.py
53+
test/test_jobset_v1alpha2_network.py
54+
test/test_jobset_v1alpha2_replicated_job.py
55+
test/test_jobset_v1alpha2_replicated_job_status.py
56+
test/test_jobset_v1alpha2_startup_policy.py
57+
test/test_jobset_v1alpha2_success_policy.py
58+
tox.ini

sdk/python/.openapi-generator/VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.3.1
1+
7.12.0-SNAPSHOT

sdk/python/.travis.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# ref: https://docs.travis-ci.com/user/languages/python
22
language: python
33
python:
4-
- "2.7"
5-
- "3.2"
6-
- "3.3"
7-
- "3.4"
8-
- "3.5"
9-
- "3.6"
10-
- "3.7"
114
- "3.8"
5+
- "3.9"
6+
- "3.10"
7+
- "3.11"
8+
- "3.12"
9+
# uncomment the following if needed
10+
#- "3.12-dev" # 3.12 development branch
11+
#- "nightly" # nightly build
1212
# command to install dependencies
1313
install:
1414
- "pip install -r requirements.txt"

sdk/python/README.md

+9-4
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ This Python package is automatically generated by the [OpenAPI Generator](https:
55

66
- API version: v0.1.4
77
- Package version: 0.1.4
8+
- Generator version: 7.12.0-SNAPSHOT
89
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
910

1011
## Requirements.
1112

12-
Python 2.7 and 3.4+
13+
Python 3.8+
1314

1415
## Installation & Usage
1516
### pip install
@@ -40,14 +41,16 @@ Then import the package:
4041
import jobset
4142
```
4243

44+
### Tests
45+
46+
Execute `pytest` to run the tests.
47+
4348
## Getting Started
4449

4550
Please follow the [installation procedure](#installation--usage) and then run the following:
4651

4752
```python
48-
from __future__ import print_function
4953

50-
import time
5154
import jobset
5255
from jobset.rest import ApiException
5356
from pprint import pprint
@@ -78,9 +81,11 @@ Class | Method | HTTP request | Description
7881
- [JobsetV1alpha2SuccessPolicy](docs/JobsetV1alpha2SuccessPolicy.md)
7982

8083

84+
<a id="documentation-for-authorization"></a>
8185
## Documentation For Authorization
8286

83-
All endpoints do not require authorization.
87+
Endpoints do not require authorization.
88+
8489

8590
## Author
8691

Original file line numberDiff line numberDiff line change
@@ -1,13 +1,32 @@
11
# JobsetV1alpha2Coordinator
22

33
Coordinator defines which pod can be marked as the coordinator for the JobSet workload.
4+
45
## Properties
6+
57
Name | Type | Description | Notes
68
------------ | ------------- | ------------- | -------------
79
**job_index** | **int** | JobIndex is the index of Job which contains the coordinator pod (i.e., for a ReplicatedJob with N replicas, there are Job indexes 0 to N-1). | [optional]
810
**pod_index** | **int** | PodIndex is the Job completion index of the coordinator pod. | [optional]
911
**replicated_job** | **str** | ReplicatedJob is the name of the ReplicatedJob which contains the coordinator pod. | [default to '']
1012

13+
## Example
14+
15+
```python
16+
from jobset.models.jobset_v1alpha2_coordinator import JobsetV1alpha2Coordinator
17+
18+
# TODO update the JSON string below
19+
json = "{}"
20+
# create an instance of JobsetV1alpha2Coordinator from a JSON string
21+
jobset_v1alpha2_coordinator_instance = JobsetV1alpha2Coordinator.from_json(json)
22+
# print the JSON string representation of the object
23+
print(JobsetV1alpha2Coordinator.to_json())
24+
25+
# convert the object into a dict
26+
jobset_v1alpha2_coordinator_dict = jobset_v1alpha2_coordinator_instance.to_dict()
27+
# create an instance of JobsetV1alpha2Coordinator from a dict
28+
jobset_v1alpha2_coordinator_from_dict = JobsetV1alpha2Coordinator.from_dict(jobset_v1alpha2_coordinator_dict)
29+
```
1130
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
1231

1332

Original file line numberDiff line numberDiff line change
@@ -1,12 +1,31 @@
11
# JobsetV1alpha2FailurePolicy
22

3+
34
## Properties
5+
46
Name | Type | Description | Notes
57
------------ | ------------- | ------------- | -------------
68
**max_restarts** | **int** | MaxRestarts defines the limit on the number of JobSet restarts. A restart is achieved by recreating all active child jobs. | [optional]
79
**restart_strategy** | **str** | RestartStrategy defines the strategy to use when restarting the JobSet. Defaults to Recreate. | [optional]
8-
**rules** | [**list[JobsetV1alpha2FailurePolicyRule]**](JobsetV1alpha2FailurePolicyRule.md) | List of failure policy rules for this JobSet. For a given Job failure, the rules will be evaluated in order, and only the first matching rule will be executed. If no matching rule is found, the RestartJobSet action is applied. | [optional]
10+
**rules** | [**List[JobsetV1alpha2FailurePolicyRule]**](JobsetV1alpha2FailurePolicyRule.md) | List of failure policy rules for this JobSet. For a given Job failure, the rules will be evaluated in order, and only the first matching rule will be executed. If no matching rule is found, the RestartJobSet action is applied. | [optional]
11+
12+
## Example
13+
14+
```python
15+
from jobset.models.jobset_v1alpha2_failure_policy import JobsetV1alpha2FailurePolicy
16+
17+
# TODO update the JSON string below
18+
json = "{}"
19+
# create an instance of JobsetV1alpha2FailurePolicy from a JSON string
20+
jobset_v1alpha2_failure_policy_instance = JobsetV1alpha2FailurePolicy.from_json(json)
21+
# print the JSON string representation of the object
22+
print(JobsetV1alpha2FailurePolicy.to_json())
923

24+
# convert the object into a dict
25+
jobset_v1alpha2_failure_policy_dict = jobset_v1alpha2_failure_policy_instance.to_dict()
26+
# create an instance of JobsetV1alpha2FailurePolicy from a dict
27+
jobset_v1alpha2_failure_policy_from_dict = JobsetV1alpha2FailurePolicy.from_dict(jobset_v1alpha2_failure_policy_dict)
28+
```
1029
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
1130

1231

Original file line numberDiff line numberDiff line change
@@ -1,14 +1,33 @@
11
# JobsetV1alpha2FailurePolicyRule
22

33
FailurePolicyRule defines a FailurePolicyAction to be executed if a child job fails due to a reason listed in OnJobFailureReasons.
4+
45
## Properties
6+
57
Name | Type | Description | Notes
68
------------ | ------------- | ------------- | -------------
79
**action** | **str** | The action to take if the rule is matched. | [default to '']
810
**name** | **str** | The name of the failure policy rule. The name is defaulted to &#39;failurePolicyRuleN&#39; where N is the index of the failure policy rule. The name must match the regular expression \&quot;^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$\&quot;. | [default to '']
9-
**on_job_failure_reasons** | **list[str]** | The requirement on the job failure reasons. The requirement is satisfied if at least one reason matches the list. The rules are evaluated in order, and the first matching rule is executed. An empty list applies the rule to any job failure reason. | [optional]
10-
**target_replicated_jobs** | **list[str]** | TargetReplicatedJobs are the names of the replicated jobs the operator applies to. An empty list will apply to all replicatedJobs. | [optional]
11+
**on_job_failure_reasons** | **List[str]** | The requirement on the job failure reasons. The requirement is satisfied if at least one reason matches the list. The rules are evaluated in order, and the first matching rule is executed. An empty list applies the rule to any job failure reason. | [optional]
12+
**target_replicated_jobs** | **List[str]** | TargetReplicatedJobs are the names of the replicated jobs the operator applies to. An empty list will apply to all replicatedJobs. | [optional]
13+
14+
## Example
15+
16+
```python
17+
from jobset.models.jobset_v1alpha2_failure_policy_rule import JobsetV1alpha2FailurePolicyRule
18+
19+
# TODO update the JSON string below
20+
json = "{}"
21+
# create an instance of JobsetV1alpha2FailurePolicyRule from a JSON string
22+
jobset_v1alpha2_failure_policy_rule_instance = JobsetV1alpha2FailurePolicyRule.from_json(json)
23+
# print the JSON string representation of the object
24+
print(JobsetV1alpha2FailurePolicyRule.to_json())
1125

26+
# convert the object into a dict
27+
jobset_v1alpha2_failure_policy_rule_dict = jobset_v1alpha2_failure_policy_rule_instance.to_dict()
28+
# create an instance of JobsetV1alpha2FailurePolicyRule from a dict
29+
jobset_v1alpha2_failure_policy_rule_from_dict = JobsetV1alpha2FailurePolicyRule.from_dict(jobset_v1alpha2_failure_policy_rule_dict)
30+
```
1231
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
1332

1433

sdk/python/docs/JobsetV1alpha2JobSet.md

+19
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# JobsetV1alpha2JobSet
22

33
JobSet is the Schema for the jobsets API
4+
45
## Properties
6+
57
Name | Type | Description | Notes
68
------------ | ------------- | ------------- | -------------
79
**api_version** | **str** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional]
@@ -10,6 +12,23 @@ Name | Type | Description | Notes
1012
**spec** | [**JobsetV1alpha2JobSetSpec**](JobsetV1alpha2JobSetSpec.md) | | [optional]
1113
**status** | [**JobsetV1alpha2JobSetStatus**](JobsetV1alpha2JobSetStatus.md) | | [optional]
1214

15+
## Example
16+
17+
```python
18+
from jobset.models.jobset_v1alpha2_job_set import JobsetV1alpha2JobSet
19+
20+
# TODO update the JSON string below
21+
json = "{}"
22+
# create an instance of JobsetV1alpha2JobSet from a JSON string
23+
jobset_v1alpha2_job_set_instance = JobsetV1alpha2JobSet.from_json(json)
24+
# print the JSON string representation of the object
25+
print(JobsetV1alpha2JobSet.to_json())
26+
27+
# convert the object into a dict
28+
jobset_v1alpha2_job_set_dict = jobset_v1alpha2_job_set_instance.to_dict()
29+
# create an instance of JobsetV1alpha2JobSet from a dict
30+
jobset_v1alpha2_job_set_from_dict = JobsetV1alpha2JobSet.from_dict(jobset_v1alpha2_job_set_dict)
31+
```
1332
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
1433

1534

+20-1
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,33 @@
11
# JobsetV1alpha2JobSetList
22

33
JobSetList contains a list of JobSet
4+
45
## Properties
6+
57
Name | Type | Description | Notes
68
------------ | ------------- | ------------- | -------------
79
**api_version** | **str** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional]
8-
**items** | [**list[JobsetV1alpha2JobSet]**](JobsetV1alpha2JobSet.md) | |
10+
**items** | [**List[JobsetV1alpha2JobSet]**](JobsetV1alpha2JobSet.md) | |
911
**kind** | **str** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional]
1012
**metadata** | [**V1ListMeta**](V1ListMeta.md) | | [optional]
1113

14+
## Example
15+
16+
```python
17+
from jobset.models.jobset_v1alpha2_job_set_list import JobsetV1alpha2JobSetList
18+
19+
# TODO update the JSON string below
20+
json = "{}"
21+
# create an instance of JobsetV1alpha2JobSetList from a JSON string
22+
jobset_v1alpha2_job_set_list_instance = JobsetV1alpha2JobSetList.from_json(json)
23+
# print the JSON string representation of the object
24+
print(JobsetV1alpha2JobSetList.to_json())
25+
26+
# convert the object into a dict
27+
jobset_v1alpha2_job_set_list_dict = jobset_v1alpha2_job_set_list_instance.to_dict()
28+
# create an instance of JobsetV1alpha2JobSetList from a dict
29+
jobset_v1alpha2_job_set_list_from_dict = JobsetV1alpha2JobSetList.from_dict(jobset_v1alpha2_job_set_list_dict)
30+
```
1231
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
1332

1433

0 commit comments

Comments
 (0)