-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Bring Java client into core. (#7026)
Signed-off-by: Alex Collins <alex_collins@intuit.com>
- Loading branch information
1 parent
48e1aa9
commit 3f14c68
Showing
409 changed files
with
12,115 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: SDKs | ||
on: | ||
push: | ||
tags: | ||
- v* | ||
- 'v3.2.*' | ||
- 'v3.1.*' | ||
branches: | ||
- dev-* | ||
jobs: | ||
sdk: | ||
if: github.repository == 'argoproj/argo-workflows' | ||
runs-on: ubuntu-latest | ||
name: Publish SDK | ||
strategy: | ||
matrix: | ||
name: | ||
- java | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- run: make --directory sdks/${{matrix.name}} publish -B | ||
env: | ||
JAVA_SDK_MAVEN_PASSWORD: ${{ secrets.GITHUB_TOKEN }} | ||
- uses: peter-evans/create-pull-request@v3 | ||
with: | ||
title: 'chore: updated ${{matrix.name}} SDK' | ||
commit-message: 'chore: updated ${{matrix.name}} SDK' | ||
branch: create-pull-request/sdk/${{matrix.name}} | ||
signoff: true |
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,27 @@ | ||
# Client Libraries | ||
|
||
This page contains an overview of the client libraries for using the Argo API from various programming languages. | ||
|
||
To write applications using the REST API, you do not need to implement the API calls and request/response types | ||
yourself. You can use a client library for the programming language you are using. | ||
|
||
Client libraries often handle common tasks such as authentication for you. | ||
|
||
## Officially-supported client libraries | ||
|
||
The following client libraries are officially maintained by the Argo team. | ||
|
||
| Language | Client Library | Examples/Docs | | ||
|----------|----------------|---------------| | ||
| Golang | [apiclient.go](https://github.com/argoproj/argo-workflows/blob/master/pkg/apiclient/apiclient.go) | [Example](https://github.com/argoproj/argo-workflows/blob/master/cmd/argo/commands/submit.go) | ||
| Java | [java](https://github.com/argoproj/argo-workflows/blob/master/sdks/java) | | | ||
| Python | [python](python) | TBC | | ||
|
||
## Community-maintained client libraries | ||
|
||
The following client libraries are provided and maintained by their authors, not the Argo team. | ||
|
||
| Language | Client Library | Info | | ||
|----------|----------------|---------------| | ||
| Python | [Couler](https://github.com/couler-proj/couler) | Multi-workflow engine support Python SDK | | ||
| Python | Hera | TBC | |
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,16 @@ | ||
# Contributing an SDK | ||
|
||
Make it contributor friendly: | ||
|
||
* Make it fast, because engineers will have to generate SDKs for every PR. | ||
* Make it dependency free, engineers will not be a be able to install anything. You can use Docker. | ||
* Generate the minimal amount of code possible, so other engineers don't have to commit lots of files too. | ||
* Provide a [`Makefile`](java/Makefile) with the following: | ||
* A `generate` target to generate the code using `openapi-generator` into `client` directory. | ||
* A `publish` target to publish the generated code for use. | ||
* Committed code must be stable, it must not change based on Git tags. | ||
|
||
Make it user friendly: | ||
|
||
* Commit enough for users to learn how to use it. Use `.gitignore` to exclude files. | ||
* Add a [README.md](java/README.md) to help users get started. |
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/api/ | ||
/client/src/ | ||
/client/gradle/ | ||
/client/.gitignore | ||
/client/.openapi-generator-ignore | ||
/client/gradlew | ||
/client/*.* |
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,72 @@ | ||
GIT_TAG := $(shell git describe --exact-match --tags --abbrev=0 2> /dev/null || echo untagged) | ||
ifeq ($(GIT_TAG),untagged) | ||
# "SNAPSHOT" is "latest" for Java | ||
VERSION := 0.0.0-SNAPSHOT | ||
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 | ||
MVN = $(DOCKER) -v $(HOME)/.m2:/root/.m2 -e JAVA_SDK_MAVEN_PASSWORD=${JAVA_SDK_MAVEN_PASSWORD} maven:3-openjdk-8 mvn -s settings.xml | ||
CHOWN = chown -R $(shell id -u):$(shell id -g) | ||
|
||
publish: generate | ||
# https://help.github.com/en/packages/using-github-packages-with-your-projects-ecosystem/configuring-apache-maven-for-use-with-github-packages | ||
$(MVN) deploy -DskipTests -DaltDeploymentRepository=github::default::https://maven.pkg.github.com/argoproj/argo-workflows | ||
|
||
generate: | ||
rm -Rf $(WD) | ||
mkdir -p $(WD) | ||
cp settings.xml $(WD)/settings.xml | ||
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 java \ | ||
-o /wd \ | ||
-p hideGenerationTimestamp=true \ | ||
-p dateLibrary=java8 \ | ||
--api-package io.argoproj.workflow.apis \ | ||
--invoker-package io.argoproj.workflow \ | ||
--model-package io.argoproj.workflow.models \ | ||
--skip-validate-spec \ | ||
--group-id io.argoproj.workflow \ | ||
--artifact-id argo-client-java \ | ||
--import-mappings Time=java.time.Instant \ | ||
--import-mappings Affinity=io.kubernetes.client.openapi.models.V1Affinity \ | ||
--import-mappings ConfigMapKeySelector=io.kubernetes.client.openapi.models.V1ConfigMapKeySelector \ | ||
--import-mappings Container=io.kubernetes.client.openapi.models.V1Container \ | ||
--import-mappings ContainerPort=io.kubernetes.client.openapi.models.V1ContainerPort \ | ||
--import-mappings EnvFromSource=io.kubernetes.client.openapi.models.V1EnvFromSource \ | ||
--import-mappings EnvVar=io.kubernetes.client.openapi.models.V1EnvVar \ | ||
--import-mappings HostAlias=io.kubernetes.client.openapi.models.V1HostAlias \ | ||
--import-mappings Lifecycle=io.kubernetes.client.openapi.models.V1Lifecycle \ | ||
--import-mappings ListMeta=io.kubernetes.client.openapi.models.V1ListMeta \ | ||
--import-mappings LocalObjectReference=io.kubernetes.client.openapi.models.V1LocalObjectReference \ | ||
--import-mappings ObjectMeta=io.kubernetes.client.openapi.models.V1ObjectMeta \ | ||
--import-mappings ObjectReference=io.kubernetes.client.openapi.models.V1ObjectReference \ | ||
--import-mappings PersistentVolumeClaim=io.kubernetes.client.openapi.models.V1PersistentVolumeClaim \ | ||
--import-mappings PodDisruptionBudgetSpec=io.kubernetes.client.openapi.models.V1beta1PodDisruptionBudgetSpec \ | ||
--import-mappings PodDNSConfig=io.kubernetes.client.openapi.models.V1PodDNSConfig \ | ||
--import-mappings PodSecurityContext=io.kubernetes.client.openapi.models.V1PodSecurityContext \ | ||
--import-mappings Probe=io.kubernetes.client.openapi.models.V1Probe \ | ||
--import-mappings ResourceRequirements=io.kubernetes.client.openapi.models.V1ResourceRequirements \ | ||
--import-mappings SecretKeySelector=io.kubernetes.client.openapi.models.V1SecretKeySelector \ | ||
--import-mappings SecurityContext=io.kubernetes.client.openapi.models.V1SecurityContext \ | ||
--import-mappings Toleration=io.kubernetes.client.openapi.models.V1Toleration \ | ||
--import-mappings Volume=io.kubernetes.client.openapi.models.V1Volume \ | ||
--import-mappings VolumeDevice=io.kubernetes.client.openapi.models.V1VolumeDevice \ | ||
--import-mappings VolumeMount=io.kubernetes.client.openapi.models.V1VolumeMount \ | ||
--generate-alias-as-model | ||
# https://vsupalov.com/docker-shared-permissions/#set-the-docker-user-when-running-your-container | ||
$(CHOWN) $(WD) || sudo $(CHOWN) $(WD) | ||
# replace the generated pom.xml, because that has too many dependencies | ||
sed 's/0.0.0-VERSION/$(VERSION)/' pom.xml > $(WD)/pom.xml | ||
|
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,45 @@ | ||
# Java SDK | ||
|
||
## Download | ||
|
||
## Client Library | ||
|
||
This provides model and APIs for accessing the Argo Server API rather. | ||
|
||
If you wish to access the Kubernetes APIs, you can use the models to do this. You'll need to write your own code to speak to the API. | ||
|
||
⚠️ The Java SDK is published to Github packages, not Maven Central. You must update your Maven settings.xml | ||
file: [how to do that](https://github.com/argoproj/argo-workflows/packages). | ||
|
||
Recommended: | ||
|
||
```xml | ||
<dependency> | ||
<groupId>io.argoproj.workflow</groupId> | ||
<artifactId>argo-client-java</artifactId> | ||
<version>3.3.0</version> | ||
</dependency> | ||
``` | ||
|
||
The very latest version: | ||
|
||
```xml | ||
<dependency> | ||
<groupId>io.argoproj.workflow</groupId> | ||
<artifactId>argo-client-java</artifactId> | ||
<version>0.0.0-SNAPSHOT</version> | ||
</dependency> | ||
``` | ||
|
||
## Examples | ||
|
||
* [Example.java](examples/client) | ||
|
||
## Docs | ||
|
||
* [Event service](client/docs/EventServiceApi.md) | ||
* [Sensor service](client/docs/SensorServiceApi.md) | ||
* [Event source service](client/docs/EventSourceServiceApi.md) | ||
* [Info service](client/docs/InfoServiceApi.md ) | ||
* [Pipeline service](client/docs/PipelineServiceApi.md) | ||
* [Workflow service](client/docs/WorkflowServiceApi.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,17 @@ | ||
|
||
|
||
# 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 | ||
------------ | ------------- | ------------- | ------------- | ||
**fsType** | **String** | 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** | **Integer** | 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] | ||
**readOnly** | **Boolean** | 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] | ||
**volumeID** | **String** | Unique ID of the persistent disk resource in AWS (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore | | ||
|
||
|
||
|
Oops, something went wrong.