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

Packager directory fix #507

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Packager directory fix #507

wants to merge 4 commits into from

Conversation

nemanjarajic
Copy link

Summary:

Added

os.path.samefile(neuropod_path,python_root) 

to the if statement so that it would be triggered if neuropod_path and python_root are the same directory or neuropod_path is a subdirectory of python_root

Tests:

Using ./build/test.sh

INFO: Analyzed 35 targets (0 packages loaded, 0 targets configured).
INFO: Found 31 targets and 4 test targets...
INFO: Elapsed time: 1.243s, Critical Path: 0.99s
INFO: 5 processes: 1 internal, 4 processwrapper-sandbox.
INFO: Build completed successfully, 5 total actions
//neuropod/bindings/java:LibraryLoaderTest PASSED in 0.5s
WARNING: //neuropod/bindings/java:LibraryLoaderTest: Test execution time (0.5s excluding execution overhead) outside of range for MODERATE tests. Consider setting timeout="short" or size="small".
//neuropod/bindings/java:TFAdditionTest PASSED in 1.0s
WARNING: //neuropod/bindings/java:TFAdditionTest: Test execution time (1.0s excluding execution overhead) outside of range for MODERATE tests. Consider setting timeout="short" or size="small".
//neuropod/bindings/java:TensorSpecTest PASSED in 0.5s
WARNING: //neuropod/bindings/java:TensorSpecTest: Test execution time (0.5s excluding execution overhead) outside of range for MODERATE tests. Consider setting timeout="short" or size="small".
//neuropod/bindings/java:TorchscriptAdditionTest PASSED in 1.0s
WARNING: //neuropod/bindings/java:TorchscriptAdditionTest: Test execution time (1.0s excluding execution overhead) outside of range for MODERATE tests. Consider setting timeout="short" or size="small".

INFO: Build completed successfully, 5 total actions

@CLAassistant
Copy link

CLAassistant commented Aug 17, 2021

CLA assistant check
All committers have signed the CLA.

Copy link
Collaborator

@VivekPanyam VivekPanyam left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! Looks good overall. Couple of notes:

  • Make sure lint passes (see my inline comment)
  • Can you add a test for this functionality to test_python_packaging.py? You can look at the other tests in the containing folder to get an idea of how they work. (Feel free to comment here if you have questions)

Also just to note, the test output you posted in the PR description from ./build/test.sh is actually showing the output of the Java inference tests. The python and packaging tests are higher up in the output :)

Thanks again!

Comment on lines 119 to 126
#Ensures that neuropod_path is not a subdirectory of python_root
#Ensures neuropod_path and python_root are not the same directory
if os.path.samefile(neuropod_path,python_root) or os.path.realpath(neuropod_path).startswith(
os.path.realpath(python_root) + os.sep
):
raise ValueError(
"`neuropod_path` cannot be a subdirectory of `python_root`"
"`neuropod_path` cannot be the same directory as `python_root' or a subdirectory of `python_root`."
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Have you run lint locally to check formatting and code style?

From https://neuropod.ai/docs/stable/developing/#lint-and-static-analysis:

To show all lint errors and warnings locally, you can run ./tools/lint.sh. To attempt to automatically fix any issues that can be automatically fixed, run ./tools/autofix.sh.

Copy link
Author

Choose a reason for hiding this comment

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

I have not run lint. The link to the lint description in the contributions guidelines and did not open to the page you added when i tried to open it.

@VivekPanyam
Copy link
Collaborator

@nemanjarajic did you intend to close this PR?

@nemanjarajic
Copy link
Author

@VivekPanyam sorry i'm still work on getting the hang of github.

@nemanjarajic nemanjarajic reopened this Aug 17, 2021
@codecov
Copy link

codecov bot commented Aug 17, 2021

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.07% 🎉

Comparison is base (fa32117) 87.20% compared to head (fe795fd) 87.27%.
Report is 41 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #507      +/-   ##
==========================================
+ Coverage   87.20%   87.27%   +0.07%     
==========================================
  Files         111      111              
  Lines        7298     7301       +3     
==========================================
+ Hits         6364     6372       +8     
+ Misses        934      929       -5     
Files Changed Coverage Δ
source/neuropod/internal/backend_registration.cc 86.00% <100.00%> (+0.17%) ⬆️
source/python/neuropod/backends/python/packager.py 93.54% <100.00%> (ø)

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

None yet

3 participants