Skip to content

Commit

Permalink
Merge branch 'openfoodfacts:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-nguyen-cs authored Feb 1, 2024
2 parents 41e5f87 + cdcdf05 commit 7ca9925
Show file tree
Hide file tree
Showing 86 changed files with 2,263 additions and 859 deletions.
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ logs
debug/
perl-language-server.log

openfoodfacts-mongodbdump.tar.gz
openfoodfacts-products.jsonl.gz
en.openfoodfacts.org.products.csv
en.openfoodfacts.org.products.csv.gz

html/images/misc/openfoodfacts-visual-decision-05-03-13.pdf
html/images/misc/20130416_QUOz.pdf
html/images/misc/assemblee-constitutive-off-v1.pdf
Expand Down
13 changes: 13 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ Stores:
- taxonomies/states.result.sto
- taxonomies/states.result.txt

status system:
- taxonomies/states.result.sto
- taxonomies/states.result.txt
- taxonomies/states.txt

WikiData:
- scripts/build_countries_taxonomy_from_wikidata.pl
- scripts/build_languages_taxonomy_from_wikidata.pl
Expand Down Expand Up @@ -193,6 +198,7 @@ Footer:

🐋 Docker:
- docker/**/*
- .dockerignore

🏷️ Folksonomy Project:
- html/js/folksonomy.js
Expand Down Expand Up @@ -253,6 +259,7 @@ Food.pm:
Food groups:
- lib/ProductOpener/FoodGroups.pm
- tests/unit/food_groups.t
- taxonomies/food_groups.txt

🧪 Additives:
- taxonomies/additives.txt
Expand Down Expand Up @@ -314,6 +321,7 @@ Ingredients analysis:

Labels:
- taxonomies/labels.txt
- taxonomies/unused/labels_categories.txt

Categories:
- taxonomies/categories.txt
Expand Down Expand Up @@ -621,6 +629,7 @@ Blocks:

🗺️ Made Near Me:
- scripts/generate_madenearme_page.pl
- scripts/generate_madenearme_pages.sh

PAO:
- scripts/generate_pao_taxonomy.pl
Expand Down Expand Up @@ -657,6 +666,7 @@ Config:

Ingredients processing:
- tests/unit/ingredients_processing.t
- taxonomies/ingredients_processing.txt

👥 Users:
- lib/ProductOpener/Users.pm
Expand Down Expand Up @@ -798,6 +808,9 @@ Averages by categories:
Static content:
- scripts/copy_text_files.pl

matomo:
- scripts/utils/logs/download_matomo_logs.pl

# TODO: find or create proper labels for those
#- scripts/extract_images.pl
#- scripts/test_text_fuzzy.pl
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/auto-assign-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ jobs:
name: 'Pull request assignment'
runs-on: ubuntu-latest
steps:
- uses: toshimaru/auto-author-assign@v2.0.1
- uses: toshimaru/auto-author-assign@v2.1.0
2 changes: 1 addition & 1 deletion .github/workflows/crowdin-per-language.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Matrix
uses: crowdin/github-action@v1.16.0
uses: crowdin/github-action@v1.16.1
with:
upload_translations: false # default is false
download_translations: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/crowdin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: crowdin action
uses: crowdin/github-action@v1.16.0
uses: crowdin/github-action@v1.16.1
with:
upload_translations: false # default is false
# Use this option to upload translations for a single specified language
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,10 @@ create_folders:
# Docker Compose #
#----------------#

# args variable may be use to eg. "--progress plain" option and keep logs on a failing build
build:
@echo "🥫 Building containers …"
${DOCKER_COMPOSE} build ${container} 2>&1
${DOCKER_COMPOSE} build ${args} ${container} 2>&1

_up:
@echo "🥫 Starting containers …"
Expand Down
13 changes: 13 additions & 0 deletions conf/systemd/sync_images_s3@.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# service instance name "%i" is off only (for now)
[Unit]
Description=Synchronize images to AWS S3 %i
# __ will be replaced by @ in email-failures@.service
OnFailure=email-failures@sync_images_s3__%i.service

[Service]
Type=oneshot
User=off
Group=off
WorkingDirectory=/srv/%i/scripts/sync-s3-images
ExecStart=.venv/bin/python3 sync_s3_images.py /mnt/%i/images/products
KillMode=process
12 changes: 12 additions & 0 deletions conf/systemd/sync_images_s3@.timer
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# service instance name "%i" is off only (for now)
[Unit]
Description=Synchronize images to AWS S3 daily

[Timer]
# every tuesday
OnCalendar=Tue *-*-* 02:00:00
# service instance name "%i" is off / obf / opff / opf
Unit=sync_images_s3@%i.service

[Install]
WantedBy=multi-user.target
3 changes: 2 additions & 1 deletion docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ See also [targets to run tests](../docs/dev/how-to-write-and-run-tests.md#runnin

| Command | Description | Notes |
| ------------------------- | -------------------------------------------------------------------------------------- | ------------------------------------------------------------- |
| `make dev` | Setup a fresh dev environment. | Run only once, then use the `up`, `down`, `restart` commands. |
| `make dev` | Setup a fresh dev environment. | Run only once, then use the `up`, `down`, `restart` commands. |
| `make build` | build containers. Add `container=name` to build a specific container | args="--progress log" keeps all log in console (to debug failing build) |
| `make up` | Start containers. | |
| `make down` | Stop containers and keep the volumes. | Products and users data will be kept. |
| `make hdown` | Stop containers and delete the volumes (hard down). | Products and users data will be lost ! |
Expand Down
1 change: 0 additions & 1 deletion docker/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ x-minion-db-network: &minion-db-network
services:
postgres:
# only turn on for off profile
profiles: ["off"]
<<: *minion-db-network
backend:
<<: [*backend-conf, *minion-db-network]
Expand Down
Loading

0 comments on commit 7ca9925

Please sign in to comment.