Merge branch '18842-arv-mount-disk-config' refs #18842
[arvados.git] / sdk / go / arvados / container.go
index 3d08f2235a0c488c902b6e6d3b0ccce273ea6690..165c8112e8f1ed39cde40e2b6a913072ced0fe32 100644 (file)
@@ -8,31 +8,41 @@ import "time"
 
 // Container is an arvados#container resource.
 type Container struct {
-       UUID                 string                 `json:"uuid"`
-       Etag                 string                 `json:"etag"`
-       CreatedAt            time.Time              `json:"created_at"`
-       ModifiedByClientUUID string                 `json:"modified_by_client_uuid"`
-       ModifiedByUserUUID   string                 `json:"modified_by_user_uuid"`
-       ModifiedAt           time.Time              `json:"modified_at"`
-       Command              []string               `json:"command"`
-       ContainerImage       string                 `json:"container_image"`
-       Cwd                  string                 `json:"cwd"`
-       Environment          map[string]string      `json:"environment"`
-       LockedByUUID         string                 `json:"locked_by_uuid"`
-       Mounts               map[string]Mount       `json:"mounts"`
-       Output               string                 `json:"output"`
-       OutputPath           string                 `json:"output_path"`
-       Priority             int64                  `json:"priority"`
-       RuntimeConstraints   RuntimeConstraints     `json:"runtime_constraints"`
-       State                ContainerState         `json:"state"`
-       SchedulingParameters SchedulingParameters   `json:"scheduling_parameters"`
-       ExitCode             int                    `json:"exit_code"`
-       RuntimeStatus        map[string]interface{} `json:"runtime_status"`
-       StartedAt            *time.Time             `json:"started_at"`  // nil if not yet started
-       FinishedAt           *time.Time             `json:"finished_at"` // nil if not yet finished
+       UUID                      string                 `json:"uuid"`
+       Etag                      string                 `json:"etag"`
+       CreatedAt                 time.Time              `json:"created_at"`
+       ModifiedByClientUUID      string                 `json:"modified_by_client_uuid"`
+       ModifiedByUserUUID        string                 `json:"modified_by_user_uuid"`
+       ModifiedAt                time.Time              `json:"modified_at"`
+       Command                   []string               `json:"command"`
+       ContainerImage            string                 `json:"container_image"`
+       Cwd                       string                 `json:"cwd"`
+       Environment               map[string]string      `json:"environment"`
+       LockedByUUID              string                 `json:"locked_by_uuid"`
+       Mounts                    map[string]Mount       `json:"mounts"`
+       Output                    string                 `json:"output"`
+       OutputPath                string                 `json:"output_path"`
+       Priority                  int64                  `json:"priority"`
+       RuntimeConstraints        RuntimeConstraints     `json:"runtime_constraints"`
+       State                     ContainerState         `json:"state"`
+       SchedulingParameters      SchedulingParameters   `json:"scheduling_parameters"`
+       ExitCode                  int                    `json:"exit_code"`
+       RuntimeStatus             map[string]interface{} `json:"runtime_status"`
+       StartedAt                 *time.Time             `json:"started_at"`  // nil if not yet started
+       FinishedAt                *time.Time             `json:"finished_at"` // nil if not yet finished
+       GatewayAddress            string                 `json:"gateway_address"`
+       InteractiveSessionStarted bool                   `json:"interactive_session_started"`
+       OutputStorageClasses      []string               `json:"output_storage_classes"`
+       RuntimeUserUUID           string                 `json:"runtime_user_uuid"`
+       RuntimeAuthScopes         []string               `json:"runtime_auth_scopes"`
+       RuntimeToken              string                 `json:"runtime_token"`
+       AuthUUID                  string                 `json:"auth_uuid"`
+       Log                       string                 `json:"log"`
+       Cost                      float64                `json:"cost"`
+       SubrequestsCost           float64                `json:"subrequests_cost"`
 }
 
-// Container is an arvados#container resource.
+// ContainerRequest is an arvados#container_request resource.
 type ContainerRequest struct {
        UUID                    string                 `json:"uuid"`
        OwnerUUID               string                 `json:"owner_uuid"`
@@ -41,7 +51,6 @@ type ContainerRequest struct {
        ModifiedByUserUUID      string                 `json:"modified_by_user_uuid"`
        ModifiedAt              time.Time              `json:"modified_at"`
        Href                    string                 `json:"href"`
-       Kind                    string                 `json:"kind"`
        Etag                    string                 `json:"etag"`
        Name                    string                 `json:"name"`
        Description             string                 `json:"description"`
@@ -65,6 +74,12 @@ type ContainerRequest struct {
        LogUUID                 string                 `json:"log_uuid"`
        OutputUUID              string                 `json:"output_uuid"`
        RuntimeToken            string                 `json:"runtime_token"`
+       ExpiresAt               time.Time              `json:"expires_at"`
+       Filters                 []Filter               `json:"filters"`
+       ContainerCount          int                    `json:"container_count"`
+       OutputStorageClasses    []string               `json:"output_storage_classes"`
+       OutputProperties        map[string]interface{} `json:"output_properties"`
+       CumulativeCost          float64                `json:"cumulative_cost"`
 }
 
 // Mount is special behavior to attach to a filesystem path or device.
@@ -83,13 +98,21 @@ type Mount struct {
        GitURL            string      `json:"git_url"`         // only if kind=="git_tree"
 }
 
+type CUDARuntimeConstraints struct {
+       DriverVersion      string `json:"driver_version"`
+       HardwareCapability string `json:"hardware_capability"`
+       DeviceCount        int    `json:"device_count"`
+}
+
 // RuntimeConstraints specify a container's compute resources (RAM,
 // CPU) and network connectivity.
 type RuntimeConstraints struct {
-       API          *bool
-       RAM          int64 `json:"ram"`
-       VCPUs        int   `json:"vcpus"`
-       KeepCacheRAM int64 `json:"keep_cache_ram"`
+       API           bool                   `json:"API"`
+       RAM           int64                  `json:"ram"`
+       VCPUs         int                    `json:"vcpus"`
+       KeepCacheRAM  int64                  `json:"keep_cache_ram"`
+       KeepCacheDisk int64                  `json:"keep_cache_disk"`
+       CUDA          CUDARuntimeConstraints `json:"cuda"`
 }
 
 // SchedulingParameters specify a container's scheduling parameters
@@ -127,7 +150,7 @@ const (
        ContainerStateCancelled = ContainerState("Cancelled")
 )
 
-// ContainerState is a string corresponding to a valid Container state.
+// ContainerRequestState is a string corresponding to a valid Container Request state.
 type ContainerRequestState string
 
 const (