allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [1/2] allura git commit: Docker & doc fixes for node, pwd, etc
Date Tue, 13 Oct 2015 18:56:07 GMT
Repository: allura
Updated Branches:
  refs/heads/master 77c45dacd -> 00110b12e

Docker & doc fixes for node, pwd, etc

Revert changes to WORKDIR in Allura/Dockerfile from recent broccoli/jsx setup
commits.  Its needed to have the 'web' container start in the root folder, so
`pip` command etc works.

Update docs to take advantage of the 'taskd' container starting in Allura
subdir so paster commands can run without "bash -c 'cd ...'" stuff.

Use newest version of node/npm to avoid symlink errors when installing
npm packages within a VM shared mount.

Add instructions for running administrative commands within docker.  Add
success logging at end of create-neighborhood so that some thread widget
errors don't make people think that command failed.


Branch: refs/heads/master
Commit: a1aab2208a37d3a32ed6639650eedcd5325dccaf
Parents: 0323078
Author: Dave Brondsema <>
Authored: Mon Oct 5 13:38:39 2015 -0400
Committer: Dave Brondsema <>
Committed: Mon Oct 5 13:38:39 2015 -0400

 Allura/allura/command/   |  5 +++++
 Allura/docs/getting_started/administration.rst |  4 ++++
 Allura/docs/getting_started/installation.rst   | 20 +++++++++++++-------
 Dockerfile                                     | 13 +++++++++----
 docker-compose.yml                             |  8 ++++----
 5 files changed, 35 insertions(+), 15 deletions(-)
diff --git a/Allura/allura/command/ b/Allura/allura/command/
index db79bb0..d099c46 100644
--- a/Allura/allura/command/
+++ b/Allura/allura/command/
@@ -15,6 +15,8 @@
 #       specific language governing permissions and limitations
 #       under the License.
+import logging
 from . import base
 from ming.orm import session
@@ -23,6 +25,8 @@ from bson import ObjectId
 from allura import model as M
 from allura.lib import plugin, exceptions
+log = logging.getLogger(__name__)
 class CreateNeighborhoodCommand(base.Command):
     min_args = 3
@@ -44,6 +48,7 @@ class CreateNeighborhoodCommand(base.Command):
         project_reg = plugin.ProjectRegistrationProvider.get()
         project_reg.register_neighborhood_project(n, admins)
+'Successfully created neighborhood "{}"'.format(shortname))
 class UpdateNeighborhoodCommand(base.Command):
diff --git a/Allura/docs/getting_started/administration.rst b/Allura/docs/getting_started/administration.rst
index 1571cb6..8673840 100644
--- a/Allura/docs/getting_started/administration.rst
+++ b/Allura/docs/getting_started/administration.rst
@@ -76,6 +76,10 @@ Scripts are in the `scripts/` directory and run slightly differently, via
      paster script development.ini ../scripts/ -- -u 100
+To run these when using docker, prefix with :code:`docker-compose run web` and use :code:`docker-dev.ini`
+    docker-compose run taskd paster create-neighborhood docker-dev.ini myneighborhood myuser
 Tasks can be run via the web interface at http://MYSITE/nf/admin/task_manager  You must know
 the full task name, e.g. :code:`allura.tasks.admin_tasks.install_app`  You can
 optionally provide a username and project and app which will get set on the
diff --git a/Allura/docs/getting_started/installation.rst b/Allura/docs/getting_started/installation.rst
index 026da99..e180ac3 100644
--- a/Allura/docs/getting_started/installation.rst
+++ b/Allura/docs/getting_started/installation.rst
@@ -182,12 +182,12 @@ Allura uses a background task service called "taskd" to do async tasks
like send
 A few more steps, if using git
-If you're using a released version of Allura, these are already done for you.  This transpiles
JS into a version all browsers support:
+If you're using a released version of Allura, these are already done for you.  This transpiles
JS into a version all browsers support.
+For non-Ubuntu installations see for other
options to replace the first line here:
 .. code-block:: bash
-    (env-allura)~$ sudo aptitude install nodejs npm
-    (env-allura)~$ sudo ln -s /usr/bin/nodejs /usr/bin/node
+    (env-allura)~$ curl --silent --location | sudo bash
     (env-allura)~$ cd ~/src/allura
     (env-allura)~$ npm install -g broccoli-cli
     (env-allura)~$ npm install
@@ -256,7 +256,7 @@ Build/fetch all required images (run these in allura source directory):
     docker-compose build
-Install requirements:
+Install requirements (and first containers started):
 .. code-block:: bash
@@ -272,11 +272,11 @@ Initialize database with test data:
 .. code-block:: bash
-    docker-compose run web bash -c 'cd Allura && paster setup-app docker-dev.ini'
+    docker-compose run taskd paster setup-app docker-dev.ini
 .. note::
-   If you want to skip test data creation you can instead run: :code:`docker-compose run
web bash -c 'cd Allura && ALLURA_TEST_DATA=False paster setup-app docker-dev.ini'`
+   If you want to skip test data creation you can instead run: :code:`docker-compose run
-e ALLURA_TEST_DATA=False taskd paster setup-app docker-dev.ini`
 Start containers in the background:
@@ -284,9 +284,15 @@ Start containers in the background:
     docker-compose up -d
-You're up and running!  Visit localhost:8080 or on a Mac or Windows, whatever IP address
Docker Toolbox is using.  Then
+You're up and running!  Visit localhost:8080, or on a Mac or Windows whatever IP address
Docker Toolbox is using.  Then
 see our :ref:`post-setup-instructions` and read more below about the Docker environment for
+.. note::
+   If running from git source, it will take a few minutes during the first time running "up",
to set up JS build tools
+   before the webapp is actually running on port 8080.  Watch the progress with :code:`docker-compose
logs web`.
diff --git a/Dockerfile b/Dockerfile
index f125d55..f91dd98 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -30,8 +30,13 @@ RUN apt-get update && apt-get install -y \
     zip \
     subversion \
     python-svn \
-    npm
-RUN ln -s /usr/bin/nodejs /usr/bin/node
+    curl
+# up-to-date version of node & npm
+RUN curl --silent --location | sudo bash - &&
+    apt-get install --yes nodejs
+# only do the global installation here.  All local packages are installed in the docker-compose.yml
command, since they need the shared mount
 RUN npm install -g broccoli-cli
 # Snapshot generation for SVN (and maybe other SCMs) might fail without this
@@ -42,5 +47,5 @@ ENV LANG en_US.UTF-8
 # tests). If this is not set, it uses os.getlogin, which fails inside docker.
 ENV USER root
-WORKDIR /allura/Allura
-CMD gunicorn --paste docker-dev.ini --reload
+WORKDIR /allura
+CMD gunicorn --paste Allura/docker-dev.ini --reload
diff --git a/docker-compose.yml b/docker-compose.yml
index faac4a4..5eaaf4c 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -17,16 +17,16 @@
   build: .
-  working_dir: /allura
-  # specialized command (and working_dir) to run broccoli
+  # specialized command to run broccoli
   # since it depends on files from the shared volume, it can't be run as part of the Dockerfile
build :(
+  # and --no-bin-links necessary when Virtualbox is used since shared mount can't handle
   command: >
     sh -c '
     if [ ! -e Allura/allura/public/nf/js/build/transpiled.js ]; then
-      npm install &&
+      npm install --no-bin-links --loglevel http &&
       npm run build;
-    gunicorn --paste Allura/docker-dev.ini --reload
+    gunicorn --paste Allura/docker-dev.ini --reload;
     - "8080:8080"

View raw message