{"id":15652331,"url":"https://github.com/linuxsuren/argo-workflow-atomic-plugin","last_synced_at":"2025-04-30T20:07:54.429Z","repository":{"id":65253566,"uuid":"588380746","full_name":"LinuxSuRen/argo-workflow-atomic-plugin","owner":"LinuxSuRen","description":"An atomic plugin of Argo workflows","archived":false,"fork":false,"pushed_at":"2024-10-24T01:28:28.000Z","size":95,"stargazers_count":8,"open_issues_count":10,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-30T20:07:47.330Z","etag":null,"topics":["argo-workflows","atomic"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LinuxSuRen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-13T01:16:13.000Z","updated_at":"2025-04-18T17:42:27.000Z","dependencies_parsed_at":"2024-06-20T14:45:17.712Z","dependency_job_id":"b013dfed-ce73-4178-b379-325204c74acb","html_url":"https://github.com/LinuxSuRen/argo-workflow-atomic-plugin","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":"LinuxSuRen/github-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinuxSuRen%2Fargo-workflow-atomic-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinuxSuRen%2Fargo-workflow-atomic-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinuxSuRen%2Fargo-workflow-atomic-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LinuxSuRen%2Fargo-workflow-atomic-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LinuxSuRen","download_url":"https://codeload.github.com/LinuxSuRen/argo-workflow-atomic-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251774896,"owners_count":21641731,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["argo-workflows","atomic"],"created_at":"2024-10-03T12:42:03.161Z","updated_at":"2025-04-30T20:07:54.384Z","avatar_url":"https://github.com/LinuxSuRen.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![](https://goreportcard.com/badge/linuxsuren/argo-workflow-atomic-plugin)](https://goreportcard.com/report/linuxsuren/argo-workflow-atomic-plugin)\n[![](http://img.shields.io/badge/godoc-reference-5272B4.svg?style=flat-square)](https://godoc.org/github.com/linuxsuren/argo-workflow-atomic-plugin)\n[![Contributors](https://img.shields.io/github/contributors/linuxsuren/argo-workflow-atomic-plugin.svg)](https://github.com/linuxsuren/argo-workflow-atomic-plugin/graphs/contributors)\n[![GitHub release](https://img.shields.io/github/release/linuxsuren/argo-workflow-atomic-plugin.svg?label=release)](https://github.com/linuxsuren/argo-workflow-atomic-plugin/releases/latest)\n![GitHub All Releases](https://img.shields.io/github/downloads/linuxsuren/argo-workflow-atomic-plugin/total)\n\nThis plugin could reduce unnecessary Argo workflows. For example, there are mutiple commits against a pull request in a short time.\nIn most cases, only the last time of the workflow running is necessary. This plugin will stop all the workflows which have the same \nparameters and come from same WorkflowTemplate.\n\n## Install\nFirst, enable the plugin feature of Argo workflows:\n```shell\nkubectl patch deployment \\\n  workflow-controller \\\n  --namespace argo \\\n  --type='json' \\\n  -p='[{\"op\": \"add\", \"path\": \"/spec/template/spec/containers/0/env/0\", \"value\": {\n    \"name\": \"ARGO_EXECUTOR_PLUGINS\",\n    \"value\": \"true\",\n}}]'\n```\n\nthen, install this plugin as a ConfigMap:\n```shell\ncat \u003c\u003cEOF | kubectl apply -f -\n---\napiVersion: v1\nkind: ServiceAccount\nmetadata:\n  name: argo-atomic-plugin-executor-plugin\n  namespace: default\n---\napiVersion: rbac.authorization.k8s.io/v1\nkind: ClusterRole\nmetadata:\n  name: argo-plugin-addition-role\nrules:\n- apiGroups:\n  - argoproj.io\n  resources:\n  - workflowtasksets\n  - workflowtasksets/status\n  verbs:\n  - get\n  - watch\n  - patch\n---\napiVersion: rbac.authorization.k8s.io/v1\nkind: ClusterRoleBinding\nmetadata:\n  name: argo-plugin-atomic-addition-binding\nroleRef:\n  apiGroup: rbac.authorization.k8s.io\n  kind: ClusterRole\n  name: argo-plugin-addition-role\nsubjects:\n- kind: ServiceAccount\n  name: argo-atomic-plugin-executor-plugin\n  namespace: default\n- kind: ServiceAccount\n  name: argo\n  namespace: argo\n- kind: ServiceAccount\n  name: default\n  namespace: default\n---\napiVersion: rbac.authorization.k8s.io/v1\nkind: ClusterRoleBinding\nmetadata:\n  name: argo-plugin-atomic-binding\nroleRef:\n  apiGroup: rbac.authorization.k8s.io\n  kind: ClusterRole\n  name: argo-server-cluster-role\nsubjects:\n- kind: ServiceAccount\n  name: argo-atomic-plugin-executor-plugin\n  namespace: default\n- kind: ServiceAccount\n  name: argo\n  namespace: argo\n- kind: ServiceAccount\n  name: default\n  namespace: default\n---\napiVersion: v1\ndata:\n  sidecar.automountServiceAccountToken: \"true\"\n  sidecar.container: |\n    image: ghcr.io/linuxsuren/argo-workflow-atomic-plugin:master\n    command:\n    - argo-wf-atomic\n    name: argo-atomic-plugin\n    ports:\n    - containerPort: 3002\n    resources:\n      limits:\n        cpu: 500m\n        memory: 128Mi\n      requests:\n        cpu: 250m\n        memory: 64Mi\n    securityContext:\n      allowPrivilegeEscalation: true\n      runAsNonRoot: true\n      runAsUser: 65534\nkind: ConfigMap\nmetadata:\n  labels:\n    workflows.argoproj.io/configmap-type: ExecutorPlugin\n  name: argo-atomic-plugin\n  namespace: argo\nEOF\n```\n\n## Try it\nFirst, create a WorkflowTemplate:\n\n```shell\ncat \u003c\u003cEOF | kubectl apply -f -\napiVersion: argoproj.io/v1alpha1\nkind: WorkflowTemplate\nmetadata:\n  name: plugin-atomic\n  namespace: default\nspec:\n  entrypoint: main\n  templates:\n  - name: main\n    dag:\n      tasks:\n        - name: sleep\n          template: sleep\n        - name: atomic\n          template: atomic\n  - script:\n      image: ghcr.io/linuxsuren/hd:v0.0.70\n      command: [sh]\n      source: sleep 90\n    name: sleep\n  - name: atomic\n    plugin:\n      argo-atomic-plugin: {}\nEOF\n```\n\nthen, trigger it from UI or the following command:\n```shell\ncat \u003c\u003cEOF | kubectl create -f -\napiVersion: argoproj.io/v1alpha1\nkind: Workflow\nmetadata:\n  generateName: plugin-atomic\n  namespace: default\n  labels:\n    workflows.argoproj.io/workflow-template: plugin-atomic\nspec:\n  workflowTemplateRef:\n    name: plugin-atomic\nEOF\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinuxsuren%2Fargo-workflow-atomic-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinuxsuren%2Fargo-workflow-atomic-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinuxsuren%2Fargo-workflow-atomic-plugin/lists"}