Switch to poetry#1083
Conversation
da9eae2 to
cdce36a
Compare
| RUN poetry install --no-root --no-dev | ||
|
|
||
| # Copy full source code and install again | ||
| COPY server/ /home/server/ | ||
| RUN poetry install --no-dev |
There was a problem hiding this comment.
Just a question here. If you have the .toml and the .lock in the folder already with the full source code won't it just use them by default? I'm curious as to why it requires a second install?
There was a problem hiding this comment.
It's done for the sake of build cache. Most of the time you're changing code, not dependencies. When you ldc build girder you can just skip the dependency installation and get right to linking.
BryonLewis
left a comment
There was a problem hiding this comment.
I've pulled, ran through some basic testing with uploading/importing and running pipelines. Also ran the integration test succesfully.
I think I have a base understanding of what the changes are doing and how they are affecting the install.
One final question/comment since we are using the master branch of poetry, should we switch the get-poetry.py to install-poetry.py considering that poetry 1.2 will be dropping get-poetry.py? We may end up in the same instance in which an update to our package dependency tool meant to fix issues by locking dependencies just refuses to build one day soon?
ref: https://python-poetry.org/docs/master/
|
Yes, good catch. I didn't realize that. I will also "pin" the poetry version using |
|
Turns out that the new installer changed the install behavior in a subtle way that really impacts docker. It used to just install poetry on the system, but now the poetry install goes to some particular path. the behavior of
I've been using docker for years, but I'm really still learning a lot about how to organize stuff. Multistage builds are a powerful way to simplify your code and shrink your images at the same time. Now, instead of hacking the internals of
|
BryonLewis
left a comment
There was a problem hiding this comment.
pulled, built and ran integration testing again, looks good.
Important
Requires update to compose file in prod.
Summary of changes
See also: https://www.notion.so/2ad1e1cce9204b37a6e406d76bb1e705?v=edef249eb5144b0a860528c90d77d15f&p=b452ad4d816a4cdda3726847c74fc21f
Required several changes to the docker image
girder/girderofficial docker image, it wasn't providing value and was based on node:12, so we were bundling outdated dead dependencies. Switch topython:3.7-slim-busteras the final stage and buster as the build stage.slim-busteris a stripped down buster, which closely resembles our ubuntu developement environments and is more "familar" than the unfriendly alpine linux image. Apline is great for statically compiled languages like Go, but for us, the target environment is too unusual (musl/glibc dynamic linking is the main issue)tiniinit system with docker-builtininit: true(new docker feature since we first wrote this)pip install -esince poetry is editable-by-default--mode productionor--devto switch between dev an prod modes when running withldc up -dorldc dev up girderI see no downsides to this change, it has simplified the docker build and made the development mode hot reload easier to use