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

Use relative paths in generated Dockerfile #3035

Closed
wants to merge 3 commits into from
Closed

Use relative paths in generated Dockerfile #3035

wants to merge 3 commits into from

Conversation

pravindahal
Copy link

@pravindahal pravindahal commented Jul 27, 2020

Thanks for contributing to Prefect!

Please describe your work and make sure your PR:

  • adds new tests (if appropriate)
  • add a changelog entry in the changes/ directory (if appropriate)
  • updates docstrings for any new functions or function arguments, including docs/outline.toml for API reference docs (if appropriate)

What does this PR change?

Before the fix, in the temporary Dockerfile that is created when using Docker storage for a flow, full paths to files are inserted. This causes docker build to fail as reported here: #3023

@marvin-robot
Copy link
Member

Here I am, brain the size of a planet and they ask me to welcome you to Prefect.

So, welcome to the community @pravindahal! 🎉 🎉

@codecov
Copy link

codecov bot commented Jul 27, 2020

Codecov Report

Merging #3035 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

@thomasfrederikhoeck
Copy link
Contributor

I think you still want to have the option for absoulte if you are using Docker for windows without SSH hence it should maybe be
if sys.platform == "win32" and not self.base_url.startswith("ssh://"):
at this location:

if sys.platform == "win32":

@pravindahal
Copy link
Author

pravindahal commented Jul 27, 2020

@thomasfrederikhoeck I am using Docker for Windows using wsl2 backend. So, self.base_url starts with npipe:/// for me.

EDIT: Also, there is no downside to always having relative paths, IMO.

@joshmeek
Copy link

@pravindahal it looks like your local git may not be authenticated with your github account (commits are showing up as grey octocat logo):

If you want you could try this:
https://docs.github.com/en/enterprise/2.18/user/github/committing-changes-to-your-project/why-are-my-commits-linked-to-the-wrong-user#commits-are-not-linked-to-any-user
https://docs.github.com/en/github/setting-up-and-managing-your-github-user-account/setting-your-commit-email-address#setting-your-commit-email-address-in-git

Also going to tag @lauralorenz if she wants to test this windows side 🙂

@pravindahal
Copy link
Author

@joshmeek Thanks for pointing out. My git client was using my company email, which I hadn't added to github. Fixed it now.

@thomasfrederikhoeck
Copy link
Contributor

@pravindahal I agree that there should be no downsides to relative paths. However it is worth noticing this comment (which leads me to suspect that someone has tried working on it before):

# problem with docker and relative paths only on windows

It might be worth testing out if the relative paths work on the legacy Hyper-V backend :-)

@pravindahal
Copy link
Author

@thomasfrederikhoeck I went back and found out the change here #2390 addresses the exact same issue.

I will come back with an updated fix.

@pravindahal
Copy link
Author

I think I found the real problem, which is with the dockerfile parameter to client.build. I will close this and open a new PR.

@pravindahal
Copy link
Author

New PR here: #3044

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.

4 participants