Skip to content

Commit

Permalink
Use docker-compose if available
Browse files Browse the repository at this point in the history
  • Loading branch information
maya-doshi committed Feb 18, 2024
1 parent 307eb63 commit 3626ae4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
9 changes: 5 additions & 4 deletions setup_dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
no_gpu=false
force_gpu=false
run_automated_testing_docker=false
docker_compose=$(which docker-compose 2>/dev/null || echo docker compose)

usage() {
echo "Usage: $0 [options]"
Expand Down Expand Up @@ -76,9 +77,9 @@ then
fi

echo "Killing old development containers..."
docker compose -f docker-compose-gpu-automated-testing.yml down # kill old containers, this is most complete
$docker_compose -f docker-compose-gpu-automated-testing.yml down # kill old containers, this is most complete

# copy python-requirements + cuda-requirements into appropriate folders for docker compose
# copy python-requirements + cuda-requirements into appropriate folders for docker-compose
cp python-requirements.txt docker_auton
mv docker_auton/python-requirements.txt docker_auton/python-requirements_TEMP_DO_NOT_EDIT.txt
cp python-requirements.txt docker_tester
Expand All @@ -87,10 +88,10 @@ cp cuda-requirements.txt docker_auton
mv docker_auton/cuda-requirements.txt docker_auton/cuda-requirements_TEMP_DO_NOT_EDIT.txt

echo "Building containers..."
docker compose -f $dockerfile build
$docker_compose -f $dockerfile build

echo "Starting containers..."
docker compose -f $dockerfile --env-file .env.dev up -d
$docker_compose -f $dockerfile --env-file .env.dev up -d

sleep 0.5

Expand Down
5 changes: 3 additions & 2 deletions setup_prod.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
no_gpu=false
force_gpu=false
run_automated_testing_docker=false
docker_compose=$(which docker-compose 2>/dev/null || echo docker compose)

usage() {
echo "Usage: $0 [options]"
Expand Down Expand Up @@ -87,10 +88,10 @@ cp cuda-requirements.txt docker_auton
mv docker_auton/cuda-requirements.txt docker_auton/cuda-requirements_TEMP_DO_NOT_EDIT.txt

echo "Building containers..."
docker compose -f $dockerfile build
$docker_compose -f $dockerfile build

echo "Starting containers..."
docker compose -f $dockerfile --env-file .env.prod up -d
$docker_compose -f $dockerfile --env-file .env.prod up -d

sleep 0.5

Expand Down

0 comments on commit 3626ae4

Please sign in to comment.