Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Singularity At JSC
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
Simulation and Data Lab Applied Machine Learning
Singularity At JSC
Commits
6d2d2511
Commit
6d2d2511
authored
4 months ago
by
kasravi1
Browse files
Options
Downloads
Patches
Plain Diff
add group name into args
parent
6c95a2d4
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/build_customized_nvidia_image.sh
+8
-6
8 additions, 6 deletions
scripts/build_customized_nvidia_image.sh
with
8 additions
and
6 deletions
scripts/build_customized_nvidia_image.sh
+
8
−
6
View file @
6d2d2511
...
@@ -6,26 +6,28 @@ PARTITION_NAME=""
...
@@ -6,26 +6,28 @@ PARTITION_NAME=""
SINGULARITY_BASE_IMG_PATH
=
""
SINGULARITY_BASE_IMG_PATH
=
""
SINGULARITY_FINAL_IMG_NAME
=
""
SINGULARITY_FINAL_IMG_NAME
=
""
REQUIREMENT_PATH
=
""
REQUIREMENT_PATH
=
""
GROUP_NAME
=
""
# Parse options
# Parse options
while
getopts
"A:P:S:R:F:"
opt
;
do
while
getopts
"A:
G:
P:S:R:F:"
opt
;
do
echo
"Processing option:
$opt
with argument:
$OPTARG
"
# Add this for debugging
echo
"Processing option:
$opt
with argument:
$OPTARG
"
# Add this for debugging
case
$opt
in
case
$opt
in
A
)
ACCOUNT_NAME
=
$OPTARG
;;
A
)
ACCOUNT_NAME
=
$OPTARG
;;
G
)
GROUP_NAME
=
$OPTARG
;;
P
)
PARTITION_NAME
=
$OPTARG
;;
P
)
PARTITION_NAME
=
$OPTARG
;;
S
)
SINGULARITY_BASE_IMG_PATH
=
$OPTARG
;;
S
)
SINGULARITY_BASE_IMG_PATH
=
$OPTARG
;;
R
)
REQUIREMENT_PATH
=
$OPTARG
;;
R
)
REQUIREMENT_PATH
=
$OPTARG
;;
F
)
SINGULARITY_FINAL_IMG_NAME
=
$OPTARG
;;
F
)
SINGULARITY_FINAL_IMG_NAME
=
$OPTARG
;;
*
)
*
)
echo
"Usage:
$0
-A <account_name> -P <partition_name> -S <singularity_base_image_path> -R <requirement.txt_path> F <singularity_image_name>"
echo
"Usage:
$0
-A <account_name>
-G <group_name>
-P <partition_name> -S <singularity_base_image_path> -R <requirement.txt_path> F <singularity_image_name>"
exit
1
exit
1
;;
;;
esac
esac
done
done
# Check if required arguments are provided
# Check if required arguments are provided
if
[
-z
"
$ACCOUNT_NAME
"
]
||
[
-z
"
$PARTITION_NAME
"
]
||
[
-z
"
$SINGULARITY_BASE_IMG_PATH
"
]
||
[
-z
"
$REQUIREMENT_PATH
"
]
||
[
-z
"
$SINGULARITY_FINAL_IMG_NAME
"
]
;
then
if
[
-z
"
$ACCOUNT_NAME
"
]
||
[
-z
"
$GROUP_NAME
"
]
||
[
-z
"
$PARTITION_NAME
"
]
||
[
-z
"
$SINGULARITY_BASE_IMG_PATH
"
]
||
[
-z
"
$REQUIREMENT_PATH
"
]
||
[
-z
"
$SINGULARITY_FINAL_IMG_NAME
"
]
;
then
echo
"Usage:
$0
-A <account_name> -P <partition_name> -S <singularity_base_image_path> -R <requirement.txt_path> F <singularity_image_name>"
echo
"Usage:
$0
-A <account_name>
-G <group_name>
-P <partition_name> -S <singularity_base_image_path> -R <requirement.txt_path> F <singularity_image_name>"
exit
1
exit
1
fi
fi
...
@@ -62,7 +64,7 @@ module load Stages
...
@@ -62,7 +64,7 @@ module load Stages
module try-load GCC Apptainer-Tools
module try-load GCC Apptainer-Tools
# Define the directory path
# Define the directory path
DIR="/p/project1/
${
ACCOUNT
_NAME
}
/
${
USER
}
/apptainer"
DIR="/p/project1/
${
GROUP
_NAME
}
/
${
USER
}
/apptainer"
# Ensure directory exists
# Ensure directory exists
if [ ! -d "
\$
DIR" ]; then
if [ ! -d "
\$
DIR" ]; then
...
@@ -74,7 +76,7 @@ else
...
@@ -74,7 +76,7 @@ else
fi
fi
# Create temporary directory for Apptainer build
# Create temporary directory for Apptainer build
TMP=
\$
(mktemp -p /p/scratch/
${
ACCOUNT
_NAME
}
/apptainer -d) || { echo "Failed to create temporary directory"; exit 1; }
TMP=
\$
(mktemp -p /p/scratch/
${
GROUP
_NAME
}
/apptainer -d) || { echo "Failed to create temporary directory"; exit 1; }
export APPTAINER_TMPDIR=
\$
TMP
export APPTAINER_TMPDIR=
\$
TMP
# Create the Singularity definition file in TMP
# Create the Singularity definition file in TMP
...
...
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