Goal of Analysis: Use ML algorithms to get best accuracy of predictions for California housing prices given the attributes in the dataset. (Link to the dataset for California housing prices in 1990)
Live site: http://calihouseprice90.westus2.azurecontainer.io/
Press '.' on your keyboard to try it out!
- vscode-pyodide - Visual Studio Marketplace (Pyolite kernel)
- Install packages from PyPI with micropip
- Load publicly available csv / json file
- Spin up Codespaces for full VS Code features with GitHub compute backing it
- Log in to Azure:
az login
- Create a new Azure Container Registry:
az acr create --resource-group <somin-rg> --name <calidemo> --sku Basic
- Log in to the created registry:
az acr login -n <calidemo>
- Create
deployment.yml
using YAML reference for ACI, and get the password for the container registry using:az acr update -n <calidemo> --admin-enabled true az acr credential show --name <calidemo>
- Create
nginx.conf
to reroute the web traffic to Streamlit's port 8501 - Create a
Dockerfile
to install and setup all the resources needed to run the Streamlit app, including nginx - Build and push the image to the registry:
docker build -t <azure_demo:v1> . docker tag azure_demo:v1 <calidemo>.azurecr.io/<azure_demo:v1> docker push <calidemo>.azurecr.io/<azure_demo:v1>
- Deploy the app as an ACI:
az container create --resource-group <somin-rg> --name <calidemo> -f deployment.yml
- Confirm that your instance has been deployed using the Azure portal (navigate to Container Instances) and/or access the live ML app 🥳:
<calihouseprice90>.westus2.azurecontainer.io
- Create a compute instance through the AML extension using the AML YAML configuration spec (can also be done through the Azure portal), for example:
$schema: https://azuremlschemas.azureedge.net/latest/computeInstance.schema.json name: california-housing type: computeinstance size: Standard_DS3_v2
- Connect to that compute instance from VS Code (right click on compute instance and click "Connect")
- Trust folder authors and... you're connected! 🙌🏻
- (Optional) Verify connection via remote window indicator (bottom left), and/or type
pwd
in the terminal - (Optional) Debug within the AML compute, directly from VSC
- (Optional) Load a local directory and execute a file against a specified compute target through a
command job
using the AML YAML configuration spec, for example:$schema: https://azuremlschemas.azureedge.net/latest/commandJob.schema.json code: ./ command: python test.py environment: azureml:AzureML-PyTorch-1.3-CPU:40 compute: azureml: somin-aml-compute