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