Skip to content

Commit

Permalink
ci: better just recipe for local build and better compose for dev
Browse files Browse the repository at this point in the history
  • Loading branch information
danellecline committed Aug 29, 2024
1 parent e8ef2c7 commit d68ce82
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 69 deletions.
77 changes: 21 additions & 56 deletions compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,71 +11,36 @@ services:
healthcheck:
test: [ "CMD", "curl", "-f", "http://127.0.0.1:8000/health" ]
env_file:
- ./.env
- .env
ports:
- "8001:80"
user: "$MLDEVOPS_GID:$MLDEVOPS_UID"
restart: always
redis-uav:
image: redis/redis-stack-server
container_name: redis-uav
ports:
- "6379:6379"
- "8000:80"
environment:
- CONFIG_PATH=/config
volumes:
- redis-uav-data:/data
- ./config:/config
user: ${MLDEVOPS_GID}:${MLDEVOPS_UID}
restart: always
command: redis-server --appendonly yes
depends_on:
- redis
networks:
- vss
redis-i2map:
image: redis/redis-stack-server
container_name: redis-i2map
ports:
- "6380:6379"
volumes:
- redis-i2map-data:/data
restart: always
command: redis-server --appendonly yes
networks:
- vss
redis-bio:
image: redis/redis-stack-server
container_name: redis-bio
ports:
- "6381:6379"
volumes:
- redis-bio-data:/data
restart: always
command: redis-server --appendonly yes
networks:
- vss
redis-cfe:
image: redis/redis-stack-server
container_name: redis-cfe
ports:
- "6382:6379"
volumes:
- redis-cfe-data:/data
restart: always
command: redis-server --appendonly yes
networks:
- vss
redis-compas:
redis:
env_file:
- .env
command:
- /bin/sh
- -c
- redis-server --requirepass "$${REDIS_PASSWD:?REDIS_PASSWD variable is not set}"
image: redis/redis-stack-server
container_name: redis-compas
container_name: redis
ports:
- "6383:6379"
- "6379:6379"
volumes:
- redis-compas-data:/data
- redis-data:/data
restart: always
command: redis-server --appendonly yes
networks:
- vss
volumes:
scratch:
redis-uav-data:
redis-cfe-data:
redis-bio-data:
redis-i2map-data:
redis-compas-data:

redis-data:
networks:
vss:
3 changes: 1 addition & 2 deletions example.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
MLDEVOPS_GID=1000
MLDEVOPS_UID=1000
REDIS_PASSWORD=<your redis password>
PORT=8001
REDIS_PASSWD=<your redis password>
CONFIG_PATH=<path to your config files>
20 changes: 9 additions & 11 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,24 +38,22 @@ run-server: kill-uvicorn
export PYTHONPATH=$PWD/src:$PWD/src/submodules/aidata
cd src/app && conda run -n fastapi-vss --no-capture-output uvicorn main:app --port 8002 --reload
run-server-prod:
run-server-prod: build-docker
#!/usr/bin/env bash
tag=$(git describe --tags --always)
GIT_VERSION=$tag COMPOSE_PROJECT_NAME=fastapi-vss \
docker-compose -f compose.yml up \
--build \
--force-recreate \
--no-deps
GIT_VERSION=$tag COMPOSE_PROJECT_NAME=fastapi-vss docker-compose -f compose.yml down --remove-orphans && \
GIT_VERSION=$tag COMPOSE_PROJECT_NAME=fastapi-vss docker-compose -f compose.yml up -d
# Build the Docker image
build-docker:
docker build -t mbari/fastapi-app .
#!/usr/bin/env bash
tag=$(git describe --tags --always)
docker build -t mbari/fastapi-app:$tag .
build-docker-no-cache:
docker build --no-cache -t mbari/fastapi-app .

build-cuda-docker:
docker build -f Dockerfile.cuda -t mbari/fastapi-app .
#!/usr/bin/env bash
tag=$(git describe --tags --always)
docker build --no-cache -t mbari/fastapi-app:$tag .
run-docker:
echo "FastAPI server running at http://localhost:8001"
Expand Down

0 comments on commit d68ce82

Please sign in to comment.