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(gcs): backoff bool should be false if error is transient #6577

Merged
merged 2 commits into from
Aug 20, 2021

Conversation

AntoineDao
Copy link
Contributor

@AntoineDao AntoineDao commented Aug 20, 2021

Fixes #6576

I'm not really sure how to write proper e2e or unit tests for this fix as it involves stubbing the GCS API... I am deploying this fix to our staging cluster and testing it just now. I'll comment here with the tests carried out and the outcomes.

Signed-off-by: AntoineDao <antoinedao1@gmail.com>
@codecov
Copy link

codecov bot commented Aug 20, 2021

Codecov Report

Merging #6577 (0071afc) into master (3595ac5) will decrease coverage by 0.05%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6577      +/-   ##
==========================================
- Coverage   48.62%   48.57%   -0.06%     
==========================================
  Files         261      261              
  Lines       18945    18961      +16     
==========================================
- Hits         9212     9210       -2     
- Misses       8714     8732      +18     
  Partials     1019     1019              
Impacted Files Coverage Δ
workflow/artifacts/gcs/gcs.go 9.04% <0.00%> (+0.53%) ⬆️
cmd/argo/commands/get.go 58.89% <0.00%> (-1.46%) ⬇️
workflow/artifacts/oss/oss.go 3.63% <0.00%> (-0.29%) ⬇️
cmd/argoexec/commands/emissary.go 51.79% <0.00%> (+1.43%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3595ac5...0071afc. Read the comment docs.

@AntoineDao
Copy link
Contributor Author

I'm not sure what the linting error is here... Any help figuring what went wrong?

I tested these changes on our staging cluster and it works as expected. The GCS bucket is publicly available so you should be able to test them as is on your own cluster or on minkube if you want to test the changes to ensure it works as expected.

I'm not sure how to test the retry behavior however but I could observe it retrying for optional artifacts before this fix so I am confident it will still work as expected.

Optional GCS Artifact does not throw error on not found

apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  namespace: argo
  generateName: gcs-test-artifact-exists-
spec:
  entrypoint: gcs-test
  templates:
    - name: gcs-test
      inputs:
        artifacts:
          - name: my-art
            path: /my-artifact
            optional: true
            gcs:
              bucket: pollination-public
              key: blobs/argo-test/not-exists.txt
      container:
        image: ubuntu:latest
        command: [sh, -c]
        args: ["cat /my-artifact"]

Non-Optional GCS Artifact throws error on not found

apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  namespace: argo
  generateName: gcs-test-artifact-exists-
spec:
  entrypoint: gcs-test
  templates:
    - name: gcs-test
      inputs:
        artifacts:
          - name: my-art
            path: /my-artifact
            gcs:
              bucket: pollination-public
              key: blobs/argo-test/not-exists.txt
      container:
        image: ubuntu:latest
        command: [sh, -c]
        args: ["cat /my-artifact"]

Existing GCS artifact is downloaded correctly

apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  namespace: argo
  generateName: gcs-test-artifact-exists-
spec:
  entrypoint: gcs-test
  templates:
    - name: gcs-test
      inputs:
        artifacts:
          - name: my-art
            path: /my-artifact
            gcs:
              bucket: pollination-public
              key: blobs/argo-test/exists.txt
      container:
        image: ubuntu:latest
        command: [sh, -c]
        args: ["cat /my-artifact"]

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.

Thank you. You’ll need to fix the formatting to pass the checks.

Signed-off-by: AntoineDao <antoinedao1@gmail.com>
@alexec alexec merged commit 30340c4 into argoproj:master Aug 20, 2021
@sarabala1979 sarabala1979 mentioned this pull request Sep 2, 2021
61 tasks
sarabala1979 pushed a commit that referenced this pull request Sep 3, 2021
Signed-off-by: AntoineDao <antoinedao1@gmail.com>
@sarabala1979 sarabala1979 mentioned this pull request Sep 9, 2021
68 tasks
@AntoineDao AntoineDao deleted the fix-gcs-retry branch September 22, 2021 08:03
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.

Regression on Optional GCS Artifact
2 participants