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

Git artifacts detached from revision #10018

Open
2 of 3 tasks
wsams opened this issue Nov 11, 2022 · 7 comments
Open
2 of 3 tasks

Git artifacts detached from revision #10018

wsams opened this issue Nov 11, 2022 · 7 comments
Assignees
Labels
P3 Low priority type/bug type/regression Regression from previous behavior (a specific type of bug)

Comments

@wsams
Copy link

wsams commented Nov 11, 2022

Pre-requisites

  • I have double-checked my configuration
  • I can confirm the issues exists when I tested with :latest
  • I'd like to contribute the fix myself (see contributing guide) (I would fix myself but I am not allowed at my organization. I may only report during business hours.)

What happened/what you expected to happen?

When using a standard git input artifact in Argo Workflows v3.4.3 or latest to clone a repository, the resulting source directory will not be on the branch that was cloned.

If you were to exec into the container that ran a git clone and run git branch you will see (based on the workflow I provided),

* (no branch)
  main
  feature/2022q4

We recently upgraded from v3.2.7 where the clone would have been on the branch feature/2022q4 based on the sample workflow I've provided.

Version

v3.4.3

Paste a small 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-git-clone-
spec:
  entrypoint: git-clone
  templates:
    - name: git-clone
      inputs:
        artifacts:
          - name: repo-source
            path: /clone
            git:
              # Any repo and revision can be used here
              repo: https://github.com/wsams/latex
              revision: "release/2022q4"
      script:
        image: golang:1.19.2
        command: ["sh"]
        workingDir: /clone
        source: |
          git status
          git branch

Logs from the workflow controller

I ran,

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

but as far as I can tell nothing related to this git clone was logged.

msg="Get leases 200"
msg="Update leases 200"
msg="Alloc=4653 TotalAlloc=336634 Sys=20305 NumGC=818 Goroutines=14"
msg="Get leases 200"
msg="Processing workflow" namespace=argo-ns workflow=test-git-clone-dm2lr
msg="Get configmaps 404"
ng msg="Non-transient error: configmaps \"artifact-repositories\" not found"
msg="resolved artifact repository" artifactRepositoryRef=default-artifact-repository
msg="Updated phase  -> Running" namespace=argo-ns workflow=test-git-clone-dm2lr
msg="Pod node test-git-clone-dm2lr initialized Pending" namespace=argo-ns workflow=test-git-clone-dm2lr
msg="Create events 201"
msg="Create pods 201"
msg="Created pod: test-git-clone-dm2lr (test-git-clone-dm2lr)" namespace=argo-ns workflow=test-git-clone-dm2lr
msg="TaskSet Reconciliation" namespace=argo-ns workflow=test-git-clone-dm2lr
msg=reconcileAgentPod namespace=argo-ns workflow=test-git-clone-dm2lr
msg="Workflow to be dehydrated" Workflow Size=1607
msg="Update workflows 200"
msg="Workflow update successful" namespace=argo-ns phase=Running resourceVersion=258834004 workflow=test-git-clone-dm2lr
msg="Get leases 200"
msg="Update leases 200"
msg="Get leases 200"
msg="Get leases 200"
msg="Update leases 200"
msg="Get leases 200"
msg="Processing workflow" namespace=argo-ns workflow=test-git-clone-dm2lr
msg="Task-result reconciliation" namespace=argo-ns numObjs=0 workflow=test-git-clone-dm2lr
ng msg="workflow uses legacy/insecure pod patch, see https://argoproj.github.io/argo-workflows/workflow-rbac/" namespace=argo-ns workflow=test-git-clone-dm2lr
msg="node changed" namespace=argo-ns new.message= new.phase=Succeeded new.progress=0/1 nodeID=test-git-clone-dm2lr old.message= old.phase=Pending old.progress=0/1 workflow=test-git-clone-dm2lr
msg="TaskSet Reconciliation" namespace=argo-ns workflow=test-git-clone-dm2lr
msg=reconcileAgentPod namespace=argo-ns workflow=test-git-clone-dm2lr
msg="Updated phase Running -> Succeeded" namespace=argo-ns workflow=test-git-clone-dm2lr
msg="Marking workflow completed" namespace=argo-ns workflow=test-git-clone-dm2lr
msg="Checking daemoned children of " namespace=argo-ns workflow=test-git-clone-dm2lr
msg="Workflow to be dehydrated" Workflow Size=2195
msg="cleaning up pod" action=deletePod key=argo-ns/test-git-clone-dm2lr-1340600742-agent/deletePod
msg="Create events 201"
msg="Delete pods 404"
msg="Update workflows 200"
msg="Workflow update successful" namespace=argo-ns phase=Succeeded resourceVersion=258834066 workflow=test-git-clone-dm2lr
msg="DeleteCollection workflowtaskresults 200"
msg="Create events 201"
msg="cleaning up pod" action=labelPodCompleted key=argo-ns/test-git-clone-dm2lr/labelPodCompleted

Logs from in your workflow's wait container

I ran the following because this workflow completes successfully. There are no errors in any of these steps.

kubectl logs -n argo-ns -c wait -l workflows.argoproj.io/workflow=${workflow},workflow.argoproj.io/phase!=Completed
time="2022-11-11T19:38:40.099Z" level=info msg="Starting Workflow Executor" version=v3.4.3
time="2022-11-11T19:38:40.102Z" level=info msg="Using executor retry strategy" Duration=1s Factor=1.6 Jitter=0.5 Steps=5
time="2022-11-11T19:38:40.102Z" level=info msg="Starting deadline monitor"
time="2022-11-11T19:38:43.102Z" level=info msg="Main container completed" error="<nil>"
time="2022-11-11T19:38:43.102Z" level=info msg="No Script output reference in workflow. Capturing script output ignored"
time="2022-11-11T19:38:43.102Z" level=info msg="No output parameters"
time="2022-11-11T19:38:43.102Z" level=info msg="No output artifacts"
time="2022-11-11T19:38:43.102Z" level=info msg="S3 Save path: /tmp/argo/outputs/logs/main.log, key: archive-logs/argo-ns/2022/11/11/test-git-clone-dm2lr/test-git-clone-dm2lr/main.log"
time="2022-11-11T19:38:43.102Z" level=info msg="Creating minio client using static credentials" endpoint=s3.endpoint
time="2022-11-11T19:38:43.110Z" level=info msg="Saving file to s3" bucket=argo-snd endpoint=s3.endpoint key=archive-logs/argo-ns/2022/11/11/test-git-clone-dm2lr/test-git-clone-dm2lr/main.log path=/tmp/argo/outputs/logs/main.log
time="2022-11-11T19:38:44.364Z" level=info msg="Save artifact" artifactName=main-logs duration=1.261411633s error="<nil>" key=archive-logs/argo-ns/2022/11/11/test-git-clone-dm2lr/test-git-clone-dm2lr/main.log
time="2022-11-11T19:38:44.364Z" level=info msg="not deleting local artifact" localArtPath=/tmp/argo/outputs/logs/main.log
time="2022-11-11T19:38:44.364Z" level=info msg="Successfully saved file: /tmp/argo/outputs/logs/main.log"
time="2022-11-11T19:38:44.371Z" level=info msg="Create workflowtaskresults 403"
time="2022-11-11T19:38:44.371Z" level=warning msg="failed to patch task set, falling back to legacy/insecure pod patch, see https://argoproj.github.io/argo-workflows/workflow-rbac/" error="workflowtaskresults.argoproj.io is forbidden: User \"system:serviceaccount:argo-ns:default\" cannot create resource \"workflowtaskresults\" in API group \"argoproj.io\" in the namespace \"argo-ns\""
time="2022-11-11T19:38:44.381Z" level=info msg="Patch pods 200"
time="2022-11-11T19:38:44.385Z" level=info msg="Alloc=8351 TotalAlloc=16773 Sys=22994 NumGC=5 Goroutines=10"
@wsams wsams added type/bug type/regression Regression from previous behavior (a specific type of bug) labels Nov 11, 2022
@alexec
Copy link
Contributor

alexec commented Nov 16, 2022

We changed the Git library in v3.4. That is probably the cause, but a revert isn’t going to happen anytime soon.

I think there might be a workaround. Have you tried branch: instead?

@alexec
Copy link
Contributor

alexec commented Nov 16, 2022

Also, please make sure you don’t have both a label and branch with the same name. Git does allow that.

@wsams
Copy link
Author

wsams commented Nov 16, 2022

Hi @alexec , thanks for the update. I'll give branch a try. It looks like we have to switch to singleBranch mode, but I think that will be okay - we're only interested in one of the branches. I do have a workaround in place, but if branch works that would be cleaner. Here's what I have at the moment. I added a revision input parameter that will set the revision on the git artifact. And then in the script body I checked it out. These workarounds should be fine for now.

apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  generateName: test-git-clone-
spec:
  entrypoint: git-clone
  templates:
    - name: git-clone
      inputs:
        parameters:
          - name: revision
            value: "release/2022q4"
        artifacts:
          - name: repo-source
            path: /clone
            git:
              repo: https://github.com/wsams/latex
              revision: "{{inputs.parameters.revision}}"
      script:
        image: golang:1.19.2
        command: ["sh"]
        workingDir: /clone
        source: |
          git checkout {{inputs.parameters.revision}}

@stale
Copy link

stale bot commented Jan 21, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is a mentoring request, please provide an update here. Thank you for your contributions.

@stale stale bot added the problem/stale This has not had a response in some time label Jan 21, 2023
@caelan-io caelan-io removed the problem/stale This has not had a response in some time label Feb 23, 2023
@stale
Copy link

stale bot commented Mar 25, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is a mentoring request, please provide an update here. Thank you for your contributions.

@stale stale bot added the problem/stale This has not had a response in some time label Mar 25, 2023
@caelan-io caelan-io removed the problem/stale This has not had a response in some time label Apr 26, 2023
@stale
Copy link

stale bot commented Jun 18, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is a mentoring request, please provide an update here. Thank you for your contributions.

@stale stale bot added the problem/stale This has not had a response in some time label Jun 18, 2023
@rohankmr414 rohankmr414 removed the problem/stale This has not had a response in some time label Aug 6, 2023
@stale
Copy link

stale bot commented Sep 17, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the problem/stale This has not had a response in some time label Sep 17, 2023
@terrytangyuan terrytangyuan removed the problem/stale This has not had a response in some time label Sep 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 Low priority type/bug type/regression Regression from previous behavior (a specific type of bug)
Projects
None yet
Development

No branches or pull requests

6 participants