serialize :command, Array
serialize :scheduling_parameters, Hash
serialize :command, Array
serialize :scheduling_parameters, Hash
before_validation :fill_field_defaults, :if => :new_record?
before_validation :set_timestamps
before_validation :check_lock
before_validation :fill_field_defaults, :if => :new_record?
before_validation :set_timestamps
before_validation :check_lock
- super - ["secret_mounts", "secret_mounts_md5", "runtime_token"]
+ super - ["secret_mounts", "secret_mounts_md5", "runtime_token", "gateway_address"]
act_as_system_user do
# Update the priority of child container requests to match new
# priority of the parent container (ignoring requests with no
act_as_system_user do
# Update the priority of child container requests to match new
# priority of the parent container (ignoring requests with no
- defaults = {
- 'keep_cache_ram' =>
- Rails.configuration.Containers.DefaultKeepCacheRAM,
- }
- defaults.merge(runtime_constraints).each do |k, v|
+ runtime_constraints.each do |k, v|
- permitted.push :started_at
+ permitted.push :started_at, :gateway_address
+ end
+ if !self.interactive_session_started_was
+ permitted.push :interactive_session_started
# If self.final?, this update is superfluous: the final log/output
# update will be done when handle_completed calls finalize! on
# each requesting CR.
# If self.final?, this update is superfluous: the final log/output
# update will be done when handle_completed calls finalize! on
# each requesting CR.
leave_modified_by_user_alone do
ContainerRequest.where(container_uuid: self.uuid).each do |cr|
cr.update_collections(container: self, collections: ['log'])
leave_modified_by_user_alone do
ContainerRequest.where(container_uuid: self.uuid).each do |cr|
cr.update_collections(container: self, collections: ['log'])
def handle_completed
# This container is finished so finalize any associated container requests
# that are associated with this container.
def handle_completed
# This container is finished so finalize any associated container requests
# that are associated with this container.
# These get wiped out by with_lock (which reloads the record),
# so record them now in case we need to schedule a retry.
# These get wiped out by with_lock (which reloads the record),
# so record them now in case we need to schedule a retry.
# Need to take a lock on the container to ensure that any
# concurrent container requests that might try to reuse this
# Need to take a lock on the container to ensure that any
# concurrent container requests that might try to reuse this