Data-Oriented, pure Clojure API wrapper for Argo Workflow, an open source container-native workflow engine for orchestrating parallel jobs on Kubernetes.
Generate OpenAPI stubs for latest version with script:
/bin/zsh bin/openapi-generate
Create a client spec as follow:
(ns user
(:require [argoj.api :as argo]))
(def client-spec
(argo/mk-client {:token "xxxx"
:endpoint "argo-server.argo.svc.cluster:2746"}))
See Field Reference for all supported field used as EDN
(def spec
{:namespace "argo"
:serverDryRun false
:workflow {:metadata {:namespace "argo"
:generateName "foobar-"
:labels #:workflows.argoproj.io{:completed "false"}}
:spec
{:templates
[{:name "cowsay"
:container {:name "cowsay"
:image "docker/whalesay:latest"
:command ["cowsay"]
:args ["hello world"]
:resources {}}}]
:entrypoint "cowsay"}}})
(argo/create-workflow client "argo" spec)
Workflows can be selected by their labels:
(argo/search-workflows spec "argo" {:initiator "foobar"}) ;; {:metadata {:resourceVersion ...
List workflows, and return their status / results
(count (:items (argo/list-workflows client "argo"))) ;; => 1
Delete running or completed Workflow
(argo/create-workflow client "argo" "foobar-8fu7j")
See complete implemented API method on this documentation page.
lein test
Copyright © 2023 iomonad iomonad@riseup.net
This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 which is available at http://www.eclipse.org/legal/epl-2.0.
This Source Code may also be made available under the following Secondary Licenses when the conditions for such availability set forth in the Eclipse Public License, v. 2.0 are satisfied: GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version, with the GNU Classpath Exception which is available at https://www.gnu.org/software/classpath/license.html.
Can you improve this documentation? These fine people already did:
iomonad & citrouilleEdit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close