Cloud Providers and Kubernetes#
This guide explains how to deploy the Argilla Server on different cloud providers and Kubernetes.
Kubernetes#
The Kubernetes (k8s) folder in the repo holds several files for a minimal config on deploying Argilla to Kubernetes. These files also contain some resource requirement recommendations for hosting. For a more robust config, we recommend using Helm charts.
argilla-server-deployment.yaml: deploy main Argilla server,
argilla-server-hpa.yaml: scaler to scale the server from 1 to 3 pods.
argilla-server-ingress.yaml: server ingress config.
argilla-server-service.yaml: server service config.
elasticsearch-deployment.yaml: a minimal Elastic Search config.
elasticsearch-pvc.yaml: a persistent volume claim to dynamically scale and retain data.
elasticsearch-service.yaml: a Elastic service config.
Helm charts#
For a more robust and modern set-up, we recommend using official Kubernetes helm charts in combination with the Argilla server Kubernetes yaml
. Argilla itself doesnโt have any helm support but it can still be used together with Helm-deployed ElasticSearch by setting the ARGILLA_ELASTICSEARCH
environment variable to the endpoint where ElasticSearch is hosted.
Amazon Web Services (AWS)#
Setup an AWS profile#
The aws
command cli must be installed. Then, type:
aws configure --profile argilla
and follow command instructions. For more details, visit AWS official documentation.
Once the profile is created (a new entry should appear in file ~/.aws/config
), you can activate it via setting environment variable:
export AWS_PROFILE=argilla
Create docker machine#
docker-machine create --driver amazonec2 \
--amazonec2-root-size 60 \
--amazonec2-instance-type t2.large \
--amazonec2-open-port 80 \
--amazonec2-ami ami-0b541372 \
--amazonec2-region eu-west-1 \
argilla-aws
Available Amazon Machine Instance (AMI) depends on region. The provided AMI is available for eu-west regions and is an ubuntu-16.04-server image.
To find available recent images, go to the AWS AMI Marketplace, choose โLaunch instanceโ. and filter by ubuntu
(donโt forget to choose your targeted region).
If you already have multiple instances and VPC in the targeted region, creating a new VPC before creating the Argilla instance is recommended. Add the following parameter to specify the VPC you want to use for the instance:
--amazonec2-vpc-id vpc-1234abcd # Replace vpc-1234abcd with the created VPC id
Verify machine creation#
$>docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
argilla-aws - amazonec2 Running tcp://52.213.178.33:2376 v20.10.7
Save assigned machine ip#
In our case, the assigned ip is 52.213.178.33
Connect to remote docker machine#
To enable the connection between the local docker client and the remote daemon, we must type following command:
eval $(docker-machine env argilla-aws)
Define a docker-compose.yaml#
# docker-compose.yaml
version: "3"
services:
argilla:
image: argilla/argilla-server:v1.12
ports:
- "80:80"
environment:
ELASTICSEARCH: <elasticsearch-host_and_port>
restart: unless-stopped
Pull image#
docker-compose pull
Launch docker container#
docker-compose up -d
Accessing Argilla#
In our case http://52.213.178.33
Azure#
The easiest way to deploy Argilla on Azure is using the Azure Container Instances (ACI) service. This service allows you to run containers in a serverless way, without the need to manage the underlying infrastructure. ACI integrates with Docker compose files, so you can easily deploy your application using the same file you use for local development.
1. Install Docker with compose#
Install th latest Docker with the compose method described as described in the official documentation. Note that this is not the independent docker-compose
application.
2. Login to Azure#
Using docker
and az
CLI, login to Azure:
docker login azure
You can install the az
CLI using the official documentation.
3. Create an Azure context#
Create a separate context with Azure credentials and the subscription where you want to deploy the Argilla Server:
docker context create aci azurecontext --subscription-id <subscription-id> --resource-group <resource-group> --location <location>
You can also switch back to the default context with:
docker context use default
4. Deploy the Argilla Server#
To deploy the Argilla Server, you can use the Docker Compose file provided in the Argilla repository and the docker-compose up
command:
wget -O docker-compose.yaml https://raw.githubusercontent.com/argilla-io/argilla/main/docker/docker-compose.yaml && docker-compose up -d
This guide is adapted from this blog post by Ben Burtenshaw. Thereโs also an official tutorial on Microsoft Learn.
Google Cloud Platform (GCP)#
Coming soon!
๐ If youโd like support with this and/or want to contribute this gude, join the Slack Community