Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

[MXNET-769] Use MXNET_HOME in a tempdir in windows to prevent access denied due t… #13531

Merged
merged 2 commits into from
Dec 5, 2018

Conversation

larroy
Copy link
Contributor

@larroy larroy commented Dec 4, 2018

…o concurrent data downloads

Description

see title

fixes #13484

Checklist

Essentials

Please feel free to remove inapplicable items for your PR.

  • The PR title starts with [MXNET-$JIRA_ID], where $JIRA_ID refers to the relevant JIRA issue created (except PRs with tiny changes)
  • Changes are complete (i.e. I finished coding on this PR)
  • All changes have test coverage:
  • Unit tests are added for small changes to verify correctness (e.g. adding a new operator)
  • Nightly tests are added for complicated/long-running ones (e.g. changing distributed kvstore)
  • Build tests will be added for build configuration changes (e.g. adding a new build option with NCCL)
  • Code is well-documented:
  • For user-facing API changes, API doc string has been updated.
  • For new C++ functions in header files, their functionalities and arguments are documented.
  • For new examples, README.md is added to explain the what the example does, the source of the dataset, expected performance on test set and reference to the original paper if applicable
  • Check the API doc at http:https://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-$PR_ID/$BUILD_ID/index.html
  • To the my best knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change

Changes

  • Feature1, tests, (and when applicable, API doc)
  • Feature2, tests, (and when applicable, API doc)

Comments

  • If this change is a backward incompatible change, why must this change be made.
  • Interesting edge cases to note here

@larroy larroy force-pushed the win_home branch 2 times, most recently from 2aca0d6 to b2a9f03 Compare December 4, 2018 16:38
@larroy
Copy link
Contributor Author

larroy commented Dec 4, 2018

@larroy larroy changed the title [WIP] Use MXNET_HOME in a tempdir in windows to prevent access denied due t… Use MXNET_HOME in a tempdir in windows to prevent access denied due t… Dec 4, 2018
@Chancebair
Copy link
Contributor

If we use pythons virtualenv we can knock out many birds with one stone

$env:MXNET_LIBRARY_PATH=join-path $pwd.Path windows_package\lib\libmxnet.dll
$env:PYTHONPATH=join-path $pwd.Path windows_package\python
$env:MXNET_STORAGE_FALLBACK_LOG_VERBOSE=0
$env:MXNET_HOME=New-TemporaryDirectory
Copy link
Contributor

Choose a reason for hiding this comment

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

This is what I wrote up to solve this issue

c:\Anaconda3\envs\py2\Scripts\pip show virtualenv
if ($LASTEXITCODE == 1) {
    c:\Anaconda3\envs\py2\Scripts\pip install virtualenv
    c:\Anaconda3\envs\py2\Scripts\pip install virtualenvwrapper-win
}
$parent = [System.IO.Path]::GetTempPath()
[string] $name = [System.Guid]::NewGuid()
New-Item -ItemType Directory -Path (Join-Path $parent $name)
cd $name
New-VirtualEnvironment virtual_test_env

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a good fix, but it's a different thing, we should also include this fix for the virtualenv but as well a temp directory for the data folder. If you want please aggregate this change in your PR so both issues are fixed and the folder is not in /tmp as marco complained about.

Copy link
Contributor

Choose a reason for hiding this comment

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

Please give me a quick heads up when you changed the path to a workspace relative one

@@ -78,7 +78,6 @@ def _dataset_transform_fn(x, y):
return x, y

@with_seed()
@unittest.skip("Flaky test: https://github.com/apache/incubator-mxnet/issues/13484")
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be here? Looks like you have a rogue commit

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it fixes the "flaky" test which isn't flaky.

@marcoabreu
Copy link
Contributor

Mxnet Home should be local to the workspace and not in a temporary folder. What is chosen right now?

Also, please link the problem you are trying to solve here. I'm missing context

@larroy
Copy link
Contributor Author

larroy commented Dec 4, 2018

@marcoabreu ok, it's good point to put it in the workspace. The problem is linked in the description. We download models and data during tests and this causes access denied in windows due to concurrent usage, this was discused long ago between you, sheng and me.

@marcoabreu
Copy link
Contributor

Gotcha

$env:MXNET_LIBRARY_PATH=join-path $pwd.Path windows_package\lib\libmxnet.dll
$env:PYTHONPATH=join-path $pwd.Path windows_package\python
$env:MXNET_STORAGE_FALLBACK_LOG_VERBOSE=0
$env:MXNET_HOME=New-TemporaryDirectory
Copy link
Contributor

Choose a reason for hiding this comment

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

Please give me a quick heads up when you changed the path to a workspace relative one

@larroy larroy changed the title Use MXNET_HOME in a tempdir in windows to prevent access denied due t… [MXNET-769] Use MXNET_HOME in a tempdir in windows to prevent access denied due t… Dec 5, 2018
Copy link
Contributor

@lebeg lebeg left a comment

Choose a reason for hiding this comment

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

Looks good

@marcoabreu marcoabreu merged commit bd8e0f8 into apache:master Dec 5, 2018
TaoLv added a commit that referenced this pull request Dec 6, 2018
TaoLv added a commit that referenced this pull request Dec 6, 2018
…icense file" (#13558)

* Revert "Chi_square_check for discrete distribution fix (#13543)"

This reverts commit cf6e8cb.

* Revert "Updated docs for randint operator (#13541)"

This reverts commit e0ff3c3.

* Revert "Simplifications and some fun stuff for the MNIST Gluon tutorial (#13094)"

This reverts commit 8bbac82.

* Revert "Fix #13521 (#13537)"

This reverts commit f6b4665.

* Revert "Add a retry to qemu_provision (#13551)"

This reverts commit f6f8401.

* Revert "[MXNET-769] Use MXNET_HOME in a tempdir in windows to prevent access denied due t… (#13531)"

This reverts commit bd8e0f8.

* Revert "[MXNET-1249] Fix Object Detector Performance with GPU (#13522)"

This reverts commit 1c8972c.

* Revert "Fixing a 404 in the ubuntu setup doc (#13542)"

This reverts commit cb0db29.

* Revert "Bumped minor version from 1.4.0 to 1.5.0 on master, updated License file (#13478)"

This reverts commit 40db619.
zhaoyao73 pushed a commit to zhaoyao73/incubator-mxnet that referenced this pull request Dec 13, 2018
…denied due t… (apache#13531)

* Use MXNET_HOME in cwd in windows to prevent access denied due to concurrent data downloads

Fixes apache#13484

* Revert "Disabled flaky test test_gluon_data.test_recordimage_dataset_with_data_loader_multiworker (apache#13527)"

This reverts commit 3d499cb.
zhaoyao73 pushed a commit to zhaoyao73/incubator-mxnet that referenced this pull request Dec 13, 2018
…icense file" (apache#13558)

* Revert "Chi_square_check for discrete distribution fix (apache#13543)"

This reverts commit cf6e8cb.

* Revert "Updated docs for randint operator (apache#13541)"

This reverts commit e0ff3c3.

* Revert "Simplifications and some fun stuff for the MNIST Gluon tutorial (apache#13094)"

This reverts commit 8bbac82.

* Revert "Fix apache#13521 (apache#13537)"

This reverts commit f6b4665.

* Revert "Add a retry to qemu_provision (apache#13551)"

This reverts commit f6f8401.

* Revert "[MXNET-769] Use MXNET_HOME in a tempdir in windows to prevent access denied due t… (apache#13531)"

This reverts commit bd8e0f8.

* Revert "[MXNET-1249] Fix Object Detector Performance with GPU (apache#13522)"

This reverts commit 1c8972c.

* Revert "Fixing a 404 in the ubuntu setup doc (apache#13542)"

This reverts commit cb0db29.

* Revert "Bumped minor version from 1.4.0 to 1.5.0 on master, updated License file (apache#13478)"

This reverts commit 40db619.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

flaky test test_gluon_data.test_recordimage_dataset_with_data_loader_multiworker
4 participants