# Arvados API server Docker container. FROM arvados/passenger MAINTAINER Tim Pierce # Install postgres and apache. # Clone a git repository of Arvados source -- not used to build, but # will be used by the Commit model and anything else that needs to # check a git repo for crunch scripts. RUN apt-get update && \ apt-get -q -y install procps postgresql postgresql-server-dev-9.1 apache2 slurm-llnl munge \ supervisor sudo libwww-perl libio-socket-ssl-perl libcrypt-ssleay-perl \ libjson-perl cron && \ git clone --bare git://github.com/curoverse/arvados.git /var/cache/git/arvados.git ADD munge.key /etc/munge/ RUN chown munge:munge /etc/munge/munge.key && chmod 600 /etc/munge/munge.key ADD generated/slurm.conf /etc/slurm-llnl/ RUN /usr/local/rvm/bin/rvm-exec default gem install arvados-cli arvados # /for crunch-dispatch RUN /bin/mkdir -p /usr/src/arvados/services ADD generated/api.tar.gz /usr/src/arvados/services/ # Install generated config files ADD generated/database.yml /usr/src/arvados/services/api/config/database.yml ADD generated/omniauth.rb /usr/src/arvados/services/api/config/initializers/omniauth.rb RUN /bin/cp /usr/src/arvados/services/api/config/environments/production.rb.example /usr/src/arvados/services/api/config/environments/production.rb ADD generated/application.yml /usr/src/arvados/services/api/config/application.yml ADD generated/apache2_vhost /etc/apache2/sites-available/arvados # Configure Rails databases. ENV RAILS_ENV production ADD generated/config_databases.sh /tmp/config_databases.sh ADD generated/superuser_token /tmp/superuser_token RUN /usr/local/rvm/bin/rvm-exec default bundle install --gemfile=/usr/src/arvados/services/api/Gemfile && \ sh /tmp/config_databases.sh && \ rm /tmp/config_databases.sh && \ /etc/init.d/postgresql start && \ cd /usr/src/arvados/services/api && \ /usr/local/rvm/bin/rvm-exec default bundle exec rake db:setup && \ /usr/local/rvm/bin/rvm-exec default bundle exec rake assets:precompile && \ /usr/local/rvm/bin/rvm-exec default ./script/create_superuser_token.rb $(cat /tmp/superuser_token) && \ chown www-data:www-data config.ru && \ chown www-data:www-data log -R && \ mkdir -p tmp && \ chown www-data:www-data tmp -R # Configure Apache and Passenger. RUN a2dissite default && \ a2ensite arvados && \ a2enmod rewrite && \ a2enmod ssl && \ /bin/mkdir /var/run/apache2 # Install a token for root RUN mkdir -p /root/.config/arvados; echo "ARVADOS_API_HOST=api" >> /root/.config/arvados/settings.conf && echo "ARVADOS_API_HOST_INSECURE=yes" >> /root/.config/arvados/settings.conf && echo "ARVADOS_API_TOKEN=$(cat /tmp/superuser_token)" >> /root/.config/arvados/settings.conf && chmod 600 /root/.config/arvados/settings.conf # Set up directory for job commit repo RUN mkdir -p /var/lib/arvados # Add crunch user RUN addgroup --gid 4005 crunch && mkdir /home/crunch && useradd --uid 4005 --gid 4005 crunch && chown crunch:crunch /home/crunch # Create keep and compute node objects ADD keep_server_0.json /root/ ADD keep_server_1.json /root/ # Set up update-gitolite.rb RUN mkdir /usr/local/arvados/config -p ADD generated/arvados-clients.yml /usr/local/arvados/config/ ADD update-gitolite.rb /usr/local/arvados/ # Supervisor. ADD supervisor.conf /etc/supervisor/conf.d/arvados.conf ADD ssh.sh /usr/local/bin/ssh.sh ADD generated/setup.sh /usr/local/bin/setup.sh ADD setup-gitolite.sh /usr/local/bin/setup-gitolite.sh ADD crunch-dispatch-run.sh /usr/local/bin/crunch-dispatch-run.sh ADD apache2_foreground.sh /etc/apache2/foreground.sh # Start the supervisor. CMD ["/usr/bin/supervisord", "-n"]