Revision YAML Field Types

Name

Service name created by the user.

NameTypeRequiredDescription
namestringRequriedService name
name: vessl-test-service

Message

Write a message for the Service Revision. We recommend writing an identical message for each revision to distinguish them.

NameTypeRequiredDescription
messagestringRequriedDescription of the revision.
message: vessl-yaml-revision

Image

The name of the docker image that will be used for inference. You can also use a custom docker image.

NameTypeRequiredDescription
imagestringRequriedDocker image url.
image: quay.io/vessl-ai/ngc-pytorch-kernel:22.10-py3-202306140422

Resources

Write down the compute resources you want to use for Service. You can specify the resources you want to use in the Cluster settings.

NameTypeRequiredDescription
clusterstringOptionalThe cluster to be used for the run. (default: VESSL-managed cluster)
presetstringOptionalThe preset to be used for the run.
spotone of (empty, SpotOnly, SpotFirst, OnDemandOnly)OptionalWhether to use spot instances for the run or not.
resources:
  cluster: vessl-gcp-oregon
  preset: gpu-l4-small-spot

Import

Write the datasets and volumes imported in the Revision container when the Revision is deployed.

PrefixTypeRequiredDescription
git://stringOptionalMount a git repository into your container. The repository will be cloned into the specified mount path when container starts.
hf://stringOptionalMount a huggingface repository into your container. The repository will be cloned into the specified mount path when container starts.
vessl-dataset://stringOptionalMount a dataset stored in VESSL. Replace organizationName with the name of your organization and datasetName with the name of the dataset.
s3://stringOptionalMount an AWS S3 bucket into your container. Replace bucketName with the name of your S3 bucket and path with the path to te file or folder you want to mount.
gs://stringOptionalMount an GCP GCS bucket into your container. Replace bucketName with the name of your GCS bucket and path with the path to te file or folder you want to mount.
vessl-model://stringOptionalMount a VESSL Model into your container.
vessl-artifact://stringOptionalMount a VESSL Artifact into your container.
import:
  /root/git-examples: git://github.com/vessl-ai/examples
  /root/hf: hf:///opt/data1
  /input/config: gs://config.yml
  /input/data2: s3://192.168.10.2:~/
  /input/data3: vessl-dataset://{organization_name}/{dataset_name}

Mount

Write down the volumes that will be mounted in the Revision Service container when the Revision is deployed.

PrefixTypeRequiredDescription
hf://stringOptionalMount a huggingface repository into your container. The repository will be cloned into the specified mount path when container starts.
hostpath://stringOptionalMount a file or directory from the host node’s filesystem into your container. Replace path with the path to the file or folder you want to mount.
nfs://stringOptionalMount a Network File System(NFS) into your container. Replace ip with the IP address of your NFS server and path with the path to the file or folder you want to mount.
cifs://stringOptionalMount a Command Internet File System(CIFS) into your contianer. Replace ip with the IP address of your NFS server and path with the path to the file or folder you want to mount.
gcs-fuse://stringOptionalMount a GCS with FUSE csi driver.

Run

Write down what commands you want to run on the service container when the Revision is deployed.

NameTypeRequiredDescription
workdirstringOptionalThe working directory for the command.
commandstringRequiredThe command to be run.
run:
  - workdir: /root/git-examples
    command: |
      vessl model launch service.py:Service -p 3000

Env

Write down the environment variables that will be set in the Revision Service container.

NameTypeRequiredDescription
envmapOptionalKey-value pairs for environment variables in the run container.
env:
  learning_rate: 0.001
  batch_size: 64
  optimizer: sgd

Ports

Write down the ports and protocols that the Revision Service container should open.

NameTypeRequiredDescription
namestringRequiredThe name for the opening port.
typestringRequiredThe protocol the port will use.
portintRequiredThe number of the port.
ports:
  - name: web-service
    type: http
    port: 8000
  - name: web-service-2
    type: http
    port: 8001

Autoscaling

Sets the value for how the Revision Pod will autoscale.

NameTypeRequiredDescription
minstringRequiredMinimum number of Pods to autoscale.
maxstringRequiredMaximum number of Pods to autoscale.
metricintRequiredDetermine what conditions you want to autoscale under. You can select cpu, gpu, memory, and custom
targetintRequiredA metric threshold percentage. If the metric is above the target, then the Autoscaler automatically scale-out.
autoscaling:
  min: 1
  max: 3
  metric: cpu
  target: 50