#!/bin/bash export MSYS_NO_PATHCONV=1 set -e function chown_iterations() { if [ -d "./iterations" ] && [ "$(find ./iterations/ ! -user $USER -o ! -group $USER 2>/dev/null)" ]; then echo "Chowning iterations directory" sudo chown -R $USER:$USER ./iterations/ fi } trap chown_iterations EXIT docker build \ --tag sia \ . docker run \ --init \ --rm \ -ti \ --gpus=all \ -p 8080:8080 \ -e SIA_ITERATIONS_DIR=/root/iterations \ --env-file .env \ -v /$(pwd)/model/:/root/model/ \ -v /$(pwd)/.env:/root/.env \ -v /$(pwd)/iterations/:/root/iterations/ \ -v /$(pwd)/tools/:/root/sia/tools/ \ -v /$(pwd)/.git/:/root/sia/.git/ \ sia "$@"