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