Skip to content

Commit

Permalink
Merge branch 'argoproj:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
MenD32 authored Oct 16, 2024
2 parents f3329b5 + 5be8cbf commit 1841129
Show file tree
Hide file tree
Showing 43 changed files with 7,276 additions and 218 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"
}
]
}
}
}
}
}
2 changes: 2 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 @@ -165,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
3 changes: 3 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ type Config struct {
// NodeEvents configures how node events are emitted
NodeEvents NodeEvents `json:"nodeEvents,omitempty"`

// WorkflowEvents configures how workflow events are emitted
WorkflowEvents WorkflowEvents `json:"workflowEvents,omitempty"`

// Executor holds container customizations for the executor to use when running pods
Executor *apiv1.Container `json:"executor,omitempty"`

Expand Down
9 changes: 9 additions & 0 deletions config/workflow_events.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package config

type WorkflowEvents struct {
Enabled *bool `json:"enabled,omitempty"`
}

func (e WorkflowEvents) IsEnabled() bool {
return e.Enabled == nil || *e.Enabled
}
14 changes: 14 additions & 0 deletions config/workflow_events_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package config

import (
"testing"

"github.com/stretchr/testify/assert"
"k8s.io/utils/ptr"
)

func TestWorkflowEvents_IsEnabled(t *testing.T) {
assert.True(t, WorkflowEvents{}.IsEnabled())
assert.False(t, WorkflowEvents{Enabled: ptr.To(false)}.IsEnabled())
assert.True(t, WorkflowEvents{Enabled: ptr.To(true)}.IsEnabled())
}
6 changes: 5 additions & 1 deletion dev/nix/conf.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ rec {
LOGS = "true"; # same as CTRL - not acted upon
UI = "true"; # same as CTRL
API = "true"; # same as CTRL
UI_SECURE = "false";
PLUGINS = "false";
};
controller = {
Expand All @@ -50,7 +51,10 @@ rec {
args = "--loglevel ${env.LOG_LEVEL} server --namespaced=${env.NAMESPACED} --auth-mode ${env.AUTH_MODE} --secure=${env.SECURE} --x-frame-options=SAMEORIGIN";
};
ui = {
env = { };
env = {
ARGO_UI_SECURE = "${env.UI_SECURE}";
ARGO_SECURE = "${env.SECURE}";
};
args = "--cwd ui start";
};
}
12 changes: 6 additions & 6 deletions docs/client-libraries.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ Client libraries often handle common tasks such as authentication for you.
The following client libraries are auto-generated using [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator-cli).
Please expect very minimal support from the Argo team.

| Language | Client Library | Examples/Docs |
|----------|-----------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------|
| Golang | [`apiclient.go`](https://github.com/argoproj/argo-workflows/blob/main/pkg/apiclient/apiclient.go) | [Example](https://github.com/argoproj/argo-workflows/blob/main/cmd/argo/commands/submit.go) |
| Java | [Java](https://github.com/argoproj/argo-workflows/blob/main/sdks/java) | |
| Python | [Python](https://github.com/argoproj/argo-workflows/blob/main/sdks/python) | |
| Language | Client Library | Examples/Docs |
|----------|---------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------|
| Golang | [`apiclient.go`](https://github.com/argoproj/argo-workflows/blob/main/pkg/apiclient/apiclient.go) | [Example](https://github.com/argoproj/argo-workflows/blob/main/cmd/argo/commands/submit.go) |
| Java | [Java](https://github.com/argoproj/argo-workflows/blob/main/sdks/java) | |
| Python | ⚠️ deprecated [Python](https://github.com/argoproj/argo-workflows/blob/main/sdks/python) | Use one of the [community-maintained](#community-maintained-client-libraries) instead. Will be removed in version 3.7 |

## Community-maintained client libraries

The following client libraries are provided and maintained by their authors, not the Argo team.

| Language | Client Library | Examples/Docs |
|----------|---------------------------------------------------------|--------------------------------------------------------------------------|
| Python | [Couler](https://github.com/couler-proj/couler) | Multi-workflow engine support Python SDK |
| Python | [Hera](https://github.com/argoproj-labs/hera-workflows) | Easy and accessible Argo workflows construction and submission in Python |
| Python | [Couler](https://github.com/couler-proj/couler) | Multi-workflow engine support Python SDK. May be unmaintained. |
1 change: 1 addition & 0 deletions docs/environment-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ This document outlines environment variables that can be used to customize behav
| `ARGO_AGENT_CPU_LIMIT` | `resource.Quantity` | `100m` | CPU resource limit for the agent. |
| `ARGO_AGENT_MEMORY_LIMIT` | `resource.Quantity` | `256m` | Memory resource limit for the agent. |
| `ARGO_POD_STATUS_CAPTURE_FINALIZER` | `bool` | `false` | The finalizer blocks the deletion of pods until the controller captures their status.
| `ARGO_TEMPLATE_WITH_INPUTS_PARAMETERS` | `bool` | `true` | Whether to keep inputs.parameters inside the ARGO_TEMPLATE environment variable of pods.
| `BUBBLE_ENTRY_TEMPLATE_ERR` | `bool` | `true` | Whether to bubble up template errors to workflow. |
| `CACHE_GC_PERIOD` | `time.Duration` | `0s` | How often to perform memoization cache GC, which is disabled by default and can be enabled by providing a non-zero duration. |
| `CACHE_GC_AFTER_NOT_HIT_DURATION` | `time.Duration` | `30s` | When a memoization cache has not been hit after this duration, it will be deleted. |
Expand Down
8 changes: 8 additions & 0 deletions docs/fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -2399,7 +2399,11 @@ Mutex holds Mutex configuration

- [`synchronization-mutex-tmpl-level-legacy.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/synchronization-mutex-tmpl-level-legacy.yaml)

- [`synchronization-mutex-tmpl-level.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/synchronization-mutex-tmpl-level.yaml)

- [`synchronization-mutex-wf-level-legacy.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/synchronization-mutex-wf-level-legacy.yaml)

- [`synchronization-mutex-wf-level.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/synchronization-mutex-wf-level.yaml)
</details>

### Fields
Expand Down Expand Up @@ -3291,7 +3295,11 @@ MutexStatus contains which objects hold mutex locks, and which objects this work

- [`synchronization-mutex-tmpl-level-legacy.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/synchronization-mutex-tmpl-level-legacy.yaml)

- [`synchronization-mutex-tmpl-level.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/synchronization-mutex-tmpl-level.yaml)

- [`synchronization-mutex-wf-level-legacy.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/synchronization-mutex-wf-level-legacy.yaml)

- [`synchronization-mutex-wf-level.yaml`](https://github.com/argoproj/argo-workflows/blob/main/examples/synchronization-mutex-wf-level.yaml)
</details>

### Fields
Expand Down
21 changes: 21 additions & 0 deletions docs/running-locally.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,21 @@ To test SSO integration, use `PROFILE=sso`:
make start UI=true PROFILE=sso
```

## TLS

By default, `make start` will start Argo in [plain text mode](tls.md#plain-text).
To simulate a TLS proxy in front of Argo, use `UI_SECURE=true` (which implies `UI=true`):

```bash
make start UI_SECURE=true
```

To start Argo in [encrypted mode](tls.md#encrypted), use `SECURE=true`, which can be optionally combined with `UI_SECURE=true`:

```bash
make start SECURE=true UI_SECURE=true
```

### Running E2E tests locally

Start up Argo Workflows using the following:
Expand Down Expand Up @@ -206,6 +221,12 @@ Tests often fail: that's good. To diagnose failure:

If tests run slowly or time out, factory reset your Kubernetes cluster.

### Debugging using Visual Studio Code

When using the Dev Container with VSCode, use the `Attach to argo server` and/or `Attach to workflow controller` launch configurations to attach to the `argo` or `workflow-controller` processes, respectively.

This will allow you to start a debug session, where you can inspect variables and set breakpoints.

## Committing

Before you commit code and raise a PR, always run:
Expand Down
Loading

0 comments on commit 1841129

Please sign in to comment.