Skip to content

Commit

Permalink
Merge branch 'main' into issue-12124
Browse files Browse the repository at this point in the history
Signed-off-by: Sairam Arunachalam <sair.aruna@gmail.com>
  • Loading branch information
sairam91 authored Oct 17, 2024
2 parents c254b7f + e18570c commit 2340b21
Show file tree
Hide file tree
Showing 164 changed files with 9,709 additions and 1,560 deletions.
24 changes: 24 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,29 @@
"remoteEnv": {
"PATH": "${containerEnv:PATH}:/home/vscode/go/bin",
"GOPATH": "/home/vscode/go"
},
"customizations": {
"vscode": {
"settings": {
"launch": {
"configurations": [
{
"name": "Attach to argo server",
"type": "go",
"request": "attach",
"mode": "local",
"processId": "argo"
},
{
"name": "Attach to workflow controller",
"type": "go",
"request": "attach",
"mode": "local",
"processId": "workflow-controller"
}
]
}
}
}
}
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ git-ask-pass.sh
sdks/python/client/dist/*
/v3/
/cmd/argoexec/commands/test.txt
/db-dumps/

# Do not commit rendered installation manifests since they are misleading to users.
manifests/install.yaml
Expand Down
3 changes: 3 additions & 0 deletions .spelling
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
5xx
8Ki
90m
ARGO_TEMPLATE
Alexandre
Alibaba
Ang
Expand Down Expand Up @@ -102,6 +103,7 @@ PVCs
Peixuan
Ploomber
Postgres
PriorityClass
RCs
Roadmap
RoleBinding
Expand Down Expand Up @@ -164,6 +166,7 @@ govaluate
gzipped
i.e.
idempotence
inputs.parameters
instantiator
instantiators
jenkins
Expand Down
26 changes: 22 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,16 @@ endif
PROFILE ?= minimal
KUBE_NAMESPACE ?= argo # namespace where Kubernetes resources/RBAC will be installed
PLUGINS ?= $(shell [ $PROFILE = plugins ] && echo false || echo true)
UI ?= false # start the UI
UI ?= false # start the UI with HTTP
UI_SECURE ?= false # start the UI with HTTPS
API ?= $(UI) # start the Argo Server
TASKS := controller
ifeq ($(API),true)
TASKS := controller server
endif
ifeq ($(UI_SECURE),true)
TASKS := controller server ui
endif
ifeq ($(UI),true)
TASKS := controller server ui
endif
Expand Down Expand Up @@ -486,6 +490,9 @@ ifeq ($(RUN_MODE),kubernetes)
kubectl -n $(KUBE_NAMESPACE) scale deploy/workflow-controller --replicas 1
kubectl -n $(KUBE_NAMESPACE) scale deploy/argo-server --replicas 1
endif
ifeq ($(UI_SECURE)$(PROFILE),truesso)
KUBE_NAMESPACE=$(KUBE_NAMESPACE) ./hack/update-sso-redirect-url.sh
endif

.PHONY: argosay
argosay:
Expand Down Expand Up @@ -563,7 +570,7 @@ endif
grep '127.0.0.1.*postgres' /etc/hosts
grep '127.0.0.1.*mysql' /etc/hosts
ifeq ($(RUN_MODE),local)
env DEFAULT_REQUEUE_TIME=$(DEFAULT_REQUEUE_TIME) ARGO_SECURE=$(SECURE) ALWAYS_OFFLOAD_NODE_STATUS=$(ALWAYS_OFFLOAD_NODE_STATUS) ARGO_LOGLEVEL=$(LOG_LEVEL) UPPERIO_DB_DEBUG=$(UPPERIO_DB_DEBUG) ARGO_AUTH_MODE=$(AUTH_MODE) ARGO_NAMESPACED=$(NAMESPACED) ARGO_NAMESPACE=$(KUBE_NAMESPACE) ARGO_MANAGED_NAMESPACE=$(MANAGED_NAMESPACE) ARGO_EXECUTOR_PLUGINS=$(PLUGINS) ARGO_POD_STATUS_CAPTURE_FINALIZER=$(POD_STATUS_CAPTURE_FINALIZER) PROFILE=$(PROFILE) kit $(TASKS)
env DEFAULT_REQUEUE_TIME=$(DEFAULT_REQUEUE_TIME) ARGO_SECURE=$(SECURE) ALWAYS_OFFLOAD_NODE_STATUS=$(ALWAYS_OFFLOAD_NODE_STATUS) ARGO_LOGLEVEL=$(LOG_LEVEL) UPPERIO_DB_DEBUG=$(UPPERIO_DB_DEBUG) ARGO_AUTH_MODE=$(AUTH_MODE) ARGO_NAMESPACED=$(NAMESPACED) ARGO_NAMESPACE=$(KUBE_NAMESPACE) ARGO_MANAGED_NAMESPACE=$(MANAGED_NAMESPACE) ARGO_EXECUTOR_PLUGINS=$(PLUGINS) ARGO_POD_STATUS_CAPTURE_FINALIZER=$(POD_STATUS_CAPTURE_FINALIZER) ARGO_UI_SECURE=$(UI_SECURE) PROFILE=$(PROFILE) kit $(TASKS)
endif

.PHONY: wait
Expand All @@ -581,11 +588,22 @@ endif

.PHONY: postgres-cli
postgres-cli:
kubectl exec -ti `kubectl get pod -l app=postgres -o name|cut -c 5-` -- psql -U postgres
kubectl exec -ti svc/postgres -- psql -U postgres

.PHONY: postgres-dump
postgres-dump:
@mkdir -p db-dumps
kubectl exec svc/postgres -- pg_dump --clean -U postgres > "db-dumps/postgres-$(BUILD_DATE).sql"

.PHONY: mysql-cli
mysql-cli:
kubectl exec -ti `kubectl get pod -l app=mysql -o name|cut -c 5-` -- mysql -u mysql -ppassword argo
kubectl exec -ti svc/mysql -- mysql -u mysql -ppassword argo

.PHONY: mysql-dump
mysql-dump:
@mkdir -p db-dumps
kubectl exec svc/mysql -- mysqldump --no-tablespaces -u mysql -ppassword argo > "db-dumps/mysql-$(BUILD_DATE).sql"


test-cli: ./dist/argo

Expand Down
1 change: 1 addition & 0 deletions USERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ Currently, the following organizations are **officially** using Argo Workflows:
1. [Procore](https://www.procore.com)
1. [Promaton](https://www.promaton.com/)
1. [Prudential](https://www.prudential.com.sg/)
1. [Pvotal Technologies](https://pvotal.tech/)
1. [Quantibio](http://quantibio.com/us/en/)
1. [QuantumBlack](https://quantumblack.com/)
1. [Raccoon Digital Marketing](https://raccoon.ag/)
Expand Down
8 changes: 4 additions & 4 deletions api/jsonschema/schema.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 10 additions & 4 deletions api/openapi-spec/swagger.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions cmd/argo/commands/archive/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@ import (
"sigs.k8s.io/yaml"

"github.com/argoproj/argo-workflows/v3/cmd/argo/commands/client"
"github.com/argoproj/argo-workflows/v3/cmd/argo/commands/common"
workflowarchivepkg "github.com/argoproj/argo-workflows/v3/pkg/apiclient/workflowarchive"
wfv1 "github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1"
)

func NewGetCommand() *cobra.Command {
var output string
var output = common.EnumFlagValue{
AllowedValues: []string{"json", "yaml", "wide"},
Value: "wide",
}
command := &cobra.Command{
Use: "get UID",
Short: "get a workflow in the archive",
Expand All @@ -41,11 +45,11 @@ func NewGetCommand() *cobra.Command {
if err != nil {
return err
}
printWorkflow(wf, output)
printWorkflow(wf, output.String())
return nil
},
}
command.Flags().StringVarP(&output, "output", "o", "wide", "Output format. One of: json|yaml|wide")
command.Flags().VarP(&output, "output", "o", "Output format. "+output.Usage())
return command
}

Expand Down
7 changes: 4 additions & 3 deletions cmd/argo/commands/archive/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"github.com/argoproj/argo-workflows/v3/cmd/argo/commands/client"
"github.com/argoproj/argo-workflows/v3/cmd/argo/commands/common"
workflowarchivepkg "github.com/argoproj/argo-workflows/v3/pkg/apiclient/workflowarchive"
wfv1 "github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1"
"github.com/argoproj/argo-workflows/v3/util/printer"
Expand All @@ -18,7 +19,7 @@ import (
func NewListCommand() *cobra.Command {
var (
selector string
output string
output = common.NewPrintWorkflowOutputValue("wide")
chunkSize int64
)
command := &cobra.Command{
Expand Down Expand Up @@ -50,10 +51,10 @@ func NewListCommand() *cobra.Command {
if err != nil {
return err
}
return printer.PrintWorkflows(workflows, os.Stdout, printer.PrintOpts{Output: output, Namespace: true, UID: true})
return printer.PrintWorkflows(workflows, os.Stdout, printer.PrintOpts{Output: output.String(), Namespace: true, UID: true})
},
}
command.Flags().StringVarP(&output, "output", "o", "wide", "Output format. One of: json|yaml|wide")
command.Flags().VarP(&output, "output", "o", "Output format. "+output.Usage())
command.Flags().StringVarP(&selector, "selector", "l", "", "Selector (label query) to filter on, not including uninitialized ones, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2)")
command.Flags().Int64VarP(&chunkSize, "chunk-size", "", 0, "Return large lists in chunks rather than all at once. Pass 0 to disable.")
return command
Expand Down
6 changes: 3 additions & 3 deletions cmd/argo/commands/archive/resubmit.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func (o *resubmitOps) hasSelector() bool {
func NewResubmitCommand() *cobra.Command {
var (
resubmitOpts resubmitOps
cliSubmitOpts common.CliSubmitOpts
cliSubmitOpts = common.NewCliSubmitOpts()
)
command := &cobra.Command{
Use: "resubmit [WORKFLOW...]",
Expand Down Expand Up @@ -87,7 +87,7 @@ func NewResubmitCommand() *cobra.Command {

command.Flags().StringArrayVarP(&cliSubmitOpts.Parameters, "parameter", "p", []string{}, "input parameter to override on the original workflow spec")
command.Flags().Int32Var(&resubmitOpts.priority, "priority", 0, "workflow priority")
command.Flags().StringVarP(&cliSubmitOpts.Output, "output", "o", "", "Output format. One of: name|json|yaml|wide")
command.Flags().VarP(&cliSubmitOpts.Output, "output", "o", "Output format. "+cliSubmitOpts.Output.Usage())
command.Flags().BoolVarP(&cliSubmitOpts.Wait, "wait", "w", false, "wait for the workflow to complete, only works when a single workflow is resubmitted")
command.Flags().BoolVar(&cliSubmitOpts.Watch, "watch", false, "watch the workflow until it completes, only works when a single workflow is resubmitted")
command.Flags().BoolVar(&cliSubmitOpts.Log, "log", false, "log the workflow until it completes")
Expand Down Expand Up @@ -140,7 +140,7 @@ func resubmitArchivedWorkflows(ctx context.Context, archiveServiceClient workflo
if err != nil {
return err
}
printWorkflow(lastResubmitted, cliSubmitOpts.Output)
printWorkflow(lastResubmitted, cliSubmitOpts.Output.String())
}

if len(resubmittedUids) == 1 {
Expand Down
6 changes: 3 additions & 3 deletions cmd/argo/commands/archive/retry.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func (o *retryOps) hasSelector() bool {

func NewRetryCommand() *cobra.Command {
var (
cliSubmitOpts common.CliSubmitOpts
cliSubmitOpts = common.NewCliSubmitOpts()
retryOpts retryOps
)
command := &cobra.Command{
Expand Down Expand Up @@ -92,7 +92,7 @@ func NewRetryCommand() *cobra.Command {
}

command.Flags().StringArrayVarP(&cliSubmitOpts.Parameters, "parameter", "p", []string{}, "input parameter to override on the original workflow spec")
command.Flags().StringVarP(&cliSubmitOpts.Output, "output", "o", "", "Output format. One of: name|json|yaml|wide")
command.Flags().VarP(&cliSubmitOpts.Output, "output", "o", "Output format. "+cliSubmitOpts.Output.Usage())
command.Flags().BoolVarP(&cliSubmitOpts.Wait, "wait", "w", false, "wait for the workflow to complete, only works when a single workflow is retried")
command.Flags().BoolVar(&cliSubmitOpts.Watch, "watch", false, "watch the workflow until it completes, only works when a single workflow is retried")
command.Flags().BoolVar(&cliSubmitOpts.Log, "log", false, "log the workflow until it completes")
Expand Down Expand Up @@ -146,7 +146,7 @@ func retryArchivedWorkflows(ctx context.Context, archiveServiceClient workflowar
if err != nil {
return err
}
printWorkflow(lastRetried, cliSubmitOpts.Output)
printWorkflow(lastRetried, cliSubmitOpts.Output.String())
}
if len(retriedUids) == 1 {
// watch or wait when there is only one workflow retried
Expand Down
11 changes: 6 additions & 5 deletions cmd/argo/commands/clustertemplate/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,17 @@ import (
"github.com/spf13/cobra"

"github.com/argoproj/argo-workflows/v3/cmd/argo/commands/client"
"github.com/argoproj/argo-workflows/v3/cmd/argo/commands/common"
"github.com/argoproj/argo-workflows/v3/pkg/apiclient/clusterworkflowtemplate"
)

type cliCreateOpts struct {
output string // --output
strict bool // --strict
output common.EnumFlagValue // --output
strict bool // --strict
}

func NewCreateCommand() *cobra.Command {
var cliCreateOpts cliCreateOpts
var cliCreateOpts = cliCreateOpts{output: common.NewPrintWorkflowOutputValue("")}
command := &cobra.Command{
Use: "create FILE1 FILE2...",
Short: "create a cluster workflow template",
Expand All @@ -35,7 +36,7 @@ func NewCreateCommand() *cobra.Command {
return createClusterWorkflowTemplates(cmd.Context(), args, &cliCreateOpts)
},
}
command.Flags().StringVarP(&cliCreateOpts.output, "output", "o", "", "Output format. One of: name|json|yaml|wide")
command.Flags().VarP(&cliCreateOpts.output, "output", "o", "Output format. "+cliCreateOpts.output.Usage())
command.Flags().BoolVar(&cliCreateOpts.strict, "strict", true, "perform strict workflow validation")
return command
}
Expand All @@ -62,7 +63,7 @@ func createClusterWorkflowTemplates(ctx context.Context, filePaths []string, cli
if err != nil {
return fmt.Errorf("Failed to create cluster workflow template: %s, %v", wftmpl.Name, err)
}
printClusterWorkflowTemplate(created, cliOpts.output)
printClusterWorkflowTemplate(created, cliOpts.output.String())
}
return nil
}
7 changes: 4 additions & 3 deletions cmd/argo/commands/clustertemplate/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ import (
"github.com/spf13/cobra"

"github.com/argoproj/argo-workflows/v3/cmd/argo/commands/client"
"github.com/argoproj/argo-workflows/v3/cmd/argo/commands/common"
clusterworkflowtmplpkg "github.com/argoproj/argo-workflows/v3/pkg/apiclient/clusterworkflowtemplate"
)

func NewGetCommand() *cobra.Command {
var output string
var output = common.NewPrintWorkflowOutputValue("")

command := &cobra.Command{
Use: "get CLUSTER WORKFLOW_TEMPLATE...",
Expand All @@ -29,12 +30,12 @@ func NewGetCommand() *cobra.Command {
if err != nil {
return err
}
printClusterWorkflowTemplate(wftmpl, output)
printClusterWorkflowTemplate(wftmpl, output.String())
}
return nil
},
}

command.Flags().StringVarP(&output, "output", "o", "", "Output format. One of: json|yaml|wide")
command.Flags().VarP(&output, "output", "o", "Output format. "+output.Usage())
return command
}
Loading

0 comments on commit 2340b21

Please sign in to comment.