Open emiliom opened 4 years ago
I tried the original suggestions (with small corrections from the email wrap-arounds, etc), plus removing the last two find ... -delete
statements. But I kept running into a version of these errors:
ERROR conda.core.link:_execute_post_link_actions(658): An error occurred while installing package 'conda-forge::widgetsnbextension-3.5.1-py37_0'.
FileNotFoundError(2, "No such file or directory: 'bash'")
Attempting to roll back.
failed
ERROR conda.core.link:_execute(568): An error occurred while installing package 'conda-forge::widgetsnbextension-3.5.1-py37_0'.
FileNotFoundError(2, "No such file or directory: 'bash'")
Attempting to roll back.
Rolling back transaction: ...working... done
[Errno 2] No such file or directory: 'bash': 'bash'
The command '/bin/sh -c /opt/conda/bin/conda env update --name base --file environment.yml && rm environment.yml && conda clean --all --force-pkgs-dirs --yes && find /opt/conda/ -follow -type f -name '*.a' -delete && find /opt/conda/ -follow -type f -name '*.pyc' -delete' returned a non-zero code: 1
The fact that the miniconda installation was fairly old and there was an error about bash
not being found led me to keep all your steps in place except reverting to using the continuumio/miniconda3
image. That did it!
Now the image size is 2.4 GB instead of the original 4.1 GB -- a big trim. I suspect the main savings come from building on top of the base env and cleaning up the conda pkg cache dir.
I can live with this. It's a major improvement already. Thanks so much!! Hopefully my tests and experience will be of use to you too. FYI, I'm pushing to heroku right now, and will get around to pushing to this repo later on.
plus removing the last two
find ... -delete
statements
Those can save a lot of space too depending on your dependencies. We are already removing most of this files in the packages already though so, as time passes, those lines will not be needed.
Now the image size is 2.4 GB instead of the original 4.1 GB -- a big trim.
:open_mouth:
I suspect the main savings come from building on top of the base env and cleaning up the conda pkg cache dir.
Yep.
FYI, I'm pushing to heroku right now, and will get around to pushing to this repo later on.
Glad it helped. Hopefully this will make your deployment more stable.
@ocefpaf Thanks for your suggestions for trimming the size of the docker container / heroku slug! I've tried your suggestions, but first I'll paste them from your email to here (with minor edits) so I can refer back to them easily: