You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aurora.apache.org by js...@apache.org on 2016/03/11 23:30:11 UTC

aurora git commit: Limit the scope of hot-reload resources.

Repository: aurora
Updated Branches:
  refs/heads/master 7fc4bff7b -> de128a10a


Limit the scope of hot-reload resources.

This limits the hot-reload resources to those found under
dist/resources/main/scheduler (all the UI resources), in order to
prevent confusion when rebuilding the scheduler for use in the vagrant
vm with non-ui resource changes (say to the db schema.sql).

Reviewed at https://reviews.apache.org/r/44726/


Project: http://git-wip-us.apache.org/repos/asf/aurora/repo
Commit: http://git-wip-us.apache.org/repos/asf/aurora/commit/de128a10
Tree: http://git-wip-us.apache.org/repos/asf/aurora/tree/de128a10
Diff: http://git-wip-us.apache.org/repos/asf/aurora/diff/de128a10

Branch: refs/heads/master
Commit: de128a10ad17cc2089e7c840950c92f383f81924
Parents: 7fc4bff
Author: John Sirois <js...@apache.org>
Authored: Fri Mar 11 15:30:53 2016 -0700
Committer: John Sirois <jo...@gmail.com>
Committed: Fri Mar 11 15:30:53 2016 -0700

----------------------------------------------------------------------
 docs/developing-aurora-scheduler.md |  8 ++++----
 examples/vagrant/aurorabuild.sh     | 11 ++++++++++-
 2 files changed, 14 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/aurora/blob/de128a10/docs/developing-aurora-scheduler.md
----------------------------------------------------------------------
diff --git a/docs/developing-aurora-scheduler.md b/docs/developing-aurora-scheduler.md
index a7a929e..a703871 100644
--- a/docs/developing-aurora-scheduler.md
+++ b/docs/developing-aurora-scheduler.md
@@ -126,10 +126,10 @@ Faster Iteration in Vagrant
 ---------------------------
 The scheduler serves UI assets from the classpath. For production deployments this means the assets
 are served from within a jar. However, for faster development iteration, the vagrant image is
-configured to add `/vagrant/dist/resources/main` to the head of CLASSPATH. This path is configured
-as a shared filesystem to the path on the host system where your Aurora repository lives. This means
-that any updates to dist/resources/main in your checkout will be reflected immediately in the UI
-served from within the vagrant image.
+configured to add the `scheduler` subtree of `/vagrant/dist/resources/main` to the head of
+`CLASSPATH`. This path is configured as a shared filesystem to the path on the host system where
+your Aurora repository lives. This means that any updates under `dist/resources/main/scheduler` in
+your checkout will be reflected immediately in the UI served from within the vagrant image.
 
 The one caveat to this is that this path is under `dist` not `src`. This is because the assets must
 be processed by gradle before they can be served. So, unfortunately, you cannot just save your local

http://git-wip-us.apache.org/repos/asf/aurora/blob/de128a10/examples/vagrant/aurorabuild.sh
----------------------------------------------------------------------
diff --git a/examples/vagrant/aurorabuild.sh b/examples/vagrant/aurorabuild.sh
index 92066e8..9daca06 100755
--- a/examples/vagrant/aurorabuild.sh
+++ b/examples/vagrant/aurorabuild.sh
@@ -45,7 +45,16 @@ function build_admin_client {
 function build_scheduler {
   # This CLASSPATH_PREFIX is inserted at the front of the CLASSPATH to enable "hot" reloads of the
   # UI code (c.f. the startScripts task in build.gradle).
-  CLASSPATH_PREFIX=/vagrant/dist/resources/main ./gradlew installDist
+  # NB: We limit the scope of the hot-reloadable resources to the UI resources in the /schedulder
+  # top-level resource dir; ie we do not support hot-loading of other resources like /logback.xml
+  # or /org/apache/aurora/scheduler/storage/db/schema.sql
+  local hot_resources_dir=/vagrant/dist/.hot_resources
+  if [ ! -L $hot_resources_dir/scheduler ]
+  then
+    rm -rf $hot_resources_dir && mkdir -p $hot_resources_dir
+    ln -s /vagrant/dist/resources/main/scheduler $hot_resources_dir/scheduler
+  fi
+  CLASSPATH_PREFIX=$hot_resources_dir ./gradlew installDist
 
   export LD_LIBRARY_PATH=/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server
   sudo mkdir -p /var/db/aurora