Parametrised hostname

This commit is contained in:
Christoph Schranz 2019-11-15 11:22:33 +01:00
parent a66928eb61
commit de87185185
2 changed files with 3 additions and 2 deletions

View File

@ -31,9 +31,10 @@ if [[ "$result" != *" $NETWORK "* ]]; then
fi
# starting in swarm
echo "Adding gpu-jupyter to the swarm in the network $NETWORK on port $PORT."
export HOSTNAME=$(hostname)
export JUPYTER_PORT=$PORT
export JUPYTER_NETWORK=$NETWORK
echo "Adding gpu-jupyter to the swarm on the node $HOSTNAME in the network $NETWORK on port $PORT."
# echo $JUPYTER_NETWORK
envsubst < docker-compose-swarm.yml > .docker-compose-swarm.yml.envsubst
docker-compose -f .docker-compose-swarm.yml.envsubst build

View File

@ -18,7 +18,7 @@ services:
- $JUPYTER_NETWORK
deploy:
placement:
constraints: [node.hostname == data-science]
constraints: [node.hostname == $HOSTNAME]
resources:
limits:
cpus: "4"