简体   繁体   English

通过 REST 调用启动 Argo 工作流

[英]Kickoff Argo workflows via REST call

I am exploring Argo to orchestrate processing big data.我正在探索 Argo 来协调处理大数据。 I wish to kick off a workflow via REST call that divides a large data set among a number of machines with desired resources for processing.我希望通过 REST 调用启动一个工作流,该工作流在具有所需处理资源的许多机器之间划分大型数据集。 From an architectural perspective, how would I accomplish this?从架构的角度来看,我将如何实现这一点? Is there an REST api or maybe some libraries for Node.js that I can use?是否有 REST api 或一些我可以使用的 Node.js 库?

Argo 2.5 introduces its own API . Argo 2.5 引入了自己的 API

There are currently officially-supported Golang and Java clients.目前有官方支持的GolangJava客户端。 There is also a community-supported Python client.还有一个社区支持的Python客户端。 Updates will be available here: https://github.com/argoproj-labs/argo-client-gen更新将在此处提供: https : //github.com/argoproj-labs/argo-client-gen

Argo provides Swagger API specs, so it should be reasonably easy to generate clients for other languages. Argo 提供 Swagger API 规范,因此为其他语言生成客户端应该相当容易。

According to Argo documentation :根据 Argo 文档

Argo is implemented as a kubernetes controller and Workflow Custom Resource . Argo 实现为 kubernetes 控制器和工作流自定义资源 Argo itself does not run an API server, and with all CRDs, it extends the Kubernetes API server by introducing a new API Group/Version ( argorproj.io/v1alpha1 ) and Kind ( Workflow ). Argo 本身不运行 API 服务器,并且对于所有 CRD,它通过引入新的API 组/版本( argorproj.io/v1alpha1 ) 和Kind ( Workflow ) 扩展了 Kubernetes API 服务器。 When CRDs are registered in a cluster, access to those resources are made available by exposing new endpoints in the kubernetes API server.当 CRD 在集群中注册时,通过在 kubernetes API 服务器中公开新端点来访问这些资源。
For example, to list workflows in the default namespace, a client would make an HTTP GET request to:例如,要列出默认命名空间中的工作流,客户端将发出HTTP GET请求以:

 https://<k8s-api-server>/apis/argoproj.io/v1alpha1/namespaces/default/workflows

You can find examples for Golang, Python, Java, Ruby, OpenAPI following this link .您可以在此链接后找到 Golang、Python、Java、Ruby、OpenAPI 的示例。

So, you can generate a YAML file describing Argo Workflow resources and send it to the Kubernetes API as described in the examples.因此,您可以生成描述 Argo Workflow 资源的 YAML 文件,并将其发送到 Kubernetes API,如示例中所述。

I hope it helps.我希望它有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM