-
Notifications
You must be signed in to change notification settings - Fork 8
Use multistage Docker build for worker base docker #43
Comments
I run
Most of the spaces are consumed by
This part is necessary in order to use So we may not drastically reduce the size using multistage in this sense. Instead, it is even slower to build because we need to copy large directories. |
I'm not sure we need to use conda, we could use pip instead and only copy the python site-packages folder to a new docker stage. That might already cut down on the size, since the conda lib folder is 1.1G, with many libraries we don't need, like Qt. This might also be due to us installing We can also remove all the dev packages installed in the beginning, since we don't need I don't think it's much slower. It's the base image, so we don't need to build it every 5 minutes, and at most, on a non-SSD, it'll add 2 minutes for copying 6Gb, 15 seconds on a modern SSD. But it makes cleaning up a lot easier than having to track everything ourselves. I think realistically, we can reduce the size by 1-2 Gb |
For opencv, we only use it for `image = cv2.imdecode(x,
cv2.IMREAD_COLOR).astype('uint8')` when using the dataset in the form of
`lmdb`. It is only for the case of ImageNet.
…On Fri, Aug 24, 2018 at 9:45 AM Ralf Grubenmann ***@***.***> wrote:
I'm not sure we need to use conda, we could use pip instead and only copy
the python site-packages folder to a new docker stage. That might already
cut down on the size, since the conda lib folder is 1.1G, with many
libraries we don't need, like Qt. This might also be due to us installing
opencv, which has dependencies on ffmpeg (video encoding) and Qt (GUI
Library), both of which we don't use. I'm not sure what we need opencv
for, but removing it would already reduce size by 700Mb.
We can also remove all the dev packages installed in the beginning, since
we don't need gcc and so on later on.
I don't think it's much slower. It's the base image, so we don't need to
build it every 5 minutes, and at most, on a non-SSD, it'll add 2 minutes
for copying 6Gb, 15 seconds on a modern SSD. But it makes cleaning up a lot
easier than having to track everything ourselves.
I think realistically, we can reduce the size by 1-2 Gb
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#43 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AHcbfwWKhC9aKkG1QGwZp3GrAzvjLQkKks5uT68XgaJpZM4WHH4A>
.
|
Currently the worker base image is around 3GB in size, meaning it takes quite long to install everything (longer than the 5 min default timeout of helm).
All the temporary files and build tools etc. are inside the docker, even though they are not needed later on.
We should do multistage builds, only copying what is needed from one stage to the next.
That should help reduce the size by a lot.
The text was updated successfully, but these errors were encountered: