Giter Club home page Giter Club logo

azure-deeplearning-vm's Introduction

Prepare Deep Learning environment in Azure with Azure CLI and Ansible

See example environment variables in .envrc.

# Create a resource group
$ az group create --name ${AZ_RESOURCE_GROUP} --location ${AZ_LOCATION}

# Create a public IP
$ az network public-ip create -g ${AZ_RESOURCE_GROUP} -n ${AZ_PUBLIC_IP}

# How to find an image
# https://docs.microsoft.com/en-us/azure/virtual-machines/linux/cli-ps-findimage

# List VM image publishers
$ az vm image list-publishers --location ${AZ_LOCATION} --output table

# List image offers by publisher `microsoft-dsvm`
$ az vm image list-offers --location ${AZ_LOCATION} --publisher microsoft-dsvm --output table

# List SKUs for publisher `microsoft-dsvm` and offer `linux-data-science-vm-ubuntu`
$ az vm image list-skus --location ${AZ_LOCATION} --publisher microsoft-dsvm --offer linux-data-science-vm-ubuntu --output table

# List images by publisher, offer, and SKU
$ az vm image list \
    --location ${AZ_LOCATION} \
    --publisher microsoft-dsvm \
    --offer linux-data-science-vm-ubuntu \
    --sku linuxdsvmubuntu \
    --all \
    --output table

# Create a virtual machine with chosen image such as
# `microsoft-dsvm:linux-data-science-vm-ubuntu:linuxdsvmubuntu:20.12.11`
# and size such as `Standard_NC6_Promo`
$ az vm create \
  --name ${AZ_VM_NAME} \
  --resource-group ${AZ_RESOURCE_GROUP} \
  --image ${AZ_IMAGE} \
  --location ${AZ_LOCATION} \
  --size ${AZ_SIZE} \
  --ssh-key-value ${AZ_SSH_KEY} \
  --admin-username ${AZ_USER} \
  --public-ip-address ${AZ_PUBLIC_IP} \
  --public-ip-address-allocation static
  # --nsg ${AZ_NSG}

# Find the public IP of the VM
$ az network public-ip show \
  --resource-group ${AZ_RESOURCE_GROUP} \
  --name ${AZ_PUBLIC_IP} \
  --query ipAddress \
  --output json

# List VMs
$ az vm list --output table
# Deallocate VM
$ az vm deallocate -n ${AZ_VM_NAME} -g ${AZ_RESOURCE_GROUP}
# Delete VM
$ az vm delete -g ${AZ_RESOURCE_GROUP} -n ${AZ_VM_NAME}

Ansible

Add hosts file based on the example in hosts.example and run:

$ ansible-playbook -i hosts site.yml

TODO:

  • Fix error in starting code-server

VM commands

$ nvidia-smi

azure-deeplearning-vm's People

Contributors

ksaaskil avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.