argoproj / argoproj/argo-workflows

Resource sharing amongst users at the template level

Open
#8,982 1 comment 3 reactions 0 assignees View on GitHub
area/mutex-semaphore
Dominant language
Go
Stars
17k
Forks
3.7k
Avg merge
1d 15h
Merged PRs (30d)
138

Description

## Summary

I would like to create workflows on behalf of 3rd party users, and I would like those users to be able to share resources equally at the template level via "user-level" parallelism.

## Potential interface

One instantiation of such a feature could look like this (note that I continue to update this as I experiment more with Argo codebase):

The workflow spec has a `ResourceSharingID` that identifies a single participant who will receive the same number of resources as all other participants (basically, a "user").

A workflow could have this ID passed along like this:

```yaml
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: pipeline-
spec:
entrypoint: sg-wrapper
resourceSharingID: abc-1233333
templates:
```

but more realistically, when the workflow is created, it'd be passed in dynamically:

```sh
argo submit -l resourceSharingID=abc123333 workflow.yaml
```

Resource limits could be set in the following way. In `workflow-controller-configmap`:

```yaml
resourcesAvailable: |
template-name-1: "4"
template-name-1: "20"

```

Any templates that are not defined here (or are not used in steps / group) will bypass resource sharing checks, (but will still be subject to all other parallelism checks).

## Details / edge cases:

- If parallelism for a particular step is defined, AND a resource limit is set for it's template, the behavior is undefined but the Workflow will submit.

- Workflows that do not contain resourceSharingID will have no limits set on pods with regards to available resources.

## Notes:

- I do not think such behavior exists (trivially) at the moment, but if I have missed it I'd love to be pointed in the right direction! (I have written a cron that adjusts template-level parallelism on an interval, but this approach seems bad for a variety of reasons)

- I have already set up the codebase in a dev container and have been reading/experimenting with it. I'm beginning to get a feel for what would need to be done - I would be more than happy to work with a mentor to bring this feature back upstream (as I need this feature for a project, I'll probably be implementing either way).

## Use Cases

I am currently building software for a render farm that processes long-running workflows (several hours to days). Access to our resources is bottlenecked by a finite number of provisioned software licenses for our farm.

---

**Message from the maintainers**:

Love this enhancement proposal? Give it a 👍. We prioritise the proposals with the most 👍.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the workflow spec, argo submit label handling, and workflow-controller-configmap settings, then trace how controller parallelism is enforced. The issue needs an agreed interface and behavior for template-level resource sharing, including its edge cases, followed by tests covering submission and enforcement.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes
Domain
backend, devops, distributed-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.