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
33 GatewayAddress string `json:"gateway_address"`
34 InteractiveSessionStarted bool `json:"interactive_session_started"`
35 OutputStorageClasses []string `json:"output_storage_classes"`
36 RuntimeUserUUID string `json:"runtime_user_uuid"`
37 RuntimeAuthScopes []string `json:"runtime_auth_scopes"`
38 RuntimeToken string `json:"runtime_token"`
39 AuthUUID string `json:"auth_uuid"`
40 Log string `json:"log"`
43 // ContainerRequest is an arvados#container_request resource.
44 type ContainerRequest struct {
45 UUID string `json:"uuid"`
46 OwnerUUID string `json:"owner_uuid"`
47 CreatedAt time.Time `json:"created_at"`
48 ModifiedByClientUUID string `json:"modified_by_client_uuid"`
49 ModifiedByUserUUID string `json:"modified_by_user_uuid"`
50 ModifiedAt time.Time `json:"modified_at"`
51 Href string `json:"href"`
52 Etag string `json:"etag"`
53 Name string `json:"name"`
54 Description string `json:"description"`
55 Properties map[string]interface{} `json:"properties"`
56 State ContainerRequestState `json:"state"`
57 RequestingContainerUUID string `json:"requesting_container_uuid"`
58 ContainerUUID string `json:"container_uuid"`
59 ContainerCountMax int `json:"container_count_max"`
60 Mounts map[string]Mount `json:"mounts"`
61 RuntimeConstraints RuntimeConstraints `json:"runtime_constraints"`
62 SchedulingParameters SchedulingParameters `json:"scheduling_parameters"`
63 ContainerImage string `json:"container_image"`
64 Environment map[string]string `json:"environment"`
65 Cwd string `json:"cwd"`
66 Command []string `json:"command"`
67 OutputPath string `json:"output_path"`
68 OutputName string `json:"output_name"`
69 OutputTTL int `json:"output_ttl"`
70 Priority int `json:"priority"`
71 UseExisting bool `json:"use_existing"`
72 LogUUID string `json:"log_uuid"`
73 OutputUUID string `json:"output_uuid"`
74 RuntimeToken string `json:"runtime_token"`
75 ExpiresAt time.Time `json:"expires_at"`
76 Filters []Filter `json:"filters"`
77 ContainerCount int `json:"container_count"`
78 OutputStorageClasses []string `json:"output_storage_classes"`
79 OutputProperties map[string]interface{} `json:"output_properties"`
82 // Mount is special behavior to attach to a filesystem path or device.
84 Kind string `json:"kind"`
85 Writable bool `json:"writable"`
86 PortableDataHash string `json:"portable_data_hash"`
87 UUID string `json:"uuid"`
88 DeviceType string `json:"device_type"`
89 Path string `json:"path"`
90 Content interface{} `json:"content"`
91 ExcludeFromOutput bool `json:"exclude_from_output"`
92 Capacity int64 `json:"capacity"`
93 Commit string `json:"commit"` // only if kind=="git_tree"
94 RepositoryName string `json:"repository_name"` // only if kind=="git_tree"
95 GitURL string `json:"git_url"` // only if kind=="git_tree"
98 type CUDARuntimeConstraints struct {
99 DriverVersion string `json:"driver_version"`
100 HardwareCapability string `json:"hardware_capability"`
101 DeviceCount int `json:"device_count"`
104 // RuntimeConstraints specify a container's compute resources (RAM,
105 // CPU) and network connectivity.
106 type RuntimeConstraints struct {
107 API bool `json:"API"`
108 RAM int64 `json:"ram"`
109 VCPUs int `json:"vcpus"`
110 KeepCacheRAM int64 `json:"keep_cache_ram"`
111 CUDA CUDARuntimeConstraints `json:"cuda"`
114 // SchedulingParameters specify a container's scheduling parameters
115 // such as Partitions
116 type SchedulingParameters struct {
117 Partitions []string `json:"partitions"`
118 Preemptible bool `json:"preemptible"`
119 MaxRunTime int `json:"max_run_time"`
122 // ContainerList is an arvados#containerList resource.
123 type ContainerList struct {
124 Items []Container `json:"items"`
125 ItemsAvailable int `json:"items_available"`
126 Offset int `json:"offset"`
127 Limit int `json:"limit"`
130 // ContainerRequestList is an arvados#containerRequestList resource.
131 type ContainerRequestList struct {
132 Items []ContainerRequest `json:"items"`
133 ItemsAvailable int `json:"items_available"`
134 Offset int `json:"offset"`
135 Limit int `json:"limit"`
138 // ContainerState is a string corresponding to a valid Container state.
139 type ContainerState string
142 ContainerStateQueued = ContainerState("Queued")
143 ContainerStateLocked = ContainerState("Locked")
144 ContainerStateRunning = ContainerState("Running")
145 ContainerStateComplete = ContainerState("Complete")
146 ContainerStateCancelled = ContainerState("Cancelled")
149 // ContainerRequestState is a string corresponding to a valid Container Request state.
150 type ContainerRequestState string
153 ContainerRequestStateUncomitted = ContainerRequestState("Uncommitted")
154 ContainerRequestStateCommitted = ContainerRequestState("Committed")
155 ContainerRequestStateFinal = ContainerRequestState("Final")