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