-
Notifications
You must be signed in to change notification settings - Fork 537
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
Split CI dependencies and add ./deps:/deps mount. #22934
Conversation
9ae7ace
to
fe449cd
Compare
@diox we can simplify this if we decide it's okay to add everything in ci.txt to prod.txt but that means those dependencies ship to production. I'm happy either way. |
fe449cd
to
101839c
Compare
f29c0f8
to
7b7cfbb
Compare
@KevinMind CI is failing with |
7b7cfbb
to
ad41110
Compare
I split off the second part of this patch as it was not strictly necessary and left that line. It's gone now. |
3446792
to
4c38966
Compare
6759637
to
54107e7
Compare
54107e7
to
2dee062
Compare
I just did
(I didn't do anything from the testing section, to check the scenario for a typical use just after the patch has been merged onto master) (edited) |
605615f
to
bc34f2d
Compare
@eviljeff can you try now? I added a .gitkeep in the ./deps directory. If that dir doesn't exist then docker will bail creating the volume. |
bc34f2d
to
9ab7c82
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
works locally but:
- I expected
DOCKER_TARGET=production
to also remove the javascript formatting utilities (it didn't), not justruff
- CI is failing
fb4da16
to
07223be
Compare
0f7c111
to
c59e883
Compare
afcdf87
to
62a4562
Compare
62a4562
to
aff218e
Compare
Fixes: mozilla/addons#15234
Fixes: mozilla/addons#15034
Description
install_deps.py
to streamline the installation of pip and npm dependencies based on specified targets.docker-compose.yml
to include a new volume for dependencies and adjusted service configurations accordingly.Makefile-docker
to incorporate checks for CI dependencies and streamline the update process.Context
Adds a dependency mount to load dependencies from the host. Additionally optimizes the logic for installing dependencies in one batch.
Which dependencies to run is set during make up and not "mutable" because we pass it to the container via the .env file. to change it, re-run make up with a different value.
Note
You can cheat and install development depenednecies in a production running container is you run the command inside the container shell, where make will accept your OLYMPIA_DEPS=development argument
Testing
The value of
OLYMPIA_DEPS
defaults to the value ofDOCKER_TARGET
but can be overriden so there are 4 different scenarios.Standard development mode
Expect:
data_deps
is createdmake check
in the container should passDev mode with Prod dependencies
Expect:
Important
You will see in the logs during make up that the ./deps directory is cleaned. That is because we are running a development image but specifying we want production dependencies. To ensure we don't end up with stale dependencies we have to clean up the directory and freshly install, otherwise some dev dependencies could be left behind. we DON'T do this on local images that are installing development dependencies as we should not need any removed
Prod mode
This should happen if the
DOCKER_TARGET
isproduction
Expect:
make check
and (for example) that debug toolbar is missing on the webmake check
Prod mode with Dev dependencies
This does not currently work on a running container We set the OLYMPIA_DEPS variable during startup and make does not support passing arguments from the host makefile, into the container, and into the host again, at least not easily.
So to run prod mode with testing, run a production build with dev dependencies.
This will build the production image and install the development dependencies at runtime.
Expect:
Checklist
#ISSUENUM
at the top of your PR to an existing open issue in the mozilla/addons repository.