attribute :runtime_status, :jsonbHash, default: {}
attribute :runtime_auth_scopes, :jsonbArray, default: []
attribute :output_storage_classes, :jsonbArray, default: lambda { Rails.configuration.DefaultStorageClasses }
+ attribute :output_properties, :jsonbHash, default: {}
serialize :environment, Hash
serialize :mounts, Hash
t.add :gateway_address
t.add :interactive_session_started
t.add :output_storage_classes
+ t.add :output_properties
end
# Supported states for a container
:runtime_constraints, :scheduling_parameters,
:secret_mounts, :runtime_token,
:runtime_user_uuid, :runtime_auth_scopes,
- :output_storage_classes)
+ :output_storage_classes, :output_properties)
end
case self.state
permitted.push :priority
when Running
- permitted.push :priority, *progress_attrs
+ permitted.push :priority, :output_properties, *progress_attrs
if self.state_changed?
permitted.push :started_at, :gateway_address
end
attribute :properties, :jsonbHash, default: {}
attribute :secret_mounts, :jsonbHash, default: {}
attribute :output_storage_classes, :jsonbArray, default: lambda { Rails.configuration.DefaultStorageClasses }
+ attribute :output_properties, :jsonbHash, default: {}
serialize :environment, Hash
serialize :mounts, Hash
t.add :state
t.add :use_existing
t.add :output_storage_classes
+ t.add :output_properties
end
# Supported states for a container request
:output_path, :priority, :runtime_token,
:runtime_constraints, :state, :container_uuid, :use_existing,
:scheduling_parameters, :secret_mounts, :output_name, :output_ttl,
- :output_storage_classes]
+ :output_storage_classes, :output_properties]
def self.any_preemptible_instances?
Rails.configuration.InstanceTypes.any? do |k, v|
owner_uuid: self.owner_uuid,
name: coll_name,
manifest_text: "",
- storage_classes_desired: self.output_storage_classes,
- properties: {
- 'type' => out_type,
- 'container_request' => uuid,
- })
+ storage_classes_desired: self.output_storage_classes)
end
if out_type == "log"
manifest = dst.manifest_text
end
+ merged_properties = {}
+ if out_type == "output"
+ merged_properties.update(container.output_properties)
+ merged_properties.update(self.output_properties)
+ end
+
+ merged_properties['type'] = out_type
+ merged_properties['container_request'] = uuid
+
coll.assign_attributes(
portable_data_hash: Digest::MD5.hexdigest(manifest) + '+' + manifest.bytesize.to_s,
manifest_text: manifest,
trash_at: trash_at,
- delete_at: trash_at)
+ delete_at: trash_at,
+ properties: merged_properties)
coll.save_with_unique_name!
self.send(out_type + '_uuid=', coll.uuid)
end