Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Support for data sourcing and transformation with data template #4958

Merged
merged 58 commits into from
Feb 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
7197bcf
feat: Support for WithArtifacts expansion
simster7 Jan 27, 2021
a2dfc47
Merge branch 'master' into wa
simster7 Jan 28, 2021
05d7bfe
WIP
simster7 Jan 28, 2021
02f5766
Merge branch 'master' into wa
simster7 Feb 1, 2021
964fa71
WIP
simster7 Feb 1, 2021
89ce498
WIP
simster7 Feb 2, 2021
57cd093
e2e done
simster7 Feb 3, 2021
f06d9c4
Merge branch 'master' into wa
simster7 Feb 3, 2021
b809952
prog
simster7 Feb 4, 2021
1f37381
Merge branch 'master' into wa
simster7 Feb 5, 2021
487fada
prog
simster7 Feb 5, 2021
4ed31fc
example
simster7 Feb 8, 2021
00400e4
new spec
simster7 Feb 8, 2021
7194c74
WIP: Please don't lose my work again macOS
simster7 Feb 9, 2021
804efcf
examples
simster7 Feb 9, 2021
7de778f
minor
simster7 Feb 9, 2021
2ef45bb
Merge branch 'master' into wa
simster7 Feb 10, 2021
2079206
fix
simster7 Feb 10, 2021
ba84e82
fixes
simster7 Feb 10, 2021
41a2d0f
comments
simster7 Feb 10, 2021
4e175b7
prog
simster7 Feb 10, 2021
d9d1ed5
prog
simster7 Feb 10, 2021
a98e6d0
prog
simster7 Feb 10, 2021
92ee561
minor
simster7 Feb 10, 2021
fde97e2
prog
simster7 Feb 10, 2021
91a663c
prog
simster7 Feb 11, 2021
c4492e8
Merge branch 'master' into wa
simster7 Feb 17, 2021
8fba5ec
fix crd
simster7 Feb 17, 2021
8bad204
temp pkg
simster7 Feb 17, 2021
f5d7ee0
reduce
simster7 Feb 19, 2021
bfdb84f
prog
simster7 Feb 19, 2021
85eaaf0
rename
simster7 Feb 19, 2021
f540465
prog
simster7 Feb 20, 2021
13152b6
prog and codegen
simster7 Feb 20, 2021
7012e56
restriction
simster7 Feb 20, 2021
264501a
prog
simster7 Feb 22, 2021
975d293
test
simster7 Feb 22, 2021
9e0580f
tests
simster7 Feb 22, 2021
33ccc1a
e2e test
simster7 Feb 22, 2021
c24b134
Merge branch 'master' into wa
simster7 Feb 22, 2021
1ac4245
fix
simster7 Feb 22, 2021
8569ef8
tests
simster7 Feb 23, 2021
04a394d
doc
simster7 Feb 23, 2021
1560122
val
simster7 Feb 23, 2021
574a8b7
lint
simster7 Feb 23, 2021
4b296b8
Merge branch 'master' into wa
simster7 Feb 23, 2021
1f5f857
comments
simster7 Feb 24, 2021
87ac39d
go narrow
simster7 Feb 25, 2021
531fb7f
comments
simster7 Feb 25, 2021
d5c057d
comments
simster7 Feb 25, 2021
7ff269e
lint
simster7 Feb 25, 2021
247ad65
pkg
simster7 Feb 25, 2021
c0712d7
test
simster7 Feb 25, 2021
800ae48
doc
simster7 Feb 25, 2021
d225e38
Merge branch 'master' into wa
simster7 Feb 26, 2021
1add0ac
comments
simster7 Feb 26, 2021
7b43585
fixtest
simster7 Feb 26, 2021
627be8b
lint
simster7 Feb 26, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,7 @@ prepare-release: check-version-warning clean codegen manifests
publish-release: check-version-warning clis checksums
git push
git push $(GIT_REMOTE) $(VERSION)

endif

.PHONY: check-version-warning
Expand Down
131 changes: 128 additions & 3 deletions api/jsonschema/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2811,6 +2811,87 @@
},
"type": "object"
},
"io.argoproj.workflow.v1alpha1.ArtifactPaths": {
"description": "ArtifactPaths expands a step from a collection of artifacts",
"properties": {
"archive": {
"$ref": "#/definitions/io.argoproj.workflow.v1alpha1.ArchiveStrategy",
"description": "Archive controls how the artifact will be saved to the artifact repository."
},
"archiveLogs": {
"description": "ArchiveLogs indicates if the container logs should be archived",
"type": "boolean"
},
"artifactory": {
"$ref": "#/definitions/io.argoproj.workflow.v1alpha1.ArtifactoryArtifact",
"description": "Artifactory contains artifactory artifact location details"
},
"from": {
"description": "From allows an artifact to reference an artifact from a previous step",
"type": "string"
},
"gcs": {
"$ref": "#/definitions/io.argoproj.workflow.v1alpha1.GCSArtifact",
"description": "GCS contains GCS artifact location details"
},
"git": {
"$ref": "#/definitions/io.argoproj.workflow.v1alpha1.GitArtifact",
"description": "Git contains git artifact location details"
},
"globalName": {
"description": "GlobalName exports an output artifact to the global scope, making it available as '{{io.argoproj.workflow.v1alpha1.outputs.artifacts.XXXX}} and in workflow.status.outputs.artifacts",
"type": "string"
},
"hdfs": {
"$ref": "#/definitions/io.argoproj.workflow.v1alpha1.HDFSArtifact",
"description": "HDFS contains HDFS artifact location details"
},
"http": {
"$ref": "#/definitions/io.argoproj.workflow.v1alpha1.HTTPArtifact",
"description": "HTTP contains HTTP artifact location details"
},
"mode": {
"description": "mode bits to use on this file, must be a value between 0 and 0777 set when loading input artifacts.",
"type": "integer"
},
"name": {
"description": "name of the artifact. must be unique within a template's inputs/outputs.",
"type": "string"
},
"optional": {
"description": "Make Artifacts optional, if Artifacts doesn't generate or exist",
"type": "boolean"
},
"oss": {
"$ref": "#/definitions/io.argoproj.workflow.v1alpha1.OSSArtifact",
"description": "OSS contains OSS artifact location details"
},
"path": {
"description": "Path is the container path to the artifact",
"type": "string"
},
"raw": {
"$ref": "#/definitions/io.argoproj.workflow.v1alpha1.RawArtifact",
"description": "Raw contains raw artifact location details"
},
"recurseMode": {
"description": "If mode is set, apply the permission recursively into the artifact if it is a folder",
"type": "boolean"
},
"s3": {
"$ref": "#/definitions/io.argoproj.workflow.v1alpha1.S3Artifact",
"description": "S3 contains S3 artifact location details"
},
"subPath": {
"description": "SubPath allows an artifact to be sourced from a subpath within the specified source",
"type": "string"
}
},
"required": [
"name"
],
"type": "object"
},
"io.argoproj.workflow.v1alpha1.ArtifactRepositoryRef": {
"properties": {
"configMap": {
Expand Down Expand Up @@ -3298,6 +3379,37 @@
],
"type": "object"
},
"io.argoproj.workflow.v1alpha1.Data": {
"description": "Data is a data template",
"properties": {
"source": {
"$ref": "#/definitions/io.argoproj.workflow.v1alpha1.DataSource",
"description": "Source sources external data into a data template"
},
"transformation": {
"description": "Transformation applies a set of transformations",
"items": {
"$ref": "#/definitions/io.argoproj.workflow.v1alpha1.TransformationStep"
},
"type": "array"
}
},
"required": [
"source",
"transformation"
],
"type": "object"
},
"io.argoproj.workflow.v1alpha1.DataSource": {
"description": "DataSource sources external data into a data template",
"properties": {
"artifactPaths": {
"$ref": "#/definitions/io.argoproj.workflow.v1alpha1.ArtifactPaths",
"description": "ArtifactPaths is a data transformation that collects a list of artifact paths"
}
},
"type": "object"
},
"io.argoproj.workflow.v1alpha1.Event": {
"properties": {
"selector": {
Expand Down Expand Up @@ -4198,9 +4310,6 @@
"type": "boolean"
}
},
"required": [
"key"
],
"type": "object"
},
"io.argoproj.workflow.v1alpha1.ScriptTemplate": {
Expand Down Expand Up @@ -4577,6 +4686,10 @@
"$ref": "#/definitions/io.argoproj.workflow.v1alpha1.DAGTemplate",
"description": "DAG template subtype which runs a DAG"
},
"data": {
"$ref": "#/definitions/io.argoproj.workflow.v1alpha1.Data",
"description": "Data is a data template"
},
"executor": {
"$ref": "#/definitions/io.argoproj.workflow.v1alpha1.ExecutorConfig",
"description": "Executor holds configurations of the executor container."
Expand Down Expand Up @@ -4740,6 +4853,18 @@
},
"type": "object"
},
"io.argoproj.workflow.v1alpha1.TransformationStep": {
"properties": {
"expression": {
"description": "Expression defines an expr expression to apply",
"type": "string"
}
},
"required": [
"expression"
],
"type": "object"
},
"io.argoproj.workflow.v1alpha1.UpdateCronWorkflowRequest": {
"properties": {
"cronWorkflow": {
Expand Down
131 changes: 128 additions & 3 deletions api/openapi-spec/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -6229,6 +6229,87 @@
}
}
},
"io.argoproj.workflow.v1alpha1.ArtifactPaths": {
"description": "ArtifactPaths expands a step from a collection of artifacts",
"type": "object",
"required": [
"name"
],
"properties": {
"archive": {
"description": "Archive controls how the artifact will be saved to the artifact repository.",
"$ref": "#/definitions/io.argoproj.workflow.v1alpha1.ArchiveStrategy"
},
"archiveLogs": {
"description": "ArchiveLogs indicates if the container logs should be archived",
"type": "boolean"
},
"artifactory": {
"description": "Artifactory contains artifactory artifact location details",
"$ref": "#/definitions/io.argoproj.workflow.v1alpha1.ArtifactoryArtifact"
},
"from": {
"description": "From allows an artifact to reference an artifact from a previous step",
"type": "string"
},
"gcs": {
"description": "GCS contains GCS artifact location details",
"$ref": "#/definitions/io.argoproj.workflow.v1alpha1.GCSArtifact"
},
"git": {
"description": "Git contains git artifact location details",
"$ref": "#/definitions/io.argoproj.workflow.v1alpha1.GitArtifact"
},
"globalName": {
"description": "GlobalName exports an output artifact to the global scope, making it available as '{{io.argoproj.workflow.v1alpha1.outputs.artifacts.XXXX}} and in workflow.status.outputs.artifacts",
"type": "string"
},
"hdfs": {
"description": "HDFS contains HDFS artifact location details",
"$ref": "#/definitions/io.argoproj.workflow.v1alpha1.HDFSArtifact"
},
"http": {
"description": "HTTP contains HTTP artifact location details",
"$ref": "#/definitions/io.argoproj.workflow.v1alpha1.HTTPArtifact"
},
"mode": {
"description": "mode bits to use on this file, must be a value between 0 and 0777 set when loading input artifacts.",
"type": "integer"
},
"name": {
"description": "name of the artifact. must be unique within a template's inputs/outputs.",
"type": "string"
},
"optional": {
"description": "Make Artifacts optional, if Artifacts doesn't generate or exist",
"type": "boolean"
},
"oss": {
"description": "OSS contains OSS artifact location details",
"$ref": "#/definitions/io.argoproj.workflow.v1alpha1.OSSArtifact"
},
"path": {
"description": "Path is the container path to the artifact",
"type": "string"
},
"raw": {
"description": "Raw contains raw artifact location details",
"$ref": "#/definitions/io.argoproj.workflow.v1alpha1.RawArtifact"
},
"recurseMode": {
"description": "If mode is set, apply the permission recursively into the artifact if it is a folder",
"type": "boolean"
},
"s3": {
"description": "S3 contains S3 artifact location details",
"$ref": "#/definitions/io.argoproj.workflow.v1alpha1.S3Artifact"
},
"subPath": {
"description": "SubPath allows an artifact to be sourced from a subpath within the specified source",
"type": "string"
}
}
},
"io.argoproj.workflow.v1alpha1.ArtifactRepositoryRef": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -6712,6 +6793,37 @@
}
}
},
"io.argoproj.workflow.v1alpha1.Data": {
"description": "Data is a data template",
"type": "object",
"required": [
"source",
"transformation"
],
"properties": {
"source": {
"description": "Source sources external data into a data template",
"$ref": "#/definitions/io.argoproj.workflow.v1alpha1.DataSource"
},
"transformation": {
"description": "Transformation applies a set of transformations",
"type": "array",
"items": {
"$ref": "#/definitions/io.argoproj.workflow.v1alpha1.TransformationStep"
}
}
}
},
"io.argoproj.workflow.v1alpha1.DataSource": {
"description": "DataSource sources external data into a data template",
"type": "object",
"properties": {
"artifactPaths": {
"description": "ArtifactPaths is a data transformation that collects a list of artifact paths",
"$ref": "#/definitions/io.argoproj.workflow.v1alpha1.ArtifactPaths"
}
}
},
"io.argoproj.workflow.v1alpha1.Event": {
"type": "object",
"required": [
Expand Down Expand Up @@ -7571,9 +7683,6 @@
"io.argoproj.workflow.v1alpha1.S3Artifact": {
"description": "S3Artifact is the location of an S3 artifact",
"type": "object",
"required": [
"key"
],
"properties": {
"accessKeySecret": {
"description": "AccessKeySecret is the secret selector to the bucket's access key",
Expand Down Expand Up @@ -7995,6 +8104,10 @@
"description": "DAG template subtype which runs a DAG",
"$ref": "#/definitions/io.argoproj.workflow.v1alpha1.DAGTemplate"
},
"data": {
"description": "Data is a data template",
"$ref": "#/definitions/io.argoproj.workflow.v1alpha1.Data"
},
"executor": {
"description": "Executor holds configurations of the executor container.",
"$ref": "#/definitions/io.argoproj.workflow.v1alpha1.ExecutorConfig"
Expand Down Expand Up @@ -8154,6 +8267,18 @@
}
}
},
"io.argoproj.workflow.v1alpha1.TransformationStep": {
"type": "object",
"required": [
"expression"
],
"properties": {
"expression": {
"description": "Expression defines an expr expression to apply",
"type": "string"
}
}
},
"io.argoproj.workflow.v1alpha1.UpdateCronWorkflowRequest": {
"type": "object",
"properties": {
Expand Down
20 changes: 20 additions & 0 deletions cmd/argoexec/commands/data.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package commands

import (
"context"

"github.com/spf13/cobra"
)

func NewDataCommand() *cobra.Command {
command := cobra.Command{
Use: "data",
Short: "Process data",
RunE: func(cmd *cobra.Command, args []string) error {
ctx := context.Background()
wfExecutor := initExecutor()
return wfExecutor.Data(ctx)
},
}
return &command
}
1 change: 1 addition & 0 deletions cmd/argoexec/commands/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ func NewRootCommand() *cobra.Command {
command.AddCommand(NewInitCommand())
command.AddCommand(NewResourceCommand())
command.AddCommand(NewWaitCommand())
command.AddCommand(NewDataCommand())
command.AddCommand(cmd.NewVersionCmd(CLIName))

clientConfig = kubecli.AddKubectlFlagsToCmd(&command)
Expand Down
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ type MetricsConfig struct {
}

type WorkflowRestrictions struct {
TemplateReferencing TemplateReferencing `json:"templateReferencing"`
TemplateReferencing TemplateReferencing `json:"templateReferencing,omitempty"`
}

type TemplateReferencing string
Expand Down
Loading