uncomment some logging, and recreate folder for local workspace path in the docker client.

This commit is contained in:
Ralf Teusner
2016-01-27 15:49:38 +01:00
parent ecad5b80fa
commit 61426e8f2e
3 changed files with 7 additions and 6 deletions

View File

@ -98,7 +98,7 @@ class DockerClient
container = Docker::Container.create(container_creation_options(execution_environment))
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.
# FileUtils.mkdir(local_workspace_path)
FileUtils.mkdir(local_workspace_path)
container.start(container_start_options(execution_environment, local_workspace_path))
container.start_time = Time.now
container.status = :created

View File

@ -41,7 +41,7 @@ class DockerContainerPool
@all_containers[execution_environment.id]+=[container]
if(!@containers[execution_environment.id].include?(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
Rails.logger.info('failed trying to add existing container ' + container.to_s + ' to execution_environment ' + execution_environment.to_s)
end
@ -50,7 +50,7 @@ class DockerContainerPool
def self.create_container(execution_environment)
container = DockerClient.create_container(execution_environment)
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
end
@ -120,11 +120,11 @@ class DockerContainerPool
if refill_count > 0
Rails.logger.info('Adding ' + refill_count.to_s + ' containers for execution_environment ' + execution_environment.name )
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
@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('@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('@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)
end
end

View File

@ -34,6 +34,7 @@ class Xikolo::Client
end
def self.url
#todo: JanR: set an environment variable here, fallback value: http://open.hpi.de/api/
'http://localhost:2000/api/'
end