Merge branch 'crunch-job_finds_newer_docker_hashes' of https://github.com/tmooney...
[arvados.git] / sdk / go / arvados / container.go
1 package arvados
2
3 // Container is an arvados#container resource.
4 type Container struct {
5         UUID               string             `json:"uuid"`
6         Command            []string           `json:"command"`
7         ContainerImage     string             `json:"container_image"`
8         Cwd                string             `json:"cwd"`
9         Environment        map[string]string  `json:"environment"`
10         LockedByUUID       string             `json:"locked_by_uuid"`
11         Mounts             map[string]Mount   `json:"mounts"`
12         Output             string             `json:"output"`
13         OutputPath         string             `json:"output_path"`
14         Priority           int                `json:"priority"`
15         RuntimeConstraints RuntimeConstraints `json:"runtime_constraints"`
16         State              ContainerState     `json:"state"`
17 }
18
19 // Mount is special behavior to attach to a filesystem path or device.
20 type Mount struct {
21         Kind             string      `json:"kind"`
22         Writable         bool        `json:"writable"`
23         PortableDataHash string      `json:"portable_data_hash"`
24         UUID             string      `json:"uuid"`
25         DeviceType       string      `json:"device_type"`
26         Path             string      `json:"path"`
27         Content          interface{} `json:"content"`
28 }
29
30 // RuntimeConstraints specify a container's compute resources (RAM,
31 // CPU) and network connectivity.
32 type RuntimeConstraints struct {
33         API       *bool
34         RAM       int      `json:"ram"`
35         VCPUs     int      `json:"vcpus"`
36         Partition []string `json:"partition"`
37 }
38
39 // ContainerList is an arvados#containerList resource.
40 type ContainerList struct {
41         Items          []Container `json:"items"`
42         ItemsAvailable int         `json:"items_available"`
43         Offset         int         `json:"offset"`
44         Limit          int         `json:"limit"`
45 }
46
47 // ContainerState is a string corresponding to a valid Container state.
48 type ContainerState string
49
50 const (
51         ContainerStateQueued    = ContainerState("Queued")
52         ContainerStateLocked    = ContainerState("Locked")
53         ContainerStateRunning   = ContainerState("Running")
54         ContainerStateComplete  = ContainerState("Complete")
55         ContainerStateCancelled = ContainerState("Cancelled")
56 )