Changes default destination dir to be "working dir" #2108
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Tracking issue
flyteorg/flyte#4638
Why are the changes needed?
In the absence of this change
pyflyte run
configures the default destination directory - the path where the code should be installed within a container to be/root
. This does not work for cases in which the user may want a directory other than/root
. Though it is possible to pass in this directory, it fails in case you have a task with multiple tasks, each uses a different container and separate paths.A propose solution by @vkaiser-mb is to set it on a per task basis
This complicates the process, as it is one more argument on the task and is not simple to change and hard to keep in sync with the container Dockerfile.
What changes were proposed in this pull request?
The proposal is to instead simply set the WORKDIR in the Dockerfile and use that as the actual location of the installation. The code change then makes the current working dir as the default installation path.
How was this patch tested?
Tested with
pyflyte run
using existing flytekit dockerfile as it sets the WORKDIR correctlyflytekit/Dockerfile
Line 7 in 892b474
/root
We could easily change it to be non-root and this should continue to work.