Unverified Commit 3e2b5a04 authored by Rhett Ying's avatar Rhett Ying Committed by GitHub
Browse files

[dev] enable specifying conda env name (#5886)

parent d381f226
......@@ -12,6 +12,7 @@ examples:
bash $0 -g 11.7
bash $0 -g 11.7 -p 3.8
bash $0 -g 11.7 -p 3.8 -t 1.13.0
bash $0 -c -n dgl-dev-cpu
Create a developement environment for DGL developers.
......@@ -23,6 +24,7 @@ OPTIONS:
environment of the same name).
-g Create dev environment in GPU mode with specified CUDA version,
supported: ${CUDA_VERSIONS}.
-n Specify the name of the environment.
-o Save environment YAML file to specified path.
-p Create dev environment based on specified python version.
-s Run silently which indicates always 'yes' for any confirmation.
......@@ -51,7 +53,7 @@ confirm() {
}
# Parse flags.
while getopts "cdfg:ho:p:st:" flag; do
while getopts "cdfg:hn:o:p:st:" flag; do
case "${flag}" in
c)
cpu=1
......@@ -69,6 +71,9 @@ while getopts "cdfg:ho:p:st:" flag; do
usage
exit 0
;;
n)
name=${OPTARG}
;;
o)
output_path=${OPTARG}
;;
......@@ -109,7 +114,9 @@ fi
# Set up CPU mode.
if [[ ${cpu} -eq 1 ]]; then
torchversion=${torch_version}"+cpu"
name="dgl-dev-cpu"
if [[ -z "${name}" ]]; then
name="dgl-dev-cpu"
fi
fi
# Set up GPU mode.
......@@ -124,7 +131,9 @@ if [[ -n ${cuda_version} ]]; then
[[ -n "${always_yes}" ]] || confirm
torchversion=${torch_version}"+cu"${cuda_version//[-._]/}
name="dgl-dev-gpu"
if [[ -z "${name}" ]]; then
name="dgl-dev-gpu-"${cuda_version//[-._]/}
fi
fi
# Set python version.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment