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

Added dockerfile template #40

Merged
merged 12 commits into from
Nov 30, 2021
Merged

Added dockerfile template #40

merged 12 commits into from
Nov 30, 2021

Conversation

FlorianWilhelm
Copy link
Member

Add a Dockerfile that gives an example of how to easily dockerize for instance a model that is accessible via a console_script.

@FlorianWilhelm FlorianWilhelm added the enhancement New feature or request label Nov 29, 2021
@FlorianWilhelm
Copy link
Member Author

@abravalheri, what do you think about that approach?

@abravalheri
Copy link
Contributor

Thank you very much @FlorianWilhelm, this approach seems very elegant!
I added a few remarks to the code (some of them are doubts I have myself), but please feel free to proceed with the code you already have.

@FlorianWilhelm FlorianWilhelm force-pushed the dockerfile branch 3 times, most recently from 21a356c to 6e31a0e Compare November 30, 2021 15:40
@abravalheri
Copy link
Contributor

abravalheri commented Nov 30, 2021

By the CI logs (LookupError: setuptools-scm was unable to detect version for '/root'. ), it seems that the .git directory is missing...

A quick and dirty workaround is to define SETUPTOOLS_SCM_PRETEND_VERSION as an env var...

But then, the generated containers will not benefit from setuptools-scm...

I wonder if in the build phase would it make sense to mount the project dir inside the container instead of copying it... After the wheels are generated, the version string is fixed and that workaround is no longer needed...

@FlorianWilhelm
Copy link
Member Author

By the CI logs (LookupError: setuptools-scm was unable to detect version for '/root'. ), it seems that the .git directory is missing...

A quick and dirty workaround is to define SETUPTOOLS_SCM_PRETEND_VERSION as an env var...

But then, the generated containers will not benefit from setuptools-scm...

I wonder if in the build phase would it make sense to mount the project dir inside the container instead of copying it... After the wheels are generated, the version string is fixed and that workaround is no longer needed...

Hm... what's really strange is that it works for me on my Mac. So COPY just deeply copies over the whole git repo. Maybe the git repo is already not correctly checkout in the Cirrus CI VM?

@FlorianWilhelm FlorianWilhelm force-pushed the dockerfile branch 3 times, most recently from cfaeeeb to 30a620b Compare November 30, 2021 17:45
@FlorianWilhelm FlorianWilhelm force-pushed the dockerfile branch 3 times, most recently from 04dfdc5 to 5ff11e5 Compare November 30, 2021 19:08
@FlorianWilhelm
Copy link
Member Author

And it works 🎉 I don't know how many times I stumbled already over the nested scaffolds problem.

What do you think? Can we merge it and should it be released as Version 0.7?

@abravalheri abravalheri changed the title WIP: Added dockerfile template Added dockerfile template Nov 30, 2021
@abravalheri
Copy link
Contributor

Wow! That was serious detective work!
Thank you very much @FlorianWilhelm.

I think it is a very welcome addition to the package in version 0.7!

@abravalheri abravalheri merged commit 3e83e28 into master Nov 30, 2021
@abravalheri abravalheri deleted the dockerfile branch November 30, 2021 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants