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 LockCount int `json:"lock_count"`
23 Mounts map[string]Mount `json:"mounts"`
24 Output string `json:"output"`
25 OutputPath string `json:"output_path"`
26 OutputGlob []string `json:"output_glob"`
27 Priority int64 `json:"priority"`
28 RuntimeConstraints RuntimeConstraints `json:"runtime_constraints"`
29 State ContainerState `json:"state"`
30 SchedulingParameters SchedulingParameters `json:"scheduling_parameters"`
31 ExitCode int `json:"exit_code"`
32 RuntimeStatus map[string]interface{} `json:"runtime_status"`
33 StartedAt *time.Time `json:"started_at"` // nil if not yet started
34 FinishedAt *time.Time `json:"finished_at"` // nil if not yet finished
35 GatewayAddress string `json:"gateway_address"`
36 InteractiveSessionStarted bool `json:"interactive_session_started"`
37 OutputStorageClasses []string `json:"output_storage_classes"`
38 RuntimeUserUUID string `json:"runtime_user_uuid"`
39 RuntimeAuthScopes []string `json:"runtime_auth_scopes"`
40 RuntimeToken string `json:"runtime_token"`
41 AuthUUID string `json:"auth_uuid"`
42 Log string `json:"log"`
43 Cost float64 `json:"cost"`
44 SubrequestsCost float64 `json:"subrequests_cost"`
47 // ContainerRequest is an arvados#container_request resource.
48 type ContainerRequest struct {
49 UUID string `json:"uuid"`
50 OwnerUUID string `json:"owner_uuid"`
51 CreatedAt time.Time `json:"created_at"`
52 ModifiedByClientUUID string `json:"modified_by_client_uuid"`
53 ModifiedByUserUUID string `json:"modified_by_user_uuid"`
54 ModifiedAt time.Time `json:"modified_at"`
55 Href string `json:"href"`
56 Etag string `json:"etag"`
57 Name string `json:"name"`
58 Description string `json:"description"`
59 Properties map[string]interface{} `json:"properties"`
60 State ContainerRequestState `json:"state"`
61 RequestingContainerUUID string `json:"requesting_container_uuid"`
62 ContainerUUID string `json:"container_uuid"`
63 ContainerCountMax int `json:"container_count_max"`
64 Mounts map[string]Mount `json:"mounts"`
65 RuntimeConstraints RuntimeConstraints `json:"runtime_constraints"`
66 SchedulingParameters SchedulingParameters `json:"scheduling_parameters"`
67 ContainerImage string `json:"container_image"`
68 Environment map[string]string `json:"environment"`
69 Cwd string `json:"cwd"`
70 Command []string `json:"command"`
71 OutputPath string `json:"output_path"`
72 OutputGlob []string `json:"output_glob"`
73 OutputName string `json:"output_name"`
74 OutputTTL int `json:"output_ttl"`
75 Priority int `json:"priority"`
76 UseExisting bool `json:"use_existing"`
77 LogUUID string `json:"log_uuid"`
78 OutputUUID string `json:"output_uuid"`
79 RuntimeToken string `json:"runtime_token"`
80 ExpiresAt time.Time `json:"expires_at"`
81 Filters []Filter `json:"filters"`
82 ContainerCount int `json:"container_count"`
83 OutputStorageClasses []string `json:"output_storage_classes"`
84 OutputProperties map[string]interface{} `json:"output_properties"`
85 CumulativeCost float64 `json:"cumulative_cost"`
88 // Mount is special behavior to attach to a filesystem path or device.
90 Kind string `json:"kind"`
91 Writable bool `json:"writable"`
92 PortableDataHash string `json:"portable_data_hash"`
93 UUID string `json:"uuid"`
94 DeviceType string `json:"device_type"`
95 Path string `json:"path"`
96 Content interface{} `json:"content"`
97 ExcludeFromOutput bool `json:"exclude_from_output"`
98 Capacity int64 `json:"capacity"`
101 type CUDARuntimeConstraints struct {
102 DriverVersion string `json:"driver_version"`
103 HardwareCapability string `json:"hardware_capability"`
104 DeviceCount int `json:"device_count"`
107 // RuntimeConstraints specify a container's compute resources (RAM,
108 // CPU) and network connectivity.
109 type RuntimeConstraints struct {
110 API bool `json:"API"`
111 RAM int64 `json:"ram"`
112 VCPUs int `json:"vcpus"`
113 KeepCacheRAM int64 `json:"keep_cache_ram"`
114 KeepCacheDisk int64 `json:"keep_cache_disk"`
115 CUDA CUDARuntimeConstraints `json:"cuda"`
118 // SchedulingParameters specify a container's scheduling parameters
119 // such as Partitions
120 type SchedulingParameters struct {
121 Partitions []string `json:"partitions"`
122 Preemptible bool `json:"preemptible"`
123 MaxRunTime int `json:"max_run_time"`
124 Supervisor bool `json:"supervisor"`
127 // ContainerList is an arvados#containerList resource.
128 type ContainerList struct {
129 Items []Container `json:"items"`
130 ItemsAvailable int `json:"items_available"`
131 Offset int `json:"offset"`
132 Limit int `json:"limit"`
135 // ContainerRequestList is an arvados#containerRequestList resource.
136 type ContainerRequestList struct {
137 Items []ContainerRequest `json:"items"`
138 ItemsAvailable int `json:"items_available"`
139 Offset int `json:"offset"`
140 Limit int `json:"limit"`
143 // ContainerState is a string corresponding to a valid Container state.
144 type ContainerState string
147 ContainerStateQueued = ContainerState("Queued")
148 ContainerStateLocked = ContainerState("Locked")
149 ContainerStateRunning = ContainerState("Running")
150 ContainerStateComplete = ContainerState("Complete")
151 ContainerStateCancelled = ContainerState("Cancelled")
154 // ContainerRequestState is a string corresponding to a valid Container Request state.
155 type ContainerRequestState string
158 ContainerRequestStateUncomitted = ContainerRequestState("Uncommitted")
159 ContainerRequestStateCommitted = ContainerRequestState("Committed")
160 ContainerRequestStateFinal = ContainerRequestState("Final")
163 type ContainerStatus struct {
164 UUID string `json:"uuid"`
165 State ContainerState `json:"container_state"`
166 SchedulingStatus string `json:"scheduling_status"`