Simplify config and port handling

This commit is contained in:
Fred de Gier 2022-10-03 14:13:10 +02:00
commit 87f4f53e27
5 changed files with 70 additions and 45 deletions

View file

@ -1,11 +1,11 @@
#!/usr/bin/env bash
# Read in config.env file; error if not found
if [ ! -f config.env ]; then
echo "config.env not found, please run setup.sh"
exit 1
# Read in .env file; error if not found
if [ ! -f .env ]; then
echo ".env not found, running setup.sh"
bash setup.sh
fi
source config.env
source .env
# On newer versions, docker-compose is docker compose
DOCKER_COMPOSE=$(command -v docker-compose)
@ -13,7 +13,4 @@ if [ -z "$DOCKER_COMPOSE" ]; then
DOCKER_COMPOSE="docker compose"
fi
export NUM_GPUS=${NUM_GPUS}
export MODEL_DIR="${MODEL_DIR}"/"${MODEL}-${NUM_GPUS}gpu"
export GPUS=$(seq 0 $(( NUM_GPUS - 1 )) | paste -sd ',')
$DOCKER_COMPOSE up