Граф коммитов

43 Коммитов

Автор SHA1 Сообщение Дата
Kevin Meinhardt 23b15add5d
Remove data_deps from docker compose (#22644)
* Isolate locale dependencies

* Better dockerignore

* Faster health checks

* Drop data_deps volume
2024-09-10 18:56:33 +02:00
Kevin Meinhardt 2a64618e9d
Enable Production Mode via DEBUG or docker-compose.ci.yml (#22613)
* TMP: clean bake metadata file

* SPLIT: Log UWSGI in docker compose console

Remove PID

* SPLIT: Raise error in update_assets if file not found

* Enable Production mode via DEBUG and or docker-compose.ci.yml

* Option 1: Load node_modules from statifiles directory

* Option 2: Load node_modules via django-node-asset

* separate ./static from locally built static files

* Add docs for static file serving

* TMP: fixes from code review

* Update docs/topics/development/static-files.md

Co-authored-by: Mathieu Pillard <diox@users.noreply.github.com>

* TMP: update docs

---------

Co-authored-by: Mathieu Pillard <diox@users.noreply.github.com>
2024-09-05 16:20:03 +02:00
Kevin Meinhardt f5d21109a9
Use default buildx builder for faster build (#22631)
* Use default buildx builder for faster build

* Update Docs

* Rename metadata.json

* Remove uneeded build.py

* TMP: clarify the reason for docker driver

* Keep explicit builder declaration for backwards compatibility

* TMP: shorten metadata file
2024-09-04 15:30:38 +02:00
Kevin Meinhardt d396ce433c
Use Bakefile to build image (#22611)
* Use Bakefile to build image

* TMP: better tests and lint fix
2024-09-03 15:24:54 +02:00
Kevin Meinhardt e4ceb64b9e
Remove the chown command from entrypoint. (#22584)
* Remove the chown command from entrypoint.

* TMP: remove redundant timeout on the health check for worker/web containers
2024-08-23 12:00:32 +02:00
Kevin Meinhardt 84d514e744
Remove version.json file from host environment (#22571)
* Remove version.json file from host environment

* tmp: fix

* TMP: fix tests

* TMP: remove unecessary test

* TMP: fix test for get_version_json

* TMP: fixy
2024-08-21 10:33:31 +02:00
Kevin Meinhardt 59156f8674
Stability fixes for docker compose lifecycle (#22378)
* Stability fixes for docker compose lifecycle

* Update docs/topics/development/setup_and_configuration.md

Co-authored-by: Andrew Williamson <awilliamson@mozilla.com>

* TMP: response to comments

* Update docs/topics/development/setup_and_configuration.md

Co-authored-by: William Durand <will+git@drnd.me>

---------

Co-authored-by: Andrew Williamson <awilliamson@mozilla.com>
Co-authored-by: William Durand <will+git@drnd.me>
2024-06-21 14:22:42 +02:00
Kevin Meinhardt be592a247a
Ditch the /deps volume (#22332)
* Ditch the /deps volume

* TMP: remove update deps at the beggingin

* TMP: add comment
2024-06-10 13:18:25 +02:00
Kevin Meinhardt 299dc4922b
More efficient utilization of github action cache (#22314)
* More efficient utilization of github action cache

* Set cache from/to only in CI

* Update Dockerfile

Co-authored-by: Mathieu Pillard <diox@users.noreply.github.com>

---------

Co-authored-by: Mathieu Pillard <diox@users.noreply.github.com>
2024-06-05 14:48:42 +02:00
Kevin Meinhardt f4bdaec5bb
Add configurable compose file to make up flow (#22299) 2024-05-30 13:02:26 +02:00
Kevin Meinhardt 22e51f015d
Fix build image CircleCI job (#22290) 2024-05-27 15:46:34 +02:00
Kevin Meinhardt ddade2a62b
Fix Docker build and add concurrency limit (#22273)
* Fix Docker build:
- get correct Image ID from the build.
- set docker tag correctly supporting tag and digest
- add concurrency limit to github action ci jobs

* TMP: remove easy way to get build digest as it is not really intended for local dev

* Update .circleci/config.yml

Co-authored-by: Mathieu Pillard <diox@users.noreply.github.com>

* TMP: recomment build

---------

Co-authored-by: Mathieu Pillard <diox@users.noreply.github.com>
2024-05-24 10:09:09 +02:00
Kevin Meinhardt d3b3a50ac5
Docker digest (#22260)
* Refactor unified setup script to manage .env and version.json files in readable python

* Support using digest to run docker image

* Update scripts/setup.py

Co-authored-by: Mathieu Pillard <diox@users.noreply.github.com>

* TMP: build image

* TMP: better logs

---------

Co-authored-by: Mathieu Pillard <diox@users.noreply.github.com>
2024-05-21 13:02:19 +02:00
Kevin Meinhardt c4f4ba6487
"Fix makefile env variables definition" (#22246)
* TMP: refactor buildx bake definition and test

* TMP: better initialization and organization of make file env vars (docker relevant +)

* TMP: cleaner code.

* TMP: remove build
2024-05-16 14:49:37 +02:00
Kevin Meinhardt bc186195bc
Load service data via portable and persistent data volumes (#22235)
* Infer superuser credentials from git config

* Load service data via portable and persistent data volumes

Load storage via persistent data volume (host bound)

Make up/down commands to easily recreate local environments

* TMP: add redis volume too

* TMP: better control over volume state

* TMP: remove dead code

* TMP: more dead code gone

* TMP: add wait for mysql before restoring snapshots
2024-05-14 16:17:35 +02:00
Kevin Meinhardt b78b07d84e
Print docker image digest as a part of the CircleCI build (#22243)
* Tmp: print digest and tags after build

* TMP: remove build
2024-05-14 11:30:07 +02:00
Kevin Meinhardt 6212cc2c9e
Use environment variables to configure docker compose variable properties and build with bake (#22225)
* Remove redundant docker-cache directory

* Use environment variables to configure docker compose variable properties
2024-05-10 09:44:54 +02:00
Kevin Meinhardt 42513e191e
Use consistent and robust mapping of UID between host and container: (#22206)
* Use consistent and robust mapping of UID between host and container:
- collapse UID/GID to one value on host and container
- rename host value to HOST_UID for clarity and debugability
- rename fix_olympia_user to entrypoint and set as docker compose entrypoint
- uwsgi config to use runtime value of olympia UID/GID

* Docker compose fail after 5 attempts to start

* TMP: update outdated comment

* TMP: comment the entrypoint
2024-05-06 14:07:55 +02:00
Kevin Meinhardt 68b8e937a9
Add django check to verify docker image (#22210)
* Extract logic to load verison.json to utils

* Reimplement version.json check as django check

* Better defaults for version commit/build

* Extract django check to make command
2024-05-03 15:49:12 +02:00
Kevin Meinhardt 9879a4defa
Add "build" to version.json (#22205)
* Add "build" to version.json

* Add test for version.json in the docker container
2024-04-29 17:41:59 +02:00
Kevin Meinhardt 541e0bdacb
Generate version.json as part of docker build: (#22186)
* Generate version.json as part of docker build:
- remove git dependency from version.json generation
- use only version.json file for sentry release with soft/hard fail

* TMP: remove invalid comment

* TMP: Prefix branch tags

* TMP: re-comment the ci build in circle
2024-04-26 17:23:05 +02:00
Kevin Meinhardt 9e3f059c57
Add clean_docker command and fix local build_docker_image when run with empty cache (#22050)
* Fix local build, only use cache-from if index.json exists

* Add clean_docker command to remove local cache artifacts enabling pristine builds
2024-03-22 09:10:36 +01:00
Kevin Meinhardt 7f1ff51138
Automate L10n extract/merge with reusable docker run github action (#21966)
* Reusable Docker run action (Bunch of other stuff here to make it work)

* extract locales

* remove extraneous log

---------

Co-authored-by: Mozilla Add-ons Robot <addons-dev-automation+github@mozilla.com>
2024-03-18 11:42:04 +01:00
Kevin Meinhardt 86d0f1f998
Use buildx to build docker image in circleci (#21960) 2024-03-05 14:26:07 +01:00
Kevin Meinhardt 823e825a30
Efficiently cache docker build (#21914)
* local docker build command

* Move copy . to after installing packages (prevents always re-installing)

* Enable buildkit cache mount to cache pip/npm dependencies
- cache npm/pip dependencies across builds
- add clear logging to npm install for cache hit/miss
- move copy npm files to update_assets

* Split build into stages
- splitting to stages offers better caching of layers and more efficient use of disk/time
- The initial gains will be with better caching of locale compilation, but will expand as we can move more logic from the final stage

TODO: split up apt depedencies to specific stages, move update_assets to pre-final stage to prevent re-running on every build with a * file change.

* Document the docker file and build process

* update docs
2024-03-01 11:47:11 +01:00
Mathieu Pillard 3ef358c672
Switch to docker compose v2 (plugin) instead of v1 (docker-compose pip package) (#20755) 2023-05-26 14:05:21 +02:00
Andreas Wagner 8d0dafdbfa
Touch lockfile instead of package.json (#20533) 2023-03-29 13:49:06 +02:00
Mathieu Pillard 5c0e7a3c88
Merge deployment and development Dockerfiles (#20480)
* Merge deployment and development Dockerfiles
* Stop using root to install dependencies
* Run make commands from os with --user olympia
2023-03-23 15:46:56 +01:00
Christopher Grebs b9ac5f4413
Run dockerfile commands with correct user. (#12579)
This updates various things…

* make use o `--user` argument of pip and `$PYTHONUSERBASE` to install python libraries in the correct places where the `olympia` user has permissions
* Add a new `rootshell` command

Fixes #12366

* Correct if statement

* Use separate tag for easier testing

* Try running directly with user olympia

* Small cleanup

* Add docs

* Fix comment

* Add 'rootshell' command

* Build circleci for local dev

* Fix pip execution by using 'python -m' to fetch the correct pip

* Pick up upstream user/group for builds and implement PYTHONUSERBASE and PIP_USER

* Correctly pass USER_ID and GROUP_ID to Dockerfile when building

* Small cleanups

* Build our test branch

* Fall back to manual uploads for testing

* Cleanup

* Revert back to :latest tag
2019-10-22 11:24:05 +02:00
William Durand 464abd0d2c
Autogenerate makefile help (#12220) 2019-08-29 15:34:26 +02:00
Andrew Williamson 1d1c40f22e
apparently comments in Makefile can't be indented (#12219) 2019-08-29 12:40:25 +01:00
Andrew Williamson 6748a96134
move all the make commands that operate on a single container to Makefile-docker (#12121)
* move all the make commands that operate on a single container to Makefile-docker

* add default user to Dockerfile

* revert the PYTHON_COMMAND var change
2019-08-29 12:10:25 +01:00
Benjamin Forehand Jr 7f2a9dc8a5
Updated logic and potential permissions fix. (#12153) 2019-08-20 13:30:48 -05:00
Christopher Grebs b34c8e3102
Fix uwsgi autoreload. (#11992)
* Fix uwsgi autoreload.

This will scan python modules for modifications every 3 seconds. It most
certainly will still be more efficient than Django's autoreload.

Fixes #11990

* re-add vaccum

* Use watchmedo to reload properly
2019-08-05 11:44:29 +02:00
Benjamin Forehand Jr 241c59e2d5
Update docs for new procedures regarding integration testing. (#11076)
* Update docs for new procedures regarding integration testing.

* Add section for setup.

* Add setup command to makefile-os.
2019-04-01 20:45:40 -04:00
Mathieu Pillard 1d559fcd32
Fix codestyle and docs jobs (#10683)
* Fix docs for python 3

* Make travis behave like it's inside our container, fix tox/makefile accordingly

* Fix docs build by choosing another label than _search (which is already used)

* Fix codestyle linter issues

* Remove extra force_bytes import

* Add ignore for int|null in docs as it's used in a couple places and it's valid

* Fix more docs build failures in reviewers.rst

Also build docs with -W by default to make future docs breakage
easier to spot locally.

* Leave -f Makefile-docker for UI Tests as they are not running from the standard container
2019-02-13 16:21:05 +01:00
Christopher Grebs 07dee02dde
Use docker-compose restart instead of supervisorctl.
* Make also use of setting PYTHONDONTWRITEBYTECODE inside the docker
  image to reduce it's size considerably
* Remove some outdated code-parts
* Rename `olympia` inside our worker image to `olympia-worker`
* remove all build and cache folders after every `make update_deps`
  (which might help avoid any more package update/install ambiquities)

Fixes #7518
2018-02-19 17:47:51 +01:00
Christopher Grebs c3c31665e2
Revert "Revert "Refactor our tests and code to make better use of settings.TMP_PATH""
This reverts commit 3f7fe78093.
2018-02-02 12:47:50 +01:00
Christopher Grebs 3f7fe78093
Revert "Refactor our tests and code to make better use of settings.TMP_PATH"
This reverts commit 778a94871a.
2018-01-30 14:22:23 +01:00
Christopher Grebs 778a94871a
Refactor our tests and code to make better use of settings.TMP_PATH
* Also let the dot in py.test die so that upstream is happy again :)
 * Update tox to 2.9.1
 * Make sure that our urlconf is reset *after* we set MEDIA_ROOT
 * Adapt file extraction handling to new TMP_PATH prefixes
 * Less dump_apps hacks since the apps.json file isn't present at the
   beginning of any test now thanks to temporary paths for every separate
   test
 * Rewrite read-only-mode tests to cope with pytest settings fixture
 * Remove atexit hack from settings_test

This will probably make things a lot easier for ui-tests as well.

Fixes #7205
Fixes #7206
2018-01-05 16:41:35 +01:00
Mathieu Pillard 338df63c74 Make 'make djshell' launch shell_plus by default
It's just better :)
2017-11-09 18:18:52 +01:00
Christopher Grebs 176383b168 Upgrade to Celery 4 (#6667)
* Update celery, config and dependencies to 4.x

* Remove usage of TaskSet, replace with group(), update `ampq`
* Enable redis on travis for better celery 4.x testing
* Fix lib/celery_tests
* Correct test testing email sending retrying on errors
* Fix celery subtask mocking errors.

* Fix celery broker url env variable

* Integrate watchdog for celery autoreload

* Ensure dependencies are updated for worker and web container.

* Restart all services after the dependency update

* Remove explicit celery loader environment variable.

* Restart all services in web and worker after running 'update_docker'

* Increase sleep time a bit
2017-10-16 11:16:41 +02:00
Andrew Williamson e971a1c054 Make Makefile cleaner by splitting tasks between host and container (#5634) 2017-06-15 09:41:40 +01:00