Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sc_venv_template
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stefan Kesselheim
sc_venv_template
Commits
421c44cc
Commit
421c44cc
authored
2 years ago
by
Stefan Kesselheim
Browse files
Options
Downloads
Patches
Plain Diff
polishing and example submission script
parent
9f999a54
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitignore
+2
-0
2 additions, 0 deletions
.gitignore
config.sh
+2
-3
2 additions, 3 deletions
config.sh
example_submission_script.sh
+22
-0
22 additions, 0 deletions
example_submission_script.sh
setup.sh
+27
-19
27 additions, 19 deletions
setup.sh
with
53 additions
and
22 deletions
.gitignore
+
2
−
0
View file @
421c44cc
venv
slurm.*
overlay.*
This diff is collapsed.
Click to expand it.
config.sh
+
2
−
3
View file @
421c44cc
...
...
@@ -9,5 +9,4 @@ ABSOLUTE_PATH=`realpath ${RELATIVE_PATH}`
export
ENV_NAME
=
`
basename
$ABSOLUTE_PATH
`
# Default Name of the venv is the directory that contains this file
export
ENV_DIR
=
${
ABSOLUTE_PATH
}
/venv
# Default location of this VENV is "./venv"
export
SINGULARITY_IMAGE
=
/p/project/jb_benchmark/nvidia_singularity_images/nvidia_tensorflow_21.02-tf1-py3.sif
export
SINGULARITY_IMAGE
=
/p/project/jb_benchmark/nvidia_singularity_images/nvidia_pytorch_bert_20.06-py3-m5.1.sif
export
SINGULARITY_IMAGE
=
/p/project/hai_mlperf/oc20_singularity_v4_2022_09_06.sif
This diff is collapsed.
Click to expand it.
example_submission_script.sh
0 → 100644
+
22
−
0
View file @
421c44cc
#!/bin/bash
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=2
#SBATCH --time=00:01:00
#SBATCH --gres=gpu
#SBATCH --partition=develbooster
#SBATCH --account=atmlaml
set
-e
######## How to run with container #########
module purge
source
config.sh
echo
"Running with image
$SINGULARITY_IMAGE
"
echo
"Check that your virtual environment is in the PYTHONPATH:"
srun singularity run
$SINGULARITY_IMAGE
bash
-c
'
source activate.sh;
echo hello world;
python -c \"import sys; print(sys.path)\"
'
This diff is collapsed.
Click to expand it.
setup.sh
+
27
−
19
View file @
421c44cc
...
...
@@ -3,25 +3,33 @@ export RELATIVE_PATH=`dirname ${BASH_SOURCE}`
export
ABSOLUTE_PATH
=
`
realpath
${
RELATIVE_PATH
}
`
source
${
ABSOLUTE_PATH
}
/config.sh
echo
path
${
ABSOLUTE_PATH
}
echo
Environment
in
${
ABSOLUTE_PATH
}
#### Optional: Set the Variable Overlay if you want to use the Singularity Overlay feature
#### This might be necessary if you want to modify the image. Documentation: https://apptainer.org/docs/user/main/persistent_overlays.html
if
[
-z
$OVERLAY
]
;
then
rm
-f
overlay.img
rm
-rf
overlay
rm
-rf
venv
mkdir
-p
overlay/upper
mkdir
-p
overlay/work
dd
if
=
/dev/zero
of
=
overlay.img
bs
=
1M
count
=
500
&&
\
mkfs.ext3
-d
overlay overlay.img
export
OVERLAY_ARGS
=
" --overlay
${
ABSOLUTE_PATH
}
/overlay.img "
else
export
OVERLAY_ARGS
=
""
fi
#### /Overlay
singularity run
--overlay
${
ABSOLUTE_PATH
}
/overlay.img
$SINGULARITY_IMAGE
bash
-c
'
rm
-rf
venv
singularity run
$OVERLAY_ARGS
$SINGULARITY_IMAGE
bash
-c
'
python -m venv --prompt $ENV_NAME --system-site-packages ${ENV_DIR};
source ${ABSOLUTE_PATH}/activate.sh;
pip install --cache-dir ${ABSOLUTE_PATH}/cache --upgrade pip
#conda install -y ipykernel==5.1.3
conda uninstall -y ipykernel
conda uninstall -y ipykernel
# For Jupyter-JSC compatibility, it might be necessary to install a certain ipykernel version.
pip install --cache-dir ${ABSOLUTE_PATH}/cache -r ${ABSOLUTE_PATH}/requirements.txt;
'
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment