Documentation
¶
Index ¶
- type Config
- type Definition
- type Driver
- func (d *Driver) Allocate(definition string, metadata map[string]interface{}) (string, string, error)
- func (d *Driver) Deallocate(hwaddr string) error
- func (d *Driver) Name() string
- func (d *Driver) Prepare(config []byte) error
- func (d *Driver) Snapshot(hwaddr string, full bool) (string, error)
- func (d *Driver) Status(hwaddr string) string
- func (d *Driver) ValidateDefinition(definition string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
DockerPath string `json:"docker_path"` // '/Applications/Docker.app/Contents/Resources/bin/docker'
ImagesPath string `json:"images_path"` // Where to look/store docker file images
WorkspacePath string `json:"workspace_path"` // Where to place the disks
DownloadUser string `json:"download_user"` // The user will be used in download operations
DownloadPassword string `json:"download_password"` // The password will be used in download operations
}
type Definition ¶
type Definition struct {
Image string `json:"image"` // Image name to use
Images map[string]string `json:"images"` // List of image dependencies
Requirements drivers.Requirements `json:"requirements"` // Required resources to allocate
}
*
- Definition example:
- image: ubuntu2004-python3-ci
- images:
- ubuntu2004: https://artifact-storage/aquarium/image/docker/ubuntu2004/ubuntu2004-VERSION.tar.xz
- ubuntu2004-python3: https://artifact-storage/aquarium/image/docker/ubuntu2004-python3/ubuntu2004-python3-VERSION.tar.xz
- ubuntu2004-python3-ci: https://artifact-storage/aquarium/image/docker/ubuntu2004-python3-ci/ubuntu2004-python3-ci-VERSION.tar.xz
- requirements:
- cpu: 14
- ram: 14
- disks:
- python3_workspace:
- label: workspace
- type: dir
- size: 100
- reuse: true
- network: ""
- metadata:
- JENKINS_AGENT_WORKDIR: /mnt/workspace
func (*Definition) Apply ¶
func (d *Definition) Apply(definition string) error
func (*Definition) Validate ¶
func (d *Definition) Validate() error
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
Implements drivers.ResourceDriver interface
func (*Driver) Allocate ¶
func (d *Driver) Allocate(definition string, metadata map[string]interface{}) (string, string, error)
*
- Allocate container out of the images *
- It automatically download the required images, unpack them and runs the container.
- Using metadata to create env file and pass it to the container.
func (*Driver) Deallocate ¶
func (*Driver) ValidateDefinition ¶
Click to show internal directories.
Click to hide internal directories.