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

[CI] add always_yes mode for conda evn creation (#5384)

* add always_yes mode for conda evn creation

* Update create_dev_conda_env.sh
parent a14f69c9
...@@ -17,6 +17,7 @@ OPTIONS: ...@@ -17,6 +17,7 @@ OPTIONS:
-c Create dev environment in CPU mode. -c Create dev environment in CPU mode.
-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}.
-s Run silently which indicates always 'yes' for any confirmation.
EOF EOF
} }
...@@ -40,7 +41,7 @@ confirm() { ...@@ -40,7 +41,7 @@ confirm() {
} }
# Parse flags. # Parse flags.
while getopts "cg:h" flag; do while getopts "cg:hs" flag; do
if [[ ${flag} == "c" ]]; then if [[ ${flag} == "c" ]]; then
cpu=1 cpu=1
elif [[ ${flag} == "g" ]]; then elif [[ ${flag} == "g" ]]; then
...@@ -48,6 +49,8 @@ while getopts "cg:h" flag; do ...@@ -48,6 +49,8 @@ while getopts "cg:h" flag; do
elif [[ ${flag} == "h" ]]; then elif [[ ${flag} == "h" ]]; then
usage usage
exit 0 exit 0
elif [[ ${flag} == "s" ]]; then
always_yes=1
else else
usage usage
exit 1 exit 1
...@@ -79,7 +82,7 @@ if [[ -n ${gpu} ]]; then ...@@ -79,7 +82,7 @@ if [[ -n ${gpu} ]]; then
fi fi
echo "Confirm the installed CUDA version matches the specified one." echo "Confirm the installed CUDA version matches the specified one."
confirm [[ -n "${always_yes}" ]] || confirm
torchversion=${TORCH_VERSION}"+cu"${gpu//[-._]/} torchversion=${TORCH_VERSION}"+cu"${gpu//[-._]/}
name="dgl-dev-gpu" name="dgl-dev-gpu"
...@@ -87,7 +90,7 @@ fi ...@@ -87,7 +90,7 @@ fi
echo "Confirm you are excuting the script from your DGL root directory." echo "Confirm you are excuting the script from your DGL root directory."
echo "Current working directory: ${PWD}" echo "Current working directory: ${PWD}"
confirm [[ -n "${always_yes}" ]] || confirm
# Prepare the conda environment yaml file. # Prepare the conda environment yaml file.
rand=$(echo "${RANDOM}" | md5sum | head -c 20) rand=$(echo "${RANDOM}" | md5sum | head -c 20)
...@@ -102,7 +105,7 @@ echo "--------------------------------------------------" ...@@ -102,7 +105,7 @@ echo "--------------------------------------------------"
cat /tmp/${rand}/dgl_dev.yml cat /tmp/${rand}/dgl_dev.yml
echo "--------------------------------------------------" echo "--------------------------------------------------"
echo "Create a conda enviroment with the config?" echo "Create a conda enviroment with the config?"
confirm [[ -n "${always_yes}" ]] || confirm
# Create conda environment. # Create conda environment.
conda env create -f /tmp/${rand}/dgl_dev.yml conda env create -f /tmp/${rand}/dgl_dev.yml
......
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