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"`
37 // ContainerRequest is an arvados#container_request resource.
38 type ContainerRequest struct {
39 UUID string `json:"uuid"`
40 OwnerUUID string `json:"owner_uuid"`
41 CreatedAt time.Time `json:"created_at"`
42 ModifiedByClientUUID string `json:"modified_by_client_uuid"`
43 ModifiedByUserUUID string `json:"modified_by_user_uuid"`
44 ModifiedAt time.Time `json:"modified_at"`
45 Href string `json:"href"`
46 Etag string `json:"etag"`
47 Name string `json:"name"`
48 Description string `json:"description"`
49 Properties map[string]interface{} `json:"properties"`
50 State ContainerRequestState `json:"state"`
51 RequestingContainerUUID string `json:"requesting_container_uuid"`
52 ContainerUUID string `json:"container_uuid"`
53 ContainerCountMax int `json:"container_count_max"`
54 Mounts map[string]Mount `json:"mounts"`
55 RuntimeConstraints RuntimeConstraints `json:"runtime_constraints"`
56 SchedulingParameters SchedulingParameters `json:"scheduling_parameters"`
57 ContainerImage string `json:"container_image"`
58 Environment map[string]string `json:"environment"`
59 Cwd string `json:"cwd"`
60 Command []string `json:"command"`
61 OutputPath string `json:"output_path"`
62 OutputName string `json:"output_name"`
63 OutputTTL int `json:"output_ttl"`
64 Priority int `json:"priority"`
65 UseExisting bool `json:"use_existing"`
66 LogUUID string `json:"log_uuid"`
67 OutputUUID string `json:"output_uuid"`
68 RuntimeToken string `json:"runtime_token"`
69 ExpiresAt time.Time `json:"expires_at"`
70 Filters []Filter `json:"filters"`
71 ContainerCount int `json:"container_count"`
74 // Mount is special behavior to attach to a filesystem path or device.
76 Kind string `json:"kind"`
77 Writable bool `json:"writable"`
78 PortableDataHash string `json:"portable_data_hash"`
79 UUID string `json:"uuid"`
80 DeviceType string `json:"device_type"`
81 Path string `json:"path"`
82 Content interface{} `json:"content"`
83 ExcludeFromOutput bool `json:"exclude_from_output"`
84 Capacity int64 `json:"capacity"`
85 Commit string `json:"commit"` // only if kind=="git_tree"
86 RepositoryName string `json:"repository_name"` // only if kind=="git_tree"
87 GitURL string `json:"git_url"` // only if kind=="git_tree"
90 // RuntimeConstraints specify a container's compute resources (RAM,
91 // CPU) and network connectivity.
92 type RuntimeConstraints struct {
94 RAM int64 `json:"ram"`
95 VCPUs int `json:"vcpus"`
96 KeepCacheRAM int64 `json:"keep_cache_ram"`
99 // SchedulingParameters specify a container's scheduling parameters
100 // such as Partitions
101 type SchedulingParameters struct {
102 Partitions []string `json:"partitions"`
103 Preemptible bool `json:"preemptible"`
104 MaxRunTime int `json:"max_run_time"`
107 // ContainerList is an arvados#containerList resource.
108 type ContainerList struct {
109 Items []Container `json:"items"`
110 ItemsAvailable int `json:"items_available"`
111 Offset int `json:"offset"`
112 Limit int `json:"limit"`
115 // ContainerRequestList is an arvados#containerRequestList resource.
116 type ContainerRequestList struct {
117 Items []ContainerRequest `json:"items"`
118 ItemsAvailable int `json:"items_available"`
119 Offset int `json:"offset"`
120 Limit int `json:"limit"`
123 // ContainerState is a string corresponding to a valid Container state.
124 type ContainerState string
127 ContainerStateQueued = ContainerState("Queued")
128 ContainerStateLocked = ContainerState("Locked")
129 ContainerStateRunning = ContainerState("Running")
130 ContainerStateComplete = ContainerState("Complete")
131 ContainerStateCancelled = ContainerState("Cancelled")
134 // ContainerRequestState is a string corresponding to a valid Container Request state.
135 type ContainerRequestState string
138 ContainerRequestStateUncomitted = ContainerRequestState("Uncommitted")
139 ContainerRequestStateCommitted = ContainerRequestState("Committed")
140 ContainerRequestStateFinal = ContainerRequestState("Final")