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

feat: implement Delete func of OSS ArtifactDriver. Fixes #9349 #12907

Merged
merged 1 commit into from
Apr 7, 2024

Conversation

AlbeeSo
Copy link
Contributor

@AlbeeSo AlbeeSo commented Apr 7, 2024

Fixes #9349

Motivation

return common.ErrDeleteNotSupported

OSS Artifact Driver still NOT support Artifact Garbage Collection as Delete Func has not been implemented.

Modifications

Implemented Delete Func of OSS Artifact Driver .

Verification

Plz check with workflow like

apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
  generateName: artifact-gc-
spec:
  entrypoint: main
  artifactGC:
    strategy: OnWorkflowDeletion # the overall strategy, which can be overridden
    podMetadata:
      annotations:
         kubernetes.io/resource-type: eci
  templates:
    - name: main
      container:
        image: argoproj/argosay:v2
        command:
          - sh
          - -c
        args:
          - |
            echo "hello world" > /tmp/on-completion.txt
            echo "hello world" > /tmp/on-deletion.txt
      outputs:
        artifacts:
          - name: on-completion
            path: /tmp/on-completion.txt
            oss:
              endpoint: http://oss-cn-zhangjiakou-internal.aliyuncs.com
              bucket: my-argo-workflow
              key: on-completion.txt
              accessKeySecret:
                name: my-argo-workflow-credentials
                key: accessKey
              secretKeySecret:
                name: my-argo-workflow-credentials
                key: secretKey
            artifactGC:
              strategy: OnWorkflowCompletion # overriding the default strategy for this artifact
          - name: on-deletion
            path: /tmp/on-deletion.txt
            oss:
              endpoint: http://oss-cn-zhangjiakou-internal.aliyuncs.com
              bucket: my-argo-workflow
              key: on-deletion.txt
              accessKeySecret:
                name: my-argo-workflow-credentials
                key: accessKey
              secretKeySecret:
                name: my-argo-workflow-credentials
                key: secretKey

Co-authored-by: AlbeeSo <[email protected]>
Co-authored-by: shuangkun <[email protected]>
Signed-off-by: AlbeeSo <[email protected]>
@shuangkun shuangkun self-assigned this Apr 7, 2024
@shuangkun shuangkun added the area/artifacts S3/GCP/OSS/Git/HDFS etc label Apr 7, 2024
@shuangkun shuangkun requested a review from juliev0 April 7, 2024 04:17
@shuangkun
Copy link
Member

I tested it in my envirment. When workflow completed the on-completion.txt in oss was garbage collected. when workflow deleted the on-deletion.txt in oss was garbage collected. So LGTM.

@terrytangyuan terrytangyuan merged commit 00101c6 into argoproj:main Apr 7, 2024
27 checks passed
@agilgur5 agilgur5 added this to the v3.6.0 milestone Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/artifacts S3/GCP/OSS/Git/HDFS etc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement Artifact Garbage Collection for OSS Artifacts
4 participants