From 61426e8f2eaf7a359b03a4eb9ebb38e650ec39a3 Mon Sep 17 00:00:00 2001 From: Ralf Teusner Date: Wed, 27 Jan 2016 15:49:38 +0100 Subject: [PATCH] uncomment some logging, and recreate folder for local workspace path in the docker client. --- lib/docker_client.rb | 2 +- lib/docker_container_pool.rb | 10 +++++----- lib/xikolo/client.rb | 1 + 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/docker_client.rb b/lib/docker_client.rb index 7b6007f9..f1d855ac 100644 --- a/lib/docker_client.rb +++ b/lib/docker_client.rb @@ -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 diff --git a/lib/docker_container_pool.rb b/lib/docker_container_pool.rb index 90357875..1921afdb 100644 --- a/lib/docker_container_pool.rb +++ b/lib/docker_container_pool.rb @@ -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 diff --git a/lib/xikolo/client.rb b/lib/xikolo/client.rb index db48c91a..ecad50e7 100644 --- a/lib/xikolo/client.rb +++ b/lib/xikolo/client.rb @@ -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