uncomment some logging, and recreate folder for local workspace path in the docker client.
This commit is contained in:
@ -98,7 +98,7 @@ class DockerClient
|
|||||||
container = Docker::Container.create(container_creation_options(execution_environment))
|
container = Docker::Container.create(container_creation_options(execution_environment))
|
||||||
local_workspace_path = generate_local_workspace_path
|
local_workspace_path = generate_local_workspace_path
|
||||||
# container.start always creates the passed local_workspace_path on disk. Seems like we have to live with that, therefore we can also just create the empty folder ourselves.
|
# container.start always creates the passed local_workspace_path on disk. Seems like we have to live with that, therefore we can also just create the empty folder ourselves.
|
||||||
# FileUtils.mkdir(local_workspace_path)
|
FileUtils.mkdir(local_workspace_path)
|
||||||
container.start(container_start_options(execution_environment, local_workspace_path))
|
container.start(container_start_options(execution_environment, local_workspace_path))
|
||||||
container.start_time = Time.now
|
container.start_time = Time.now
|
||||||
container.status = :created
|
container.status = :created
|
||||||
|
@ -41,7 +41,7 @@ class DockerContainerPool
|
|||||||
@all_containers[execution_environment.id]+=[container]
|
@all_containers[execution_environment.id]+=[container]
|
||||||
if(!@containers[execution_environment.id].include?(container))
|
if(!@containers[execution_environment.id].include?(container))
|
||||||
@containers[execution_environment.id]+=[container]
|
@containers[execution_environment.id]+=[container]
|
||||||
Rails.logger.debug('Added container ' + container.to_s + ' to all_pool for execution environment ' + execution_environment.to_s + '. Containers in all_pool: ' + @all_containers[execution_environment.id].size.to_s)
|
#Rails.logger.debug('Added container ' + container.to_s + ' to all_pool for execution environment ' + execution_environment.to_s + '. Containers in all_pool: ' + @all_containers[execution_environment.id].size.to_s)
|
||||||
else
|
else
|
||||||
Rails.logger.info('failed trying to add existing container ' + container.to_s + ' to execution_environment ' + execution_environment.to_s)
|
Rails.logger.info('failed trying to add existing container ' + container.to_s + ' to execution_environment ' + execution_environment.to_s)
|
||||||
end
|
end
|
||||||
@ -50,7 +50,7 @@ class DockerContainerPool
|
|||||||
def self.create_container(execution_environment)
|
def self.create_container(execution_environment)
|
||||||
container = DockerClient.create_container(execution_environment)
|
container = DockerClient.create_container(execution_environment)
|
||||||
container.status = 'available'
|
container.status = 'available'
|
||||||
Rails.logger.debug('created container ' + container.to_s + ' for execution environment ' + execution_environment.to_s)
|
#Rails.logger.debug('created container ' + container.to_s + ' for execution environment ' + execution_environment.to_s)
|
||||||
container
|
container
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -120,11 +120,11 @@ class DockerContainerPool
|
|||||||
if refill_count > 0
|
if refill_count > 0
|
||||||
Rails.logger.info('Adding ' + refill_count.to_s + ' containers for execution_environment ' + execution_environment.name )
|
Rails.logger.info('Adding ' + refill_count.to_s + ' containers for execution_environment ' + execution_environment.name )
|
||||||
c = refill_count.times.map { create_container(execution_environment) }
|
c = refill_count.times.map { create_container(execution_environment) }
|
||||||
Rails.logger.info('Created containers: ' + c.to_s )
|
#Rails.logger.info('Created containers: ' + c.to_s )
|
||||||
@containers[execution_environment.id] += c
|
@containers[execution_environment.id] += c
|
||||||
@all_containers[execution_environment.id] += c
|
@all_containers[execution_environment.id] += c
|
||||||
Rails.logger.debug('@containers for ' + execution_environment.name.to_s + ' (' + @containers.object_id.to_s + ') has the following content: '+ @containers[execution_environment.id].to_s)
|
#Rails.logger.debug('@containers for ' + execution_environment.name.to_s + ' (' + @containers.object_id.to_s + ') has the following content: '+ @containers[execution_environment.id].to_s)
|
||||||
Rails.logger.debug('@all_containers for ' + execution_environment.name.to_s + ' (' + @all_containers.object_id.to_s + ') has the following content: ' + @all_containers[execution_environment.id].to_s)
|
#Rails.logger.debug('@all_containers for ' + execution_environment.name.to_s + ' (' + @all_containers.object_id.to_s + ') has the following content: ' + @all_containers[execution_environment.id].to_s)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -34,6 +34,7 @@ class Xikolo::Client
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.url
|
def self.url
|
||||||
|
#todo: JanR: set an environment variable here, fallback value: http://open.hpi.de/api/
|
||||||
'http://localhost:2000/api/'
|
'http://localhost:2000/api/'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user