Learn R Programming

⚠️There's a newer version (1.3.3) of this package.Take me there.

AzureContainers

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@example.com")
clus$create("model1.yaml")
clus$get("service")

Copy Link

Version

Install

install.packages('AzureContainers')

Monthly Downloads

939

Version

1.0.2

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Hong Ooi

Last Published

May 4th, 2019

Functions in AzureContainers (1.0.2)

aci_ports

Utilities for specifying ACI configuration information
acr

Azure Container Registry class
docker_registry

Docker registry class
aks_pools

Utility function for specifying Kubernetes agent pools
delete_aci

Delete an Azure Container Instance (ACI)
list_vm_sizes

List available VM sizes
list_kubernetes_versions

List available Kubernetes versions
call_docker

Call the docker commandline tool
aks

Azure Kubernetes Service class
is_acr

Utility functions to test whether an object is of the given class.
delete_aks

Delete an Azure Kubernetes Service (AKS)
kubernetes_cluster

Kubernetes cluster class
get_acr

Get Azure Container Registry (ACR)
delete_acr

Delete an Azure Container Registry (ACR)
get_aci

Get Azure Container Instance (ACI)
get_aks

Get Azure Kubernetes Service (AKS)
create_aci

Create Azure Container Instance (ACI)
create_aks

Create Azure Kubernetes Service (AKS)
call_helm

Call the Helm commandline tool
create_acr

Create Azure Container Registry (ACR)
aci

Azure Container Instance class
call_kubectl

Call the Kubernetes commandline tool, kubectl