Interface to 'Container Instances', 'Docker Registry' and 'Kubernetes' in 'Azure'

An interface to container functionality in Microsoft's 'Azure' cloud: < https://azure.microsoft.com/en-us/overview/containers/>. Manage 'Azure Container Instance' (ACI), 'Azure Container Registry' (ACR) and 'Azure Kubernetes Service' (AKS) resources, push and pull images, and deploy services. On the client side, lightweight shells to the 'docker', 'kubectl' and 'helm' commandline tools are provided.


CRAN Downloads Travis Build Status

A package for working with Azure Container Registry (ACR), Azure Kubernetes Service (AKS) and Azure Container Instances (ACI). Extends the Azure Resource Manager interface provided by the AzureRMR package.

AzureContainers lets you build and deploy containerised services in R, using Docker and Kubernetes. For full functionality, you should have Docker installed, as well as the kubectl and helm commandline tools. Otherwise it is relatively lightweight, requiring neither Powershell nor Python.

Note that AzureContainers can talk to any Docker registry that uses the V2 HTTP API, not just those created via ACR. Similarly, it can interface with Kubernetes clusters anywhere, not just those created via AKS.

Example workflow

Here is a sample R workflow to package up an R model as a container, deploy it to a Kubernetes cluster, and expose it as a service.

# login to Azure ---
az <- AzureRMR::az_rm$new("<tenant_id>", "<app_id>", "<secret>")
resgroup <- az$
    get_subscription("<subscription_id>")$
    create_resource_group("myresgroup", location="australiaeast")
 
 
# create container registry ---
acr <- resgroup$create_acr("myacr", location="australiaeast")
 
 
# create Docker image from a predefined Dockerfile ---
call_docker("build -t newcontainer .")
 
 
# get registry endpoint, upload image ---
reg <- acr$get_docker_registry()
reg$push("newcontainer")
 
 
# create Kubernetes cluster with 2 nodes ---
aks <- resgroup$create_aks("myakscluster",
    location="australiaeast",
    agent_pools=aks_pools("pool1", 2, "Standard_DS2_v2", "Linux"))
 
 
# get cluster endpoint, deploy from ACR to AKS with predefined yaml definition file ---
clus <- aks$get_cluster()
clus$create_registry_secret(reg, email="[email protected]")
clus$create("model1.yaml")
clus$get("service")

cloudyr project logo

News

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("AzureContainers")

1.0.1 by Hong Ooi, 7 days ago


https://github.com/cloudyr/AzureContainers


Report a bug at https://github.com/cloudyr/AzureContainers/issues


Browse source code at https://github.com/cran/AzureContainers


Authors: Hong Ooi [aut, cre] , Bill Liang [ctb] (Assistance debugging MMLS on Kubernetes) , Ramkumar Chandrasekaran [ctb] (Original blog article on Dockerising MMLS) , Microsoft [cph]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports AzureRMR, openssl, httr, R6

Suggests knitr, testthat


See at CRAN