Skip to content

Commit

Permalink
feat!: Add entrypoint lookup. Fixes #8344 (#8345)
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Collins <alex_collins@intuit.com>
  • Loading branch information
alexec authored Apr 13, 2022
1 parent 283f6b5 commit 73ea7c7
Show file tree
Hide file tree
Showing 20 changed files with 1,252 additions and 95 deletions.
4 changes: 2 additions & 2 deletions config/image.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package config

type Image struct {
Command []string `json:"command"`
Args []string `json:"args,omitempty"`
Entrypoint []string `json:"entrypoint,omitempty"`
Cmd []string `json:"cmd,omitempty"`
}
47 changes: 47 additions & 0 deletions docs/upgrading.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,53 @@
Breaking changes typically (sometimes we don't realise they are breaking) have "!" in the commit message, as per
the [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/#summary).

## Upgrading to v3.4

### feat!: Add entrypoint lookup. Fixes #8344

Affected if:

* Using the Emissary executor.
* Used the `args` field for any entry in `images`.

This PR automatically looks up the command and entrypoint. The implementation for config look-up was incorrect (it
allowed you to specify `args` but not `entrypoint`). `args` has been removed to correct the behaviour.

If you are incorrectly configured, the workflow controller will error on start-up.

#### Actions

You don't need to configure images that use v2 manifests anymore. You can just remove them (e.g. argoproj/argosay:v2):

```bash
% docker manifest inspect argoproj/argosay:v2
...
"schemaVersion": 2,
...
```

For v1 manifests (e.g. docker/whalesay:latest):

```bash
% docker image inspect -f '{{.Config.Entrypoint}} {{.Config.Cmd}}' docker/whalesay:latest
[] [/bin/bash]
````

```yaml
images:
docker/whalesay:latest:
cmd: [/bin/bash]
```

## feat: Fail on invalid config. (#8295)

The workflow controller will error on start-up if incorrectly configured, rather than silently ignoring
mis-configuration.

```
Failed to register watch for controller config map: error unmarshaling JSON: while decoding JSON: json: unknown field \"args\"
```
## Upgrading to v3.3
### [662a7295b](https://github.com/argoproj/argo-workflows/commit/662a7295b) feat: Replace `patch pod` with `create workflowtaskresult`. Fixes #3961 (#8000)
Expand Down
8 changes: 2 additions & 6 deletions docs/workflow-controller-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -185,14 +185,10 @@ data:
# The command/args for each image, needed when the command is not specified and the emissary executor is used.
# https://argoproj.github.io/argo-workflows/workflow-executors/#emissary-emissary
images: |
argoproj/argosay:v1:
command: [cowsay]
argoproj/argosay:v2:
command: [/argosay]
cmd: [/argosay]
docker/whalesay:latest:
command: [cowsay]
python:alpine3.6:
command: [python3]
cmd: [/bin/bash]
# Defaults for main containers. These can be overridden by the template.
# <= v3.3 only `resources` are supported.
Expand Down
2 changes: 1 addition & 1 deletion docs/workflow-executors.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ This is the most fully featured executor.
* Configuration:
* `command` must be specified for containers.

You can determine the command and args as follows:
You can determine values as follows:

```bash
docker image inspect -f '{{.Config.Entrypoint}} {{.Config.Cmd}}' argoproj/argosay:v2
Expand Down
8 changes: 6 additions & 2 deletions examples/container-set-template/outputs-result-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,17 @@ spec:
parameters:
- name: x
value: "{{tasks.a.outputs.result}}"
dependencies: ["a"]
dependencies: [ "a" ]

- name: group
containerSet:
containers:
- name: main
image: python:alpine3.6
args:
command:
- python
- -c
args:
- |
print("hi")
Expand All @@ -43,5 +45,7 @@ spec:
- name: x
script:
image: python:alpine3.6
command:
- python
source: |
assert "{{inputs.parameters.x}}" == "hi"
57 changes: 41 additions & 16 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ require (
github.com/prometheus/client_model v0.2.0
github.com/prometheus/common v0.33.0
github.com/robfig/cron/v3 v3.0.1
github.com/satori/go.uuid v1.2.0 // indirect
github.com/sirupsen/logrus v1.8.1
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
github.com/soheilhy/cmux v0.1.5
Expand All @@ -46,24 +45,24 @@ require (
github.com/spf13/viper v1.11.0
github.com/stretchr/testify v1.7.1
github.com/tidwall/gjson v1.14.0
github.com/valyala/fasthttp v1.27.0 // indirect
github.com/valyala/fasthttp v1.30.0 // indirect
github.com/valyala/fasttemplate v1.2.1
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
github.com/xeipuuv/gojsonschema v1.2.0
golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4
golang.org/x/net v0.0.0-20220412020605-290c469a71a5
golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8
golang.org/x/time v0.0.0-20220224211638-0e9765cccd65
google.golang.org/api v0.74.0
google.golang.org/genproto v0.0.0-20220407144326-9054f6ed7bac
google.golang.org/grpc v1.45.0
gopkg.in/go-playground/webhooks.v5 v5.17.0
gopkg.in/jcmturner/gokrb5.v5 v5.3.0
gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22 // indirect
k8s.io/api v0.23.3
k8s.io/apimachinery v0.23.3
k8s.io/client-go v0.23.3
k8s.io/api v0.23.4
k8s.io/apimachinery v0.23.4
k8s.io/client-go v0.23.4
k8s.io/klog/v2 v2.40.1
k8s.io/kube-openapi v0.0.0-20220124234850-424119656bbf
k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9
Expand All @@ -75,29 +74,51 @@ require (
cloud.google.com/go v0.100.2 // indirect
cloud.google.com/go/compute v1.5.0 // indirect
cloud.google.com/go/iam v0.3.0 // indirect
github.com/Azure/azure-sdk-for-go v62.0.0+incompatible // indirect
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
github.com/Azure/go-autorest/autorest v0.11.18 // indirect
github.com/Azure/go-autorest/autorest/adal v0.9.13 // indirect
github.com/Azure/go-autorest/autorest v0.11.24 // indirect
github.com/Azure/go-autorest/autorest/adal v0.9.18 // indirect
github.com/Azure/go-autorest/autorest/azure/auth v0.5.11 // indirect
github.com/Azure/go-autorest/autorest/azure/cli v0.4.5 // indirect
github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
github.com/Azure/go-autorest/logger v0.2.1 // indirect
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver/v3 v3.1.1 // indirect
github.com/Microsoft/go-winio v0.5.0 // indirect
github.com/Microsoft/go-winio v0.5.1 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7 // indirect
github.com/acomagu/bufpipe v1.0.3 // indirect
github.com/ajg/form v1.5.1 // indirect
github.com/andybalholm/brotli v1.0.2 // indirect
github.com/andybalholm/brotli v1.0.3 // indirect
github.com/awalterschulze/gographviz v0.0.0-20200901124122-0eecad45bd71 // indirect
github.com/aws/aws-sdk-go v1.42.50 // indirect
github.com/aws/aws-sdk-go-v2 v1.16.1 // indirect
github.com/aws/aws-sdk-go-v2/config v1.15.1 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.11.0 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.1 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.7 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.1 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.8 // indirect
github.com/aws/aws-sdk-go-v2/service/ecr v1.15.0 // indirect
github.com/aws/aws-sdk-go-v2/service/ecrpublic v1.12.0 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.1 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.11.1 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.16.1 // indirect
github.com/aws/smithy-go v1.11.2 // indirect
github.com/awslabs/amazon-ecr-credential-helper/ecr-login v0.0.0-20220228164355-396b2034c795 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/chrismellard/docker-credential-acr-env v0.0.0-20220119192733-fe33c00cee21 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dimchansky/utfbom v1.1.1 // indirect
github.com/docker/cli v20.10.12+incompatible // indirect
github.com/docker/distribution v2.8.0+incompatible // indirect
github.com/docker/docker v20.10.12+incompatible // indirect
github.com/docker/docker-credential-helpers v0.6.4 // indirect
github.com/dustin/go-humanize v1.0.0 // indirect
github.com/emirpasic/gods v1.12.0 // indirect
github.com/felixge/httpsnoop v1.0.2 // indirect
github.com/form3tech-oss/jwt-go v3.2.3+incompatible // indirect
github.com/fsnotify/fsnotify v1.5.1 // indirect
github.com/go-git/gcfg v1.5.0 // indirect
github.com/go-git/go-billy/v5 v5.3.1 // indirect
Expand All @@ -106,13 +127,18 @@ require (
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/swag v0.19.15 // indirect
github.com/golang-jwt/jwt/v4 v4.3.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/google/go-cmp v0.5.7 // indirect
github.com/google/go-containerregistry v0.8.1-0.20220110151055-a61fd0a8e2bb
github.com/google/go-containerregistry/pkg/authn/k8schain v0.0.0-20220411142604-2042cc9d6401
github.com/google/go-containerregistry/pkg/authn/kubernetes v0.0.0-20220301182634-bfe2ffc6b6bd // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/googleapis/gax-go/v2 v2.3.0 // indirect
github.com/googleapis/gnostic v0.5.5 // indirect
github.com/googleapis/go-type-adapters v1.0.0 // indirect
github.com/hashicorp/go-uuid v1.0.2 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/huandu/xstrings v1.3.2 // indirect
Expand Down Expand Up @@ -140,6 +166,8 @@ require (
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.0.3-0.20220114050600-8b9d41f48198 // indirect
github.com/pelletier/go-toml v1.9.4 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
Expand All @@ -156,6 +184,7 @@ require (
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.0 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/whilp/git-urls v1.0.0 // indirect
github.com/xanzy/ssh-agent v0.3.1 // indirect
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0 // indirect
Expand Down Expand Up @@ -183,10 +212,6 @@ require (
sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect
)

require (
github.com/googleapis/go-type-adapters v1.0.0 // indirect
github.com/pelletier/go-toml/v2 v2.0.0-beta.8 // indirect
github.com/whilp/git-urls v1.0.0 // indirect
)
require github.com/pelletier/go-toml/v2 v2.0.0-beta.8 // indirect

replace github.com/go-git/go-git/v5 => github.com/argoproj-labs/go-git/v5 v5.4.4
Loading

0 comments on commit 73ea7c7

Please sign in to comment.