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