-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Mount local artifact folder to docker container in MLProject #1544
Mount local artifact folder to docker container in MLProject #1544
Conversation
30c3233
to
fac70f6
Compare
This is a good catch but unfortunately it doesn't merge cleanly anymore. Do you mind updating it to fix the merge conflicts? Hopefully it won't need a large change. Thanks for adding a test too! |
e1e1f5a
to
09f5f64
Compare
Thanks @nlaille for the PR! Just to make sure things work end-to-end, would you mind:
|
To clarify, the PR otherwise LGTM - thanks! |
09f5f64
to
9500260
Compare
@smurching I added a way to handle relative path as well. Luckily the test highlighted it :) |
Codecov Report
@@ Coverage Diff @@
## master #1544 +/- ##
=======================================
Coverage 83.66% 83.66%
=======================================
Files 20 20
Lines 1120 1120
=======================================
Hits 937 937
Misses 183 183 Continue to review full report at Codecov.
|
if artifact_uri_local_path is not None: | ||
container_path = artifact_uri_local_path | ||
if not os.path.isabs(container_path): | ||
container_path = os.path.join("/mlflow/projects/code/", artifact_uri_local_path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nice to pull "/mlflow/projects/code/" into a constant so we don't have this string duplicated across mlflow/projects/__init__.py
, if you want to make a follow-up PR to do that :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM thanks @nlaille for the updates!
Hello, Both of them have a mounted volume for the artifact folder but I can't find how to set up a default path in the client. |
…1544) If artifact URI is a local directory, mounts local artifact folder inside docker container when running docker-based MLflow projects (addresses mlflow#1450)
I had the same issue to access artifacts when running MLflow server via container. I fixed it by the "docker volume" command. According to this stackoverflow
Therefore, for the container approach, you need to use docker volume to mount the artifact folder for each container. Then, you are supposed to see artifacts from the client and server-side. |
Thank you @sucitw ! |
What changes are proposed in this pull request?
Fix issue : #1450
Mount artifact folder to docker container if artifact_uri is local.
How is this patch tested?
Add a new unit test in
tests/projects/test_docker_projects.py
Manual test with
examples/docker
Release Notes
Is this a user-facing change?
Fix issue on logging artifact using local file system as artifact storage and docker MLProject.
What component(s) does this PR affect?
How should the PR be classified in the release notes? Choose one:
rn/breaking-change
- The PR will be mentioned in the "Breaking Changes" sectionrn/none
- No description will be included. The PR will be mentioned only by the PR number in the "Small Bugfixes and Documentation Updates" sectionrn/feature
- A new user-facing feature worth mentioning in the release notesrn/bug-fix
- A user-facing bug fix worth mentioning in the release notesrn/documentation
- A user-facing documentation change worth mentioning in the release notes