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.
Param | Type | Mandatory | Description |
---|---|---|---|
author | string | - | Author info |
company | string | - | Company info |
build chapter
This chapter describes how to assemble service before upload to the cloud.
Param | Type | Mandatory | Description |
---|---|---|---|
os | string | - | Supported OS |
arch | string | - | Supported Architecture |
sign_pkcs12 | string | YES | Path to certificate which is used to sign service |
symlinks | copy | 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.
Param | Type | Mandatory | Description |
---|---|---|---|
url | string | YES | Domain where to upload service |
service_uid | string | YES | Service UUID on the AosCloud |
tls_pkcs12 | string | YES | Credentials file which will be used to authenticate during upload |
version | string | YES | Uniq version of the service in semver format |
configuration chapter
Param | Sub-param | Type | Mandatory | Description |
---|---|---|---|---|
state | filename | string | - | Path to state file |
required | bool | - | Copy or not state file | |
cmd | string | YES | Command to start service | |
instances | minInstances | int | - | Number of instances to launch |
priority | int | - | Priority of service. | |
labels | string[] | - | Only start on nodes marked with labels | |
runParameters | startInterval | ISO 8601 duration | - | Number of instances to launch |
startBurst | int | - | Priority of service. | |
restartInterval | ISO 8601 duration | - | Only start on nodes marked with labels | |
runner | string (runc | crun | runx | xrun) | - | Runner that should be used by Aos Core for running service instance | |
offlineTTL | ISO 8601 duration | - | In case of the unit is offline more than TTL time - Service should be deleted | |
downloadTTL | 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 | bool | - | when set as False, the service version has no resource limits and also has no resource reservations for Pre-release versions | |
workingDir | string | - | Service working directory | |
devices | {name, mode}[] | - | Required devices for service. Service will be started where such devices present | |
name | string | - | Name of the device (camera0, mic0, audio0, etc) | |
mode | string | - | Access level for the device (rwm) | |
resources | string[] | - | Required resources for service | |
hostname | string | - | 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 | |
requestedResources | cpu | int | - | Reserve CPU in DMIPs for the service |
ram | string | - | Reserve RAM the service. Format: amount with multiplier. Example: 200kb, 30MB | |
storage | string | - | Reserve storage the service. Format: amount with multiplier. Example: 200kb, 30MB | |
state | string | - | Reserve state the service. Format: amount with multiplier. Example: 200kb, 30MB | |
quotas | cpu | int | - | Quota for CPU in DMIPs for the service |
mem | string | - | Quota for RAM the service. Format: amount with multiplier. Example: 200kb, 30MB | |
state | string | - | Quota for state size for service version. Format: amount with multiplier. Example: 200kb, 30MB | |
storage | string | - | Quota for storage size for service version. Format: amount with multiplier. Example: 200kb, 30MB | |
upload_speed | string | - | Quota for upload_speed for service version. Format: amount with multiplier. Example: 200kb, 30MB | |
download_speed | string | - | Quota for download_speed for service version. Format: amount with multiplier. Example: 200kb, 30MB | |
upload | string | - | Quota for upload amount for service version. Format: amount with multiplier. Example: 200kb, 30MB | |
download | string | - | Quota for download amount for service version. Format: amount with multiplier. Example: 200kb, 30MB | |
temp | string | - | Quota for temp for service version. Format: amount with multiplier. Example: 200kb, 30MB | |
alerts | resource:{ config} | - | Resources: ram, cpu, storage, upload, download | |
minTime | ISO 8601 duration | - | Duration of overuse resources to raise alert | |
minThreshold | int | - | minThreshold of overuse resources to raise alert | |
maxThreshold | int | - | maxThreshold of overuse resources to raise alert | |
env | {string=string}[] | - | Sets Env var on the service. Example -LOGGER=my_logger | |
layers | string[] | - | List of required layers for the service |