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 Etag string `json:"etag"`
13 CreatedAt time.Time `json:"created_at"`
14 ModifiedByClientUUID string `json:"modified_by_client_uuid"`
15 ModifiedByUserUUID string `json:"modified_by_user_uuid"`
16 ModifiedAt time.Time `json:"modified_at"`
17 Command []string `json:"command"`
18 ContainerImage string `json:"container_image"`
19 Cwd string `json:"cwd"`
20 Environment map[string]string `json:"environment"`
21 LockedByUUID string `json:"locked_by_uuid"`
22 Mounts map[string]Mount `json:"mounts"`
23 Output string `json:"output"`
24 OutputPath string `json:"output_path"`
25 Priority int64 `json:"priority"`
26 RuntimeConstraints RuntimeConstraints `json:"runtime_constraints"`
27 State ContainerState `json:"state"`
28 SchedulingParameters SchedulingParameters `json:"scheduling_parameters"`
29 ExitCode int `json:"exit_code"`
30 RuntimeStatus map[string]interface{} `json:"runtime_status"`
31 StartedAt *time.Time `json:"started_at"` // nil if not yet started
32 FinishedAt *time.Time `json:"finished_at"` // nil if not yet finished
35 // Container is an arvados#container resource.
36 type ContainerRequest struct {
37 UUID string `json:"uuid"`
38 OwnerUUID string `json:"owner_uuid"`
39 CreatedAt time.Time `json:"created_at"`
40 ModifiedByClientUUID string `json:"modified_by_client_uuid"`
41 ModifiedByUserUUID string `json:"modified_by_user_uuid"`
42 ModifiedAt time.Time `json:"modified_at"`
43 Href string `json:"href"`
44 Kind string `json:"kind"`
45 Etag string `json:"etag"`
46 Name string `json:"name"`
47 Description string `json:"description"`
48 Properties map[string]interface{} `json:"properties"`
49 State ContainerRequestState `json:"state"`
50 RequestingContainerUUID string `json:"requesting_container_uuid"`
51 ContainerUUID string `json:"container_uuid"`
52 ContainerCountMax int `json:"container_count_max"`
53 Mounts map[string]Mount `json:"mounts"`
54 RuntimeConstraints RuntimeConstraints `json:"runtime_constraints"`
55 SchedulingParameters SchedulingParameters `json:"scheduling_parameters"`
56 ContainerImage string `json:"container_image"`
57 Environment map[string]string `json:"environment"`
58 Cwd string `json:"cwd"`
59 Command []string `json:"command"`
60 OutputPath string `json:"output_path"`
61 OutputName string `json:"output_name"`
62 OutputTTL int `json:"output_ttl"`
63 Priority int `json:"priority"`
64 UseExisting bool `json:"use_existing"`
65 LogUUID string `json:"log_uuid"`
66 OutputUUID string `json:"output_uuid"`
67 RuntimeToken string `json:"runtime_token"`
70 // Mount is special behavior to attach to a filesystem path or device.
72 Kind string `json:"kind"`
73 Writable bool `json:"writable"`
74 PortableDataHash string `json:"portable_data_hash"`
75 UUID string `json:"uuid"`
76 DeviceType string `json:"device_type"`
77 Path string `json:"path"`
78 Content interface{} `json:"content"`
79 ExcludeFromOutput bool `json:"exclude_from_output"`
80 Capacity int64 `json:"capacity"`
81 Commit string `json:"commit"` // only if kind=="git_tree"
82 RepositoryName string `json:"repository_name"` // only if kind=="git_tree"
83 GitURL string `json:"git_url"` // only if kind=="git_tree"
86 // RuntimeConstraints specify a container's compute resources (RAM,
87 // CPU) and network connectivity.
88 type RuntimeConstraints struct {
90 RAM int64 `json:"ram"`
91 VCPUs int `json:"vcpus"`
92 KeepCacheRAM int64 `json:"keep_cache_ram"`
95 // SchedulingParameters specify a container's scheduling parameters
97 type SchedulingParameters struct {
98 Partitions []string `json:"partitions"`
99 Preemptible bool `json:"preemptible"`
100 MaxRunTime int `json:"max_run_time"`
103 // ContainerList is an arvados#containerList resource.
104 type ContainerList struct {
105 Items []Container `json:"items"`
106 ItemsAvailable int `json:"items_available"`
107 Offset int `json:"offset"`
108 Limit int `json:"limit"`
111 // ContainerRequestList is an arvados#containerRequestList resource.
112 type ContainerRequestList struct {
113 Items []ContainerRequest `json:"items"`
114 ItemsAvailable int `json:"items_available"`
115 Offset int `json:"offset"`
116 Limit int `json:"limit"`
119 // ContainerState is a string corresponding to a valid Container state.
120 type ContainerState string
123 ContainerStateQueued = ContainerState("Queued")
124 ContainerStateLocked = ContainerState("Locked")
125 ContainerStateRunning = ContainerState("Running")
126 ContainerStateComplete = ContainerState("Complete")
127 ContainerStateCancelled = ContainerState("Cancelled")
130 // ContainerState is a string corresponding to a valid Container state.
131 type ContainerRequestState string
134 ContainerRequestStateUncomitted = ContainerRequestState("Uncommitted")
135 ContainerRequestStateCommitted = ContainerRequestState("Committed")
136 ContainerRequestStateFinal = ContainerRequestState("Final")