2022-04-29 22:29:11 +03:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
condaEnv=$1
|
|
|
|
subId=$2
|
|
|
|
rgName=$3
|
|
|
|
wsName=$4
|
|
|
|
|
|
|
|
if [ -z $4 ]; then
|
|
|
|
echo "Expected command line: quick-setup.bash <CONDA-ENV> <SUB-ID> <RG-NAME> <WS-NAME>"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Will create conda environment $condaEnv"
|
|
|
|
echo "For subscription $subId, resourcegroup $rgName and workspace $wsName"
|
|
|
|
|
|
|
|
sleep 1
|
|
|
|
|
|
|
|
echo
|
|
|
|
|
|
|
|
echo "=-= Creating config.json"
|
|
|
|
echo "{ \"subscription_id\":\"${subId}\", \"resource_group\":\"$rgName\", \"workspace_name\":\"$wsName\" }" > config.json
|
|
|
|
echo
|
|
|
|
|
|
|
|
echo "=-= Creating comoponent_config.json"
|
|
|
|
echo "{ \"version\":\"1\" }" > component_config.json
|
|
|
|
echo
|
|
|
|
|
|
|
|
echo "=-= Creating conda environment"
|
|
|
|
source ~/miniconda3/etc/profile.d/conda.sh
|
2024-07-10 20:29:59 +03:00
|
|
|
conda create -y -n ${condaEnv} python=3.9
|
2022-04-29 22:29:11 +03:00
|
|
|
conda activate ${condaEnv}
|
|
|
|
echo
|
|
|
|
|
2022-05-24 05:01:59 +03:00
|
|
|
echo "=-= Installing nbconda"
|
|
|
|
conda install nbconda
|
|
|
|
echo
|
|
|
|
|
2022-04-29 22:29:11 +03:00
|
|
|
echo "=-= Installing Jupyter"
|
2022-06-03 16:58:43 +03:00
|
|
|
pip install jupyter
|
2022-04-29 22:29:11 +03:00
|
|
|
echo
|
|
|
|
|
|
|
|
echo "=-= Instaling other requirements"
|
2022-05-20 18:15:46 +03:00
|
|
|
pip install -r requirements.txt
|
2022-04-29 22:29:11 +03:00
|
|
|
echo
|
|
|
|
|
|
|
|
echo "=-= Runnning AzureML registrations"
|
|
|
|
python scripts/register_azureml.py --workspace_config config.json --component_config component_config.json --base_directory .
|
|
|
|
echo
|
|
|
|
|
|
|
|
echo "Configuring Azure CLI defaults"
|
|
|
|
az account set -s $subId
|
|
|
|
az configure --defaults group=$rgName workspace=$wsName
|