forked from argoproj/argo-workflows
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Bring Python client to core (argoproj#7025)
Signed-off-by: Yuan Tang <[email protected]>
- Loading branch information
1 parent
5cec4a2
commit 2bbba15
Showing
859 changed files
with
258,043 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/client/.openapi-generator/ | ||
/client/.gitignore | ||
/client/.openapi-generator-ignore | ||
/client/*.* | ||
/client/README.md | ||
/client/test | ||
/client/test-requirements.txt | ||
/client/.gitignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
GIT_TAG := $(shell git describe --exact-match --tags --abbrev=0 2> /dev/null || echo untagged) | ||
ifeq ($(GIT_TAG),untagged) | ||
VERSION := 0.0.0-latest | ||
else | ||
# remove the "v" prefix, not allowed | ||
VERSION := $(GIT_TAG:v=) | ||
endif | ||
|
||
# work dir | ||
WD := $(shell echo "`pwd`/client") | ||
|
||
DOCKER = docker run --rm -v $(WD):/wd --workdir /wd | ||
CHOWN = chown -R $(shell id -u):$(shell id -g) | ||
|
||
publish: generate | ||
echo "TODO: Publish the package to PyPI" | ||
|
||
generate: | ||
rm -Rf $(WD) | ||
mkdir -p $(WD) | ||
cat ../../api/openapi-spec/swagger.json | \ | ||
sed 's/io.k8s.api.core.v1.//' | \ | ||
sed 's/io.k8s.apimachinery.pkg.apis.meta.v1.//' \ | ||
> $(WD)/swagger.json | ||
$(DOCKER) openapitools/openapi-generator-cli:v5.2.1 \ | ||
generate \ | ||
-i /wd/swagger.json \ | ||
-g python \ | ||
-o /wd \ | ||
-p hideGenerationTimestamp=true \ | ||
--skip-validate-spec \ | ||
--artifact-id argo-client-python \ | ||
--global-property modelTests=false \ | ||
--global-property packageName=workflows.client \ | ||
--global-property packageVersion=${CLIENT_VERSION} | ||
--generate-alias-as-model | ||
# https://vsupalov.com/docker-shared-permissions/#set-the-docker-user-when-running-your-container | ||
$(CHOWN) $(WD) || sudo $(CHOWN) $(WD) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Argo Python SDK | ||
|
||
This is the Python SDK for Argo Workflows. | ||
|
||
## Requirements | ||
|
||
Python >= 3.6 | ||
|
||
## Installation & Usage | ||
|
||
To install the latest development version of the SDK, run the following: | ||
|
||
``` | ||
pip install git+https://github.com/argoproj/argo-workflows@master#subdirectory=sdks/python/client | ||
``` | ||
|
||
Then import the package: | ||
```python | ||
import openapi_client | ||
``` | ||
|
||
## Getting Started | ||
|
||
Please follow the [installation procedure](#installation--usage) and then run the following: | ||
|
||
```python | ||
import time | ||
import openapi_client | ||
import yaml | ||
import requests | ||
|
||
from pprint import pprint | ||
from openapi_client.api import workflow_service_api | ||
from openapi_client.model.io_argoproj_workflow_v1alpha1_workflow_create_request import IoArgoprojWorkflowV1alpha1WorkflowCreateRequest | ||
|
||
configuration = openapi_client.Configuration(host="http:https://localhost:2746") | ||
|
||
resp = requests.get('https://raw.githubusercontent.com/argoproj/argo-workflows/master/examples/dag-diamond-steps.yaml') | ||
manifest = yaml.safe_load(resp.text) | ||
api_client = openapi_client.ApiClient(configuration) | ||
api_instance = workflow_service_api.WorkflowServiceApi(api_client) | ||
api_response = api_instance.workflow_service_create_workflow('argo', IoArgoprojWorkflowV1alpha1WorkflowCreateRequest(workflow=manifest, _check_type=False)) | ||
pprint(api_response) | ||
``` |
16 changes: 16 additions & 0 deletions
16
sdks/python/client/docs/AWSElasticBlockStoreVolumeSource.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# AWSElasticBlockStoreVolumeSource | ||
|
||
Represents a Persistent Disk resource in AWS. An AWS EBS disk must exist before mounting to a container. The disk must also be in the same AWS zone as the kubelet. An AWS EBS disk can only be mounted as read/write once. AWS EBS volumes support ownership management and SELinux relabeling. | ||
|
||
## Properties | ||
Name | Type | Description | Notes | ||
------------ | ------------- | ------------- | ------------- | ||
**volume_id** | **str** | Unique ID of the persistent disk resource in AWS (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore | | ||
**fs_type** | **str** | Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: \"ext4\", \"xfs\", \"ntfs\". Implicitly inferred to be \"ext4\" if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore | [optional] | ||
**partition** | **int** | The partition in the volume that you want to mount. If omitted, the default is to mount by volume name. Examples: For volume /dev/sda1, you specify the partition as \"1\". Similarly, the volume partition for /dev/sda is \"0\" (or you can leave the property empty). | [optional] | ||
**read_only** | **bool** | Specify \"true\" to force and set the ReadOnly property in VolumeMounts to \"true\". If omitted, the default is \"false\". More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore | [optional] | ||
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] | ||
|
||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Affinity | ||
|
||
Affinity is a group of affinity scheduling rules. | ||
|
||
## Properties | ||
Name | Type | Description | Notes | ||
------------ | ------------- | ------------- | ------------- | ||
**node_affinity** | [**NodeAffinity**](NodeAffinity.md) | | [optional] | ||
**pod_affinity** | [**PodAffinity**](PodAffinity.md) | | [optional] | ||
**pod_anti_affinity** | [**PodAntiAffinity**](PodAntiAffinity.md) | | [optional] | ||
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional] | ||
|
||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||
|
||
|
Oops, something went wrong.