Skip to content
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

chore: switch to docker compose v2 #1325

Merged
merged 1 commit into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ NAME = "robotoff"
ENV_FILE ?= .env
MOUNT_POINT ?= /mnt
HOSTS=127.0.0.1 robotoff.openfoodfacts.localhost
DOCKER_COMPOSE=docker-compose --env-file=${ENV_FILE}
DOCKER_COMPOSE_TEST=COMPOSE_PROJECT_NAME=robotoff_test PO_LOCAL_NET=po_test docker-compose --env-file=${ENV_FILE}
DOCKER_COMPOSE=docker compose --env-file=${ENV_FILE}
DOCKER_COMPOSE_TEST=COMPOSE_PROJECT_NAME=robotoff_test PO_LOCAL_NET=po_test docker compose --env-file=${ENV_FILE}
ML_OBJECT_DETECTION_MODELS := tf-universal-logo-detector tf-nutrition-table tf-nutriscore

# mount information for robotoff backup ZFS dataset
Expand Down
2 changes: 1 addition & 1 deletion doc/how-to-guides/deployment/dev-install.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ After cloning the repository:
5. To debug in a running container, you need to run poetry in the container. For example:

```
docker-compose run --rm api poetry run python
docker compose run --rm api poetry run python
```
Here we run the `api` service. This opens a Python command prompt, you may debug with [pdb](https://docs.python.org/3/library/pdb.html) or play with the code.

Expand Down
6 changes: 3 additions & 3 deletions doc/how-to-guides/deployment/maintenance.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ All Robotoff services are running on one of the two Docker instances (OVH 200 VM
see [dev-install](./dev-install.md)

You can then use:
`docker-compose start [service-name]` or `docker-compose stop [service-name]`
`docker compose start [service-name]` or `docker compose stop [service-name]`

Or `make up` when you refresh the product (it will re-build and run `docker-compose up -d`).
Or `make up` when you refresh the product (it will re-build and run `docker compose up -d`).

Take the time to become a bit familiar with docker-compose if it's your first use.

## Monitor

To display the logs of the container, `docker-compose logs [service-name]`.
To display the logs of the container, `docker compose logs [service-name]`.
(without service-name, you got all logs).

Two options are often used: `-f` to follow output and `--tail n` to only display last n lines.
Expand Down
2 changes: 1 addition & 1 deletion doc/how-to-guides/test-and-debug.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ We recommend [Factory](https://factoryboy.readthedocs.io/en/stable/) to create

If you have installed Robotoff via Docker, you can run Python using Poetry and execute Factory like so:
```
$ docker-compose run --rm api poetry run python
$ docker compose run --rm api poetry run python
...
> from tests.integration.models_utils import *
> PredictionFactory()
Expand Down
2 changes: 1 addition & 1 deletion doc/introduction/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Ready to contribute code? Here's how to set up Robotoff for local development.
To test the APIs on your localhost run

```
docker-compose up
docker compose up
```

You can make a post request through [Postman](https://www.postman.com/) or simply paste the url in a web browser to make a get request like this one http://localhost:5500/api/v1/insights/
Expand Down
4 changes: 2 additions & 2 deletions docker/docker-livecheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

ENV_FILE="${ENV_FILE:-.env}"
RET_CODE=0
for service in `docker-compose --env-file=${ENV_FILE} config --service | tr '\n' ' '`; do
found=$(docker-compose --env-file=${ENV_FILE} ps -- ${service}|grep ${service}|grep '\bUp\b')
for service in `docker compose --env-file=${ENV_FILE} config --service | tr '\n' ' '`; do
found=$(docker compose --env-file=${ENV_FILE} ps -- ${service}|grep ${service}|grep '\bUp\b')
if [ -z "$found" ]
then
echo "$service: DOWN"
Expand Down
Loading