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

Hooks in steps use artifacts unable to submit #13860

Open
4 tasks done
shuangkun opened this issue Nov 3, 2024 · 0 comments · May be fixed by #13861
Open
4 tasks done

Hooks in steps use artifacts unable to submit #13860

shuangkun opened this issue Nov 3, 2024 · 0 comments · May be fixed by #13861

Comments

@shuangkun
Copy link
Member

Pre-requisites

  • I have double-checked my configuration
  • I have tested with the :latest image tag (i.e. quay.io/argoproj/workflow-controller:latest) and can confirm the issue still exists on :latest. If not, I have explained why, in detail, in my description below.
  • I have searched existing issues and could not find a match for this bug
  • I'd like to contribute the fix myself (see contributing guide)

What happened? What did you expect to happen?

When I submit the workflow, the following error is displayed

#shuangkun% argo submit test.yaml
FATA[2024-11-03T18:22:46.100Z] Failed to submit workflow: rpc error: code = InvalidArgument desc = templates.main.steps failed to resolve {{steps.hello1.outputs.artifacts.result}}

I hope to be able to submit the workflow normally.

Version(s)

latest

Paste a minimal workflow that reproduces the issue. We must be able to run the workflow; don't enter a workflows that uses private images.

apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  generateName: test-hook-
spec:
  entrypoint: main
  templates:
  - name: main
    steps:
    - - name: hello1            # hello1 is run before the following steps
        template: parameterization
        hooks:
          success:
            template: success-hook
            expression: steps["hello1"].status == "Succeeded"
            arguments:
              artifacts:
              - name: file_path
                from: "{{steps.hello1.outputs.artifacts.result}}"

  - name: parameterization
    script:
      image: python:3.8
      command: [python]
      source: |
        import os
        with open("foo.txt", "w") as f:
            f.write("Hello")
        # 模拟输出文件作为artifact
        os.rename('foo.txt', '/tmp/foo.txt')
    outputs:
      artifacts:
      - name: result
        path: /tmp/foo.txt

  - name: success-hook
    inputs:
      artifacts:
      - name: file_path
        path: /tmp/file_path
    script:
      image: python:3.8
      command: [sh, -c]
      source: |
        echo "File Path: {{inputs.artifacts.file_path.path}}"


### Logs from the workflow controller

```text
kubectl logs -n argo deploy/workflow-controller | grep ${workflow}

Logs from in your workflow's wait container

kubectl logs -n argo -c wait -l workflows.argoproj.io/workflow=${workflow},workflow.argoproj.io/phase!=Succeeded
shuangkun added a commit to shuangkun/argo-workflows that referenced this issue Nov 3, 2024
Signed-off-by: shuangkun <tsk2013uestc@163.com>
@shuangkun shuangkun self-assigned this Nov 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant