Simple singularity recipe for Keras (Python 3) & Flux (Julia) (personal use) Base image: nvidia/cuda + julia at Dockerhub
$ sudo singularity build /opt/singularity/flux-jskim.sif flux-julia.def
$ sudo singularity build /opt/singularity/keras-jskim.sif keras-py3.def
$ sudo singularity build /opt/singularity/torch-jskim.sif torch-py3.def
$ julia
- press
]
(v1.4) pkg> up
- Install python via pyenv and pyenv-virtualenv
$ pyenv install 3.8.2
$ pyenv virtualenv 3.8.2 env
$ pyenv local env
(env) $ pip install package_name
- If you have changed sif file name, change corresponding name in
keras
andflux
script
$ mkdir -p ~/usr/bin
$ chmod +x keras
$ chmod +x flux
$ cp keras ~/usr/bin
$ cp flux ~/usr/bin
or you can make symbolic link (ln -s src dest
to your bin
directory)
- Assume
~/usr/bin
has been added to your PATH
- assume we have
some_case_name
and save code results to${HOME}/data/some_case_name
$ flux -b some_case_name my_code.jl
$ torch -b some_case_name my_code.py
$ keras -b some_case_name my_code.py
$ flux -s
$ torch -s
$ keras -s
-
Use envionments in
Pkg
because host and guest system share~/.julia
so there would be build issue -
Shell script may not be work in specific order.
- run following command
flux -b "name" -n
- connect local machine via SSH tunneling using following command, then open web browser by this address, localhost:8157`.
ssh "remoteId"@"remoteIP" -p "remoteSSHPort" -NL 8157:localhost:8889 "remoteId"@"remoteIP"
- Better docs
- Better usage (
-h
option) - Better command line arguments handling in shell script