Skip to content

Commit

Permalink
Remove profile options in docker-compose-dev and commands in Makefile…
Browse files Browse the repository at this point in the history
… not necessary anymore
  • Loading branch information
leihuayi committed Aug 18, 2023
1 parent b4e1abb commit 38dca41
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 30 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/test-on-kube.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ jobs:
- name: Build and install basegun with helm, and test if deployment is successful
id: tests
run: |
TAG=$(make get-current-tag) BUILD_TARGET=test docker-compose -f docker-compose-prod.yml build backend
TAG=$(make get-current-tag) docker-compose -f docker-compose-prod.yml build frontend
TAG=$(make get-current-tag) BUILD_TARGET=test docker-compose -f docker-compose-prod.yml build
kind load docker-image \
basegun-backend:$(make get-current-tag)-prod \
basegun-frontend:$(make get-current-tag)-prod \
Expand Down
22 changes: 3 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,31 +30,20 @@ check-dc-config-%: check-prerequisites ## Check docker-compose syntax
${DC} -f docker-compose-$*.yml config -q

build-%: check-dc-config-% show-current-tag
TAG=${TAG} ${DC} -f docker-compose-$*.yml --profile app build
TAG=${TAG} ${DC} -f docker-compose-$*.yml build

up-%: check-dc-config-% show-current-tag
ifeq ("$(WORKSPACE)","preprod")
TAG=${TAG} PORT_PROD=8080 ${DC} --profile app -f docker-compose-$*.yml up -d
TAG=${TAG} PORT_PROD=8080 ${DC} -f docker-compose-$*.yml up -d
else
TAG=${TAG} ${DC} --profile app -f docker-compose-$*.yml up -d
TAG=${TAG} ${DC} -f docker-compose-$*.yml up -d
endif

build-test: check-dc-config-dev show-current-tag
BUILD_TARGET=prod TAG=${TAG} ${DC} --profile e2e -f docker-compose-dev.yml build

test-backend:
${DC} --profile backend-only -f docker-compose-dev.yml up -d
sleep 10
docker exec basegun-backend python -m unittest discover -v

test-frontend-alive:
${DC} --profile app -f docker-compose-dev.yml up -d
sleep 10
curl -s -o /dev/null localhost:8080

test-e2e:
${DC} --profile e2e -f docker-compose-dev.yml up

down-%:
${DC} -f docker-compose-$*.yml down

Expand All @@ -81,8 +70,3 @@ push-%:
docker push ghcr.io/datalab-mi/basegun/basegun-backend:$*

deploy-prod: pull up-prod

start-https:
touch infra/traefik/acme.json
sudo chmod 600 infra/traefik/acme.json
${DC} -f infra/traefik/docker-compose.yml up -d
2 changes: 1 addition & 1 deletion backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ docker run --rm -d -p 5000:5000 --name basegun_back -e VERSION=1.2 basegun-back:
Remember afterwards to stop container `docker stop basegun_back`

## Run tests
1. Build image to target test `docker build --target test -t basegun-back:test .`
1. Build image to target test `TAG=0.0 docker build --target test -t basegun-back:test .`
2. Start container `docker run --rm --name basegun_back_test -d basegun-back:test`
3. Execute tests `docker exec basegun_back_test python -m unittest discover -v`
8 changes: 0 additions & 8 deletions docker-compose-dev.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
version: '3.8'
services:
backend:
profiles:
- app
- backend-only
- e2e
build:
args:
- http_proxy
Expand Down Expand Up @@ -37,10 +33,6 @@ services:
- /app/src/weights

frontend:
profiles:
- app
- frontend-only
- e2e
build:
args:
- http_proxy
Expand Down

0 comments on commit 38dca41

Please sign in to comment.