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: cleanup azcopy jobs after job complete #2394

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

andyzhangx
Copy link
Member

What type of PR is this?
/kind bug

What this PR does / why we need it:
fix: cleanup azcopy jobs after job complete
this could reduce .azopy/plans folder files

Which issue(s) this PR fixes:

Fixes #2387

Requirements:

Special notes for your reviewer:

Release note:

fix: cleanup azcopy jobs after job complete

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Feb 20, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andyzhangx

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 20, 2025
@andyzhangx
Copy link
Member Author

/retest

@k8s-ci-robot
Copy link
Contributor

@andyzhangx: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-azurefile-csi-driver-e2e-capz 166c186 link true /test pull-azurefile-csi-driver-e2e-capz

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@@ -1167,6 +1167,9 @@ func (d *Driver) copyFileShareByAzcopy(srcFileShareName, dstFileShareName, srcPa
klog.Warningf("CopyFileShare(%s, %s, %s) failed with error: %v", accountOptions.ResourceGroup, dstAccountName, dstFileShareName, err)
Copy link

@mayankagg9722 mayankagg9722 Feb 21, 2025

Choose a reason for hiding this comment

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

I could see that below azcopy job completion states are not handled in job parsing. Andy, can you please check once.

case "Completed":

Unhandled States: CompletedWithErrors, CompletedWithSkipped, CompletedWithErrorsAndSkipped-

And it should be handled in this switch statement as well.
https://github.com/kubernetes-sigs/azurefile-csi-driver/blob/166c186e1123486cebef2659ca78cd1f37393186/pkg/azurefile/controllerserver.go#L1136C2-L1136C18

Azcopy Job States:
https://github.com/Azure/azure-storage-azcopy/blob/a9a6a80d598a2074d6922d50e4ece2af180a4f4a/common/fe-ste-models.go#L504

func (ac *Azcopy) TestListJobs(accountName, storageEndpointSuffix string, authAzcopyEnv []string) (string, error) {
cmdStr := fmt.Sprintf("azcopy list %s", fmt.Sprintf("https://%s.file.%s", accountName, storageEndpointSuffix))
func (ac *Azcopy) CleanJobs() (string, error) {
cmdStr := "azcopy jobs clean --with-status=completed"
Copy link

@mayankagg9722 mayankagg9722 Feb 21, 2025

Choose a reason for hiding this comment

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

Andy, do we need some kind of eventual cleanups of other completion/failed/cancelled azcopy jobs as well so that over time these were not accumulated?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove plan and log files when azcopy jobs are complete
3 participants