Skip to content

Commit

Permalink
Merge branch 'master' into feature/update-gcloud-api-packages
Browse files Browse the repository at this point in the history
  • Loading branch information
alexec committed Jul 22, 2021
2 parents a2fc1e4 + c80f4bc commit 42ba3ec
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 2 deletions.
1 change: 1 addition & 0 deletions USERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ As the Argo Community grows, we'd like to keep track of our users. Please send a
Currently, the following organizations are **officially** using Argo Workflows:

1. [23mofang](https://www.23mofang.com/)
1. [4intelligence](https://4intelligence.com.br/)
1. [7shifts](https://www.7shifts.com)
1. [Acquia](https://www.acquia.com/)
1. [Adevinta](https://www.adevinta.com/)
Expand Down
2 changes: 2 additions & 0 deletions docs/configure-artifact-repository.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ artifacts:
key: secretKey
```

You can also set `createBucketIfNotPresent` to `true` to tell the artifact driver to automatically create the OSS bucket if it doesn't exist yet when saving artifacts. Note that you'll need to set additional permission for your OSS account to create new buckets.

# Configure the Default Artifact Repository

In order for Argo to use your artifact repository, you can configure it as the
Expand Down
13 changes: 13 additions & 0 deletions docs/upgrading.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

# Upgrading

Breaking changes typically (sometimes we don't realise they are breaking) have "!" in the commit message, as per
Expand Down Expand Up @@ -40,6 +41,18 @@ containerRuntimeExecutors: |
workflows.argoproj.io/container-runtime-executor: emissary
```
### [be63efe89](https://github.com/argoproj/argo-workflows/commit/e6fa41a) feat(controller): Expression template tags. Resolves #4548 & #1293 (#5115)
This PR introduced a new expression syntax know as "expression tag template". A user has reported that this does not
always play nicely with the `when` condition syntax (Goevaluate).

This can be resolved using a single quote in your when expression:

```
when: "'{{inputs.parameters.should-print}}' != '2021-01-01'"
```

[Learn more](https://github.com/argoproj/argo-workflows/issues/6314)

## Upgrading to v3.0

Expand Down
3 changes: 3 additions & 0 deletions docs/workflow-controller-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ data:
key: secretKey
# If this is set to true, argo workflows will use AWS SDK default credentials provider chain. This will allow things like
# IRSA and any of the authentication methods that the golang SDK uses in it's default chain.
# If you are using IRSA on AWS, and set this option to true, you will also need to modify Argo-Server Deployment with
# `spec.template.spec.securityContext.fsGroup: 65534` configuration. This is required for IRSA to be able to access
# `/var/run/secrets/eks.amazonaws.com/serviceaccount/token` file, and authenticate with AWS.
useSDKCreds: false
# Specifies the container runtime interface to use (default: docker)
Expand Down
12 changes: 10 additions & 2 deletions workflow/controller/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,13 +229,21 @@ func (woc *wfOperationCtx) operate(ctx context.Context) {
woc.updated = wfUpdate
if !acquired {
woc.log.Warn("Workflow processing has been postponed due to concurrency limit")
woc.wf.Status.Message = msg
phase := woc.wf.Status.Phase
if phase == wfv1.WorkflowUnknown {
phase = wfv1.WorkflowPending
}
woc.markWorkflowPhase(ctx, phase, msg)
return
}
}

// Update workflow duration variable
woc.globalParams[common.GlobalVarWorkflowDuration] = fmt.Sprintf("%f", time.Since(woc.wf.Status.StartedAt.Time).Seconds())
if woc.wf.Status.StartedAt.IsZero() {
woc.globalParams[common.GlobalVarWorkflowDuration] = fmt.Sprintf("%f", time.Duration(0).Seconds())
} else {
woc.globalParams[common.GlobalVarWorkflowDuration] = fmt.Sprintf("%f", time.Since(woc.wf.Status.StartedAt.Time).Seconds())
}

// Populate the phase of all the nodes prior to execution
for _, node := range woc.wf.Status.Nodes {
Expand Down
31 changes: 31 additions & 0 deletions workflow/controller/operator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,37 @@ spec:
}), "zero node durations empty")
}

func TestGlobalParamDuration(t *testing.T) {
wf := wfv1.MustUnmarshalWorkflow(`
metadata:
name: my-wf
namespace: my-ns
spec:
entrypoint: main
templates:
- name: main
dag:
tasks:
- name: pod
template: pod
- name: pod
container:
image: my-image
`)
cancel, controller := newController(wf)
defer cancel()

ctx := context.Background()
woc := newWorkflowOperationCtx(wf, controller)
woc.operate(ctx)
assert.Equal(t, woc.globalParams[common.GlobalVarWorkflowDuration], "0.000000")

makePodsPhase(ctx, woc, apiv1.PodSucceeded)
woc = newWorkflowOperationCtx(woc.wf, controller)
woc.operate(ctx)
assert.Greater(t, woc.globalParams[common.GlobalVarWorkflowDuration], "0.000000")
}

func TestEstimatedDuration(t *testing.T) {
wf := wfv1.MustUnmarshalWorkflow(`
metadata:
Expand Down

0 comments on commit 42ba3ec

Please sign in to comment.