Return-Path: X-Original-To: apmail-aurora-commits-archive@minotaur.apache.org Delivered-To: apmail-aurora-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EF55C1879F for ; Wed, 5 Aug 2015 18:56:12 +0000 (UTC) Received: (qmail 93291 invoked by uid 500); 5 Aug 2015 18:56:12 -0000 Delivered-To: apmail-aurora-commits-archive@aurora.apache.org Received: (qmail 93260 invoked by uid 500); 5 Aug 2015 18:56:12 -0000 Mailing-List: contact commits-help@aurora.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@aurora.apache.org Delivered-To: mailing list commits@aurora.apache.org Received: (qmail 93251 invoked by uid 99); 5 Aug 2015 18:56:12 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Aug 2015 18:56:12 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id A1A9EE0426; Wed, 5 Aug 2015 18:56:12 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jcohen@apache.org To: commits@aurora.apache.org Message-Id: <78e0fcf6a1a14eb8aaf45942d6251c09@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: aurora git commit: Modify the gradle build to optionally prefix CLASSPATH with a custom value when running installDist. Date: Wed, 5 Aug 2015 18:56:12 +0000 (UTC) Repository: aurora Updated Branches: refs/heads/master 2130f7e9a -> ae6e8575b Modify the gradle build to optionally prefix CLASSPATH with a custom value when running installDist. This enables much greater iteration speed when working on the Aurora UI. Bugs closed: AURORA-1425 Reviewed at https://reviews.apache.org/r/37092/ Project: http://git-wip-us.apache.org/repos/asf/aurora/repo Commit: http://git-wip-us.apache.org/repos/asf/aurora/commit/ae6e8575 Tree: http://git-wip-us.apache.org/repos/asf/aurora/tree/ae6e8575 Diff: http://git-wip-us.apache.org/repos/asf/aurora/diff/ae6e8575 Branch: refs/heads/master Commit: ae6e8575be0b51eff1c80562311d7de6ed96b248 Parents: 2130f7e Author: Joshua Cohen Authored: Wed Aug 5 13:55:52 2015 -0500 Committer: Joshua Cohen Committed: Wed Aug 5 13:55:52 2015 -0500 ---------------------------------------------------------------------- build.gradle | 12 ++++++++++++ docs/developing-aurora-scheduler.md | 19 +++++++++++++++++++ examples/vagrant/aurorabuild.sh | 4 +++- 3 files changed, 34 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/aurora/blob/ae6e8575/build.gradle ---------------------------------------------------------------------- diff --git a/build.gradle b/build.gradle index fa2e268..afb9b80 100644 --- a/build.gradle +++ b/build.gradle @@ -496,3 +496,15 @@ run { main = 'org.apache.aurora.scheduler.app.local.LocalSchedulerMain' classpath += sourceSets.test.output } + +startScripts { + def environmentClasspathPrefix = System.env.CLASSPATH_PREFIX + + if (!environmentClasspathPrefix?.trim()) { + return + } + + doLast { + unixScript.text = unixScript.text.replace('CLASSPATH=', "CLASSPATH=${environmentClasspathPrefix}:") + } +} http://git-wip-us.apache.org/repos/asf/aurora/blob/ae6e8575/docs/developing-aurora-scheduler.md ---------------------------------------------------------------------- diff --git a/docs/developing-aurora-scheduler.md b/docs/developing-aurora-scheduler.md index 17cfc18..f52c76e 100644 --- a/docs/developing-aurora-scheduler.md +++ b/docs/developing-aurora-scheduler.md @@ -90,6 +90,25 @@ use the following commands to view and modify the bower repo at bower update bower help +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. + +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 +changes and see them reflected in the UI, you must first run `./gradlew processResources`. This is +less than ideal, but better than having to restart the scheduler after every change. Additionally, +gradle makes this process somewhat easier with the use of the `--continuous` flag. If you run: +`./gradlew processResources --continuous` gradle will monitor the filesystem for changes and run the +task automatically as necessary. This doesn't quite provide hot-reload capabilities, but it does +allow for <5s from save to changes being visibile in the UI with no further action required on the +part of the developer. + Developing the Aurora Build System ================================== http://git-wip-us.apache.org/repos/asf/aurora/blob/ae6e8575/examples/vagrant/aurorabuild.sh ---------------------------------------------------------------------- diff --git a/examples/vagrant/aurorabuild.sh b/examples/vagrant/aurorabuild.sh index 8850e93..92066e8 100755 --- a/examples/vagrant/aurorabuild.sh +++ b/examples/vagrant/aurorabuild.sh @@ -43,7 +43,9 @@ function build_admin_client { } function build_scheduler { - ./gradlew installDist + # 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 export LD_LIBRARY_PATH=/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/server sudo mkdir -p /var/db/aurora