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

fix: cannot access HTTP template's outputs #7200

Merged
merged 7 commits into from
Dec 2, 2021
Merged

Conversation

book987
Copy link
Contributor

@book987 book987 commented Nov 10, 2021

fix #7199

Signed-off-by: book987 book87987book@gmail.com

Don't bother creating a PR until you've done this:

  • Run make pre-commit -B to fix codegen, lint, and commit message problems.

Create your PR as a draft.

  • Your PR needs to pass the required checks before it can be approved. If the check is not required (e.g. E2E tests) it
    does not need to pass.
  • Once required tests have passed, you can make it "Ready for review".
  • Say how how you tested your changes. If you changed the UI, attach screenshots.

Tips:

  • If changes were requested, and you've made them, then dismiss the review to get it looked at again.
  • Add you organization to USERS.md if you like.
  • You can ask for help!

@book987 book987 changed the title fix: cannot access HTTP template's outputs && cannot connect to HTTP node in DAG fix: cannot access HTTP template's outputs Nov 10, 2021
Signed-off-by: book987 <book78987book@gmail.com>
@alexec alexec enabled auto-merge (squash) November 10, 2021 15:49
@alexec
Copy link
Contributor

alexec commented Nov 10, 2021

🥇

Copy link
Member

@sarabala1979 sarabala1979 left a comment

Choose a reason for hiding this comment

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

LGTM

@sarabala1979
Copy link
Member

@book987 Can you fix the lint issue?

@alexec
Copy link
Contributor

alexec commented Nov 10, 2021

looks like lint job is timing out, if this passes lint locally, it probably is transient problem

@alexec
Copy link
Contributor

alexec commented Nov 10, 2021

I think we need to increase the lint timeout:

timeout: 5m

This could be fixed in this PR.

@book987
Copy link
Contributor Author

book987 commented Nov 11, 2021

I think we need to increase the lint timeout:

timeout: 5m

This could be fixed in this PR.

Lint passed, I also increase timeout to 8m in this PR.

@alexec
Copy link
Contributor

alexec commented Nov 12, 2021

Test failure:

Checking expectation http-outputs-cqhc2
1040
http-outputs-cqhc2 : Succeeded 
1041
    functional_test.go:825: 
1042
        	Error Trace:	functional_test.go:825
1043
        	            				then.go:66
1044
        	            				then.go:41
1045
        	            				functional_test.go:823
1046
        	Error:      	Expected value not to be nil.
1047
        	Test:       	TestFunctionalSuite/TestHTTPOutputs
1048
=== FAIL: FunctionalSuite/TestHTTPOutputs

Signed-off-by: book987 <book78987book@gmail.com>
@book987
Copy link
Contributor Author

book987 commented Nov 15, 2021

Test failure:

Checking expectation http-outputs-cqhc2
1040
http-outputs-cqhc2 : Succeeded 
1041
    functional_test.go:825: 
1042
        	Error Trace:	functional_test.go:825
1043
        	            				then.go:66
1044
        	            				then.go:41
1045
        	            				functional_test.go:823
1046
        	Error:      	Expected value not to be nil.
1047
        	Test:       	TestFunctionalSuite/TestHTTPOutputs
1048
=== FAIL: FunctionalSuite/TestHTTPOutputs

Hi, this e2e test passed on my laptop, I need some help 😢 Is there any way we can get the full workflow yaml?

/usr/local/Cellar/go/1.16/libexec/bin/go tool test2json -t /private/var/folders/c7/xsy5l1m919sbbzdlvnk40rlm0000gn/T/___TestHTTPOutputs_in_github_com_argoproj_argo_workflows_v3_test_e2e -test.v -test.paniconexit0 -test.run ^\QTestFunctionalSuite\E$/^\QTestHTTPOutputs\E$ -testify.m ^TestHTTPOutputs$
=== RUN   TestFunctionalSuite
time="2021-11-15T14:37:47+08:00" level=info msg="config map" name=workflow-controller-configmap
--- PASS: TestFunctionalSuite (10.26s)
=== RUN   TestFunctionalSuite/TestHTTPOutputs
Submitting workflow  http-outputs-
Waiting 30s for workflow metadata.name=http-outputs-g8wcb
 ? http-outputs-g8wcb Workflow 0s      

 ● http-outputs-g8wcb   Workflow 0s      
 └ ● http-outputs-g8wcb DAG      0s      
 └ ◷ http               HTTP     0s      

 ● http-outputs-g8wcb   Workflow 0s      
 └ ● http-outputs-g8wcb DAG      0s      
 └ ✔ http               HTTP     0s      

 ● http-outputs-g8wcb   Workflow 0s      
 └ ● http-outputs-g8wcb DAG      0s      
 └ ✔ http               HTTP     0s      
 └ ◷ echo               Pod      0s      

 ✔ http-outputs-g8wcb   Workflow 10s     
 └ ✔ http-outputs-g8wcb DAG      10s     
 └ ✔ http               HTTP     0s      
 └ ✔ echo               Pod      1s      

Condition "to be Succeeded" met after 10s
Checking expectation http-outputs-g8wcb
http-outputs-g8wcb : Succeeded 
=== PASS: FunctionalSuite/TestHTTPOutputs
    --- PASS: TestFunctionalSuite/TestHTTPOutputs (10.24s)
PASS

Process finished with exit code 0

@alexec
Copy link
Contributor

alexec commented Nov 15, 2021

I wonder if test is not using executor image built?

@book987
Copy link
Contributor Author

book987 commented Nov 16, 2021

I wonder if test is not using executor image built?

You're right, I found this in agent's log, it still put the result in outputs.parameters, that means CI is not using executor image built I think.

https://github.com/argoproj/argo-workflows/runs/4208211529?check_suite_focus=true#step:15:3186

@alexec
Copy link
Contributor

alexec commented Nov 16, 2021

That's is odd. This works fine for other builds. I wonder if it fails on forks?

@alexec
Copy link
Contributor

alexec commented Nov 16, 2021

Ok. So HTTP templates are run by the agent. Perhaps the agent does not have correct pull policy.

@alexec
Copy link
Contributor

alexec commented Nov 16, 2021

Agent does not respect pull policy:

Spec: apiv1.PodSpec{

Can you please fix that in this PR too?

Signed-off-by: book987 <book78987book@gmail.com>
Signed-off-by: book987 <book78987book@gmail.com>
@book987
Copy link
Contributor Author

book987 commented Nov 17, 2021

Agent does not respect pull policy:

Spec: apiv1.PodSpec{

Can you please fix that in this PR too?

awesome! fixed.

kind: Workflow
metadata:
generateName: http-outputs-
labels:
Copy link
Contributor

Choose a reason for hiding this comment

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

please delete all the labels, not needed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

deleted

@@ -133,7 +134,7 @@ func (ae *AgentExecutor) executeHTTPTemplate(ctx context.Context, tmpl wfv1.Temp
return nil, err
}
outputs := &wfv1.Outputs{}
outputs.Parameters = append(outputs.Parameters, wfv1.Parameter{Name: "result", Value: wfv1.AnyStringPtr(response)})
Copy link
Contributor

Choose a reason for hiding this comment

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

@sarabala1979 is this a problem?

Signed-off-by: book987 <book78987book@gmail.com>
@book987
Copy link
Contributor Author

book987 commented Nov 22, 2021

Hi, could you please take another look @alexec @sarabala1979

@alexec
Copy link
Contributor

alexec commented Nov 22, 2021

I've requested @sarabala1979 thoughts on this.

Bala - can you please add to you TODO list?

@@ -133,7 +134,7 @@ func (ae *AgentExecutor) executeHTTPTemplate(ctx context.Context, tmpl wfv1.Temp
return nil, err
}
outputs := &wfv1.Outputs{}
outputs.Parameters = append(outputs.Parameters, wfv1.Parameter{Name: "result", Value: wfv1.AnyStringPtr(response)})
outputs.Result = pointer.StringPtr(response)
Copy link
Member

Choose a reason for hiding this comment

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

This is breaking change. it may break existing workflows. Please revert it. We did as a parameter so downline step can refer to it. But now it is too late to change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've try access HTTP template's output with steps and getting same error Internal Server Error: templates.main.steps failed to resolve {{steps.good.outputs.parameters.result}}, in v3.2.3 and v3.2.4. So looks like no one can use it's output in downline step currently. So this isn't a breaking change I think.

I rarely use steps, if I tested it in wrong way pls forgive me.

Copy link
Member

Choose a reason for hiding this comment

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

got it

Copy link
Member

@sarabala1979 sarabala1979 left a comment

Choose a reason for hiding this comment

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

This is breaking change. it may break existing workflows. Please revert it. We did as a parameter so the downline step can refer to it. But now it is too late to change.

Copy link
Contributor

@alexec alexec left a comment

Choose a reason for hiding this comment

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

LGTM. But need sync with master.

Copy link
Member

@sarabala1979 sarabala1979 left a comment

Choose a reason for hiding this comment

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

LGMT

Signed-off-by: book987 <book78987book@gmail.com>
@book987
Copy link
Contributor Author

book987 commented Nov 24, 2021

LGTM. But need sync with master.

sync completed.

@simster7
Copy link
Member

simster7 commented Dec 2, 2021

@alexec Looks like it needs another review from you

@simster7 simster7 requested a review from alexec December 2, 2021 18:55
@alexec alexec merged commit cb8c063 into argoproj:master Dec 2, 2021
@sarabala1979 sarabala1979 mentioned this pull request Dec 15, 2021
73 tasks
sarabala1979 pushed a commit that referenced this pull request Dec 15, 2021
Signed-off-by: book987 <book78987book@gmail.com>
@sarabala1979 sarabala1979 mentioned this pull request Mar 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cannot resolve HTTP template's outputs.parameters.result
4 participants