-
Notifications
You must be signed in to change notification settings - Fork 8
/
quick-setup.bash
52 lines (39 loc) · 1.19 KB
/
quick-setup.bash
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/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
conda create -y -n ${condaEnv} python=3.9
conda activate ${condaEnv}
echo
echo "=-= Installing nbconda"
conda install nbconda
echo
echo "=-= Installing Jupyter"
pip install jupyter
echo
echo "=-= Instaling other requirements"
pip install -r requirements.txt
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