Skip to content

fix: local mode deletion of temp files #2644

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

Closed
wants to merge 1 commit into from

Conversation

jmahlik
Copy link
Contributor

@jmahlik jmahlik commented Sep 16, 2021

Issue #, if available:

Description of changes:

Add try except around file cleanup in sagemaker.local.utils.copy_directory_structure. This was causing local mode to fail when docker (running as root) writes files to a mounted dir and the user does not have permission to remove the files.

The same pattern is followed here.

Testing done:

Add test for failed removal, behaves as expected.

Merge Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request.

General

  • I have read the CONTRIBUTING doc
  • I used the commit message format described in CONTRIBUTING
  • I have passed the region in to all S3 and STS clients that I've initialized as part of this change.
  • I have updated any necessary documentation, including READMEs and API docs (if appropriate)

Tests

  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have checked that my tests are not configured for a specific region or account (if appropriate)
  • I have used unique_name_from_base to create resource names in integ tests (if appropriate)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Copy link
Contributor

@shreyapandit shreyapandit left a comment

Choose a reason for hiding this comment

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

Comments inline, otherwise looks good. Thanks for the fix!

@shreyapandit shreyapandit marked this pull request as draft September 21, 2021 20:05
@jmahlik jmahlik force-pushed the fix-local-mode-root-files branch from b4e5139 to c3cdfa6 Compare September 22, 2021 13:45
@jmahlik jmahlik marked this pull request as ready for review September 22, 2021 13:46
@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-unit-tests
  • Commit ID: c3cdfa6
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@jmahlik jmahlik force-pushed the fix-local-mode-root-files branch from c3cdfa6 to 50b52b4 Compare November 3, 2021 22:20
@jmahlik
Copy link
Contributor Author

jmahlik commented Nov 3, 2021

Changes made and rebased master if someone would like to give a review.

@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-unit-tests
  • Commit ID: 50b52b4
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@codecov-commenter
Copy link

codecov-commenter commented Nov 3, 2021

Codecov Report

Merging #2644 (a601198) into dev (bb7563f) will decrease coverage by 0.52%.
The diff coverage is 92.00%.

❗ Current head a601198 differs from pull request most recent head 8adc449. Consider uploading reports for the commit 8adc449 to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##              dev    #2644      +/-   ##
==========================================
- Coverage   89.49%   88.96%   -0.53%     
==========================================
  Files         195      178      -17     
  Lines       16567    15764     -803     
==========================================
- Hits        14826    14025     -801     
+ Misses       1741     1739       -2     
Impacted Files Coverage Δ
src/sagemaker/local/utils.py 90.74% <80.00%> (-2.60%) ⬇️
src/sagemaker/clarify.py 92.91% <100.00%> (-0.09%) ⬇️
src/sagemaker/lineage/context.py 81.98% <100.00%> (ø)
src/sagemaker/huggingface/model.py 32.78% <0.00%> (-45.91%) ⬇️
src/sagemaker/huggingface/estimator.py 88.37% <0.00%> (-3.49%) ⬇️
src/sagemaker/model.py 89.05% <0.00%> (-2.36%) ⬇️
src/sagemaker/tensorflow/model.py 89.13% <0.00%> (-1.09%) ⬇️
src/sagemaker/workflow/steps.py 96.78% <0.00%> (-0.56%) ⬇️
... and 31 more

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 bb7563f...8adc449. Read the comment docs.

@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-unit-tests
  • Commit ID: 50b52b4
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@marcelgwerder
Copy link

@shreyapandit We're facing the same issue, have been for a while. My understanding is that this fix is already mostly reviewed. Anything that still needs to be done or can this be merged?

@EmadGohariTR
Copy link

I am also facing this issue, can this PR be merged or any other work is required?

@jmahlik
Copy link
Contributor Author

jmahlik commented Dec 6, 2021

@shreyapandit We're facing the same issue, have been for a while. My understanding is that this fix is already mostly reviewed. Anything that still needs to be done or can this be merged?

This should be good to go, all the comments have been addressed. I can rebase again if needed but it seems alright to me. We are currently manually applying this patch to our installs.

@diegodebrito
Copy link

This would be very useful, and it's a simple fix that seems ready to be merged.

@jmahlik jmahlik force-pushed the fix-local-mode-root-files branch from 50b52b4 to 1520cb2 Compare December 17, 2021 04:50
@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-unit-tests
  • Commit ID: 1520cb2
  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@jmahlik jmahlik force-pushed the fix-local-mode-root-files branch from 1520cb2 to 1a533e8 Compare December 17, 2021 18:24
@jmahlik
Copy link
Contributor Author

jmahlik commented Dec 17, 2021

Messed up the rebase with a trailing / . Should be good now.

@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-unit-tests
  • Commit ID: 1a533e8
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-local-mode-tests
  • Commit ID: 1a533e8
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-slow-tests
  • Commit ID: 1a533e8
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@navinsoni navinsoni changed the base branch from master to dev December 30, 2021 00:32
@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-unit-tests
  • Commit ID: fc9dc39
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-unit-tests
  • Commit ID: 4c3ec7d
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@jmahlik
Copy link
Contributor Author

jmahlik commented Jan 14, 2022

Some unrelated ones are still failing. Probably ok to merge?

FAILED tests/integ/test_model_quality_monitor.py::test_run_model_quality_monitor_baseline

There's a large number of data scientists internally experiencing the issue resolved in this PR when testing out new code.

Copy link
Member

@ahsan-z-khan ahsan-z-khan left a comment

Choose a reason for hiding this comment

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

@jmahlik Can you resolve the conflicts?

@jmahlik jmahlik force-pushed the fix-local-mode-root-files branch from 799ff53 to 85db47c Compare January 24, 2022 14:08
@jmahlik
Copy link
Contributor Author

jmahlik commented Jan 24, 2022

@jmahlik Can you resolve the conflicts?

rebased

@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-unit-tests
  • Commit ID: 85db47c
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-local-mode-tests
  • Commit ID: 85db47c
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-slow-tests
  • Commit ID: 85db47c
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@jmahlik
Copy link
Contributor Author

jmahlik commented Jan 26, 2022

@jmahlik Can you resolve the conflicts?

rebased

It seems like the changes keep getting out of sync due to force pushes on dev.

Trying merging now to hopefully allow these changes to not stack up. We aren't able to turn off the org setting to allow maintainers to update the branch. If someone wants to just take this code and submit another PR that can be edited by the maintainers, feel free.

@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-unit-tests
  • Commit ID: a601198
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-local-mode-tests
  • Commit ID: a601198
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-slow-tests
  • Commit ID: a601198
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@jmahlik jmahlik force-pushed the fix-local-mode-root-files branch from a601198 to 8adc449 Compare February 10, 2022 21:44
@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-unit-tests
  • Commit ID: 8adc449
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@sagemaker-bot
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-local-mode-tests
  • Commit ID: 8adc449
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants