From 180847c85941ee5dad75ecdbdcd47e0c9f87a5a3 Mon Sep 17 00:00:00 2001 From: Thomas Bernard Date: Tue, 10 Oct 2023 00:43:22 +0200 Subject: [PATCH] Remove docker-compose-prod.yml --- Makefile | 16 +++++------ README.md | 23 +++++----------- docker-compose-prod.yml | 28 -------------------- docker-compose-dev.yml => docker-compose.yml | 0 frontend/package.json | 2 +- infra/legacy/README.md | 2 +- infra/scripts/run.sh | 2 +- 7 files changed, 17 insertions(+), 56 deletions(-) delete mode 100644 docker-compose-prod.yml rename docker-compose-dev.yml => docker-compose.yml (100%) diff --git a/Makefile b/Makefile index 22a5e186..6a1351ab 100644 --- a/Makefile +++ b/Makefile @@ -27,20 +27,20 @@ ifeq ("$(wildcard ${DC})","") endif check-dc-config-%: check-prerequisites ## Check docker-compose syntax - ${DC} -f docker-compose-$*.yml config -q + ${DC} -f docker-compose.yml config -q -build-%: check-dc-config-% - TAG=${TAG} ${DC} -f docker-compose-$*.yml build +build: check-dc-config-% + TAG=${TAG} ${DC} -f docker-compose.yml build -up-%: check-dc-config-% +up: check-dc-config-% ifeq ("$(WORKSPACE)","preprod") - TAG=${TAG} PORT_PROD=8080 ${DC} -f docker-compose-$*.yml up -d + TAG=${TAG} PORT_PROD=8080 ${DC} -f docker-compose.yml up -d else - TAG=${TAG} ${DC} -f docker-compose-$*.yml up -d + TAG=${TAG} ${DC} -f docker-compose.yml up -d endif -down-%: - ${DC} -f docker-compose-$*.yml down +down: + ${DC} -f docker-compose.yml down tag: show-current-tag git tag -a v${TAG} diff --git a/README.md b/README.md index 23cfbfb3..1ec848cc 100644 --- a/README.md +++ b/README.md @@ -28,27 +28,16 @@ See also [Debugging](https://github.com/datalab-mi/Basegun/blob/develop/backend/ ```bash # install in dev mode -make build-dev - -# install for prod/preprod -make build-prod +make build ``` ### Launch the website ```bash -# run in dev mode -make up-dev - -# run prod mode on localhost -WORKSPACE=preprod make up-prod - -# run in prod -make up-prod +# run +make up -# stop in dev -make down-dev -# stop in prod/preprod -make down-prod +# stop +make down ``` ## Debugging @@ -68,7 +57,7 @@ Try to find error log ### The website runs the analysis, but no image shows up Use browser html inspector to find the url given in the image src. * If it starts with `https://storage.gra.cloud.ovh.net` then the website tried to upload the input image to OVH but it failed. Have you set properly in your env the variables OS_USERNAME, OS_PASSWORD and OS_PROJECT ? -* If it starts with `https://localhost` then the website tried to store the input image locally. Have you synchronised the mounts for frontend and backend in [docker-compose-dev](https://github.com/datalab-mi/Basegun/blob/develop/backend/docker-compose-dev.yml) ? (uncomment the `/tmp/basegun` lines in the volumes sections) +* If it starts with `https://localhost` then the website tried to store the input image locally. Have you synchronised the mounts for frontend and backend in [docker-compose](https://github.com/datalab-mi/Basegun/blob/develop/backend/docker-compose.yml) ? (uncomment the `/tmp/basegun` lines in the volumes sections) ### Logs are not sent to the endpoint The variables `X_OVH_TOKEN` and `API_OVH_TOKEN` must en set in your env. See [Infra README](https://github.com/datalab-mi/Basegun/blob/develop/infra/README.md) for more details. diff --git a/docker-compose-prod.yml b/docker-compose-prod.yml deleted file mode 100644 index f318531b..00000000 --- a/docker-compose-prod.yml +++ /dev/null @@ -1,28 +0,0 @@ -version: '3.8' - -services: - - backend: - build: - args: - - VERSION=${TAG} - context: ./backend - target: ${BUILD_TARGET:-prod} - container_name: basegun-backend - environment: - - PATH_LOGS=/tmp/logs - - AWS_ACCESS_KEY_ID - - AWS_SECRET_ACCESS_KEY - - WORKSPACE=${WORKSPACE:-prod} - image: basegun-backend:${TAG} - ports: - - 5000:5000 - - frontend: - build: - context: ./frontend - target: prod - container_name: basegun-frontend - image: basegun-frontend:${TAG} - ports: - - ${PORT_PROD:-80}:8080 \ No newline at end of file diff --git a/docker-compose-dev.yml b/docker-compose.yml similarity index 100% rename from docker-compose-dev.yml rename to docker-compose.yml diff --git a/frontend/package.json b/frontend/package.json index 2508f983..1fe695b6 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -5,7 +5,7 @@ "scripts": { "preview": "vite preview", "build": "vite build", - "compose:up": "docker compose -f ../docker-compose-dev.yml --profile backend-only up -d", + "compose:up": "docker compose -f ../docker-compose.yml --profile backend-only up -d", "dev": "vite", "lint": "eslint src", "format": "eslint src --fix", diff --git a/infra/legacy/README.md b/infra/legacy/README.md index 1cd4f230..1d30c434 100644 --- a/infra/legacy/README.md +++ b/infra/legacy/README.md @@ -7,7 +7,7 @@ This folder stores various contents related to Basegun deployment. 1. Using Github actions, we trigger either the [*preprod* deployment](../../.github/workflows/develop.yml) or the [*prod* deployment](../../.github/workflows/release.yml). 2. For both of them, the [workflow calls Terraform](../.github/workflows/deploy.yml) using specific env variables to differentiate preprod from prod, to start a VM on OVH public cloud. -3. On the VM, we always have [3 containers](../docker-compose-prod.yml) : +3. On the VM, we always have [3 containers](../docker-compose.yml) : * 1 for Basegun frontend (Vue.js website) * 1 for Basegun backend (Python API) * 1 for the log collector (Filebeat ) diff --git a/infra/scripts/run.sh b/infra/scripts/run.sh index bf201d90..d33b2954 100644 --- a/infra/scripts/run.sh +++ b/infra/scripts/run.sh @@ -2,7 +2,7 @@ # Launch a cluster like the one in CI kind delete cluster -TAG=$(make get-current-tag) BUILD_TARGET=test docker-compose -f docker-compose-prod.yml build +TAG=$(make get-current-tag) BUILD_TARGET=dev docker-compose -f docker-compose.yml build kind create cluster --config ./infra/kube/kind/kind-config.yml helm repo add traefik https://traefik.github.io/charts && helm repo update