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

116 Коммитов

Автор SHA1 Сообщение Дата
Kevin Meinhardt b3d0a224f1
Sync storage with make up flow (#22805)
* Sync storage with make up flow

* data_load should clean storage directory
2024-11-12 16:32:27 +01:00
Kevin Meinhardt 93fb6c5fec
Dev-mode (#22748)
* Decouple DEBUG from DEV_MODE to enable running dev/prod mode independent of debug.

* Update settings_test.py

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

* TMP: hardcode devmode false in prod

---------

Co-authored-by: Mathieu Pillard <diox@users.noreply.github.com>
2024-10-18 17:39:49 +02:00
Mathieu Pillard 24dd2ee5c2
Make assets step in Dockerfile depend on locales, for jsi18n files (#22717)
* Make assets step in Dockerfile depend on locales, for jsi18n files
* Only depend on locales stage for files we need to copy over
2024-10-09 15:05:31 +02:00
Mathieu Pillard 020bafff59
Revert "Move assets stage to production only image (#22710)" (#22723)
This reverts commit 27dd5fd1c1.
2024-09-30 14:48:43 +02:00
Kevin Meinhardt 27dd5fd1c1
Move assets stage to production only image (#22710)
* Simplify static file mounts in nginx

* Only compile assets in production image

* TMP: ensure volume dirs exist

* TMP: use django to create staticfile dirs

* Update src/olympia/core/apps.py

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

* Update src/olympia/lib/settings_base.py

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

---------

Co-authored-by: Mathieu Pillard <diox@users.noreply.github.com>
2024-09-27 23:23:59 +02:00
Kevin Meinhardt c78536d0e7
Only include locale stage in production image (#22708) 2024-09-27 17:04:13 +02:00
Kevin Meinhardt 5d24c7a759
Remove all reference to update_deps* (#22662) 2024-09-16 10:42:45 +02:00
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 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 c75565e582
Cleaner build logs (#22413) 2024-06-25 12:08:39 +02:00
Kevin Meinhardt aa31195786
Remove egg-info without breaking locale extraction (#22384)
* Remove egg-info without breaking locale extraction

* Merge setup to pyproject
2024-06-21 15:19:29 +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 14fabcbeb9
verify pip dependencies in CI (#22254)
* TMP: verify pip dependencies in CI

* TMP: Use pip freeze with more granular check for name and version matching
2024-05-20 12:34:34 +02:00
Mathieu Pillard 3f88010a5b
Upgrade to python 3.11 (#22247)
* Upgrade to python 3.11
2024-05-16 14:53:15 +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 adc37153dd
Optimize multi stage docker build (#22195)
* Add checks to verify built docker image

TMP: rename dependencies.txt

* Remove unused and uninstalled package

* More efficient multi stage docker buildTMP: reorganize docker more efficiently

* Organize dockerfile
- split base and olympia stages
- use heredocs for multiline RUN steps
- move file copy to source layer
- merge run steps where possible

* TMP: fix invalid bash syntax in dockerfile

* TMP: add comments to dockerfile
2024-05-06 12:50:34 +02:00
Kevin Meinhardt 5a86497ddf
Compile locales independently of prod.txt pip install (#22194)
* Compile locales independently of prod.txt pip install- install compile-mo.sh deps independently- properly named stage- allows locale compilation to occur in parallel of pip install prod.txt

* TMP: remove quiet mode
2024-04-29 13:45:47 +02:00
Mathieu Pillard 0f034f4789
Upgrade base image to Debian bookworm (#22044)
* Upgrade base image to Debian bookworm

* Explicitly add pkg-config

* Add basic system check for uwsgi

* Add docstring
2024-03-25 17:29:14 +01:00
Kevin Meinhardt 7f4ba78e21
Fix small bugs in the docker build that are not obvious most of the time (#21983)
* Prune the correct directory in the docker container

* Remove virtual environmnet fallback for locale compilation script
2024-03-11 07:51:50 +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
Kevin Meinhardt 04cf44bbb2
Merge requirements files and document dependency management (#21838) 2024-02-21 13:20:01 +01:00
Mathieu Pillard 0c5c155e4b
Remove local mirror of MySQL repo (#21901)
* Revert "Build local mysql apt mirror to work around upstream repo breakage  (#21018)"

This reverts commit 550a4a4754.

* Update MySQL GPG key

* Stop forcing buster
2024-02-21 12:30:00 +01:00
Andrew Williamson b1b0de11a5
Update Dockerfile
add missing `/`
2023-07-19 12:34:15 +01:00
Mathieu Pillard 550a4a4754
Build local mysql apt mirror to work around upstream repo breakage (#21018)
* Build local mysql apt mirror to work around upstream repo breakage
2023-07-19 13:18:05 +02:00
Mathieu Pillard 7730f6f3bb
Drop Django 3.2 tests (#20693) 2023-05-15 14:51:24 +02:00
Andrew Williamson e8d549c6c2
Enable django4.2 deployment (#20612)
* allow django41 installation via make; add CI matrix

* ManifestStaticFilesStorage with sourceMappingURL

* test against django4.2rc1

* import django.core.files.File directly

* handle django4.2 being precise with timeuntil

* bump django4.2 to release

* fix reviewer tools css/js

* don't downgrade django3.2

* prettier fix

* handle timesince being more picky (again)

* default to django42
2023-04-26 09:44:31 +01: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
Andrew Williamson d3d85ade8c
replace geoip lookup with HTTP_X_COUNTRY_CODE request header (#19603) 2022-08-24 15:18:28 +01:00
Andrew Williamson d42c7750f5
upgrade to python 3.10 (#19568)
* run CI with python3.10

* change Dockerfile.deploy too
2022-08-17 18:25:13 +01:00
Mathieu Pillard 41d4eba243
Upgrade pygit2 to 1.10.0, remove libgit2-dev dependency (#19570)
We shouldn't need libgit2-dev anymore (and it outdated anyway) because
the latest pygit2 versions provide precompiled wheels that match our
setup.
2022-08-17 10:18:46 +02:00
Andrew Williamson 837951428c
upgrade to python39 (#17945)
* upgrade to python3.9

* py3.9 fix - replace .getiterator with .iter

* include libgit2-dev in Dockerfile[.deploy] setup too
2021-09-22 14:52:54 +01:00
Andrew Williamson 1157e9c2cd
drop django2.2 compat (#17515)
* drop django22 CI & support in Dockerfile/Makefile

* rm obsolete fallbacks

* drop django-jsonfield-backport
2021-07-20 10:03:10 +01:00
Andrew Williamson 4b4b8b2407
default local dev to django3.2; deploy to addons-dev with 3.2 (#17452) 2021-07-08 10:31:48 +01:00
Mathieu Pillard 09030e01bb
Use MySQL client & libs, not MariaDB (#15932)
We're using MySQL 8.0 from MySQL, not MariaDB, so client libs should
follow for consistency - especially as MariaDB doesn't support the
default auth method MySQL 8 uses.

Also contains a slight refactor of the Dockerfile-s to have fewer
steps and be more consistent with each other.
2020-11-06 12:20:43 +01:00
Lucky Sivagurunathan cdb112303a
Add package-lock to version control (#14909) 2020-08-04 17:03:38 +02:00
William Durand cf2f6a7826
Switch to Terser for JS minification (#15129) 2020-07-31 16:24:53 +02:00
Mathieu Pillard 44808c2c91
Switch to Python 3.8 (#15074)
* Remove obsolete code to build a webext dictionary from a legacy one

* Simplify SafeZip initialization code

We don't need to store is_valid, since an exception will be raised
if something is invalid.

* Cleanup temporary directory for invalid zips in extract_extension_to_dest()

* Switch to Python 3.8

- Rename BadZipfile to BadZipFile as the former is deprecated
- Support BadZipFile being raised earlier (when instantiating
  the ZipFile) in validation process

* Also remove test for build_webext_dictionary_from_legacy

* Remove a stray `is_valid` on a `SafeZip` instance

* Fix test now that we consider badzipfile errors fatal
2020-07-29 12:05:10 +02:00
William Durand 94f792f86a
Add file after deps install in dockerfiles (#14247) 2020-05-12 13:12:35 +02:00
William Durand 09bbe0a616
Refactor get_mime_type_for_blob() (#14211) 2020-05-11 11:52:34 +02:00
championshuttler d17bc0b389 Upgrade docker image to latest Debian Buster 2020-04-20 18:17:55 +05:30
William Durand 57e7dffe7a
Update pygit2 to 1.1.1 (#13925) 2020-04-08 11:54:04 +02:00
William Durand e7b906b290
Revert "Update pygit2 to 1.1.1 (#13921)" (#13924)
This reverts commit 1107b0a00c.
2020-04-07 19:00:50 +02:00
William Durand 1107b0a00c
Update pygit2 to 1.1.1 (#13921) 2020-04-07 18:11:25 +02:00
Christopher Grebs b4ceb66311 Revert "Move to a rolling debian-testing release for libmagic and libg… (#13488)"
This reverts commit d0272a9b3a.
2020-02-18 17:51:34 +01:00
Christopher Grebs d0272a9b3a
Move to a rolling debian-testing release for libmagic and libg… (#13488)
* Move to a rolling debian-testing release for libmagic and libgit2

Fixes #13487
Unblocks #13391

And at least refs #12924, #12357 (these need further testing)

* Roll back temporary change
2020-02-18 11:15:17 +01:00
Mathieu Pillard fb1b722a6c
Update Dockerfile to no longer fetch geoip database
It's not needed for local envs. Geoip queries will fail, but that should be ok.

Fixes https://github.com/mozilla/addons-server/issues/13181
2020-01-09 17:02:36 +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
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