Merge remote-tracking branch 'origin/master' into rt/comments
This commit is contained in:
@ -19,11 +19,11 @@ duplicate .example config files (remove .example from filename)
|
||||
action_mailer.yml, database.yml, secrets.yml, sendmail.yml, smtp.yml
|
||||
add your local dbuser credentials to database.yml
|
||||
Linux users may need to add a "host" and a "port" parameter
|
||||
set path for /shared to codeOceanRoot/shared - double check this, when errors like "no target for make run available" arise, this is a likely cause. If in doubt, also check the paths in config/docker.yml match the relative structure, Linux users might need to use an absolute path)
|
||||
Copy vagrant files from https://github.com/hklement/vagrant-docker to codeOceanRoot or use boot2docker
|
||||
==> vagrantPath = codeOceanRoot/vagrant-docker-master
|
||||
cd vagrantPath
|
||||
open Vagrantfile in text editor of choice
|
||||
set path for /shared to codeOceanRoot/shared - double check this, when errors like "no target for make run available" arise, this is a likely cause. If in doubt, also check the paths in config/docker.yml match the relative structure)
|
||||
Execute: vagrant box add ubuntu/trusty64
|
||||
Execute: vagrant up
|
||||
Install docker environments
|
||||
|
@ -50,11 +50,12 @@ class DockerContainerPool
|
||||
end
|
||||
|
||||
def self.get_container(execution_environment)
|
||||
# if pooling is active, do pooling, otherwise just create an container and return it
|
||||
if config[:active]
|
||||
container = @containers[execution_environment.id].try(:shift) || nil
|
||||
Rails.logger.info('get_container fetched container ' + container.to_s)
|
||||
Rails.logger.info('get_container remaining avail. container ' + @containers[execution_environment.id].size.to_s)
|
||||
Rails.logger.info('get_container all container count' + @all_containers[execution_environment.id].size.to_s)
|
||||
Rails.logger.info('get_container remaining avail. containers: ' + @containers[execution_environment.id].size.to_s)
|
||||
Rails.logger.info('get_container all container count: ' + @all_containers[execution_environment.id].size.to_s)
|
||||
container
|
||||
else
|
||||
create_container(execution_environment)
|
||||
@ -77,13 +78,16 @@ class DockerContainerPool
|
||||
|
||||
def self.refill_for_execution_environment(execution_environment)
|
||||
refill_count = [execution_environment.pool_size - @all_containers[execution_environment.id].length, config[:refill][:batch_size]].min
|
||||
Rails.logger.info('adding' + refill_count.to_s + ' containers for ' + execution_environment.name )
|
||||
if refill_count > 0
|
||||
Rails.logger.info('adding ' + refill_count.to_s + ' containers for ' + execution_environment.name )
|
||||
c = refill_count.times.map { create_container(execution_environment) }
|
||||
@containers[execution_environment.id] += c
|
||||
@all_containers[execution_environment.id] += c
|
||||
#refill_count.times.map { create_container(execution_environment) }
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
def self.start_refill_task
|
||||
@refill_task = Concurrent::TimerTask.new(execution_interval: config[:refill][:interval], run_now: false, timeout_interval: config[:refill][:timeout]) { refill }
|
||||
@refill_task.execute
|
||||
|
Reference in New Issue
Block a user