1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: Apache-2.0
9 // Container is an arvados#container resource.
10 type Container struct {
11 UUID string `json:"uuid"`
12 CreatedAt time.Time `json:"created_at"`
13 Command []string `json:"command"`
14 ContainerImage string `json:"container_image"`
15 Cwd string `json:"cwd"`
16 Environment map[string]string `json:"environment"`
17 LockedByUUID string `json:"locked_by_uuid"`
18 Mounts map[string]Mount `json:"mounts"`
19 Output string `json:"output"`
20 OutputPath string `json:"output_path"`
21 Priority int `json:"priority"`
22 RuntimeConstraints RuntimeConstraints `json:"runtime_constraints"`
23 StartedAt time.Time `json:"started_at"`
24 State ContainerState `json:"state"`
25 SchedulingParameters SchedulingParameters `json:"scheduling_parameters"`
28 // Mount is special behavior to attach to a filesystem path or device.
30 Kind string `json:"kind"`
31 Writable bool `json:"writable"`
32 PortableDataHash string `json:"portable_data_hash"`
33 UUID string `json:"uuid"`
34 DeviceType string `json:"device_type"`
35 Path string `json:"path"`
36 Content interface{} `json:"content"`
37 ExcludeFromOutput bool `json:"exclude_from_output"`
38 Capacity int64 `json:"capacity"`
39 Commit string `json:"commit"` // only if kind=="git_tree"
40 RepositoryName string `json:"repository_name"` // only if kind=="git_tree"
41 GitURL string `json:"git_url"` // only if kind=="git_tree"
44 // RuntimeConstraints specify a container's compute resources (RAM,
45 // CPU) and network connectivity.
46 type RuntimeConstraints struct {
48 RAM int64 `json:"ram"`
49 VCPUs int `json:"vcpus"`
50 KeepCacheRAM int64 `json:"keep_cache_ram"`
53 // SchedulingParameters specify a container's scheduling parameters
55 type SchedulingParameters struct {
56 Partitions []string `json:"partitions"`
57 Preemptible bool `json:"preemptible"`
58 MaxRunTime int `json:"max_run_time"`
61 // ContainerList is an arvados#containerList resource.
62 type ContainerList struct {
63 Items []Container `json:"items"`
64 ItemsAvailable int `json:"items_available"`
65 Offset int `json:"offset"`
66 Limit int `json:"limit"`
69 // ContainerState is a string corresponding to a valid Container state.
70 type ContainerState string
73 ContainerStateQueued = ContainerState("Queued")
74 ContainerStateLocked = ContainerState("Locked")
75 ContainerStateRunning = ContainerState("Running")
76 ContainerStateComplete = ContainerState("Complete")
77 ContainerStateCancelled = ContainerState("Cancelled")