argoproj / argoproj/argo-workflows

Support remote script source in the script template

Open
#2,980 3 comments 3 reactions 0 assignees View on GitHub
area/templates/script
Dominant language
Go
Stars
17k
Forks
3.7k
Avg merge
1d 20h
Merged PRs (30d)
138

Description

# Summary

Support an option to fetch the script source in `ScriptTemplate` from `Git`, an `URL`, or `S3`.

# Motivation

Placing the script source directly in the workflow definition makes it difficult to manage and it loses ability to refer to a particular version of the script. With Git or S3 as a source, the developer can test the code in some interactive environment like Jupter notebook, push code to git and then refer it in a workflow. It also facilitates the dev teams to easily share the workflows.

# Proposal

Introduce a struct called `ScriptSource`,

```
type ScriptSource struct {
// Inline source - currently supported.
Inline string
// GitArtifact from the pkg/workflow_types.go
Git *GitArtifact
// S3Artifact from the pkg/workflow_types.go
S3 *S3Artifact
// A url like raw.github...
URL string
}
```

And change the `ScriptTemplate` struct to,

```
// ScriptTemplate is a template subtype to enable scripting through code steps
type ScriptTemplate struct {
apiv1.Container `json:",inline" protobuf:"bytes,1,opt,name=container"`

// Source contains the source code of the script to execute
Source ScriptSource `json:"source" protobuf:"bytes,2,opt,name=source"`
}

```
---

**Message from the maintainers**:

If you wish to see this enhancement implemented please add a 👍 reaction to this issue! We often sort issues this way to know what to prioritize.

Contributor guide

Open the contributing guide

Research direction

Start with ScriptTemplate and the GitArtifact and S3Artifact definitions in pkg/workflow_types.go. Trace how script sources are serialized and resolved before execution, then inspect nearby tests or entry points for template handling. Done means inline, Git, URL, and S3 sources are represented and fetched without breaking existing workflows.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, git, go
Domain
backend, cloud
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.