Skip to main content

Service config format

Introduction

This format is used to configure user service before upload to the AosCloud.

Format

# General publisher info section
publisher:
author: # Author info
company: # Company info

build:
os: linux
arch: x86
sign_pkcs12: aos-user-sp.p12
symlinks: copy

# Information about publishing process (URI, cert, etc)
publish:
url: aoscloud.io
service_uid: #Service UID can be found on the Cloud service details page (Required)
tls_pkcs12: aos-user-sp.p12
version: '1.0.0' # Vendor version that should be in SemVer format (Required)

# Service configuration
configuration:
state:
filename: state.dat
required: False

# Startup command
cmd: # Service start command as one or list of strings (separate entrypoint and arguments)
instances:
minInstances: 1 # indicates minimal number of service's instances that should be run on Unit
priority: 0 # Priority of service instance (0-1000000000, 0 is the lowest priority), default value is 0
labels: # Labels where service instance should be run
- string
runParameters:
startInterval: 'PT10S' # indicates maximum time (ISO 8601 duration) required by service to start
startBurst: 3 # indicates number of attempt to start
restartInterval: 'PT1S' # indicates in which time (ISO 8601 duration) the service will be restarted after exit
runner: string (runc, crun, runx, xrun) # Runner that should be used by Aos Core for running service instance. Default: crun
offlineTTL: 'PT1M' # service TTL (ISO 8601 duration). In case of the unit is offline more than TTL time - Service should be deleted.
downloadTTL: 'PT1M' # download service TTL (ISO 8601 duration). In case of the unit is not able to download service or related layer more than TTL time - Service should be deleted.
isResourceLimits: True # when set as False, the service version has no resource limits and also has no resource reservations for Pre-release versions
# Service working dir
workingDir: #service working directory

devices:
- name: string (camera0, mic0, audio0, etc)
mode: rwm

resources:
- system-dbus
- bluetooth

hostname: my-container

exposedPorts:
- 8089-8090/tcp
- 1515/udp
- 9000

allowedConnections:
- 9931560c-be75-4f60-9abf-08297d905332/8087-8088/tcp
- 9931560c-be75-4f60-9abf-08297d905332/1515/udp

requestedResources:
cpu: 10000
ram: 200kB
storage: 64kB

quotas:
cpu: 50
mem: 2kB
state: 64kB
storage: 64kB
upload_speed: 32Kb
download_speed: 32Kb
upload: 1GB
download: 1GB
temp: 32kB

alerts:
ram:
minTime: 'PT5S' # ISO 8601 duration
minThreshold: 10
maxThreshold: 150
cpu:
minTime: 'PT5S' # ISO 8601 duration
minThreshold: 40
maxThreshold: 45
storage:
minTime: 'PT5S' # ISO 8601 duration
minThreshold: 10
maxThreshold: 150
upload:
minTime: 'PT5S' # ISO 8601 duration
minThreshold: 10
maxThreshold: 150
download:
minTime: 'PT5S' # ISO 8601 duration
minThreshold: 10
maxThreshold: 150

permissions:
# functional server
vis:
# functionality name: access mode
Attribute.Body.Vehicle.VIN: "r"
Signal.Doors.* : "rw"
env:
- MY_ENV_VAR1=this env var will be set for the service'
- MY_ENV_VAR2=this_to
layers:
- 'layer_uid'
#

Description

publisher chapter

This chapter describes developer info and completely optional.

ParamTypeMandatoryDescription
authorstring-Author info
companystring-Company info

build chapter

This chapter describes how to assemble service before upload to the cloud.

ParamTypeMandatoryDescription
osstring-Supported OS
archstring-Supported Architecture
sign_pkcs12stringYESPath to certificate which is used to sign service
symlinkscopy | delete | raise-copy - follow and copy symlinks, delete - delete symlinks, raise - stop build and raise error

publish chapter

This chapter describes how upload service to the cloud.

ParamTypeMandatoryDescription
urlstringYESDomain where to upload service
service_uidstringYESService UUID on the AosCloud
tls_pkcs12stringYESCredentials file which will be used to authenticate during upload
versionstringYESUniq version of the service in semver format

configuration chapter

ParamSub-paramTypeMandatoryDescription
statefilenamestring-Path to state file
requiredbool-Copy or not state file
cmdstringYESCommand to start service
instancesminInstancesint-Number of instances to launch
priorityint-Priority of service.
labelsstring[]-Only start on nodes marked with labels
runParametersstartIntervalISO 8601 duration-Number of instances to launch
startBurstint-Priority of service.
restartIntervalISO 8601 duration-Only start on nodes marked with labels
runnerstring (runc | crun | runx | xrun)-Runner that should be used by Aos Core for running service instance
offlineTTLISO 8601 duration-In case of the unit is offline more than TTL time - Service should be deleted
downloadTTLISO 8601 duration-In case of the unit is not able to download service or related layer more than TTL time - Service should be deleted
isResourceLimitsbool-when set as False, the service version has no resource limits and also has no resource reservations for Pre-release versions
workingDirstring-Service working directory
devices{name, mode}[]-Required devices for service. Service will be started where such devices present
namestring-Name of the device (camera0, mic0, audio0, etc)
modestring-Access level for the device (rwm)
resourcesstring[]-Required resources for service
hostnamestring-Hostname which will be assigned to launched service. May be required for network access to the service by hostname
exposedPorts{port-range/protocol}[]-Expose ports in format 8089-8090/tcp or 1515/udp or 9000
allowedConnections{service-uid/port-range/protocol}[]-Allow connect to the services. Example: - 9931560c-be75-4f60-9abf-08297d905332/8087-8088/tcp
requestedResourcescpuint-Reserve CPU in DMIPs for the service
ramstring-Reserve RAM the service. Format: amount with multiplier. Example: 200kb, 30MB
storagestring-Reserve storage the service. Format: amount with multiplier. Example: 200kb, 30MB
statestring-Reserve state the service. Format: amount with multiplier. Example: 200kb, 30MB
quotascpuint-Quota for CPU in DMIPs for the service
memstring-Quota for RAM the service. Format: amount with multiplier. Example: 200kb, 30MB
statestring-Quota for state size for service version. Format: amount with multiplier. Example: 200kb, 30MB
storagestring-Quota for storage size for service version. Format: amount with multiplier. Example: 200kb, 30MB
upload_speedstring-Quota for upload_speed for service version. Format: amount with multiplier. Example: 200kb, 30MB
download_speedstring-Quota for download_speed for service version. Format: amount with multiplier. Example: 200kb, 30MB
uploadstring-Quota for upload amount for service version. Format: amount with multiplier. Example: 200kb, 30MB
downloadstring-Quota for download amount for service version. Format: amount with multiplier. Example: 200kb, 30MB
tempstring-Quota for temp for service version. Format: amount with multiplier. Example: 200kb, 30MB
alertsresource:{ config}-Resources: ram, cpu, storage, upload, download
minTimeISO 8601 duration-Duration of overuse resources to raise alert
minThresholdint-minThreshold of overuse resources to raise alert
maxThresholdint-maxThreshold of overuse resources to raise alert
env{string=string}[]-Sets Env var on the service. Example -LOGGER=my_logger
layersstring[]-List of required layers for the service