Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Only set ARGO_TEMPLATE env for init container. #13761

Merged
merged 3 commits into from
Oct 18, 2024

Conversation

jswxstw
Copy link
Member

@jswxstw jswxstw commented Oct 15, 2024

Fixes #8790

Motivation

duplicative env var ARGO_TEMPLATE result in etcd size 1MB limit

Modifications

Only set ARGO_TEMPLATE env for init container, wait container read it from the template file written by init container.

Verification

existing UT or E2E tests have covered it.

@tooptoop4
Copy link
Contributor

@jswxstw this is great but can u make this change enabled via an environment variable (ARGO_TEMPLATE_ONLY_ON_INIT)? @juliev0 mentioned one of their workflows in main container uses the variable: #8790 (comment) whereas 99% of users (including me) won't and would benefit from your PR

@juliev0
Copy link
Contributor

juliev0 commented Oct 16, 2024

Thanks for noticing that @tooptoop4 ! I believe this is one motivation for your making #13742 configurable, right?

@jswxstw will it make the code too ugly to do that? I'll admit that my use of $ARGO_TEMPLATE environment variable was a hacky workaround for exceeding the maximum size of an argument, as opposed to a promise that Argo Workflows makes will exist. And admittedly, I was later in a separate situation in which for a different Workflow even this hack didn't work, as the environment variable size made the overall Container size too big as I recall. If needed, I can adjust our Workflow so it doesn't try to do this at all. I guess the only question is whether there's anyone else out there for which this will break.

@jswxstw
Copy link
Member Author

jswxstw commented Oct 16, 2024

@jswxstw will it make the code too ugly to do that?

@juliev0 Agree, I think we should exercise restraint in adding environment variables, as it could increase complexity and confuse users.
Also, #12325 has supported ARGO_TEMPLATE env offload by default, it will also affect users who use this env. @tooptoop4
I do think ARGO_TEMPLATE is an internal environment variable, which is not documented and users should not rely on it.

@jswxstw jswxstw marked this pull request as ready for review October 16, 2024 04:53
Copy link
Contributor

@agilgur5 agilgur5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this is no longer a feature (unlike #13742, which added an env var) as it doesn't add anything; could be a fix or refactor depending on if we want to auto-backport it

I think we should exercise restraint in adding environment variables, as it could increase complexity and confuse users.

Agree.

I do think ARGO_TEMPLATE is an internal environment variable, which is not documented and users should not rely on it.

Also agree. I've said similar things elsewhere too and there is precedent for this.

If we wanted to be extra safe, we could make this a breaking fix! and leave a note in the upgrading guide.

@juliev0
Copy link
Contributor

juliev0 commented Oct 16, 2024

Hey @shuangkun - do you want to review this since you added the configmap offloading PR which it's based on?

@tooptoop4
Copy link
Contributor

tooptoop4 commented Oct 17, 2024

@jswxstw

when i tried to patch this got below error in the wait container:


time="2024-10-17T01:57:33 UTC" level=info msg="Starting Workflow Executor" version=v3.4.11
panic: unexpected end of JSON input
goroutine 1 [running]:
github.com/argoproj/argo-workflows/v3/cmd/argoexec/commands.checkErr({0x3517da0, 0xc000011a40})
        /go/src/github.com/argoproj/argo-workflows/cmd/argoexec/commands/root.go:146 +0x6b
github.com/argoproj/argo-workflows/v3/cmd/argoexec/commands.initExecutor()
        /go/src/github.com/argoproj/argo-workflows/cmd/argoexec/commands/root.go:101 +0x3b5
github.com/argoproj/argo-workflows/v3/cmd/argoexec/commands.waitContainer({0x3547bb8, 0xc0009a3e40})
        /go/src/github.com/argoproj/argo-workflows/cmd/argoexec/commands/wait.go:28 +0x4f
github.com/argoproj/argo-workflows/v3/cmd/argoexec/commands.NewWaitCommand.func1(0xc0008dbb80?, {0x2d958d7?, 0x0?, 0x0?})
        /go/src/github.com/argoproj/argo-workflows/cmd/argoexec/commands/wait.go:18 +0x2a
github.com/spf13/cobra.(*Command).execute(0xc0008dbb80, {0x4cda578, 0x0, 0x0})
        /go/pkg/mod/github.com/spf13/[email protected]/command.go:876 +0x67b
github.com/spf13/cobra.(*Command).ExecuteC(0xc0008da000)
        /go/pkg/mod/github.com/spf13/[email protected]/command.go:990 +0x3bd
github.com/spf13/cobra.(*Command).Execute(...)
        /go/pkg/mod/github.com/spf13/[email protected]/command.go:918
github.com/spf13/cobra.(*Command).ExecuteContext(0x3546178?, {0x3547bb8?, 0xc0009a3e40?})
        /go/pkg/mod/github.com/spf13/[email protected]/command.go:911 +0x4a
main.main()
        /go/src/github.com/argoproj/argo-workflows/cmd/argoexec/main.go:21 +0x9e

actually i think i'm just not building locally properly, how do you do it?

@jswxstw
Copy link
Member Author

jswxstw commented Oct 17, 2024

time="2024-10-17T01:57:33 UTC" level=info msg="Starting Workflow Executor" version=v3.4.11

It seems you are using the argoexec image of old version: v3.4.11. Not updated? @tooptoop4

@tooptoop4
Copy link
Contributor

@jswxstw what command do u use to build the controller locally?

@jswxstw
Copy link
Member Author

jswxstw commented Oct 17, 2024

@tooptoop4 I used make start UI=true, like developing locally.
Please note this, make argoexec-image will build latest image and import it into the k3d cluster:k3s-default by default.
QQ_1729146706308

@jswxstw
Copy link
Member Author

jswxstw commented Oct 17, 2024

So this is no longer a feature (unlike #13742, which added an env var) as it doesn't add anything; could be a fix or refactor depending on if we want to auto-backport it

@agilgur5 Agree, this PR should be a refactor, based on the feature configmap offloading and ARGO_TEMPLATE simplifying.

@jswxstw jswxstw changed the title feat: Only set ARGO_TEMPLATE env for init container. refactor: Only set ARGO_TEMPLATE env for init container. Oct 17, 2024
@tooptoop4
Copy link
Contributor

@tooptoop4 I used make start UI=true, like developing locally. Please note this, make argoexec-image will build latest image and import it into the k3d cluster:k3s-default by default. QQ_1729146706308

ah this makes sense, i need to build the exec image too not just the controller!

Copy link
Member

@terrytangyuan terrytangyuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a breaking change. I remember Intuit or other vendors depend on this. @juliev0 Do you remember?

@tooptoop4
Copy link
Contributor

This seems like a breaking change. I remember Intuit or other vendors depend on this. @juliev0 Do you remember?

accepted in #13761 (comment)

@agilgur5
Copy link
Contributor

agilgur5 commented Oct 17, 2024

This seems like a breaking change. I remember Intuit or other vendors depend on this.

It's also an undocumented, internal environment variable, so shouldn't have been relied on by users as mentioned by @jswxstw and I above

@juliev0
Copy link
Contributor

juliev0 commented Oct 17, 2024

Thanks for keeping that in mind, though, @terrytangyuan!

Copy link
Member

@terrytangyuan terrytangyuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@terrytangyuan terrytangyuan merged commit c9b1477 into argoproj:main Oct 18, 2024
30 checks passed
@shuangkun
Copy link
Member

Hey @shuangkun - do you want to review this since you added the configmap offloading PR which it's based on?

Sorry, I just found time now. This PR has been merged and it seems there is no problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/controller Controller issues, panics area/executor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

duplicative env var ARGO_TEMPLATE result in etcd size 1MB limit
6 participants