-
Notifications
You must be signed in to change notification settings - Fork 16
Volume managment
This document describes the definition of volumes within the Deploy exe-script command.
Up until now, the root file system was built using overlay-fs with the lowerdir being the .gvmi image (or rather the squashfs image contained within) and the upperdir and workdir set to a 128MiB tmpfs.
By passing a volumes field within the deployment command, the following can be achieved:
- Adding new volumes for transferring files between requestor and the VM (equivalent of
VOLUMEin Dockerfile). - Having
upperdirandworkdirof/in either a larger tmpfs or on disk-backed storage. - Mounting tmpfs or disk-backed storage at arbitrary paths.
Two schemas are permitted. First, an explicit form mapping mount points (relative to root) to volume definitions (see below):
{
deploy: {
volumes: {
"/golem/input": { host: {} },
"/golem/output": { host: {} }
"/": { ram: { size: "1g" }
}
}
}As well as a simplified form if only { host: {} } volumes (equivalent to VOLUME in Dockerfile) are desired.
{
deploy: {
volumes: ["/golem/input", "/golem/output"]
}
}In this case, the equivalent long-form would be:
{
deploy: {
volumes: {
"/golem/input": { host: {} },
"/golem/output": { host: {} }
}
}
}This is used for creating a mount point for transfering files between requestor and provider. This variant is not permitted for the root directory.
| Name | Type | Description | Notes |
|---|---|---|---|
| size | String | size formatting below | [required] |
| Name | Type | Description | Notes |
|---|---|---|---|
| size | String | size formatting below | [required] |
| preallocate | String | size formatting below | [optional] [default to 0] |
| errors | String | possible values continue, remount-ro, panic
|
[optional] [default to continue] |
Size is formatted as a floating-point number suffixed by the unit, supporting both SI units (powers of 10) and binary units (powers of 2). The units are not case-sensitive and whitespace is permitted between the number and the unit.
Powers of 10
| Long | Short | Value |
|---|---|---|
| b | [n/a] | 10^0 = 1 |
| kb | k | 10^3 = 1000 |
| mb | m | 10^6 = 1000^2 |
| gb | g | 10^9 = 1000^3 |
| tb | t | 10^12 = 1000^4 |
| pb | p | 10^15 = 1000^5 |
Powers of 2
| Long | Short | Value |
|---|---|---|
| b | [n/a] | 2^0 = 1 |
| kib | ki | 2^10 = 1024 |
| mib | mi | 2^20 = 1024^2 |
| gib | gi | 2^30 = 1024^3 |
| tib | ti | 2^40 = 1024^4 |
| pib | pi | 2^50 = 1024^5 |
- Root file system that can grow upto 1 gigabyte. no preallocation. container will panic if error occurs.
{
deploy: {
volumes: {
"/": { storage: { size: "1g", errors: "panic" }
}
}
}- Root fs, with prealoocated 10GB storage.
{
deploy: {
volumes: {
"/": { storage: { size: "10g", preallocate: "10g" }
}
}
}- Root fs with in memory overflow size 1g
{
deploy: {
volumes: {
"/": { tmpfs: { size: "1g" }
}
}
}- Disable image volume definition for
/golem/input
{
deploy: {
volumes: {
"/golem/input": null
}
}
}