From 3623287cdc05121a86e573b89aebb6e4aa6866b5 Mon Sep 17 00:00:00 2001 From: Ward Vandewege Date: Wed, 4 Oct 2017 11:45:09 -0400 Subject: [PATCH] arvbox: run the rails code in production mode when running in localdemo or publicdemo. refs #12355 Arvados-DCO-1.1-Signed-off-by: Ward Vandewege --- tools/arvbox/lib/arvbox/docker/Dockerfile.demo | 4 ++++ tools/arvbox/lib/arvbox/docker/Dockerfile.dev | 4 ++++ tools/arvbox/lib/arvbox/docker/api-setup.sh | 9 +++++++-- tools/arvbox/lib/arvbox/docker/crunch-setup.sh | 10 ++++++++-- .../arvbox/lib/arvbox/docker/service/api/run-service | 7 ++++++- .../lib/arvbox/docker/service/gitolite/run-service | 11 ++++++++--- .../arvbox/lib/arvbox/docker/service/sso/run-service | 8 ++++++-- .../lib/arvbox/docker/service/websockets/run-service | 8 +++++++- .../lib/arvbox/docker/service/workbench/run-service | 9 +++++++-- 9 files changed, 57 insertions(+), 13 deletions(-) diff --git a/tools/arvbox/lib/arvbox/docker/Dockerfile.demo b/tools/arvbox/lib/arvbox/docker/Dockerfile.demo index 3d953ace59..39bc21c3ae 100644 --- a/tools/arvbox/lib/arvbox/docker/Dockerfile.demo +++ b/tools/arvbox/lib/arvbox/docker/Dockerfile.demo @@ -14,6 +14,10 @@ RUN cd /usr/src && \ ADD service/ /var/lib/arvbox/service RUN ln -sf /var/lib/arvbox/service /etc +RUN mkdir -p /var/lib/arvados +RUN echo "production" > /var/lib/arvados/api_rails_env +RUN echo "production" > /var/lib/arvados/sso_rails_env +RUN echo "production" > /var/lib/arvados/workbench_rails_env RUN chown -R 1000:1000 /usr/src && /usr/local/lib/arvbox/createusers.sh diff --git a/tools/arvbox/lib/arvbox/docker/Dockerfile.dev b/tools/arvbox/lib/arvbox/docker/Dockerfile.dev index c017f70875..e6e0397b99 100644 --- a/tools/arvbox/lib/arvbox/docker/Dockerfile.dev +++ b/tools/arvbox/lib/arvbox/docker/Dockerfile.dev @@ -7,5 +7,9 @@ ARG arvados_version ADD service/ /var/lib/arvbox/service RUN ln -sf /var/lib/arvbox/service /etc +RUN mkdir -p /var/lib/arvados +RUN echo "development" > /var/lib/arvados/api_rails_env +RUN echo "development" > /var/lib/arvados/sso_rails_env +RUN echo "development" > /var/lib/arvados/workbench_rails_env RUN mkdir /etc/test-service && ln -sf /var/lib/arvbox/service/postgres /etc/test-service diff --git a/tools/arvbox/lib/arvbox/docker/api-setup.sh b/tools/arvbox/lib/arvbox/docker/api-setup.sh index b81ba00b86..de64b06e63 100755 --- a/tools/arvbox/lib/arvbox/docker/api-setup.sh +++ b/tools/arvbox/lib/arvbox/docker/api-setup.sh @@ -9,7 +9,12 @@ set -ex -o pipefail . /usr/local/lib/arvbox/common.sh cd /usr/src/arvados/services/api -export RAILS_ENV=development + +if test -s /var/lib/arvados/api_rails_env ; then + export RAILS_ENV=$(cat /var/lib/arvados/api_rails_env) +else + export RAILS_ENV=development +fi set -u @@ -41,7 +46,7 @@ else fi cat >config/application.yml < config/arvados-clients.yml <config/application.yml <config/application.yml <