Skip to content

Commit

Permalink
Merge branch 'main' into feat-cli-db-generator2
Browse files Browse the repository at this point in the history
Signed-off-by: Mason Malone <[email protected]>
  • Loading branch information
MasonM committed Oct 15, 2024
2 parents 7235cb5 + a8c3609 commit 33d01e3
Show file tree
Hide file tree
Showing 118 changed files with 1,650 additions and 476 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"
}
]
}
}
}
}
}
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
11 changes: 9 additions & 2 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 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
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
}
10 changes: 7 additions & 3 deletions cmd/argo/commands/clustertemplate/lint.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,18 @@ 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/cmd/argo/lint"
wf "github.com/argoproj/argo-workflows/v3/pkg/apis/workflow"
)

func NewLintCommand() *cobra.Command {
var (
strict bool
output string
output = common.EnumFlagValue{
AllowedValues: []string{"pretty", "simple"},
Value: "pretty",
}
)

command := &cobra.Command{
Expand All @@ -32,11 +36,11 @@ func NewLintCommand() *cobra.Command {
Printer: os.Stdout,
}

return lint.RunLint(ctx, apiClient, []string{wf.ClusterWorkflowTemplatePlural}, output, false, opts)
return lint.RunLint(ctx, apiClient, []string{wf.ClusterWorkflowTemplatePlural}, output.String(), false, opts)
},
}

command.Flags().StringVarP(&output, "output", "o", "pretty", "Linting results output format. One of: pretty|simple")
command.Flags().VarP(&output, "output", "o", "Linting results output format. "+output.Usage())
command.Flags().BoolVar(&strict, "strict", true, "perform strict workflow validation")
return command
}
15 changes: 7 additions & 8 deletions cmd/argo/commands/clustertemplate/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,15 @@ 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"
wfv1 "github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1"
)

type listFlags struct {
output string // --output
}

func NewListCommand() *cobra.Command {
var listArgs listFlags
var output = common.EnumFlagValue{
AllowedValues: []string{"wide", "name"},
}
command := &cobra.Command{
Use: "list",
Short: "list cluster workflow templates",
Expand All @@ -44,20 +43,20 @@ func NewListCommand() *cobra.Command {
if err != nil {
return err
}
switch listArgs.output {
switch output.String() {
case "", "wide":
printTable(cwftmplList.Items)
case "name":
for _, cwftmp := range cwftmplList.Items {
fmt.Println(cwftmp.ObjectMeta.Name)
}
default:
return fmt.Errorf("Unknown output mode: %s", listArgs.output)
return fmt.Errorf("Unknown output mode: %s", output.String())
}
return nil
},
}
command.Flags().StringVarP(&listArgs.output, "output", "o", "", "Output format. One of: wide|name")
command.Flags().VarP(&output, "output", "o", "Output format. "+output.Usage())
return command
}

Expand Down
Loading

0 comments on commit 33d01e3

Please sign in to comment.