Skip to content

Commit

Permalink
now checks if work properly
Browse files Browse the repository at this point in the history
  • Loading branch information
lizelive committed Mar 13, 2022
1 parent db7cb2b commit aa48435
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ before first run set env vars
`WOLFRAM_PASSWORD`

can also set
`WOLFRAM_VERSION`
to be a tag from https://hub.docker.com/r/wolframresearch/wolframengine/tags to choose which version to use
`WOLFRAM_VERSION` to be a tag from https://hub.docker.com/r/wolframresearch/wolframengine/tags to choose which version to use
`WOLFRAM_DOCKER_ARGS` to be docker args to use when running like `--gpus=all`
5 changes: 3 additions & 2 deletions wolframscript.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ mathpass_volume="mathpass"
user="wolframengine" #user=$(docker run -it --rm ${image} id -un | xargs echo)
mathpass_dir="/home/$user/.WolframEngine/Licensing/"

docker volume inspect ${mathpass_volume} > /dev/null
docker volume inspect ${mathpass_volume} > /dev/null && docker run -it --rm -v ${mathpass_volume}:${mathpass_dir} ${image} wolframscript -c 'Exit[]' > /dev/null
if [ $? -ne 0 ]
then
docker volume rm ${mathpass_volume} > /dev/null
docker volume create ${mathpass_volume} > /dev/null
docker run -it --rm -v ${mathpass_volume}:${mathpass_dir} --user root ${image} chown ${user} -R ${mathpass_dir} > /dev/null
if [[ -n "${WOLFRAM_USERNAME}" ]] && [[ -n "${WOLFRAM_PASSWORD}" ]]
Expand All @@ -21,4 +22,4 @@ else
docker run -it --rm -v ${mathpass_volume}:${mathpass_dir} ${image} wolframscript -activate
fi
fi
docker run -it --rm -v ${mathpass_volume}:${mathpass_dir} ${image} wolframscript $@
docker run -it --rm -v ${mathpass_volume}:${mathpass_dir} ${WOLFRAM_DOCKER_ARGS} ${image} wolframscript $@

0 comments on commit aa48435

Please sign in to comment.