git commit: SLIDER-153 refactor .py script slightly for use elsewhere
Repository: incubator-slider Updated Branches: refs/heads/develop a048c9f59 -> 0ad4fb4f7 SLIDER-153 refactor .py script slightly for use elsewhere Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/0ad4fb4f Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/0ad4fb4f Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/0ad4fb4f Branch: refs/heads/develop Commit: 0ad4fb4f7b5cc4e590cbb9e51aa7cefb59a0ae2d Parents: a048c9f Author: Steve Loughran Authored: Mon Jun 30 16:16:08 2014 +0100 Committer: Steve Loughran Committed: Mon Jun 30 16:16:08 2014 +0100 -- slider-assembly/src/main/scripts/slider.py | 107 ++-- 1 file changed, 64 insertions(+), 43 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/0ad4fb4f/slider-assembly/src/main/scripts/slider.py -- diff --git a/slider-assembly/src/main/scripts/slider.py b/slider-assembly/src/main/scripts/slider.py index d48eca6..e60bed3 100644 --- a/slider-assembly/src/main/scripts/slider.py +++ b/slider-assembly/src/main/scripts/slider.py @@ -60,10 +60,10 @@ def confDir(sliderdir): localconf = os.path.join(sliderdir, CONF) return os.environ.get(SLIDER_CONF_DIR,localconf) -def dirMustExist(dir): - if not os.path.exists(dir): -raise Exception("Directory does not exist: %s " % dir) - return dir +def dirMustExist(dirname): + if not os.path.exists(dirname): +raise Exception("Directory does not exist: %s " % dirname) + return dirname def read(pipe, line): """ @@ -83,7 +83,61 @@ def read(pipe, line): return line, True else: return line, False - + + +def runProcess(commandline): + """ + Run a process + :param commandline: command line + :return:the return code + """ + print "ready to exec : %s" % commandline + exe = subprocess.Popen(commandline, + stdin=None, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + shell=False) + stdout = exe.stdout + stderr = exe.stderr + outline = "" + errline = "" + while exe.poll() is None: +# process is running; grab output and echo every line +outline, done = read(stdout, outline) +if done: + print outline + outline = "" +errline, done = read(stderr, errline) +if done: + print errline + errline = "" + + # get tail + out, err = exe.communicate() + print outline + out.decode() + print errline + err.decode() + return exe.returncode + + +def java(classname, args, classpath, jvm_opts_list): + """ + Execute a java process, hooking up stdout and stderr + and printing them a line at a time as they come in + :param classname: classname + :param args: arguments to the java program + :param classpath: classpath + :param jvm_opts_list: list of JVM options + :return: the exit code. + """ + # split the JVM opts by space + # java = "/usr/bin/java" + commandline = ["java"] + commandline.extend(jvm_opts_list) + commandline.append("-classpath") + commandline.append(classpath) + commandline.append(classname) + commandline.extend(args) + return runProcess(commandline) def usage(): @@ -98,14 +152,13 @@ def main(): """ if len(sys.argv)==1 : return usage() - print "stdout encoding: "+ sys.stdout.encoding + # print "stdout encoding: "+ sys.stdout.encoding args = sys.argv[1:] slider_home = sliderDir() libdir = dirMustExist(libDir(slider_home)) confdir = dirMustExist(confDir(slider_home)) default_jvm_opts = DEFAULT_JVM__OPTS % confdir slider_jvm_opts = os.environ.get(SLIDER_JVM_OPTS, default_jvm_opts) - # split the JVM opts by space jvm_opts_split = slider_jvm_opts.split() slider_classpath_extra = os.environ.get(SLIDER_CLASSPATH_EXTRA, "") p = os.pathsep# path separator @@ -119,42 +172,10 @@ def main(): print "slider_jvm_opts = \"%s\"" % slider_jvm_opts print "slider_classpath = \"%s\"" % slider_classpath - #java = "/usr/bin/java" - commandline = ["java", ] - commandline.append("-classpath") - commandline.append(slider_classpath) - commandline.extend(jvm_opts_split) - commandline.append(SLIDER_CLASSNAME) - commandline.extend(args) - print "ready to exec : %s" % commandline - # docs warn of using PIPE on stderr - exe = subprocess.Popen(commandline, - stdin=None, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - shell=False) - stdout = exe.stdout - stderr = exe.stderr - outline = "" - errline = "" - while exe.poll() is None: -# process is running; grab output and echo every line -outline, done = read(stdo
[1/3] git commit: SLIDER-162: home dir created by hdfs if user lacks permissions (and hdfs can be impersonated)
Repository: incubator-slider Updated Branches: refs/heads/develop 0ad4fb4f7 -> 3fb598fba SLIDER-162: home dir created by hdfs if user lacks permissions (and hdfs can be impersonated) Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/e3c5d9d8 Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/e3c5d9d8 Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/e3c5d9d8 Branch: refs/heads/develop Commit: e3c5d9d8e7198e3a30027a412b9348926900c14a Parents: 9619c33 Author: Steve Loughran Authored: Mon Jun 30 16:14:15 2014 +0100 Committer: Steve Loughran Committed: Mon Jun 30 16:14:15 2014 +0100 -- .../funtest/framework/AgentUploads.groovy | 13 ++--- .../funtest/framework/FileUploader.groovy | 51 +--- .../lifecycle/AgentCommandTestBase.groovy | 10 +++- 3 files changed, 57 insertions(+), 17 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e3c5d9d8/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/AgentUploads.groovy -- diff --git a/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/AgentUploads.groovy b/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/AgentUploads.groovy index 3570183..2cec5c2 100644 --- a/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/AgentUploads.groovy +++ b/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/AgentUploads.groovy @@ -27,11 +27,9 @@ import org.apache.hadoop.fs.FileSystem as HadoopFS @Slf4j class AgentUploads implements FuntestProperties { final Configuration conf - private final FileUploader uploader - private final HadoopFS clusterFS - private final Path homeDir - - + public final FileUploader uploader + public final HadoopFS clusterFS + public final Path homeDir AgentUploads(Configuration conf) { this.conf = conf @@ -52,6 +50,8 @@ class AgentUploads implements FuntestProperties { homeDir, AGENT_TAR_FILENAME) +//create the home dir or fail +uploader.mkHomeDir() // Upload the agent tarball uploader.copyIfOutOfDate(localAgentTar, agentTarballPath, force) @@ -59,10 +59,7 @@ class AgentUploads implements FuntestProperties { // Upload the agent.ini def agentIniPath = new Path(homeDir, AGENT_INI) uploader.copyIfOutOfDate(localAgentIni, agentIniPath, force) - return [agentTarballPath, agentIniPath] - - } } http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e3c5d9d8/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/FileUploader.groovy -- diff --git a/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/FileUploader.groovy b/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/FileUploader.groovy index 4f61730..2dc85be 100644 --- a/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/FileUploader.groovy +++ b/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/FileUploader.groovy @@ -20,12 +20,14 @@ package org.apache.slider.funtest.framework import groovy.util.logging.Slf4j import org.apache.hadoop.conf.Configuration +import org.apache.hadoop.fs.FileSystem as HadoopFS import org.apache.hadoop.fs.FileUtil import org.apache.hadoop.fs.Path import org.apache.hadoop.fs.permission.FsPermission import org.apache.hadoop.security.AccessControlException import org.apache.hadoop.security.UserGroupInformation -import org.apache.hadoop.fs.FileSystem as HadoopFS + +@SuppressWarnings("GroovyOctalInteger") @Slf4j class FileUploader { final Configuration conf @@ -60,18 +62,20 @@ class FileUploader { } if (toCopy) { log.info("Copying $src to $destPath") + def dir = destPath.getParent() try { fs.delete(destPath, true) -fs.mkdirs(destPath.getParent(), FsPermission.dirDefault) +fs.mkdirs(dir, FsPermission.dirDefault) return FileUtil.copy(src, fs, destPath, false, conf) } catch (AccessControlException ace) { -log.error("No write access to test user home directory. " + +log.error("No write access to destination directory $dir" + "Ensure home directory exists and has correct permissions." + ace, ace) throw ace } } else { - log.debug("Skipping copy as the destination $destPath considered up to date") + log.debug( + "Skipping copy as the destination $destPath considered up to date") return false; } } @@ -79,7 +83,7 @@ class FileUploader { public HadoopFS getFileSystem(Path dest) { getFileS
[48/50] [abbrv] git commit: SLIDER-173 Fix typo
SLIDER-173 Fix typo Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/a048c9f5 Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/a048c9f5 Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/a048c9f5 Branch: refs/heads/feature/SLIDER-151_Implement_full_slider_API_in_REST_and_switch_client_to_it Commit: a048c9f59c8252905e3b3a9a87ea7ceb49f50cf7 Parents: 581c182 Author: tedyu Authored: Fri Jun 27 11:40:25 2014 -0700 Committer: tedyu Committed: Fri Jun 27 11:40:25 2014 -0700 -- .../org/apache/slider/providers/agent/AgentProviderService.java| 1 + .../apache/slider/server/appmaster/state/ContainerPriority.java| 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/a048c9f5/slider-core/src/main/java/org/apache/slider/providers/agent/AgentProviderService.java -- diff --git a/slider-core/src/main/java/org/apache/slider/providers/agent/AgentProviderService.java b/slider-core/src/main/java/org/apache/slider/providers/agent/AgentProviderService.java index a685a3e..85aa8db 100644 --- a/slider-core/src/main/java/org/apache/slider/providers/agent/AgentProviderService.java +++ b/slider-core/src/main/java/org/apache/slider/providers/agent/AgentProviderService.java @@ -634,6 +634,7 @@ public class AgentProviderService extends AbstractProviderService implements Application application = getMetainfo().getApplication(); if (application == null) { log.error("Malformed app definition: Expect application as the top level element for metainfo.xml"); + return scriptPath; } for (Component component : application.getComponents()) { if (component.getName().equals(roleName)) { http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/a048c9f5/slider-core/src/main/java/org/apache/slider/server/appmaster/state/ContainerPriority.java -- diff --git a/slider-core/src/main/java/org/apache/slider/server/appmaster/state/ContainerPriority.java b/slider-core/src/main/java/org/apache/slider/server/appmaster/state/ContainerPriority.java index 935c09f..56a5af2 100644 --- a/slider-core/src/main/java/org/apache/slider/server/appmaster/state/ContainerPriority.java +++ b/slider-core/src/main/java/org/apache/slider/server/appmaster/state/ContainerPriority.java @@ -43,7 +43,7 @@ public final class ContainerPriority { public static int buildPriority(int role, boolean locationSpecified) { int location = locationSpecified ? LOCATION : 0; -return role | LOCATION; +return role | location; }
[02/50] [abbrv] SLIDER-126. Slider-Agent and Agent Provider need to handle component instance install/start failure gracefully
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/3aca57d2/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestAppsThroughAgent.groovy -- diff --git a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestAppsThroughAgent.groovy b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestAppsThroughAgent.groovy index aef9aa1..e3422ee 100644 --- a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestAppsThroughAgent.groovy +++ b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestAppsThroughAgent.groovy @@ -31,14 +31,14 @@ import org.junit.Test @CompileStatic @Slf4j public class TestAppsThroughAgent extends AgentCommandTestBase -implements FuntestProperties, Arguments, SliderExitCodes, SliderActions { +implements FuntestProperties, Arguments, SliderExitCodes, SliderActions { private static String COMMAND_LOGGER = "COMMAND_LOGGER" - private static String APPLICATION_NAME = "agenttst" + private static String APPLICATION_NAME = "happy-path-with-flex" @After public void destroyCluster() { -cleanup() +cleanup(APPLICATION_NAME) } @Test @@ -48,69 +48,39 @@ public class TestAppsThroughAgent extends AgentCommandTestBase return } -cleanup() -try { - SliderShell shell = slider(EXIT_SUCCESS, - [ - ACTION_CREATE, APPLICATION_NAME, - ARG_IMAGE, agentTarballPath.toString(), - ARG_TEMPLATE, APP_TEMPLATE, - ARG_RESOURCES, APP_RESOURCE - ]) +cleanup(APPLICATION_NAME) +SliderShell shell = slider(EXIT_SUCCESS, +[ +ACTION_CREATE, APPLICATION_NAME, +ARG_IMAGE, agentTarballPath.toString(), +ARG_TEMPLATE, APP_TEMPLATE, +ARG_RESOURCES, APP_RESOURCE +]) - logShell(shell) +logShell(shell) - ensureApplicationIsUp(APPLICATION_NAME) +ensureApplicationIsUp(APPLICATION_NAME) - //flex - slider(EXIT_SUCCESS, - [ - ACTION_FLEX, - APPLICATION_NAME, - ARG_COMPONENT, - COMMAND_LOGGER, - "2"]) +//flex +slider(EXIT_SUCCESS, +[ +ACTION_FLEX, +APPLICATION_NAME, +ARG_COMPONENT, +COMMAND_LOGGER, +"2"]) - // sleep till the new instance starts - sleep(1000 * 10) +// sleep till the new instance starts +sleep(1000 * 10) - shell = slider(EXIT_SUCCESS, - [ - ACTION_STATUS, - APPLICATION_NAME]) +shell = slider(EXIT_SUCCESS, +[ +ACTION_STATUS, +APPLICATION_NAME]) - assertComponentCount(COMMAND_LOGGER, 2, shell) +assertComponentCount(COMMAND_LOGGER, 2, shell) - shell = slider(EXIT_SUCCESS, - [ - ACTION_LIST, - APPLICATION_NAME]) - - assert isAppRunning("RUNNING", shell), 'App is not running.' - - assertSuccess(shell) -} finally { - cleanup() -} - } - - - public void cleanup() throws Throwable { -log.info "Cleaning app instance, if exists, by name " + APPLICATION_NAME -teardown(APPLICATION_NAME) - -// sleep till the instance is frozen -sleep(1000 * 3) - -SliderShell shell = slider([ -ACTION_DESTROY, -APPLICATION_NAME]) - -if (shell.ret != 0 && shell.ret != EXIT_UNKNOWN_INSTANCE) { - logShell(shell) - assert fail("Old cluster either should not exist or should get destroyed.") -} +assertSuccess(shell) +assert isApplicationInState("RUNNING", APPLICATION_NAME), 'App is not running.' } - - }
[38/50] [abbrv] git commit: Merge branch 'develop' of https://git-wip-us.apache.org/repos/asf/incubator-slider into develop
Merge branch 'develop' of https://git-wip-us.apache.org/repos/asf/incubator-slider into develop Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/9619c335 Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/9619c335 Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/9619c335 Branch: refs/heads/feature/SLIDER-151_Implement_full_slider_API_in_REST_and_switch_client_to_it Commit: 9619c3356f44e91c4cb6de604e0ecfd8c1abcac9 Parents: 7089fa0 93bd8ce Author: Steve Loughran Authored: Wed Jun 25 11:23:08 2014 -0700 Committer: Steve Loughran Committed: Wed Jun 25 11:23:08 2014 -0700 -- .../org/apache/slider/server/appmaster/web/SliderAmIpFilter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --
[25/50] [abbrv] git commit: SLIDER-153: output streaming now working
SLIDER-153: output streaming now working Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/6fc569de Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/6fc569de Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/6fc569de Branch: refs/heads/feature/SLIDER-151_Implement_full_slider_API_in_REST_and_switch_client_to_it Commit: 6fc569de084dbba6a9701bba5595f557d1029484 Parents: 06816c4 Author: Steve Loughran Authored: Tue Jun 24 13:01:37 2014 -0700 Committer: Steve Loughran Committed: Tue Jun 24 13:01:37 2014 -0700 -- slider-assembly/src/main/scripts/slider.py | 60 +++-- 1 file changed, 46 insertions(+), 14 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/6fc569de/slider-assembly/src/main/scripts/slider.py -- diff --git a/slider-assembly/src/main/scripts/slider.py b/slider-assembly/src/main/scripts/slider.py index cfad59a..1e55cc6 100644 --- a/slider-assembly/src/main/scripts/slider.py +++ b/slider-assembly/src/main/scripts/slider.py @@ -67,6 +67,26 @@ def dirMustExist(dir): raise Exception("Directory does not exist: %s " % dir) return dir +def read(pipe, line): + """ + read a char, append to the listing if there is a char that is not \n + :param pipe: pipe to read from + :param line: line being built up + :return: (the potentially updated line, flag indicating newline reached) + """ + + c = pipe.read(1) + if c != "": +o = c.decode('utf-8') +if o != '\n': + line += o + return line, False +else: + return line, True + else: +return line, False + + def usage(): print "Usage: slider " @@ -80,6 +100,7 @@ def main(): """ if len(sys.argv)==1 : return usage() + print "stdout encoding: "+ sys.stdout.encoding args = sys.argv[1:] slider_home = sliderDir() libdir = dirMustExist(libDir(slider_home)) @@ -109,30 +130,41 @@ def main(): print "ready to exec : %s" % commandline # docs warn of using PIPE on stderr exe = subprocess.Popen(commandline, - stdin=subprocess.PIPE, + stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=False) - exe.wait() + stdout = exe.stdout + stderr = exe.stderr + outline = "" + errline = "" + while exe.poll() is None: +# process is running; grab output and echo every line +outline, done = read(stdout, outline) +if done: + print outline + outline = "" +errline, done = read(stderr, errline) +if done: + print errline + errline = "" + + # get tail out, err = exe.communicate() - print "stdout : ", out.decode() - print "stderr : ", err.decode() + print outline + out.decode() + print errline + err.decode() return exe.returncode - - if __name__ == '__main__': - print "slider python script" + """ + Entry point + """ try: -rv = main() -if rv != 0: - print "Failed with exit code = %d" % rv -else: - print "Success" +returncode = main() except Exception as e: print "Exception: %s " % e.message -rv = -1 +returncode = -1 - sys.exit(rv) + sys.exit(returncode)
[09/50] [abbrv] git commit: SLIDER-159 Jenkins testEcho failing
SLIDER-159 Jenkins testEcho failing Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/537d87c2 Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/537d87c2 Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/537d87c2 Branch: refs/heads/feature/SLIDER-151_Implement_full_slider_API_in_REST_and_switch_client_to_it Commit: 537d87c25e20e3c11994dbfdcfcb89ba20f59859 Parents: bc0c672 Author: Steve Loughran Authored: Mon Jun 23 13:25:41 2014 -0700 Committer: Steve Loughran Committed: Mon Jun 23 13:25:41 2014 -0700 -- .../services/workflow/ForkedProcessService.java | 25 .../services/workflow/LongLivedProcess.java | 13 ++ .../TestWorkflowForkedProcessService.java | 3 ++- 3 files changed, 35 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/537d87c2/slider-core/src/main/java/org/apache/slider/server/services/workflow/ForkedProcessService.java -- diff --git a/slider-core/src/main/java/org/apache/slider/server/services/workflow/ForkedProcessService.java b/slider-core/src/main/java/org/apache/slider/server/services/workflow/ForkedProcessService.java index b0c503d..7e73005 100644 --- a/slider-core/src/main/java/org/apache/slider/server/services/workflow/ForkedProcessService.java +++ b/slider-core/src/main/java/org/apache/slider/server/services/workflow/ForkedProcessService.java @@ -269,15 +269,28 @@ public class ForkedProcessService extends AbstractWorkflowExecutorService implem /** * Get the recent output from the process, or [] if not defined - * @param duration the duration, in ms, which we wait for recent output to become non-empty + * + * @param finalOutput flag to indicate "wait for the final output of the process" + * @param duration the duration, in ms, + * ro wait for recent output to become non-empty * @return a possibly empty list */ - public List getRecentOutput(int duration) { -if (process == null) return new LinkedList(); + public List getRecentOutput(boolean finalOutput, int duration) { +if (process == null) { + return new LinkedList(); +} long start = System.currentTimeMillis(); -while (process.isRecentOutputEmpty() && System.currentTimeMillis() - start <= duration) { +while (System.currentTimeMillis() - start <= duration) { + if (finalOutput && process.isFinalOutputProcessed()) { +//end of stream, break +break; + } + if (!process.isRecentOutputEmpty()) { +// there is some output +break; + } try { -Thread.sleep(20); +Thread.sleep(100); } catch (InterruptedException ie) { Thread.currentThread().interrupt(); break; @@ -285,4 +298,6 @@ public class ForkedProcessService extends AbstractWorkflowExecutorService implem } return process.getRecentOutput(); } + + } http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/537d87c2/slider-core/src/main/java/org/apache/slider/server/services/workflow/LongLivedProcess.java -- diff --git a/slider-core/src/main/java/org/apache/slider/server/services/workflow/LongLivedProcess.java b/slider-core/src/main/java/org/apache/slider/server/services/workflow/LongLivedProcess.java index 7b9863f..d9ddecb 100644 --- a/slider-core/src/main/java/org/apache/slider/server/services/workflow/LongLivedProcess.java +++ b/slider-core/src/main/java/org/apache/slider/server/services/workflow/LongLivedProcess.java @@ -35,6 +35,7 @@ import java.util.Set; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; /** * Execute a long-lived process. @@ -82,6 +83,7 @@ public class LongLivedProcess implements Runnable { private final List recentLines = new LinkedList(); private int recentLineLimit = RECENT_LINE_LOG_LIMIT; private LongLivedProcessLifecycleEvent lifecycleCallback; + private final AtomicBoolean finalOutputProcessed = new AtomicBoolean(false); /** @@ -347,6 +349,14 @@ public class LongLivedProcess implements Runnable { } /** + * Query to see if the final output has been processed + * @return + */ + public boolean isFinalOutputProcessed() { +return finalOutputProcessed.get(); + } + + /** * add the recent line to the list of recent lines; deleting * an earlier on if the limit is reached. * @@ -499,6 +509,9 @@ public class LongLivedProcess implements Runnable { LOG.warn("encountered {}", ignored, ignored); //process connection
[06/50] [abbrv] SLIDER-157 Remove app-packages/hbase-v0_96
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/7729653f/app-packages/hbase/README.txt -- diff --git a/app-packages/hbase/README.txt b/app-packages/hbase/README.txt index 941579d..fb84750 100644 --- a/app-packages/hbase/README.txt +++ b/app-packages/hbase/README.txt @@ -17,11 +17,17 @@ How to create a Slider package for HBase? - mvn clean package -DskipTests -Phbase-app-package +Copy the tarball for HBase: + cp ~/Downloads/hbase-0.98.3-hadoop2-bin.tar.gz package/files/ +If, HBase tarball is publised in maven repository, you can use: + mvn clean package -DskipTests -Phbase-app-package App package can be found in app-packages/HBase/target/apache-slider-hbase-${hbase.version}-app-package-${slider.version}.zip +Create a zip package at the root of the package (/app-packages/hbase/) + zip -r hbase-v098.zip . + Verify the content using zip -Tv apache-slider-hbase-*.zip
[04/50] [abbrv] git commit: Merge branch 'feature/SLIDER_126_handle_heartbeat_failures' into develop
Merge branch 'feature/SLIDER_126_handle_heartbeat_failures' into develop Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/45f5d796 Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/45f5d796 Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/45f5d796 Branch: refs/heads/feature/SLIDER-151_Implement_full_slider_API_in_REST_and_switch_client_to_it Commit: 45f5d7968d03f24c9d6f1af03f9afb4c1925e8c7 Parents: 1a8062e 3aca57d Author: Sumit Mohanty Authored: Sat Jun 21 18:22:00 2014 -0700 Committer: Sumit Mohanty Committed: Sat Jun 21 18:22:00 2014 -0700 -- slider-agent/conf/agent.ini | 2 + .../src/main/python/agent/AgentConfig.py| 21 +++ slider-agent/src/main/python/agent/Constants.py | 3 + .../src/main/python/agent/Controller.py | 23 ++- slider-agent/src/main/python/agent/main.py | 4 + .../src/test/python/agent/TestController.py | 30 slider-agent/src/test/python/agent/TestMain.py | 5 +- .../providers/AbstractProviderService.java | 15 +- .../slider/providers/ProviderService.java | 5 +- .../slider/providers/agent/AgentKeys.java | 3 + .../providers/agent/AgentLaunchParameter.java | 130 ++ .../providers/agent/AgentProviderService.java | 179 --- .../slider/providers/agent/AgentRoles.java | 18 +- .../apache/slider/providers/agent/Command.java | 13 +- .../slider/providers/agent/CommandResult.java | 16 +- .../providers/agent/ComponentInstanceState.java | 24 +++ .../slider/providers/agent/ContainerState.java | 41 + .../providers/agent/HeartbeatMonitor.java | 116 .../server/appmaster/AMViewForProviders.java| 27 +++ .../server/appmaster/SliderAppMaster.java | 32 +++- .../slider/server/appmaster/state/AppState.java | 20 +++ .../test_command_log/appConfig_fast_no_reg.json | 29 +++ .../test_command_log/appConfig_no_hb.json | 29 +++ .../model/mock/MockProviderService.groovy | 4 +- .../agent/TestAgentLaunchParameter.java | 76 .../providers/agent/TestHeartbeatMonitor.java | 136 ++ .../publisher/TestAgentProviderService.java | 5 +- .../lifecycle/AgentCommandTestBase.groovy | 100 --- .../lifecycle/TestAgentClusterLifecycle.groovy | 2 +- .../funtest/lifecycle/TestAgentFailures.groovy | 103 +++ .../funtest/lifecycle/TestAgentFailures2.groovy | 103 +++ .../lifecycle/TestAppsThroughAgent.groovy | 90 -- 32 files changed, 1253 insertions(+), 151 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/45f5d796/slider-core/src/main/java/org/apache/slider/providers/AbstractProviderService.java --
[10/50] [abbrv] git commit: Merge branch 'develop' into feature/SLIDER-153_add_slider_py_command
Merge branch 'develop' into feature/SLIDER-153_add_slider_py_command Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/e519fbcc Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/e519fbcc Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/e519fbcc Branch: refs/heads/feature/SLIDER-151_Implement_full_slider_API_in_REST_and_switch_client_to_it Commit: e519fbcc645894541bdf93d1fef9ceba36ded847 Parents: 19d313d 537d87c Author: Steve Loughran Authored: Mon Jun 23 13:33:20 2014 -0700 Committer: Steve Loughran Committed: Mon Jun 23 13:33:20 2014 -0700 -- app-packages/hbase-v0_96/README.txt | 33 -- app-packages/hbase-v0_96/appConfig.json | 67 .../hbase-v0_96/configuration/global.xml| 160 .../hbase-v0_96/configuration/hbase-log4j.xml | 142 .../hbase-v0_96/configuration/hbase-policy.xml | 53 --- .../hbase-v0_96/configuration/hbase-site.xml| 365 --- app-packages/hbase-v0_96/ganglia_metrics.json | 38 -- app-packages/hbase-v0_96/jmx_metrics.json | 56 --- app-packages/hbase-v0_96/metainfo.xml | 109 -- .../hbase-0.96.1-hadoop2-bin.tar.gz.REPLACE | 16 - .../hbase-v0_96/package/scripts/__init__.py | 19 - .../hbase-v0_96/package/scripts/functions.py| 40 -- .../hbase-v0_96/package/scripts/hbase.py| 125 --- .../hbase-v0_96/package/scripts/hbase_client.py | 43 --- .../hbase-v0_96/package/scripts/hbase_master.py | 63 .../package/scripts/hbase_regionserver.py | 66 .../package/scripts/hbase_service.py| 45 --- .../hbase-v0_96/package/scripts/params.py | 109 -- .../package/scripts/status_params.py| 26 -- ...-metrics2-hbase.properties-GANGLIA-MASTER.j2 | 62 ...doop-metrics2-hbase.properties-GANGLIA-RS.j2 | 62 .../package/templates/hbase-env.sh.j2 | 81 .../package/templates/hbase_client_jaas.conf.j2 | 22 -- .../package/templates/hbase_master_jaas.conf.j2 | 25 -- .../templates/hbase_regionserver_jaas.conf.j2 | 25 -- .../package/templates/regionservers.j2 | 20 - app-packages/hbase-v0_96/resources.json | 19 - app-packages/hbase/README.txt | 8 +- slider-agent/conf/agent.ini | 2 + .../src/main/python/agent/AgentConfig.py| 21 ++ slider-agent/src/main/python/agent/Constants.py | 3 + .../src/main/python/agent/Controller.py | 23 +- slider-agent/src/main/python/agent/main.py | 4 + .../src/test/python/agent/TestController.py | 30 ++ slider-agent/src/test/python/agent/TestMain.py | 5 +- .../providers/AbstractProviderService.java | 15 +- .../slider/providers/ProviderService.java | 5 +- .../slider/providers/agent/AgentKeys.java | 3 + .../providers/agent/AgentLaunchParameter.java | 130 +++ .../providers/agent/AgentProviderService.java | 179 +++-- .../slider/providers/agent/AgentRoles.java | 18 +- .../apache/slider/providers/agent/Command.java | 13 +- .../slider/providers/agent/CommandResult.java | 16 +- .../providers/agent/ComponentInstanceState.java | 24 ++ .../slider/providers/agent/ContainerState.java | 41 +++ .../providers/agent/HeartbeatMonitor.java | 116 ++ .../server/appmaster/AMViewForProviders.java| 27 ++ .../server/appmaster/SliderAppMaster.java | 32 +- .../slider/server/appmaster/state/AppState.java | 20 + .../services/workflow/ForkedProcessService.java | 25 +- .../services/workflow/LongLivedProcess.java | 13 + .../test_command_log/appConfig_fast_no_reg.json | 29 ++ .../test_command_log/appConfig_no_hb.json | 29 ++ .../model/mock/MockProviderService.groovy | 4 +- .../agent/TestAgentLaunchParameter.java | 76 .../providers/agent/TestHeartbeatMonitor.java | 136 +++ .../publisher/TestAgentProviderService.java | 5 +- .../TestWorkflowForkedProcessService.java | 3 +- .../lifecycle/AgentCommandTestBase.groovy | 100 +++-- .../lifecycle/TestAgentClusterLifecycle.groovy | 2 +- .../funtest/lifecycle/TestAgentFailures.groovy | 103 ++ .../funtest/lifecycle/TestAgentFailures2.groovy | 103 ++ .../lifecycle/TestAppsThroughAgent.groovy | 90 ++--- .../providers/hbase/HBaseProviderService.java | 13 +- .../slider_specs/creating_app_definitions.md| 80 ++-- 65 files changed, 1349 insertions(+), 2088 deletions(-) --
[17/50] [abbrv] git commit: SLIDER-153 python script working: stdout and stderr is being printed after the end of the process
SLIDER-153 python script working: stdout and stderr is being printed after the end of the process Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/06816c4c Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/06816c4c Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/06816c4c Branch: refs/heads/feature/SLIDER-151_Implement_full_slider_API_in_REST_and_switch_client_to_it Commit: 06816c4cd6ffbb94014ff95250f26c5028723a09 Parents: acdfe5b Author: Steve Loughran Authored: Tue Jun 24 10:52:10 2014 -0700 Committer: Steve Loughran Committed: Tue Jun 24 10:52:10 2014 -0700 -- slider-assembly/src/main/scripts/slider.py | 28 - 1 file changed, 18 insertions(+), 10 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/06816c4c/slider-assembly/src/main/scripts/slider.py -- diff --git a/slider-assembly/src/main/scripts/slider.py b/slider-assembly/src/main/scripts/slider.py index 2c1f4b3..cfad59a 100644 --- a/slider-assembly/src/main/scripts/slider.py +++ b/slider-assembly/src/main/scripts/slider.py @@ -97,21 +97,27 @@ def main(): print "slider_home = \"%s\"" % slider_home print "slider_jvm_opts = \"%s\"" % slider_jvm_opts print "slider_classpath = \"%s\"" % slider_classpath - - - commandline = ["java",] + + #java = "/usr/bin/java" + java = "java" + commandline = [java, + "-classpath", + slider_classpath, + SLIDER_CLASSNAME] # commandline.append(slider_jvm_opts) - commandline.append("-classpath") - commandline.append(slider_classpath) - commandline.append(SLIDER_CLASSNAME) commandline.extend(args) print "ready to exec : %s" % commandline # docs warn of using PIPE on stderr - return subprocess.call(commandline, - stdin=None, + exe = subprocess.Popen(commandline, + stdin=subprocess.PIPE, stdout=subprocess.PIPE, - stderr=subprocess.STDOUT, + stderr=subprocess.PIPE, shell=False) + exe.wait() + out, err = exe.communicate() + print "stdout : ", out.decode() + print "stderr : ", err.decode() + return exe.returncode @@ -122,7 +128,9 @@ if __name__ == '__main__': try: rv = main() if rv != 0: - print "exit code = %d" % rv + print "Failed with exit code = %d" % rv +else: + print "Success" except Exception as e: print "Exception: %s " % e.message rv = -1
[3/3] git commit: Merge branch 'feature/SLIDER-162_test_runner_to_bootstrap_clean_HDFS_cluster_for_test_runs' into develop
Merge branch 'feature/SLIDER-162_test_runner_to_bootstrap_clean_HDFS_cluster_for_test_runs' into develop Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/3fb598fb Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/3fb598fb Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/3fb598fb Branch: refs/heads/develop Commit: 3fb598fba45b08b1d1d13124bf3ce5a0b2c77bb5 Parents: 0ad4fb4 1bdf134 Author: Steve Loughran Authored: Mon Jun 30 16:36:17 2014 +0100 Committer: Steve Loughran Committed: Mon Jun 30 16:36:17 2014 +0100 -- .../funtest/framework/AgentUploads.groovy | 13 ++--- .../funtest/framework/FileUploader.groovy | 51 +--- .../lifecycle/AgentCommandTestBase.groovy | 10 +++- 3 files changed, 57 insertions(+), 17 deletions(-) --
[14/50] [abbrv] git commit: SLIDER-106 funtest properties skipped by default
SLIDER-106 funtest properties skipped by default Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/153f5e94 Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/153f5e94 Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/153f5e94 Branch: refs/heads/feature/SLIDER-151_Implement_full_slider_API_in_REST_and_switch_client_to_it Commit: 153f5e94b64a45e97c4b0494755472788455d678 Parents: 537d87c Author: Steve Loughran Authored: Mon Jun 23 16:19:49 2014 -0700 Committer: Steve Loughran Committed: Mon Jun 23 16:19:49 2014 -0700 -- slider-funtest/pom.xml | 34 ++ 1 file changed, 34 insertions(+) -- http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/153f5e94/slider-funtest/pom.xml -- diff --git a/slider-funtest/pom.xml b/slider-funtest/pom.xml index 42a57b2..51b5cec 100644 --- a/slider-funtest/pom.xml +++ b/slider-funtest/pom.xml @@ -265,5 +265,39 @@ + + + tests-on-from-CLI + + + slider.conf.dir + + + +false + + + + tests-on-from-build.properties + + + ../build.properties + + + +false + + + + tests-off + +true + + +true + + + +
[18/50] [abbrv] git commit: SLIDER-163 Change recommended app_log_dir value
SLIDER-163 Change recommended app_log_dir value Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/83e4e473 Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/83e4e473 Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/83e4e473 Branch: refs/heads/feature/SLIDER-151_Implement_full_slider_API_in_REST_and_switch_client_to_it Commit: 83e4e47385d41f4c2258d4c510bd7c1a0ebf2354 Parents: 153f5e9 Author: tedyu Authored: Tue Jun 24 11:07:39 2014 -0700 Committer: tedyu Committed: Tue Jun 24 11:07:39 2014 -0700 -- app-packages/hbase/appConfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/83e4e473/app-packages/hbase/appConfig.json -- diff --git a/app-packages/hbase/appConfig.json b/app-packages/hbase/appConfig.json index 2b7ec52..6225129 100644 --- a/app-packages/hbase/appConfig.json +++ b/app-packages/hbase/appConfig.json @@ -9,7 +9,7 @@ "java_home": "/usr/jdk64/jdk1.7.0_45", "package_list": "files/hbase-${hbase.version}-hadoop2-bin.tar.gz", "site.global.app_user": "yarn", -"site.global.app_log_dir": "${AGENT_LOG_ROOT}/app/log", +"site.global.app_log_dir": "app/log", "site.global.app_pid_dir": "${AGENT_WORK_ROOT}/app/run", "site.global.app_root": "${AGENT_WORK_ROOT}/app/install/hbase-${hbase.version}-hadoop2", "site.global.app_install_dir": "${AGENT_WORK_ROOT}/app/install",
[36/50] [abbrv] git commit: SLIDER-153 revert rename -> slider for bash
SLIDER-153 revert rename -> slider for bash Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/150b589b Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/150b589b Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/150b589b Branch: refs/heads/feature/SLIDER-151_Implement_full_slider_API_in_REST_and_switch_client_to_it Commit: 150b589b72dae4c4b857a6b19205f6ce11f63d39 Parents: 1c5f303 Author: Steve Loughran Authored: Wed Jun 25 11:22:20 2014 -0700 Committer: Steve Loughran Committed: Wed Jun 25 11:22:20 2014 -0700 -- slider-assembly/src/main/scripts/slider| 74 + slider-assembly/src/main/scripts/slider.sh | 74 - 2 files changed, 74 insertions(+), 74 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/150b589b/slider-assembly/src/main/scripts/slider -- diff --git a/slider-assembly/src/main/scripts/slider b/slider-assembly/src/main/scripts/slider new file mode 100755 index 000..caf275b --- /dev/null +++ b/slider-assembly/src/main/scripts/slider @@ -0,0 +1,74 @@ +#!/usr/bin/env bash + +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +# this is the shell script to start Slider deploying an application +# Usage: slider + +# The env variable SLIDER_JVM_OPTS can be used to override +# the default JVM opts + +function usage +{ + echo "Usage: slider " + echo "" +} + +# Slider works out its own location +this="${BASH_SOURCE-$0}" +bindir=$(cd -P -- "$(dirname -- "$this")" && pwd -P) +script="$(basename -- "$this")" + +# lib directory is one up; it is expected to contain +# slider.jar and any other dependencies that are not in the +# standard Hadoop classpath + +slider_home="${bindir}/.." +slider_home=`cd -P "${slider_home}" && pwd -P` + +libdir="${slider_home}/lib" +libdir=`cd -P "${libdir}" && pwd -P` + + +confdir="${slider_home}/conf" + +# normalize the conf dir so it can be passed down +confdir=`cd -P "${confdir}" && pwd -P` +confdir=${SLIDER_CONF_DIR:-$confdir} + + +slider_jvm_opts="-Djava.net.preferIPv4Stack=true -Djava.awt.headless=true -Xmx256m -Djava.confdir=${confdir}" +slider_jvm_opts=${SLIDER_JVM_OPTS:-$slider_jvm_opts} + +# allow for an extra classpath +slider_classpath_extra=${SLIDER_CLASSPATH_EXTRA:-""} + +slider_classpath="${libdir}/*:${confdir}:${slider_classpath_extra}" + +launcher=org.apache.slider.Slider + + +echo "slider_home = \"${slider_home}\"" +echo "slider_jvm_opts = \"${slider_jvm_opts}\"" +echo "classpath = \"${slider_classpath}\"" +export CLASSPATH="${slider_classpath}" +echo "" + +echo "command is java ${slider_jvm_opts} --classpath \"${slider_classpath}\" ${launcher} $@" +echo "" +echo "" +exec java ${slider_jvm_opts} ${launcher} $@ http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/150b589b/slider-assembly/src/main/scripts/slider.sh -- diff --git a/slider-assembly/src/main/scripts/slider.sh b/slider-assembly/src/main/scripts/slider.sh deleted file mode 100755 index caf275b..000 --- a/slider-assembly/src/main/scripts/slider.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/env bash - -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the
[39/50] [abbrv] git commit: SLIDER-173 When host is specified in ContainerRequest, relaxLocality should be false
SLIDER-173 When host is specified in ContainerRequest, relaxLocality should be false Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/22c9689e Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/22c9689e Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/22c9689e Branch: refs/heads/feature/SLIDER-151_Implement_full_slider_API_in_REST_and_switch_client_to_it Commit: 22c9689e648a13f09dda9e78337ebd5afe7f0a47 Parents: 9619c33 Author: tedyu Authored: Wed Jun 25 19:13:07 2014 -0700 Committer: tedyu Committed: Wed Jun 25 19:13:07 2014 -0700 -- .../slider/server/appmaster/state/OutstandingRequest.java | 2 +- .../org/apache/slider/server/appmaster/state/RoleHistory.java | 6 ++ 2 files changed, 7 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/22c9689e/slider-core/src/main/java/org/apache/slider/server/appmaster/state/OutstandingRequest.java -- diff --git a/slider-core/src/main/java/org/apache/slider/server/appmaster/state/OutstandingRequest.java b/slider-core/src/main/java/org/apache/slider/server/appmaster/state/OutstandingRequest.java index 7d3e427..45dd9d1 100644 --- a/slider-core/src/main/java/org/apache/slider/server/appmaster/state/OutstandingRequest.java +++ b/slider-core/src/main/java/org/apache/slider/server/appmaster/state/OutstandingRequest.java @@ -108,7 +108,7 @@ public final class OutstandingRequest { if (node != null) { hosts = new String[1]; hosts[0] = node.hostname; - relaxLocality = true; + relaxLocality = false; locationSpecified = true; // tell the node it is in play node.getOrCreate(roleId); http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/22c9689e/slider-core/src/main/java/org/apache/slider/server/appmaster/state/RoleHistory.java -- diff --git a/slider-core/src/main/java/org/apache/slider/server/appmaster/state/RoleHistory.java b/slider-core/src/main/java/org/apache/slider/server/appmaster/state/RoleHistory.java index 68e7693..990d735 100644 --- a/slider-core/src/main/java/org/apache/slider/server/appmaster/state/RoleHistory.java +++ b/slider-core/src/main/java/org/apache/slider/server/appmaster/state/RoleHistory.java @@ -29,6 +29,7 @@ import org.apache.slider.core.exceptions.BadConfigException; import org.apache.slider.providers.ProviderRole; import org.apache.slider.server.avro.RoleHistoryHeader; import org.apache.slider.server.avro.RoleHistoryWriter; +import org.mortbay.log.Log; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -468,12 +469,17 @@ public class RoleHistory { NodeInstance nodeInstance = null; List targets = getNodesForRoleId(roleKey); +int cnt = targets == null ? 0 : targets.size(); +Log.info("There're " + cnt + " nodes to consider for " + role.getName()); while (targets != null && !targets.isEmpty() && nodeInstance == null) { NodeInstance head = targets.remove(0); if (head.getActiveRoleInstances(roleKey) == 0) { nodeInstance = head; } } +if (nodeInstance == null) { + Log.debug("No node selected for " + role.getName()); +} return nodeInstance; }
[05/50] [abbrv] git commit: SLIDER-156 Utilize multiple log directories when possible
SLIDER-156 Utilize multiple log directories when possible Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/57a9c9f8 Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/57a9c9f8 Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/57a9c9f8 Branch: refs/heads/feature/SLIDER-151_Implement_full_slider_API_in_REST_and_switch_client_to_it Commit: 57a9c9f88d7bc41ee80320dd146244be5c3d420f Parents: 45f5d79 Author: tedyu Authored: Sun Jun 22 17:52:20 2014 -0700 Committer: tedyu Committed: Sun Jun 22 17:52:20 2014 -0700 -- .../slider/providers/hbase/HBaseProviderService.java | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/57a9c9f8/slider-providers/hbase/slider-hbase-provider/src/main/java/org/apache/slider/providers/hbase/HBaseProviderService.java -- diff --git a/slider-providers/hbase/slider-hbase-provider/src/main/java/org/apache/slider/providers/hbase/HBaseProviderService.java b/slider-providers/hbase/slider-hbase-provider/src/main/java/org/apache/slider/providers/hbase/HBaseProviderService.java index 5405753..a578441 100644 --- a/slider-providers/hbase/slider-hbase-provider/src/main/java/org/apache/slider/providers/hbase/HBaseProviderService.java +++ b/slider-providers/hbase/slider-hbase-provider/src/main/java/org/apache/slider/providers/hbase/HBaseProviderService.java @@ -60,6 +60,7 @@ import java.net.URL; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Random; import static org.apache.slider.server.appmaster.web.rest.RestPaths.SLIDER_PATH_PUBLISHER; @@ -127,9 +128,16 @@ public class HBaseProviderService extends AbstractProviderService implements // Set the environment launcher.putEnv(SliderUtils.buildEnvMap(appComponent)); -String logDir = providerUtils.getLogdir(); -int idx = logDir.indexOf(","); -launcher.setEnv(HBASE_LOG_DIR, idx > 0 ? logDir.substring(0, idx) : logDir); +String logDirs = providerUtils.getLogdir(); +String logDir; +int idx = logDirs.indexOf(","); +if (idx > 0) { + // randomly choose a log dir candidate + String[] segments = logDirs.split(","); + Random rand = new Random(); + logDir = segments[rand.nextInt(segments.length)]; +} else logDir = logDirs; +launcher.setEnv(HBASE_LOG_DIR, logDir); launcher.setEnv(PROPAGATED_CONFDIR, ProviderUtils.convertToAppRelativePath(
[34/50] [abbrv] git commit: SLIDER-169 Change proxy-user cookie log to DEBUG
SLIDER-169 Change proxy-user cookie log to DEBUG Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/93bd8ce6 Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/93bd8ce6 Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/93bd8ce6 Branch: refs/heads/feature/SLIDER-151_Implement_full_slider_API_in_REST_and_switch_client_to_it Commit: 93bd8ce6f3ef3ab7e94a4ab7298c321549de1565 Parents: 1866733 Author: tedyu Authored: Wed Jun 25 10:24:42 2014 -0700 Committer: tedyu Committed: Wed Jun 25 10:24:42 2014 -0700 -- .../org/apache/slider/server/appmaster/web/SliderAmIpFilter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/93bd8ce6/slider-core/src/main/java/org/apache/slider/server/appmaster/web/SliderAmIpFilter.java -- diff --git a/slider-core/src/main/java/org/apache/slider/server/appmaster/web/SliderAmIpFilter.java b/slider-core/src/main/java/org/apache/slider/server/appmaster/web/SliderAmIpFilter.java index dec89d1..fc96284 100644 --- a/slider-core/src/main/java/org/apache/slider/server/appmaster/web/SliderAmIpFilter.java +++ b/slider-core/src/main/java/org/apache/slider/server/appmaster/web/SliderAmIpFilter.java @@ -121,7 +121,7 @@ public class SliderAmIpFilter implements Filter { } try { if (user == null) { -log.warn("Could not find " + WebAppProxyServlet.PROXY_USER_COOKIE_NAME +log.debug("Could not find " + WebAppProxyServlet.PROXY_USER_COOKIE_NAME + " cookie, so user will not be set"); chain.doFilter(req, resp); } else {
[50/50] [abbrv] git commit: Merge branch 'develop' into feature/SLIDER-151_Implement_full_slider_API_in_REST_and_switch_client_to_it
Merge branch 'develop' into feature/SLIDER-151_Implement_full_slider_API_in_REST_and_switch_client_to_it Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/81a85495 Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/81a85495 Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/81a85495 Branch: refs/heads/feature/SLIDER-151_Implement_full_slider_API_in_REST_and_switch_client_to_it Commit: 81a85495de9dcbf6aed1a37594d0e29b95a180d5 Parents: 6f5c5fa 0ad4fb4 Author: Steve Loughran Authored: Mon Jun 30 16:16:30 2014 +0100 Committer: Steve Loughran Committed: Mon Jun 30 16:16:30 2014 +0100 -- .gitignore | 10 +- LICENSE | 423 LICENSE.txt | 423 NOTICE |5 + NOTICE.txt |5 - app-packages/accumulo-v1_5/README.txt | 33 - app-packages/accumulo-v1_5/appConfig.json | 62 -- .../configuration/accumulo-site.xml | 111 -- .../accumulo-v1_5/configuration/global.xml | 94 -- app-packages/accumulo-v1_5/jmx_metrics.json | 41 - app-packages/accumulo-v1_5/metainfo.xml | 145 --- .../files/accumulo-1.5.1-bin.tar.gz.REPLACE | 14 - .../package/files/accumulo-metrics.xml | 60 -- .../accumulo-v1_5/package/files/auditLog.xml| 41 - app-packages/accumulo-v1_5/package/files/gc | 16 - .../package/files/generic_logger.xml| 83 -- .../package/files/log4j.properties | 41 - .../accumulo-v1_5/package/files/masters | 16 - .../accumulo-v1_5/package/files/monitor | 16 - .../package/files/monitor_logger.xml| 64 -- app-packages/accumulo-v1_5/package/files/slaves | 16 - .../accumulo-v1_5/package/files/tracers | 16 - .../accumulo-v1_5/package/scripts/__init__.py | 19 - .../package/scripts/accumulo_client.py | 43 - .../package/scripts/accumulo_configuration.py | 134 --- .../package/scripts/accumulo_gc.py | 24 - .../package/scripts/accumulo_master.py | 24 - .../package/scripts/accumulo_monitor.py | 24 - .../package/scripts/accumulo_script.py | 110 -- .../package/scripts/accumulo_service.py | 52 - .../package/scripts/accumulo_tracer.py | 24 - .../package/scripts/accumulo_tserver.py | 24 - .../accumulo-v1_5/package/scripts/params.py | 72 -- .../package/scripts/status_params.py| 26 - .../package/templates/accumulo-env.sh.j2| 42 - app-packages/accumulo-v1_5/resources.json | 31 - app-packages/accumulo/LICENSE.txt | 261 + app-packages/accumulo/NOTICE.txt|8 + app-packages/accumulo/README.txt| 47 + app-packages/accumulo/appConfig.json| 62 ++ .../accumulo/configuration/accumulo-site.xml| 111 ++ app-packages/accumulo/configuration/global.xml | 94 ++ app-packages/accumulo/jmx_metrics.json | 41 + app-packages/accumulo/metainfo.xml | 147 +++ .../accumulo/package/files/accumulo-metrics.xml | 60 ++ .../accumulo/package/files/auditLog.xml | 41 + app-packages/accumulo/package/files/gc | 16 + .../accumulo/package/files/generic_logger.xml | 83 ++ .../accumulo/package/files/log4j.properties | 41 + app-packages/accumulo/package/files/masters | 16 + app-packages/accumulo/package/files/monitor | 16 + .../accumulo/package/files/monitor_logger.xml | 64 ++ app-packages/accumulo/package/files/slaves | 16 + app-packages/accumulo/package/files/tracers | 16 + .../accumulo/package/scripts/__init__.py| 19 + .../accumulo/package/scripts/accumulo_client.py | 43 + .../package/scripts/accumulo_configuration.py | 135 +++ .../accumulo/package/scripts/accumulo_gc.py | 24 + .../accumulo/package/scripts/accumulo_master.py | 24 + .../package/scripts/accumulo_monitor.py | 24 + .../accumulo/package/scripts/accumulo_script.py | 110 ++ .../package/scripts/accumulo_service.py | 52 + .../accumulo/package/scripts/accumulo_tracer.py | 24 + .../package/scripts/accumulo_tserver.py | 24 + app-packages/accumulo/package/scripts/params.py | 76 ++ .../accumulo/package/scripts/status_params.py | 26 + .../package/templates/accumulo-env.sh.j2| 42 + app-packages/accumulo/pom.xml | 93 ++ app-packages/accumulo/resources.json| 31 + app-packages/accumulo/src/assembly/accumulo.xml | 71 ++ app-packages/hbase-v0_96/README.txt | 33 - app-packages/hbase-v0_96/appConfig.json
[45/50] [abbrv] git commit: SLIDER-173 relaxLocality should be false if specific node is requested
SLIDER-173 relaxLocality should be false if specific node is requested Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/590cbe02 Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/590cbe02 Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/590cbe02 Branch: refs/heads/feature/SLIDER-151_Implement_full_slider_API_in_REST_and_switch_client_to_it Commit: 590cbe02a805362242657f1c3be3b60fe0ab7825 Parents: ea251f1 Author: tedyu Authored: Thu Jun 26 19:23:35 2014 -0700 Committer: tedyu Committed: Thu Jun 26 19:23:35 2014 -0700 -- .../slider/server/appmaster/state/ContainerPriority.java | 8 ++-- .../slider/server/appmaster/state/OutstandingRequest.java| 7 ++- .../appmaster/model/appstate/TestMockRMOperations.groovy | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/590cbe02/slider-core/src/main/java/org/apache/slider/server/appmaster/state/ContainerPriority.java -- diff --git a/slider-core/src/main/java/org/apache/slider/server/appmaster/state/ContainerPriority.java b/slider-core/src/main/java/org/apache/slider/server/appmaster/state/ContainerPriority.java index ccd9a64..935c09f 100644 --- a/slider-core/src/main/java/org/apache/slider/server/appmaster/state/ContainerPriority.java +++ b/slider-core/src/main/java/org/apache/slider/server/appmaster/state/ContainerPriority.java @@ -37,9 +37,13 @@ import org.apache.hadoop.yarn.util.Records; */ public final class ContainerPriority { + // bit that represents whether location is specified + static final int LOCATION = 1 << 30; + public static int buildPriority(int role, boolean locationSpecified) { -return (role) ; +int location = locationSpecified ? LOCATION : 0; +return role | LOCATION; } @@ -53,7 +57,7 @@ public final class ContainerPriority { public static int extractRole(int priority) { -return priority ; +return priority >= LOCATION ? priority^LOCATION : priority; } /** http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/590cbe02/slider-core/src/main/java/org/apache/slider/server/appmaster/state/OutstandingRequest.java -- diff --git a/slider-core/src/main/java/org/apache/slider/server/appmaster/state/OutstandingRequest.java b/slider-core/src/main/java/org/apache/slider/server/appmaster/state/OutstandingRequest.java index 7d3e427..0d8b56c 100644 --- a/slider-core/src/main/java/org/apache/slider/server/appmaster/state/OutstandingRequest.java +++ b/slider-core/src/main/java/org/apache/slider/server/appmaster/state/OutstandingRequest.java @@ -103,23 +103,20 @@ public final class OutstandingRequest { RoleStatus role, long time) { String[] hosts; boolean relaxLocality; -boolean locationSpecified; requestedTime = time; if (node != null) { hosts = new String[1]; hosts[0] = node.hostname; - relaxLocality = true; - locationSpecified = true; + relaxLocality = false; // tell the node it is in play node.getOrCreate(roleId); log.info("Submitting request for container on {}", hosts[0]); } else { hosts = null; relaxLocality = true; - locationSpecified = false; } Priority pri = ContainerPriority.createPriority(roleId, -locationSpecified); +!relaxLocality); AMRMClient.ContainerRequest request = new AMRMClient.ContainerRequest(resource, hosts, http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/590cbe02/slider-core/src/test/groovy/org/apache/slider/server/appmaster/model/appstate/TestMockRMOperations.groovy -- diff --git a/slider-core/src/test/groovy/org/apache/slider/server/appmaster/model/appstate/TestMockRMOperations.groovy b/slider-core/src/test/groovy/org/apache/slider/server/appmaster/model/appstate/TestMockRMOperations.groovy index 7f92f9c..168ac9f 100644 --- a/slider-core/src/test/groovy/org/apache/slider/server/appmaster/model/appstate/TestMockRMOperations.groovy +++ b/slider-core/src/test/groovy/org/apache/slider/server/appmaster/model/appstate/TestMockRMOperations.groovy @@ -41,7 +41,7 @@ class TestMockRMOperations extends BaseMockAppStateTest implements MockRoles { @Test public void testPriorityOnly() throws Throwable { -assert 5 == buildPriority(5, false) +assert 5 == extractRole(buildPriority(5, false)) }
[2/3] git commit: Merge branch 'develop' into feature/SLIDER-162_test_runner_to_bootstrap_clean_HDFS_cluster_for_test_runs
Merge branch 'develop' into feature/SLIDER-162_test_runner_to_bootstrap_clean_HDFS_cluster_for_test_runs Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/1bdf134a Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/1bdf134a Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/1bdf134a Branch: refs/heads/develop Commit: 1bdf134af5dd9fdb8186c848df8806324296f9cc Parents: e3c5d9d 0ad4fb4 Author: Steve Loughran Authored: Mon Jun 30 16:18:14 2014 +0100 Committer: Steve Loughran Committed: Mon Jun 30 16:18:14 2014 +0100 -- LICENSE | 423 +++ LICENSE.txt | 423 --- NOTICE | 5 + NOTICE.txt | 5 - app-packages/accumulo/metainfo.xml | 238 +-- app-packages/hbase/metainfo.xml | 168 app-packages/storm-v0_91/metainfo.xml | 229 +- slider-assembly/src/main/scripts/slider.py | 107 +++-- .../providers/agent/AgentClientProvider.java| 29 +- .../slider/providers/agent/AgentKeys.java | 1 - .../providers/agent/AgentProviderService.java | 53 +-- .../agent/application/metadata/Application.java | 121 ++ .../agent/application/metadata/Metainfo.java| 17 +- .../application/metadata/MetainfoParser.java| 10 +- .../agent/application/metadata/Service.java | 121 -- .../appmaster/state/ContainerPriority.java | 8 +- .../appmaster/state/OutstandingRequest.java | 7 +- .../server/appmaster/state/RoleHistory.java | 8 + .../app_packages/test_command_log/metainfo.xml | 62 ++- .../agent/AgentMiniClusterTestBase.groovy | 41 +- .../slider/providers/agent/AgentTestBase.groovy | 44 +- .../agent/TestAgentAMManagementWS.groovy| 3 +- .../slider/providers/agent/TestAgentEcho.groovy | 6 +- .../providers/agent/TestBuildBasicAgent.groovy | 78 ++-- .../curator/TestRegistryRestResources.groovy| 3 +- .../model/appstate/TestMockRMOperations.groovy | 2 +- .../publisher/TestPublisherRestResources.groovy | 3 +- .../slider/common/tools/TestSliderUtils.java| 23 +- .../agent/TestAgentClientProvider.java | 40 +- .../agent/TestAgentProviderService.java | 61 ++- .../metadata/MetainfoParserTest.java| 15 +- .../org/apache/slider/tools/TestUtility.java| 71 slider-core/src/test/python/appdef_1.zip| Bin 972 -> 0 bytes slider-core/src/test/python/metainfo.xml| 68 ++- .../org/apache/slider/common/tools/test.zip | Bin 1273 -> 0 bytes .../slider/common/tools/test/metainfo.txt | 16 + .../slider/common/tools/test/metainfo.xml | 95 + .../slider/common/tools/test/someOtherFile.txt | 16 + .../slider/common/tools/test/someOtherFile.xml | 16 + .../agent/application/metadata/metainfo.xml | 136 +++--- .../slider/providers/hbase/HBaseRoles.java | 3 +- 41 files changed, 1543 insertions(+), 1232 deletions(-) --
[28/50] [abbrv] git commit: Modify README.txt for HBase app package
Modify README.txt for HBase app package Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/3be6c869 Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/3be6c869 Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/3be6c869 Branch: refs/heads/feature/SLIDER-151_Implement_full_slider_API_in_REST_and_switch_client_to_it Commit: 3be6c86922d0413163e65766d827bfcc03d60f88 Parents: 209cee4 Author: tedyu Authored: Tue Jun 24 14:00:22 2014 -0700 Committer: tedyu Committed: Tue Jun 24 14:00:22 2014 -0700 -- app-packages/hbase/README.txt | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/3be6c869/app-packages/hbase/README.txt -- diff --git a/app-packages/hbase/README.txt b/app-packages/hbase/README.txt index fb84750..78d033e 100644 --- a/app-packages/hbase/README.txt +++ b/app-packages/hbase/README.txt @@ -17,10 +17,17 @@ How to create a Slider package for HBase? +The version of HBase used for the app package can be adjusted by adding a +flag such as + -Dhbase.version=0.98.3 + Copy the tarball for HBase: cp ~/Downloads/hbase-0.98.3-hadoop2-bin.tar.gz package/files/ -If, HBase tarball is publised in maven repository, you can use: +Use the following command to install HBase tarball locally: + mvn install:install-file -Dfile= -DgroupId=org.apache.hbase -DartifactId=hbase -Dversion=0.98.3-hadoop2 -Dclassifier=bin -Dpackaging=tar.gz + +After HBase tarball is publised locally in maven repository, you can use the following command: mvn clean package -DskipTests -Phbase-app-package App package can be found in app-packages/HBase/target/apache-slider-hbase-${hbase.version}-app-package-${slider.version}.zip @@ -36,10 +43,6 @@ work well as the default configuration for Slider apps. So it is advisable that when you create an application package for Slider, include sample/default resources.json and appConfig.json for a minimal Yarn cluster. -The version of HBase used for the app package can be adjusted by adding a -flag such as - -Dhbase.version=0.98.3 - If an HBase version older than 0.98.3 is desired, it must be installed in the local maven repo.
[16/50] [abbrv] git commit: File upload work ... security model wrong
File upload work ... security model wrong Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/8327e52a Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/8327e52a Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/8327e52a Branch: refs/heads/feature/SLIDER-151_Implement_full_slider_API_in_REST_and_switch_client_to_it Commit: 8327e52ae2dec00e0a954da1804413b1ef76f93c Parents: 81578df Author: Steve Loughran Authored: Mon Jun 23 18:42:25 2014 -0700 Committer: Steve Loughran Committed: Mon Jun 23 18:42:25 2014 -0700 -- .../funtest/framework/AgentUploads.groovy | 41 +++ .../funtest/framework/FileUploader.groovy | 76 .../slider/funtest/framework/SudoClosure.groovy | 54 ++ 3 files changed, 171 insertions(+) -- http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/8327e52a/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/AgentUploads.groovy -- diff --git a/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/AgentUploads.groovy b/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/AgentUploads.groovy new file mode 100644 index 000..b1c29c0 --- /dev/null +++ b/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/AgentUploads.groovy @@ -0,0 +1,41 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.slider.funtest.framework + +import groovy.util.logging.Slf4j +import org.apache.hadoop.conf.Configuration +import org.apache.hadoop.fs.FileUtil +import org.apache.hadoop.fs.Path +import org.apache.hadoop.fs.permission.FsPermission +import org.apache.hadoop.security.UserGroupInformation + +@Slf4j +class AgentUploads { + final Configuration conf + + + AgentUploads(Configuration conf) { +this.conf = conf + } + + def execUploadSequence() { +UserGroupInformation.loginUserFromKeytabAndReturnUGI("yarn") + } + +} http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/8327e52a/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/FileUploader.groovy -- diff --git a/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/FileUploader.groovy b/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/FileUploader.groovy new file mode 100644 index 000..dd42473 --- /dev/null +++ b/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/FileUploader.groovy @@ -0,0 +1,76 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.slider.funtest.framework + +import groovy.util.logging.Slf4j +import org.apache.hadoop.conf.Configuration +import org.apache.hadoop.fs.FileUtil +import org.apache.hadoop.fs.Path +import org.apache.hadoop.fs.permission.FsPermission +import org.apache.hadoop.security.UserGroupInformation + +@Slf4j +class FileUploader { + final Configuration conf + final UserGroupInformation user + + FileUploader(Configuration conf, UserGroupInformation user) { +this.conf = conf +this.user = user + } + + /** + * Copy if the file is considered out of date + * @param s
[42/50] [abbrv] git commit: SLIDER-96. Fixes to some tests.
SLIDER-96. Fixes to some tests. Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/78a1364b Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/78a1364b Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/78a1364b Branch: refs/heads/feature/SLIDER-151_Implement_full_slider_API_in_REST_and_switch_client_to_it Commit: 78a1364b1c52453f029d3afdedfd1fc6e9fb6ebb Parents: b64e1cd Author: Sumit Mohanty Authored: Thu Jun 26 07:21:28 2014 -0700 Committer: Sumit Mohanty Committed: Thu Jun 26 13:41:31 2014 -0700 -- .../slider/providers/agent/AgentTestBase.groovy | 2 +- .../providers/agent/TestBuildBasicAgent.groovy | 73 ++-- 2 files changed, 36 insertions(+), 39 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/78a1364b/slider-core/src/test/groovy/org/apache/slider/providers/agent/AgentTestBase.groovy -- diff --git a/slider-core/src/test/groovy/org/apache/slider/providers/agent/AgentTestBase.groovy b/slider-core/src/test/groovy/org/apache/slider/providers/agent/AgentTestBase.groovy index bb3eabe..9b4c377 100644 --- a/slider-core/src/test/groovy/org/apache/slider/providers/agent/AgentTestBase.groovy +++ b/slider-core/src/test/groovy/org/apache/slider/providers/agent/AgentTestBase.groovy @@ -47,7 +47,7 @@ public abstract class AgentTestBase extends YarnZKMiniClusterTestBase { @Rule public TemporaryFolder folder = new TemporaryFolder(); - public static String app_def_pkg_path; + public String app_def_pkg_path; @Before public void setupAppPkg() { http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/78a1364b/slider-core/src/test/groovy/org/apache/slider/providers/agent/TestBuildBasicAgent.groovy -- diff --git a/slider-core/src/test/groovy/org/apache/slider/providers/agent/TestBuildBasicAgent.groovy b/slider-core/src/test/groovy/org/apache/slider/providers/agent/TestBuildBasicAgent.groovy index 1879f84..9f44888 100644 --- a/slider-core/src/test/groovy/org/apache/slider/providers/agent/TestBuildBasicAgent.groovy +++ b/slider-core/src/test/groovy/org/apache/slider/providers/agent/TestBuildBasicAgent.groovy @@ -38,34 +38,31 @@ import static org.apache.slider.providers.agent.AgentKeys.* @Slf4j class TestBuildBasicAgent extends AgentTestBase { static String TEST_FILES = "./src/test/resources/org/apache/slider/providers/agent/tests/" + static File slider_core = new File(new File(".").absoluteFile, "src/test/python"); + static String bad_app_def = "appdef_1.tar" + static File bad_app_def_path = new File(slider_core, bad_app_def) + static String agt_conf = "agent.ini" + static File agt_conf_path = new File(slider_core, agt_conf) @Override void checkTestAssumptions(YarnConfiguration conf) { } - private static class TestResources { -static File slider_core = new File(new File(".").absoluteFile, "src/test/python"); -static String bad_app_def = "appdef_1.tar" -static File bad_app_def_path = new File(slider_core, bad_app_def) -static String agt_conf = "agent.ini" -static File agt_conf_path = new File(slider_core, agt_conf) - -public static File getAppDef() { - return new File(app_def_pkg_path); -} + private File getAppDef() { +return new File(app_def_pkg_path); + } -public static File getBadAppDef() { - return bad_app_def_path; -} + private File getBadAppDef() { +return bad_app_def_path; + } -public static File getAgentConf() { - return agt_conf_path; -} + private File getAgentConf() { +return agt_conf_path; + } -public static File getAgentImg() { - return new File(app_def_pkg_path); -} + private File getAgentImg() { +return new File(app_def_pkg_path); } @@ -86,8 +83,8 @@ class TestBuildBasicAgent extends AgentTestBase { [ ARG_OPTION, CONTROLLER_URL, "http://localhost";, ARG_PACKAGE, ".", -ARG_OPTION, APP_DEF, "file://" + TestResources.getAppDef().absolutePath, -ARG_OPTION, AGENT_CONF, "file://" + TestResources.getAgentConf().absolutePath, +ARG_OPTION, APP_DEF, "file://" + getAppDef().absolutePath, +ARG_OPTION, AGENT_CONF, "file://" + getAgentConf().absolutePath, ARG_OPTION, SCRIPT_PATH, "agent/scripts/agent.py", ARG_COMP_OPT, ROLE_NODE, SCRIPT_PATH, "agent/scripts/agent.py", ARG_RES_COMP_OPT, ROLE_NODE, ResourceKeys.COMPONENT_PRIORITY, "1", @@ -106,8 +103,8 @@ class TestBuildBasicAgent extends AgentTestBase { [ ARG_OPTION, CONTROLLER_URL, "http://localhost";, ARG_OPTI
[29/50] [abbrv] git commit: SLIDER-153 bin/slider is now python
SLIDER-153 bin/slider is now python Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/6f05995e Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/6f05995e Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/6f05995e Branch: refs/heads/feature/SLIDER-151_Implement_full_slider_API_in_REST_and_switch_client_to_it Commit: 6f05995e42c767062500da68759f75e7f66fd05c Parents: 8a8ffd9 Author: Steve Loughran Authored: Tue Jun 24 16:08:58 2014 -0700 Committer: Steve Loughran Committed: Tue Jun 24 16:08:58 2014 -0700 -- slider-assembly/src/main/scripts/slider| 217 +--- slider-assembly/src/main/scripts/slider.py | 169 -- slider-assembly/src/main/scripts/slider.sh | 74 3 files changed, 230 insertions(+), 230 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/6f05995e/slider-assembly/src/main/scripts/slider -- diff --git a/slider-assembly/src/main/scripts/slider b/slider-assembly/src/main/scripts/slider old mode 100755 new mode 100644 index caf275b..d48eca6 --- a/slider-assembly/src/main/scripts/slider +++ b/slider-assembly/src/main/scripts/slider @@ -1,5 +1,6 @@ -#!/usr/bin/env bash - +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. @@ -7,68 +8,162 @@ # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - - -# this is the shell script to start Slider deploying an application -# Usage: slider - -# The env variable SLIDER_JVM_OPTS can be used to override -# the default JVM opts - -function usage -{ - echo "Usage: slider " - echo "" -} - -# Slider works out its own location -this="${BASH_SOURCE-$0}" -bindir=$(cd -P -- "$(dirname -- "$this")" && pwd -P) -script="$(basename -- "$this")" - -# lib directory is one up; it is expected to contain -# slider.jar and any other dependencies that are not in the -# standard Hadoop classpath - -slider_home="${bindir}/.." -slider_home=`cd -P "${slider_home}" && pwd -P` - -libdir="${slider_home}/lib" -libdir=`cd -P "${libdir}" && pwd -P` - - -confdir="${slider_home}/conf" - -# normalize the conf dir so it can be passed down -confdir=`cd -P "${confdir}" && pwd -P` -confdir=${SLIDER_CONF_DIR:-$confdir} - - -slider_jvm_opts="-Djava.net.preferIPv4Stack=true -Djava.awt.headless=true -Xmx256m -Djava.confdir=${confdir}" -slider_jvm_opts=${SLIDER_JVM_OPTS:-$slider_jvm_opts} - -# allow for an extra classpath -slider_classpath_extra=${SLIDER_CLASSPATH_EXTRA:-""} - -slider_classpath="${libdir}/*:${confdir}:${slider_classpath_extra}" - -launcher=org.apache.slider.Slider - - -echo "slider_home = \"${slider_home}\"" -echo "slider_jvm_opts = \"${slider_jvm_opts}\"" -echo "classpath = \"${slider_classpath}\"" -export CLASSPATH="${slider_classpath}" -echo "" - -echo "command is java ${slider_jvm_opts} --classpath \"${slider_classpath}\" ${launcher} $@" -echo "" -echo "" -exec java ${slider_jvm_opts} ${launcher} $@ +import sys +import os +import subprocess + +CONF = "conf" + +LIB = "lib" + +SLIDER_CONF_DIR = "SLIDER_CONF_DIR" +SLIDER_JVM_OPTS = "SLIDER_JVM_OPTS" +SLIDER_CLASSPATH_EXTRA = "SLIDER_CLASSPATH_EXTRA" + +SLIDER_CLASSNAME = "org.apache.slider.Slider" +DEFAULT_JVM__OPTS = "-Djava.net.preferIPv4Stack=true -Djava.awt.headless=true -Xmx256m -Djava.confdir=%s" + +""" +Launches slider + + +""" + + + +def scriptDir(): + """ + get the script path + """ + return os.path.dirname(os.path.realpath(__file__)) + +def sliderDir(): + return os.path.dirname(scriptDir()) + +def libDir(sliderdir) : + return os.path.join(sliderdir, LIB) + +def confDir(sliderdir): + """ + determine the active configuration directory + :param sliderdir: slider directory + :return: the configuration directory -any env var will + override the relative path + """ + localconf = os.path.join(sliderdir, CONF) + return os.environ.get(SLIDER_CONF_DIR,localconf) + +def dirMustExist(dir): + if not os.path.exists(dir): +raise Exception("Directory does not exist: %s " % dir) + return dir + +def read(pipe
[13/50] [abbrv] git commit: SLIDER-153 more on execing scripts
SLIDER-153 more on execing scripts Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/acdfe5bd Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/acdfe5bd Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/acdfe5bd Branch: refs/heads/feature/SLIDER-151_Implement_full_slider_API_in_REST_and_switch_client_to_it Commit: acdfe5bd6dfe59daca573a5e28271d9950467b16 Parents: 918e746 Author: Steve Loughran Authored: Mon Jun 23 14:47:28 2014 -0700 Committer: Steve Loughran Committed: Mon Jun 23 14:47:28 2014 -0700 -- slider-assembly/src/main/scripts/slider.py | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/acdfe5bd/slider-assembly/src/main/scripts/slider.py -- diff --git a/slider-assembly/src/main/scripts/slider.py b/slider-assembly/src/main/scripts/slider.py index e846e64..2c1f4b3 100644 --- a/slider-assembly/src/main/scripts/slider.py +++ b/slider-assembly/src/main/scripts/slider.py @@ -89,11 +89,10 @@ def main(): slider_classpath_extra = os.environ.get(SLIDER_CLASSPATH_EXTRA, "") p = os.pathsep# path separator d = os.sep# dir separator - slider_classpath = '"' + \ - libdir + d + "*" + p \ + slider_classpath = libdir + d + "*" + p \ + confdir + p \ - + slider_classpath_extra \ - + '"' + + slider_classpath_extra + print "slider_home = \"%s\"" % slider_home print "slider_jvm_opts = \"%s\"" % slider_jvm_opts @@ -111,7 +110,7 @@ def main(): return subprocess.call(commandline, stdin=None, stdout=subprocess.PIPE, - stderr=subprocess.PIPE, + stderr=subprocess.STDOUT, shell=False)
[26/50] [abbrv] git commit: SLIDER-153 fix shebang line
SLIDER-153 fix shebang line Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/77f3e021 Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/77f3e021 Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/77f3e021 Branch: refs/heads/feature/SLIDER-151_Implement_full_slider_API_in_REST_and_switch_client_to_it Commit: 77f3e02186cf1e55857eb991c216e94ef4f85c49 Parents: 6fc569d Author: Steve Loughran Authored: Tue Jun 24 13:18:50 2014 -0700 Committer: Steve Loughran Committed: Tue Jun 24 13:18:50 2014 -0700 -- slider-assembly/src/main/scripts/slider.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/77f3e021/slider-assembly/src/main/scripts/slider.py -- diff --git a/slider-assembly/src/main/scripts/slider.py b/slider-assembly/src/main/scripts/slider.py index 1e55cc6..77c39aa 100644 --- a/slider-assembly/src/main/scripts/slider.py +++ b/slider-assembly/src/main/scripts/slider.py @@ -1,4 +1,4 @@ -# !/usr/bin/env python +#!/usr/bin/env python # -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one or more
[47/50] [abbrv] git commit: SLIDER-173 Container requests for the same role should utilize different nodes - add more logs
SLIDER-173 Container requests for the same role should utilize different nodes - add more logs Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/581c182b Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/581c182b Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/581c182b Branch: refs/heads/feature/SLIDER-151_Implement_full_slider_API_in_REST_and_switch_client_to_it Commit: 581c182beccc24bbc720b363ba42ea927b09e84f Parents: 736a9c7 Author: tedyu Authored: Fri Jun 27 09:29:32 2014 -0700 Committer: tedyu Committed: Fri Jun 27 09:29:32 2014 -0700 -- .../org/apache/slider/server/appmaster/state/RoleHistory.java | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/581c182b/slider-core/src/main/java/org/apache/slider/server/appmaster/state/RoleHistory.java -- diff --git a/slider-core/src/main/java/org/apache/slider/server/appmaster/state/RoleHistory.java b/slider-core/src/main/java/org/apache/slider/server/appmaster/state/RoleHistory.java index 990d735..0cd2b39 100644 --- a/slider-core/src/main/java/org/apache/slider/server/appmaster/state/RoleHistory.java +++ b/slider-core/src/main/java/org/apache/slider/server/appmaster/state/RoleHistory.java @@ -406,6 +406,7 @@ public class RoleHistory { for (int i = 0; i < roleSize; i++) { NodeEntry nodeEntry = ni.get(i); if (nodeEntry != null && nodeEntry.isAvailable()) { + log.debug("Adding {} for role {}", ni, i); getOrCreateNodesForRoleId(i).add(ni); } } @@ -470,7 +471,7 @@ public class RoleHistory { List targets = getNodesForRoleId(roleKey); int cnt = targets == null ? 0 : targets.size(); -Log.info("There're " + cnt + " nodes to consider for " + role.getName()); +log.info("There're {} nodes to consider for {}", cnt, role.getName()); while (targets != null && !targets.isEmpty() && nodeInstance == null) { NodeInstance head = targets.remove(0); if (head.getActiveRoleInstances(roleKey) == 0) { @@ -478,7 +479,7 @@ public class RoleHistory { } } if (nodeInstance == null) { - Log.debug("No node selected for " + role.getName()); + log.debug("No node selected for {}", role.getName()); } return nodeInstance; } @@ -597,6 +598,7 @@ public class RoleHistory { hosts = outstandingRequests.cancelOutstandingRequests(role); if (!hosts.isEmpty()) { //add the list +log.debug("Adding {} hosts for role {}", hosts.size(), role); getOrCreateNodesForRoleId(role).addAll(hosts); sortAvailableNodeList(role); }
[37/50] [abbrv] git commit: Merge branch 'feature/SLIDER-153_add_slider_py_command' into develop
Merge branch 'feature/SLIDER-153_add_slider_py_command' into develop Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/7089fa0f Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/7089fa0f Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/7089fa0f Branch: refs/heads/feature/SLIDER-151_Implement_full_slider_API_in_REST_and_switch_client_to_it Commit: 7089fa0fbd6d1cb8c92eb1a360cdd82429321bdf Parents: 1866733 150b589 Author: Steve Loughran Authored: Wed Jun 25 11:22:59 2014 -0700 Committer: Steve Loughran Committed: Wed Jun 25 11:22:59 2014 -0700 -- slider-assembly/src/main/scripts/slider| 1 - slider-assembly/src/main/scripts/slider.py | 169 2 files changed, 169 insertions(+), 1 deletion(-) --
[11/50] [abbrv] git commit: SLIDER-153 stub main()
SLIDER-153 stub main() Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/d6131ca4 Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/d6131ca4 Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/d6131ca4 Branch: refs/heads/feature/SLIDER-151_Implement_full_slider_API_in_REST_and_switch_client_to_it Commit: d6131ca426bee6e8aa9819a377bb82345fc97b56 Parents: e519fbc Author: Steve Loughran Authored: Mon Jun 23 13:41:18 2014 -0700 Committer: Steve Loughran Committed: Mon Jun 23 13:41:18 2014 -0700 -- slider-assembly/src/main/scripts/slider.py | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/d6131ca4/slider-assembly/src/main/scripts/slider.py -- diff --git a/slider-assembly/src/main/scripts/slider.py b/slider-assembly/src/main/scripts/slider.py index f154210..d5891ed 100644 --- a/slider-assembly/src/main/scripts/slider.py +++ b/slider-assembly/src/main/scripts/slider.py @@ -15,8 +15,14 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +import sys +import subprocess # Slider main method - +def main(): + + if __name__ == '__main__': -print "slider python script" \ No newline at end of file +print "slider python script" +rv = main() +sys.exit(rv)
[33/50] [abbrv] git commit: Merge branch 'feature/SLIDER-160_Improve_slider_functional_testing' into develop
Merge branch 'feature/SLIDER-160_Improve_slider_functional_testing' into develop Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/18667336 Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/18667336 Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/18667336 Branch: refs/heads/feature/SLIDER-151_Implement_full_slider_API_in_REST_and_switch_client_to_it Commit: 186673363c32a644d5ebaa21e3e2f7e3150115d6 Parents: 3be6c86 bab8867 Author: Steve Loughran Authored: Tue Jun 24 18:10:28 2014 -0700 Committer: Steve Loughran Committed: Tue Jun 24 18:10:28 2014 -0700 -- .../funtest/framework/AgentUploads.groovy | 68 + .../funtest/framework/CommandTestBase.groovy| 9 +- .../funtest/framework/FileUploader.groovy | 100 +++ .../funtest/framework/FuntestProperties.groovy | 12 ++- .../slider/funtest/framework/SudoClosure.groovy | 54 ++ .../lifecycle/AgentCommandTestBase.groovy | 39 +++- .../lifecycle/TestAppsThroughAgent.groovy | 5 +- .../lifecycle/TestClusterBuildDestroy.groovy| 2 +- src/test/clusters/c6401/slider/log4j.properties | 83 +++ .../clusters/c6401/slider/slider-client.xml | 71 + 10 files changed, 403 insertions(+), 40 deletions(-) --
[40/50] [abbrv] git commit: SLIDER-174 HBase Master needs data locality
SLIDER-174 HBase Master needs data locality Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/e4c855ad Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/e4c855ad Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/e4c855ad Branch: refs/heads/feature/SLIDER-151_Implement_full_slider_API_in_REST_and_switch_client_to_it Commit: e4c855ad8ea095e3304b161b0a3df87a2b4e93cc Parents: 22c9689 Author: tedyu Authored: Thu Jun 26 09:27:25 2014 -0700 Committer: tedyu Committed: Thu Jun 26 09:27:25 2014 -0700 -- .../main/java/org/apache/slider/providers/hbase/HBaseRoles.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/e4c855ad/slider-providers/hbase/slider-hbase-provider/src/main/java/org/apache/slider/providers/hbase/HBaseRoles.java -- diff --git a/slider-providers/hbase/slider-hbase-provider/src/main/java/org/apache/slider/providers/hbase/HBaseRoles.java b/slider-providers/hbase/slider-hbase-provider/src/main/java/org/apache/slider/providers/hbase/HBaseRoles.java index 552374c..01776f7 100644 --- a/slider-providers/hbase/slider-hbase-provider/src/main/java/org/apache/slider/providers/hbase/HBaseRoles.java +++ b/slider-providers/hbase/slider-hbase-provider/src/main/java/org/apache/slider/providers/hbase/HBaseRoles.java @@ -42,8 +42,7 @@ public class HBaseRoles { */ static { ROLES.add(new ProviderRole(HBaseKeys.ROLE_WORKER, KEY_WORKER)); -// Master doesn't need data locality -ROLES.add(new ProviderRole(HBaseKeys.ROLE_MASTER, KEY_MASTER,PlacementPolicy.NO_DATA_LOCALITY)); +ROLES.add(new ProviderRole(HBaseKeys.ROLE_MASTER, KEY_MASTER)); }
[15/50] [abbrv] git commit: SLIDER-160: initial client settings for an ambari vagrant VM up on c6401
SLIDER-160: initial client settings for an ambari vagrant VM up on c6401 Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/81578df2 Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/81578df2 Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/81578df2 Branch: refs/heads/feature/SLIDER-151_Implement_full_slider_API_in_REST_and_switch_client_to_it Commit: 81578df22f2eee22f49419e48a2f3e07c33005ff Parents: 153f5e9 Author: Steve Loughran Authored: Mon Jun 23 17:35:23 2014 -0700 Committer: Steve Loughran Committed: Mon Jun 23 17:35:23 2014 -0700 -- src/test/clusters/c6401/slider/log4j.properties | 83 .../clusters/c6401/slider/slider-client.xml | 71 + 2 files changed, 154 insertions(+) -- http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/81578df2/src/test/clusters/c6401/slider/log4j.properties -- diff --git a/src/test/clusters/c6401/slider/log4j.properties b/src/test/clusters/c6401/slider/log4j.properties new file mode 100644 index 000..6211771 --- /dev/null +++ b/src/test/clusters/c6401/slider/log4j.properties @@ -0,0 +1,83 @@ +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +#http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. See accompanying LICENSE file. +# + +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# log4j configuration used during build and unit tests + +log4j.rootLogger=INFO,stdout +log4j.threshhold=ALL +log4j.appender.stdout=org.apache.log4j.ConsoleAppender +log4j.appender.stdout.layout=org.apache.log4j.PatternLayout + +# log layout skips stack-trace creation operations by avoiding line numbers and method +#log4j.appender.stdout.layout.ConversionPattern=%d{ISO8601} [%t] %-5p %c{2} - %m%n + +# debug edition is much more expensive +log4j.appender.stdout.layout.ConversionPattern=%d{ISO8601} [%t] %-5p %c{2} (%F:%M(%L)) - %m%n + + +log4j.appender.subprocess=org.apache.log4j.ConsoleAppender +log4j.appender.subprocess.layout=org.apache.log4j.PatternLayout +log4j.appender.subprocess.layout.ConversionPattern=[%c{1}]: %m%n + +log4j.logger.org.apache.slider=DEBUG + +# uncomment to debug service lifecycle issues +#log4j.logger.org.apache.hadoop.yarn.service.launcher=DEBUG +#log4j.logger.org.apache.hadoop.yarn.service=DEBUG + +# uncomment for YARN operations +#log4j.logger.org.apache.hadoop.yarn.client=DEBUG + +# uncomment this to debug security problems +#log4j.logger.org.apache.hadoop.security=DEBUG + +#crank back on some noise +log4j.logger.org.apache.hadoop.util.NativeCodeLoader=ERROR +log4j.logger.org.apache.hadoop.hdfs=WARN + + +log4j.logger.org.apache.hadoop.yarn.server.nodemanager.containermanager.monitor=WARN +log4j.logger.org.apache.hadoop.yarn.server.nodemanager.NodeStatusUpdaterImpl=WARN +log4j.logger.org.apache.zookeeper=WARN + + http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/81578df2/src/test/clusters/c640
[12/50] [abbrv] git commit: SLIDER-153 building up exec
SLIDER-153 building up exec Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/918e746d Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/918e746d Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/918e746d Branch: refs/heads/feature/SLIDER-151_Implement_full_slider_API_in_REST_and_switch_client_to_it Commit: 918e746d83c4ad0f4a25bba39050942f5689599a Parents: d6131ca Author: Steve Loughran Authored: Mon Jun 23 14:40:34 2014 -0700 Committer: Steve Loughran Committed: Mon Jun 23 14:40:34 2014 -0700 -- slider-assembly/src/main/scripts/slider| 1 - slider-assembly/src/main/scripts/slider.py | 109 +++- 2 files changed, 106 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/918e746d/slider-assembly/src/main/scripts/slider -- diff --git a/slider-assembly/src/main/scripts/slider b/slider-assembly/src/main/scripts/slider index e9522cf..caf275b 100755 --- a/slider-assembly/src/main/scripts/slider +++ b/slider-assembly/src/main/scripts/slider @@ -32,7 +32,6 @@ function usage this="${BASH_SOURCE-$0}" bindir=$(cd -P -- "$(dirname -- "$this")" && pwd -P) script="$(basename -- "$this")" -this="$bin/$script" # lib directory is one up; it is expected to contain # slider.jar and any other dependencies that are not in the http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/918e746d/slider-assembly/src/main/scripts/slider.py -- diff --git a/slider-assembly/src/main/scripts/slider.py b/slider-assembly/src/main/scripts/slider.py index d5891ed..e846e64 100644 --- a/slider-assembly/src/main/scripts/slider.py +++ b/slider-assembly/src/main/scripts/slider.py @@ -16,13 +16,116 @@ # See the License for the specific language governing permissions and # limitations under the License. import sys +import os import subprocess -# Slider main method +CONF = "conf" + +LIB = "lib" + +SLIDER_CONF_DIR = "SLIDER_CONF_DIR" +SLIDER_JVM_OPTS = "SLIDER_JVM_OPTS" +SLIDER_CLASSPATH_EXTRA = "SLIDER_CLASSPATH_EXTRA" + +SLIDER_CLASSNAME = "org.apache.slider.Slider" +DEFAULT_JVM__OPTS = "-Djava.net.preferIPv4Stack=true -Djava.awt.headless=true -Xmx256m -Djava.confdir=%s" + +"""Launches slider + + +""" + + + +print os.environ['HOME'] + + +def scriptDir(): + """ + get the script path + """ + return os.path.dirname(os.path.realpath(__file__)) + +def sliderDir(): + return os.path.dirname(scriptDir()) + +def libDir(sliderdir) : + return os.path.join(sliderdir, LIB) + +def confDir(sliderdir): + """ + determine the active configuration directory + :param sliderdir: slider directory + :return: the configuration directory -any env var will + override the relative path + """ + localconf = os.path.join(sliderdir, CONF) + return os.environ.get(SLIDER_CONF_DIR,localconf) + +def dirMustExist(dir): + if not os.path.exists(dir): +raise Exception("Directory does not exist: %s " % dir) + return dir + + +def usage(): + print "Usage: slider " + return 1 + + def main(): + """ + Slider main method + :return: exit code of the process + """ + if len(sys.argv)==1 : +return usage() + args = sys.argv[1:] + slider_home = sliderDir() + libdir = dirMustExist(libDir(slider_home)) + confdir = dirMustExist(confDir(slider_home)) + default_jvm_opts = DEFAULT_JVM__OPTS % confdir + slider_jvm_opts = os.environ.get(SLIDER_JVM_OPTS, default_jvm_opts) + slider_classpath_extra = os.environ.get(SLIDER_CLASSPATH_EXTRA, "") + p = os.pathsep# path separator + d = os.sep# dir separator + slider_classpath = '"' + \ + libdir + d + "*" + p \ + + confdir + p \ + + slider_classpath_extra \ + + '"' + + print "slider_home = \"%s\"" % slider_home + print "slider_jvm_opts = \"%s\"" % slider_jvm_opts + print "slider_classpath = \"%s\"" % slider_classpath + commandline = ["java",] + # commandline.append(slider_jvm_opts) + commandline.append("-classpath") + commandline.append(slider_classpath) + commandline.append(SLIDER_CLASSNAME) + commandline.extend(args) + print "ready to exec : %s" % commandline + # docs warn of using PIPE on stderr + return subprocess.call(commandline, + stdin=None, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + shell=False) + + + + + if __name__ == '__main__': -print "slider python script" + print "slider python script" + try: rv = main() -sys.exit(rv) +if rv != 0: + print "exit code = %d" % rv + except Exception
[31/50] [abbrv] git commit: SLIDER-160: move test for file existence into upload method; now covers all source files
SLIDER-160: move test for file existence into upload method; now covers all source files Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/eba97da0 Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/eba97da0 Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/eba97da0 Branch: refs/heads/feature/SLIDER-151_Implement_full_slider_API_in_REST_and_switch_client_to_it Commit: eba97da01765ecf924d0a4f672e8ffd2474b7464 Parents: 5464584 Author: Steve Loughran Authored: Tue Jun 24 17:42:36 2014 -0700 Committer: Steve Loughran Committed: Tue Jun 24 17:42:36 2014 -0700 -- .../org/apache/slider/funtest/framework/AgentUploads.groovy | 2 -- .../org/apache/slider/funtest/framework/FileUploader.groovy | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/eba97da0/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/AgentUploads.groovy -- diff --git a/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/AgentUploads.groovy b/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/AgentUploads.groovy index 5f10c0e..3570183 100644 --- a/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/AgentUploads.groovy +++ b/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/AgentUploads.groovy @@ -48,8 +48,6 @@ class AgentUploads implements FuntestProperties { */ def uploadAgentFiles(File tarballDir, boolean force) { def localAgentTar = new File(tarballDir, AGENT_SLIDER_GZ_IN_SLIDER_TAR) -assert localAgentTar.exists() - def agentTarballPath = new Path( homeDir, AGENT_TAR_FILENAME) http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/eba97da0/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/FileUploader.groovy -- diff --git a/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/FileUploader.groovy b/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/FileUploader.groovy index 262693c..4f61730 100644 --- a/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/FileUploader.groovy +++ b/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/FileUploader.groovy @@ -44,6 +44,9 @@ class FileUploader { * @return */ public boolean copyIfOutOfDate(File src, Path destPath, boolean force) { +if (!src.exists()) { + throw new FileNotFoundException("Source file $src not found") +} def srcLen = src.length() def fs = getFileSystem(destPath) boolean toCopy = force
[27/50] [abbrv] git commit: SLIDER-153 add JVM args to CLI
SLIDER-153 add JVM args to CLI Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/8a8ffd94 Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/8a8ffd94 Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/8a8ffd94 Branch: refs/heads/feature/SLIDER-151_Implement_full_slider_API_in_REST_and_switch_client_to_it Commit: 8a8ffd94c9b9685df578ba493e6cb0148af0e5b1 Parents: 77f3e02 Author: Steve Loughran Authored: Tue Jun 24 13:19:49 2014 -0700 Committer: Steve Loughran Committed: Tue Jun 24 13:19:49 2014 -0700 -- slider-assembly/src/main/scripts/slider.py | 19 +-- 1 file changed, 9 insertions(+), 10 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/8a8ffd94/slider-assembly/src/main/scripts/slider.py -- diff --git a/slider-assembly/src/main/scripts/slider.py b/slider-assembly/src/main/scripts/slider.py index 77c39aa..d48eca6 100644 --- a/slider-assembly/src/main/scripts/slider.py +++ b/slider-assembly/src/main/scripts/slider.py @@ -30,14 +30,12 @@ SLIDER_CLASSPATH_EXTRA = "SLIDER_CLASSPATH_EXTRA" SLIDER_CLASSNAME = "org.apache.slider.Slider" DEFAULT_JVM__OPTS = "-Djava.net.preferIPv4Stack=true -Djava.awt.headless=true -Xmx256m -Djava.confdir=%s" -"""Launches slider - - """ +Launches slider +""" -print os.environ['HOME'] def scriptDir(): @@ -107,6 +105,8 @@ def main(): confdir = dirMustExist(confDir(slider_home)) default_jvm_opts = DEFAULT_JVM__OPTS % confdir slider_jvm_opts = os.environ.get(SLIDER_JVM_OPTS, default_jvm_opts) + # split the JVM opts by space + jvm_opts_split = slider_jvm_opts.split() slider_classpath_extra = os.environ.get(SLIDER_CLASSPATH_EXTRA, "") p = os.pathsep# path separator d = os.sep# dir separator @@ -120,12 +120,11 @@ def main(): print "slider_classpath = \"%s\"" % slider_classpath #java = "/usr/bin/java" - java = "java" - commandline = [java, - "-classpath", - slider_classpath, - SLIDER_CLASSNAME] - # commandline.append(slider_jvm_opts) + commandline = ["java", ] + commandline.append("-classpath") + commandline.append(slider_classpath) + commandline.extend(jvm_opts_split) + commandline.append(SLIDER_CLASSNAME) commandline.extend(args) print "ready to exec : %s" % commandline # docs warn of using PIPE on stderr
[01/50] [abbrv] git commit: SLIDER-153: stub .py command
Repository: incubator-slider Updated Branches: refs/heads/feature/SLIDER-151_Implement_full_slider_API_in_REST_and_switch_client_to_it 6f5c5faf1 -> 81a85495d SLIDER-153: stub .py command Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/19d313d7 Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/19d313d7 Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/19d313d7 Branch: refs/heads/feature/SLIDER-151_Implement_full_slider_API_in_REST_and_switch_client_to_it Commit: 19d313d7fb879ff8aff24494800870a704100df1 Parents: 5023eb5 Author: Steve Loughran Authored: Fri Jun 20 18:07:54 2014 -0700 Committer: Steve Loughran Committed: Fri Jun 20 18:07:54 2014 -0700 -- slider-assembly/src/main/scripts/slider.py | 22 ++ 1 file changed, 22 insertions(+) -- http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/19d313d7/slider-assembly/src/main/scripts/slider.py -- diff --git a/slider-assembly/src/main/scripts/slider.py b/slider-assembly/src/main/scripts/slider.py new file mode 100644 index 000..f154210 --- /dev/null +++ b/slider-assembly/src/main/scripts/slider.py @@ -0,0 +1,22 @@ +# !/usr/bin/env python +# -*- coding: utf-8 -*- +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Slider main method + +if __name__ == '__main__': +print "slider python script" \ No newline at end of file
[44/50] [abbrv] git commit: SLIDER-176. Container request after failure is failing to allocate replacement container
SLIDER-176. Container request after failure is failing to allocate replacement container Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/ea251f16 Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/ea251f16 Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/ea251f16 Branch: refs/heads/feature/SLIDER-151_Implement_full_slider_API_in_REST_and_switch_client_to_it Commit: ea251f165bf322c4cd86c6d84483169b07b6fba5 Parents: 78a1364 Author: Sumit Mohanty Authored: Thu Jun 26 13:41:26 2014 -0700 Committer: Sumit Mohanty Committed: Thu Jun 26 13:41:31 2014 -0700 -- .../appmaster/state/OutstandingRequest.java | 2 +- .../app_packages/test_command_log/metainfo.xml | 62 ++-- 2 files changed, 31 insertions(+), 33 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/ea251f16/slider-core/src/main/java/org/apache/slider/server/appmaster/state/OutstandingRequest.java -- diff --git a/slider-core/src/main/java/org/apache/slider/server/appmaster/state/OutstandingRequest.java b/slider-core/src/main/java/org/apache/slider/server/appmaster/state/OutstandingRequest.java index 45dd9d1..7d3e427 100644 --- a/slider-core/src/main/java/org/apache/slider/server/appmaster/state/OutstandingRequest.java +++ b/slider-core/src/main/java/org/apache/slider/server/appmaster/state/OutstandingRequest.java @@ -108,7 +108,7 @@ public final class OutstandingRequest { if (node != null) { hosts = new String[1]; hosts[0] = node.hostname; - relaxLocality = false; + relaxLocality = true; locationSpecified = true; // tell the node it is in play node.getOrCreate(roleId); http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/ea251f16/slider-core/src/test/app_packages/test_command_log/metainfo.xml -- diff --git a/slider-core/src/test/app_packages/test_command_log/metainfo.xml b/slider-core/src/test/app_packages/test_command_log/metainfo.xml index f5fde30..845ad93 100644 --- a/slider-core/src/test/app_packages/test_command_log/metainfo.xml +++ b/slider-core/src/test/app_packages/test_command_log/metainfo.xml @@ -17,38 +17,36 @@ --> 2.0 - - - TEST_COMMAND_LOG - -When started it creates a new log file and stores all commands in the -log file. When stopped it renames the file. - - 0.1.0 - - - COMMAND_LOGGER - MASTER - -scripts/cl.py -PYTHON -600 - - - + +TEST_COMMAND_LOG + + When started it creates a new log file and stores all commands in the + log file. When stopped it renames the file. + +0.1.0 + + +COMMAND_LOGGER +MASTER + + scripts/cl.py + PYTHON + 600 + + + - - - any - - - tarball - files/command_log.tar.gz - - - - + + +any + + +tarball +files/command_log.tar.gz + + + + - - +
[08/50] [abbrv] git commit: SLIDER-157 Remove app-packages/hbase-v0_96
SLIDER-157 Remove app-packages/hbase-v0_96 Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/bc0c6728 Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/bc0c6728 Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/bc0c6728 Branch: refs/heads/feature/SLIDER-151_Implement_full_slider_API_in_REST_and_switch_client_to_it Commit: bc0c672843efaa8d83a97a94d1152f6ebd1c27c1 Parents: 7729653 Author: tedyu Authored: Mon Jun 23 09:24:46 2014 -0700 Committer: tedyu Committed: Mon Jun 23 09:24:46 2014 -0700 -- .../slider_specs/creating_app_definitions.md| 80 +++- 1 file changed, 43 insertions(+), 37 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/bc0c6728/src/site/markdown/slider_specs/creating_app_definitions.md -- diff --git a/src/site/markdown/slider_specs/creating_app_definitions.md b/src/site/markdown/slider_specs/creating_app_definitions.md index be3dd33..ab9f51c 100644 --- a/src/site/markdown/slider_specs/creating_app_definitions.md +++ b/src/site/markdown/slider_specs/creating_app_definitions.md @@ -70,45 +70,51 @@ Additional configuration parameters are described in `app-packages/accumulo/READ For other app packages, follow this example: -* cd slider/app-packages/hbase-v0_96 -* zip -r hbase_v096.zip . -* Looking at the content through unzip -l "$@" hbase_v096.zip +* cd slider/app-packages/hbase +* zip -r hbase-v098.zip . +* Looking at the content through unzip -l "$@" hbase-v098.zip ``` -Archive: hbase_v096.zip - Length Date TimeName - - 3163 05-16-14 16:32 appConfig.json -0 05-02-14 07:51 configuration/ - 5077 05-02-14 07:51 configuration/global.xml - 5248 05-02-14 07:51 configuration/hbase-log4j.xml - 2250 05-02-14 07:51 configuration/hbase-policy.xml -14705 05-02-14 07:51 configuration/hbase-site.xml - 3332 05-16-14 16:33 metainfo.xml -0 05-02-14 07:51 package/ -0 05-19-14 20:36 package/files/ - 83154798 05-19-14 20:36 package/files/hbase-0.96.1-hadoop2-bin.tar.gz -0 05-02-14 07:51 package/scripts/ - 787 05-02-14 07:51 package/scripts/__init__.py - 1378 05-02-14 07:51 package/scripts/functions.py - 3599 05-02-14 07:51 package/scripts/hbase.py - 1205 05-02-14 07:51 package/scripts/hbase_client.py - 1640 05-02-14 07:51 package/scripts/hbase_master.py - 1764 05-02-14 07:51 package/scripts/hbase_regionserver.py - 1482 05-02-14 07:51 package/scripts/hbase_service.py - 4924 05-02-14 07:51 package/scripts/params.py - 973 05-02-14 07:51 package/scripts/status_params.py -0 05-02-14 07:51 package/templates/ - 2723 05-02-14 07:51 package/templates/hadoop-metrics2-hbase.properties-GANGLIA-MASTER.j2 - 2723 05-02-14 07:51 package/templates/hadoop-metrics2-hbase.properties-GANGLIA-RS.j2 - 3878 05-02-14 07:51 package/templates/hbase-env.sh.j2 - 909 05-02-14 07:51 package/templates/hbase_client_jaas.conf.j2 - 989 05-02-14 07:51 package/templates/hbase_master_jaas.conf.j2 - 1001 05-02-14 07:51 package/templates/hbase_regionserver_jaas.conf.j2 - 837 05-02-14 07:51 package/templates/regionservers.j2 - 357 05-12-14 12:04 resources.json - --- - 83219742 29 files +Archive: hbase-v098.zip + Length DateTimeName +- -- - + 3158 06-19-2014 22:08 appConfig.json +0 06-19-2014 22:15 configuration/ + 5077 06-19-2014 22:15 configuration/global.xml + 5248 06-19-2014 22:15 configuration/hbase-log4j.xml + 2250 06-19-2014 22:15 configuration/hbase-policy.xml +14705 06-19-2014 22:15 configuration/hbase-site.xml + 2142 06-19-2014 22:17 jmx_metrics.json + 3991 06-19-2014 22:45 metainfo.xml +0 06-19-2014 22:33 package/ +0 06-19-2014 22:31 package/files/ + 83278591 06-19-2014 22:31 package/files/hbase-0.98.3-hadoop2-bin.tar.gz +0 06-19-2014 22:29 package/scripts/ + 787 06-19-2014 22:27 package/scripts/__init__.py + 1378 06-19-2014 22:27 package/scripts/functions.py + 3738 06-19-2014 22:27 package/scripts/hbase.py + 1205 06-19-2014 22:27 package/scripts/hbase_client.py + 1640 06-19-2014 22:27 package/scripts/hbase_master.py + 1764 06-19-2014 22:27 package/scripts/hbase_regionserver.py + 1482 06-19-2014 22:27 package/scripts/hbase_service.py + 5089 06-19-2014 22:27 package/scripts/params.py + 973 06-19-2014 22:27 package/scripts/status_params.py +
[35/50] [abbrv] git commit: SLIDER-153 revert rename -> slider.py for python
SLIDER-153 revert rename -> slider.py for python Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/1c5f303f Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/1c5f303f Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/1c5f303f Branch: refs/heads/feature/SLIDER-151_Implement_full_slider_API_in_REST_and_switch_client_to_it Commit: 1c5f303f31693b89c1d767043655b16922ae0b57 Parents: 6f05995 Author: Steve Loughran Authored: Wed Jun 25 11:21:29 2014 -0700 Committer: Steve Loughran Committed: Wed Jun 25 11:21:29 2014 -0700 -- slider-assembly/src/main/scripts/slider| 169 slider-assembly/src/main/scripts/slider.py | 169 2 files changed, 169 insertions(+), 169 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/1c5f303f/slider-assembly/src/main/scripts/slider -- diff --git a/slider-assembly/src/main/scripts/slider b/slider-assembly/src/main/scripts/slider deleted file mode 100644 index d48eca6..000 --- a/slider-assembly/src/main/scripts/slider +++ /dev/null @@ -1,169 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -import sys -import os -import subprocess - -CONF = "conf" - -LIB = "lib" - -SLIDER_CONF_DIR = "SLIDER_CONF_DIR" -SLIDER_JVM_OPTS = "SLIDER_JVM_OPTS" -SLIDER_CLASSPATH_EXTRA = "SLIDER_CLASSPATH_EXTRA" - -SLIDER_CLASSNAME = "org.apache.slider.Slider" -DEFAULT_JVM__OPTS = "-Djava.net.preferIPv4Stack=true -Djava.awt.headless=true -Xmx256m -Djava.confdir=%s" - -""" -Launches slider - - -""" - - - -def scriptDir(): - """ - get the script path - """ - return os.path.dirname(os.path.realpath(__file__)) - -def sliderDir(): - return os.path.dirname(scriptDir()) - -def libDir(sliderdir) : - return os.path.join(sliderdir, LIB) - -def confDir(sliderdir): - """ - determine the active configuration directory - :param sliderdir: slider directory - :return: the configuration directory -any env var will - override the relative path - """ - localconf = os.path.join(sliderdir, CONF) - return os.environ.get(SLIDER_CONF_DIR,localconf) - -def dirMustExist(dir): - if not os.path.exists(dir): -raise Exception("Directory does not exist: %s " % dir) - return dir - -def read(pipe, line): - """ - read a char, append to the listing if there is a char that is not \n - :param pipe: pipe to read from - :param line: line being built up - :return: (the potentially updated line, flag indicating newline reached) - """ - - c = pipe.read(1) - if c != "": -o = c.decode('utf-8') -if o != '\n': - line += o - return line, False -else: - return line, True - else: -return line, False - - - -def usage(): - print "Usage: slider " - return 1 - - -def main(): - """ - Slider main method - :return: exit code of the process - """ - if len(sys.argv)==1 : -return usage() - print "stdout encoding: "+ sys.stdout.encoding - args = sys.argv[1:] - slider_home = sliderDir() - libdir = dirMustExist(libDir(slider_home)) - confdir = dirMustExist(confDir(slider_home)) - default_jvm_opts = DEFAULT_JVM__OPTS % confdir - slider_jvm_opts = os.environ.get(SLIDER_JVM_OPTS, default_jvm_opts) - # split the JVM opts by space - jvm_opts_split = slider_jvm_opts.split() - slider_classpath_extra = os.environ.get(SLIDER_CLASSPATH_EXTRA, "") - p = os.pathsep# path separator - d = os.sep# dir separator - slider_classpath = libdir + d + "*" + p \ - + confdir + p \ - + slider_classpath_extra - - - print "slider_home = \"%s\"" % slider_home - print "slider_jvm_opts = \"%s\"" % slider_jvm_opts - print "slider_classpath = \"%s\"" % slider_classpath - - #java = "/usr/bin/java" - commandline = ["java", ] - commandline.append("-classpath") - commandline.append(slider_classpath) - commandline.extend(jvm_opts_split) -
[30/50] [abbrv] git commit: SLIDER-160: agent functional tests upload binaries/ini file if there is a difference
SLIDER-160: agent functional tests upload binaries/ini file if there is a difference Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/5464584d Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/5464584d Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/5464584d Branch: refs/heads/feature/SLIDER-151_Implement_full_slider_API_in_REST_and_switch_client_to_it Commit: 5464584d784cf57348bf22100cee2581d5a887c0 Parents: 8327e52 Author: Steve Loughran Authored: Tue Jun 24 17:40:49 2014 -0700 Committer: Steve Loughran Committed: Tue Jun 24 17:40:49 2014 -0700 -- .../funtest/framework/AgentUploads.groovy | 41 +++--- .../funtest/framework/CommandTestBase.groovy| 9 ++-- .../funtest/framework/FileUploader.groovy | 45 ++-- .../funtest/framework/FuntestProperties.groovy | 12 -- .../lifecycle/AgentCommandTestBase.groovy | 39 ++--- .../lifecycle/TestClusterBuildDestroy.groovy| 2 +- 6 files changed, 94 insertions(+), 54 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/5464584d/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/AgentUploads.groovy -- diff --git a/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/AgentUploads.groovy b/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/AgentUploads.groovy index b1c29c0..5f10c0e 100644 --- a/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/AgentUploads.groovy +++ b/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/AgentUploads.groovy @@ -20,22 +20,51 @@ package org.apache.slider.funtest.framework import groovy.util.logging.Slf4j import org.apache.hadoop.conf.Configuration -import org.apache.hadoop.fs.FileUtil import org.apache.hadoop.fs.Path -import org.apache.hadoop.fs.permission.FsPermission import org.apache.hadoop.security.UserGroupInformation +import org.apache.hadoop.fs.FileSystem as HadoopFS @Slf4j -class AgentUploads { +class AgentUploads implements FuntestProperties { final Configuration conf + private final FileUploader uploader + private final HadoopFS clusterFS + private final Path homeDir + AgentUploads(Configuration conf) { this.conf = conf +uploader = new FileUploader(conf, UserGroupInformation.currentUser) +clusterFS = uploader.fileSystem +homeDir = clusterFS.homeDirectory } - def execUploadSequence() { -UserGroupInformation.loginUserFromKeytabAndReturnUGI("yarn") + /** + * Upload agent-related files + * @param tarballDir + * @param force + * @return + */ + def uploadAgentFiles(File tarballDir, boolean force) { +def localAgentTar = new File(tarballDir, AGENT_SLIDER_GZ_IN_SLIDER_TAR) +assert localAgentTar.exists() + +def agentTarballPath = new Path( +homeDir, +AGENT_TAR_FILENAME) + +// Upload the agent tarball +uploader.copyIfOutOfDate(localAgentTar, agentTarballPath, force) + +File localAgentIni = new File(tarballDir, AGENT_INI_IN_SLIDER_TAR) +// Upload the agent.ini +def agentIniPath = new Path(homeDir, AGENT_INI) +uploader.copyIfOutOfDate(localAgentIni, agentIniPath, force) + +return [agentTarballPath, agentIniPath] + + } - + } http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/5464584d/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/CommandTestBase.groovy -- diff --git a/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/CommandTestBase.groovy b/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/CommandTestBase.groovy index d2accbb..61ae804 100644 --- a/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/CommandTestBase.groovy +++ b/slider-funtest/src/main/groovy/org/apache/slider/funtest/framework/CommandTestBase.groovy @@ -50,17 +50,16 @@ abstract class CommandTestBase extends SliderTestUtils { LoggerFactory.getLogger(CommandTestBase.class); public static final String SLIDER_CONF_DIR = sysprop(SLIDER_CONF_DIR_PROP) - public static final String SLIDER_BIN_DIR = sysprop(SLIDER_BIN_DIR_PROP) - public static final File SLIDER_BIN_DIRECTORY = new File( - SLIDER_BIN_DIR).canonicalFile + public static final String SLIDER_TAR_DIR = sysprop(SLIDER_BIN_DIR_PROP) + public static final File SLIDER_TAR_DIRECTORY = new File( + SLIDER_TAR_DIR).canonicalFile public static final File SLIDER_SCRIPT = new File( - SLIDER_BIN_DIRECTORY, + SLIDER_TAR_DIRECTORY, BIN_SLIDER).canonicalFile public static final File SLIDER_CONF_DIRECTORY
[19/50] [abbrv] SLIDER-121 removed site documentation from git source
http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/209cee43/src/site/markdown/specification/cli-actions.md -- diff --git a/src/site/markdown/specification/cli-actions.md b/src/site/markdown/specification/cli-actions.md deleted file mode 100644 index 5060ab5..000 --- a/src/site/markdown/specification/cli-actions.md +++ /dev/null @@ -1,675 +0,0 @@ - - -# Apache Slider CLI Actions - - -## Important - -1. This document is still being updated from the original hoya design -2. The new cluster model of separated specification files for internal, resource and application configuration -has not been incorporated. -1. What is up to date is the CLI command list and arguments - -## client configuration - -As well as the CLI options, the `conf/slider-client.xml` XML file can define arguments used to communicate with the Application instance - - -`fs.defaultFS` - -Equivalent to setting the filesystem with `--filesystem` - - - -## Common - -### System Properties - -Arguments of the form `-S key=value` define JVM system properties. - -These are supported primarily to define options needed for some Kerberos configurations. - -### Definitions - -Arguments of the form `-D key=value` define JVM system properties. - -These can define client options that are not set in `conf/slider-client.xml` - or to override them. - -### Cluster names - -All actions that must take an instance name will fail with `EXIT_UNKNOWN_INSTANCE` -if one is not provided. - -## Action: Build - -Builds a cluster -creates all the on-filesystem datastructures, and generates a cluster description -that is both well-defined and deployable -*but does not actually start the cluster* - -build (instancename, - options:List[(String,String)], - components:List[(String, int)], - componentOptions:List[(String,String, String)], - resourceOptions:List[(String,String)], - resourceComponentOptions:List[(String,String, String)], - confdir: URI, - provider: String - zkhosts, - zkport, - image - apphome - appconfdir - - - Preconditions - -(Note that the ordering of these preconditions is not guaranteed to remain constant) - -The instance name is valid - -if not valid-instance-name(instancename) : raise SliderException(EXIT_COMMAND_ARGUMENT_ERROR) - -The instance must not be live. This is purely a safety check as the next test should have the same effect. - -if slider-instance-live(YARN, instancename) : raise SliderException(EXIT_CLUSTER_IN_USE) - -The instance must not exist - -if is-dir(HDFS, instance-path(FS, instancename)) : raise SliderException(EXIT_CLUSTER_EXISTS) - -The configuration directory must exist it does not have to be the instance's HDFS instance, -as it will be copied there -and must contain only files - -let FS = FileSystem.get(appconfdir) -if not isDir(FS, appconfdir) raise SliderException(EXIT_COMMAND_ARGUMENT_ERROR) -forall f in children(FS, appconfdir) : -if not isFile(f): raise IOException - -There's a race condition at build time where between the preconditions being met and the instance specification being saved, the instance -is created by another process. This addressed by creating a lock file, `writelock.json` in the destination directory. If the file -exists, no other process may acquire the lock. - -There is a less exclusive readlock file, `readlock.json` which may be created by any process that wishes to read the configuration. -If it exists when another process wishes to access the files, the subsequent process may read the data, but MUST NOT delete it -afterwards. A process attempting to acquire the writelock must check for the existence of this file before AND after creating the -writelock file, failing if its present. This retains a small race condition: a second or later reader may still be reading the data -when a process successfully acquires the write lock. If this proves to be an issue, a stricter model could be implemented, with each reading process creating a unique named readlock- file. - - - - - Postconditions - -All the instance directories exist - -is-dir(HDFS', instance-path(HDFS', instancename)) -is-dir(HDFS', original-conf-path(HDFS', instancename)) -is-dir(HDFS', generated-conf-path(HDFS', instancename)) - -The application cluster specification saved is well-defined and deployable - -let instance-description = parse(data(HDFS', instance-json-path(HDFS', instancename))) -well-defined-instance(instance-description) -deployable-application-instance(HDFS', instance-description) - -More precisely: the specification generated before it is saved as JSON is well-defined and deployable; no JSON file will be created -if the validation fails. - -Fields in the cluster description have been filled in - -internal.global["internal.provider.name"] == provider -app_conf.global["zook
[32/50] [abbrv] git commit: SLIDER-153 remove superflous check for agent test enablement in TestAppsThroughAgent
SLIDER-153 remove superflous check for agent test enablement in TestAppsThroughAgent Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/bab88672 Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/bab88672 Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/bab88672 Branch: refs/heads/feature/SLIDER-151_Implement_full_slider_API_in_REST_and_switch_client_to_it Commit: bab886723eca65bbe3a4090642b26714391df3ba Parents: eba97da Author: Steve Loughran Authored: Tue Jun 24 18:10:02 2014 -0700 Committer: Steve Loughran Committed: Tue Jun 24 18:10:02 2014 -0700 -- .../apache/slider/funtest/lifecycle/TestAppsThroughAgent.groovy | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/bab88672/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestAppsThroughAgent.groovy -- diff --git a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestAppsThroughAgent.groovy b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestAppsThroughAgent.groovy index e3422ee..793a323 100644 --- a/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestAppsThroughAgent.groovy +++ b/slider-funtest/src/test/groovy/org/apache/slider/funtest/lifecycle/TestAppsThroughAgent.groovy @@ -43,10 +43,7 @@ implements FuntestProperties, Arguments, SliderExitCodes, SliderActions { @Test public void testCreateFlex() throws Throwable { -if (!AGENTTESTS_ENABLED) { - log.info "TESTS are not run." - return -} +assumeAgentTestsEnabled() cleanup(APPLICATION_NAME) SliderShell shell = slider(EXIT_SUCCESS,
[46/50] [abbrv] git commit: SLIDER-107. Work items for the release 0.40
SLIDER-107. Work items for the release 0.40 Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/736a9c7e Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/736a9c7e Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/736a9c7e Branch: refs/heads/feature/SLIDER-151_Implement_full_slider_API_in_REST_and_switch_client_to_it Commit: 736a9c7e87aa4f31470bcf6016b004b9a83954b5 Parents: 590cbe0 Author: Sumit Mohanty Authored: Thu Jun 26 17:29:58 2014 -0700 Committer: Sumit Mohanty Committed: Thu Jun 26 20:13:44 2014 -0700 -- LICENSE | 423 +++ LICENSE.txt | 423 --- NOTICE | 5 + NOTICE.txt | 5 - 4 files changed, 428 insertions(+), 428 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/736a9c7e/LICENSE -- diff --git a/LICENSE b/LICENSE new file mode 100644 index 000..b029173 --- /dev/null +++ b/LICENSE @@ -0,0 +1,423 @@ + Apache License + Version 2.0, January 2004 +http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants t
[49/50] [abbrv] git commit: SLIDER-153 refactor .py script slightly for use elsewhere
SLIDER-153 refactor .py script slightly for use elsewhere Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/0ad4fb4f Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/0ad4fb4f Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/0ad4fb4f Branch: refs/heads/feature/SLIDER-151_Implement_full_slider_API_in_REST_and_switch_client_to_it Commit: 0ad4fb4f7b5cc4e590cbb9e51aa7cefb59a0ae2d Parents: a048c9f Author: Steve Loughran Authored: Mon Jun 30 16:16:08 2014 +0100 Committer: Steve Loughran Committed: Mon Jun 30 16:16:08 2014 +0100 -- slider-assembly/src/main/scripts/slider.py | 107 ++-- 1 file changed, 64 insertions(+), 43 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/0ad4fb4f/slider-assembly/src/main/scripts/slider.py -- diff --git a/slider-assembly/src/main/scripts/slider.py b/slider-assembly/src/main/scripts/slider.py index d48eca6..e60bed3 100644 --- a/slider-assembly/src/main/scripts/slider.py +++ b/slider-assembly/src/main/scripts/slider.py @@ -60,10 +60,10 @@ def confDir(sliderdir): localconf = os.path.join(sliderdir, CONF) return os.environ.get(SLIDER_CONF_DIR,localconf) -def dirMustExist(dir): - if not os.path.exists(dir): -raise Exception("Directory does not exist: %s " % dir) - return dir +def dirMustExist(dirname): + if not os.path.exists(dirname): +raise Exception("Directory does not exist: %s " % dirname) + return dirname def read(pipe, line): """ @@ -83,7 +83,61 @@ def read(pipe, line): return line, True else: return line, False - + + +def runProcess(commandline): + """ + Run a process + :param commandline: command line + :return:the return code + """ + print "ready to exec : %s" % commandline + exe = subprocess.Popen(commandline, + stdin=None, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + shell=False) + stdout = exe.stdout + stderr = exe.stderr + outline = "" + errline = "" + while exe.poll() is None: +# process is running; grab output and echo every line +outline, done = read(stdout, outline) +if done: + print outline + outline = "" +errline, done = read(stderr, errline) +if done: + print errline + errline = "" + + # get tail + out, err = exe.communicate() + print outline + out.decode() + print errline + err.decode() + return exe.returncode + + +def java(classname, args, classpath, jvm_opts_list): + """ + Execute a java process, hooking up stdout and stderr + and printing them a line at a time as they come in + :param classname: classname + :param args: arguments to the java program + :param classpath: classpath + :param jvm_opts_list: list of JVM options + :return: the exit code. + """ + # split the JVM opts by space + # java = "/usr/bin/java" + commandline = ["java"] + commandline.extend(jvm_opts_list) + commandline.append("-classpath") + commandline.append(classpath) + commandline.append(classname) + commandline.extend(args) + return runProcess(commandline) def usage(): @@ -98,14 +152,13 @@ def main(): """ if len(sys.argv)==1 : return usage() - print "stdout encoding: "+ sys.stdout.encoding + # print "stdout encoding: "+ sys.stdout.encoding args = sys.argv[1:] slider_home = sliderDir() libdir = dirMustExist(libDir(slider_home)) confdir = dirMustExist(confDir(slider_home)) default_jvm_opts = DEFAULT_JVM__OPTS % confdir slider_jvm_opts = os.environ.get(SLIDER_JVM_OPTS, default_jvm_opts) - # split the JVM opts by space jvm_opts_split = slider_jvm_opts.split() slider_classpath_extra = os.environ.get(SLIDER_CLASSPATH_EXTRA, "") p = os.pathsep# path separator @@ -119,42 +172,10 @@ def main(): print "slider_jvm_opts = \"%s\"" % slider_jvm_opts print "slider_classpath = \"%s\"" % slider_classpath - #java = "/usr/bin/java" - commandline = ["java", ] - commandline.append("-classpath") - commandline.append(slider_classpath) - commandline.extend(jvm_opts_split) - commandline.append(SLIDER_CLASSNAME) - commandline.extend(args) - print "ready to exec : %s" % commandline - # docs warn of using PIPE on stderr - exe = subprocess.Popen(commandline, - stdin=None, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - shell=False) - stdout = exe.stdout - stderr = exe.stderr - outline = "" - errline = "" - while exe.poll() is None: -# process is running; grab output and echo every line -outline, done = read(stdout, outline) -if do
[43/50] [abbrv] git commit: SLIDER-96. Related fix. Dynamically create app packages for tests.
SLIDER-96. Related fix. Dynamically create app packages for tests. Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/b64e1cdf Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/b64e1cdf Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/b64e1cdf Branch: refs/heads/feature/SLIDER-151_Implement_full_slider_API_in_REST_and_switch_client_to_it Commit: b64e1cdfc5d4d5c89c786a301209bd43391d5b36 Parents: 4eb8ea9 Author: Sumit Mohanty Authored: Wed Jun 25 14:07:59 2014 -0700 Committer: Sumit Mohanty Committed: Thu Jun 26 13:41:31 2014 -0700 -- app-packages/accumulo/metainfo.xml | 238 ++- app-packages/hbase/metainfo.xml | 168 +++-- app-packages/storm-v0_91/metainfo.xml | 229 +- .../providers/agent/AgentClientProvider.java| 23 +- .../agent/AgentMiniClusterTestBase.groovy | 41 +++- .../slider/providers/agent/AgentTestBase.groovy | 44 +++- .../agent/TestAgentAMManagementWS.groovy| 3 +- .../slider/providers/agent/TestAgentEcho.groovy | 6 +- .../providers/agent/TestBuildBasicAgent.groovy | 17 +- .../curator/TestRegistryRestResources.groovy| 3 +- .../publisher/TestPublisherRestResources.groovy | 3 +- slider-core/src/test/python/appdef_1.zip| Bin 972 -> 0 bytes slider-core/src/test/python/metainfo.xml| 68 +++--- 13 files changed, 445 insertions(+), 398 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/b64e1cdf/app-packages/accumulo/metainfo.xml -- diff --git a/app-packages/accumulo/metainfo.xml b/app-packages/accumulo/metainfo.xml index eba75c6..4cf6c79 100644 --- a/app-packages/accumulo/metainfo.xml +++ b/app-packages/accumulo/metainfo.xml @@ -17,129 +17,131 @@ --> 2.0 - - - ACCUMULO - -The Apache Accumulo sorted, distributed key/value store is a robust, -scalable, high performance data storage system that features cell-based -access control and customizable server-side processing. It is based on -Google's BigTable design and is built on top of Apache Hadoop, -Zookeeper, and Thrift. -Requirements: -1. Ensure parent dir for path (accumulo-site/instance.volumes) is accessible to the App owner. - - ${accumulo.version} - - - QuickLinks - - - org.apache.slider.monitor - ${site.global.monitor_protocol}://${ACCUMULO_MONITOR_HOST}:${site.accumulo-site.monitor.port.client} - - - org.apache.slider.jmx - ${site.global.monitor_protocol}://${ACCUMULO_MONITOR_HOST}:${site.accumulo-site.monitor.port.client}/xml - - - - - - - ACCUMULO_MASTER-START - ACCUMULO_MONITOR-INSTALLED - - - ACCUMULO_TSERVER-START - ACCUMULO_MASTER-STARTED - - - ACCUMULO_MONITOR-START - ACCUMULO_MASTER-STARTED - - - ACCUMULO_GC-START - ACCUMULO_MASTER-STARTED - - - ACCUMULO_TRACER-START - ACCUMULO_MASTER-STARTED - - - - - ACCUMULO_MASTER - MASTER - -scripts/accumulo_master.py -PYTHON -600 - - + +ACCUMULO + + The Apache Accumulo sorted, distributed key/value store is a robust, + scalable, high performance data storage system that features cell-based + access control and customizable server-side processing. It is based on + Google's BigTable design and is built on top of Apache Hadoop, + Zookeeper, and Thrift. + Requirements: + 1. Ensure parent dir for path (accumulo-site/instance.volumes) is accessible to the App owner. + +${accumulo.version} + + +QuickLinks + + +org.apache.slider.monitor + + ${site.global.monitor_protocol}://${ACCUMULO_MONITOR_HOST}:${site.accumulo-site.monitor.port.client} + + + +org.apache.slider.jmx + + ${site.global.monitor_protocol}://${ACCUMULO_MONITOR_HOST}:${site.accumulo-site.monitor.port.client}/xml + + + + + + + +ACCUMULO_MASTER-START +ACCUMULO_MONITOR-INSTALLED + + +ACCUMULO_TSERVER-START +ACCUMULO_MASTER-STARTED + + +ACCUMULO_MONITOR-START +ACCUMULO_MASTER-STARTED + + +ACCUMULO_GC-STA
git commit: SLIDER-173 Container requests for the same role should utilize different nodes - give higher priority to requests with location specified
Repository: incubator-slider Updated Branches: refs/heads/develop 3fb598fba -> 2449f6f35 SLIDER-173 Container requests for the same role should utilize different nodes - give higher priority to requests with location specified Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/2449f6f3 Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/2449f6f3 Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/2449f6f3 Branch: refs/heads/develop Commit: 2449f6f35bee3220d05f9b386487d44439c9a3cc Parents: 3fb598f Author: tedyu Authored: Mon Jun 30 09:43:31 2014 -0700 Committer: tedyu Committed: Mon Jun 30 09:43:31 2014 -0700 -- .../slider/server/appmaster/state/ContainerPriority.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/2449f6f3/slider-core/src/main/java/org/apache/slider/server/appmaster/state/ContainerPriority.java -- diff --git a/slider-core/src/main/java/org/apache/slider/server/appmaster/state/ContainerPriority.java b/slider-core/src/main/java/org/apache/slider/server/appmaster/state/ContainerPriority.java index 56a5af2..369a932 100644 --- a/slider-core/src/main/java/org/apache/slider/server/appmaster/state/ContainerPriority.java +++ b/slider-core/src/main/java/org/apache/slider/server/appmaster/state/ContainerPriority.java @@ -38,11 +38,11 @@ import org.apache.hadoop.yarn.util.Records; public final class ContainerPriority { // bit that represents whether location is specified - static final int LOCATION = 1 << 30; + static final int NOLOCATION = 1 << 30; public static int buildPriority(int role, boolean locationSpecified) { -int location = locationSpecified ? LOCATION : 0; +int location = locationSpecified ? 0 : NOLOCATION; return role | location; } @@ -57,7 +57,7 @@ public final class ContainerPriority { public static int extractRole(int priority) { -return priority >= LOCATION ? priority^LOCATION : priority; +return priority >= NOLOCATION ? priority^NOLOCATION : priority; } /**
git commit: SLIDER-175 Scripts for installing, running, and destroying slider applications
Repository: incubator-slider Updated Branches: refs/heads/develop 2449f6f35 -> 31d22b888 SLIDER-175 Scripts for installing, running, and destroying slider applications Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/31d22b88 Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/31d22b88 Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/31d22b88 Branch: refs/heads/develop Commit: 31d22b8884ff83e99050e5e3fea3594ca6c1c862 Parents: 2449f6f Author: Steve Loughran Authored: Mon Jun 30 17:57:52 2014 +0100 Committer: Steve Loughran Committed: Mon Jun 30 17:57:52 2014 +0100 -- slider-install/README.md | 102 slider-install/src/main/bash/slider-client.xml | 83 ++ slider-install/src/main/bash/slider_destroy| 64 slider-install/src/main/bash/slider_setup | 173 slider-install/src/main/bash/slider_setup.conf | 60 +++ 5 files changed, 482 insertions(+) -- http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/31d22b88/slider-install/README.md -- diff --git a/slider-install/README.md b/slider-install/README.md new file mode 100644 index 000..a4b7b08 --- /dev/null +++ b/slider-install/README.md @@ -0,0 +1,102 @@ + + + +slider_setup + + +Tools for installing, starting, and destroying HBase, Accumulo, and Storm slider apps on YARN. + +**WARNING: This is intended for POC/sandbox testing, may not be idempotent so DO NOT use on an existing Production cluster!!!** + +Setup +- +1. Clone the repo +2. Set the necessary cluster variables in `slider_setup.conf`, it shouldn't be necessary to change any other values but thoe ones below + + +# Zookeeper nodes +ZK_QUORUM="zk1:2181,zk2:2181,zk3:2181" + +# Resource Manager address (yarn.resourcemanager.address) +RM_ADDRESS="rm1:8050" + +# Resource Manager scheduler address (yarn.resourcemanager.scheduler.address) +RM_SCHED_ADDRESS="rm1:8030" + +# Default FS (fs.defaultFS) +DEFAULT_FS="hdfs://nn1:8020" + +Running +--- +* slider_setup is the main script and handles the following + 1. Pulls down slider and extracts the contents to the SLIDER_INST_DIR + 2. Modifies slider-client.xml with cluster related info + 3. Pulls down the slider enabled version of the specified product + 4. Creates necessary directories and copies required files to HDFS + 5. For HBase, creates the app dir in HDFS + 6. Submits the slider base application to the YARN cluster + +* The following args are required + * -f - The path to the slider_setup.conf that has been modified with cluster info + * -p - The product to run (hbase, accumulo, or storm are all that are supported at this time) + * -w - The number of "worker" nodes. This has different meaning depending on product. +* HBase - number of region servers +* Accumulo - number of tablet servers +* Storm - number of supervisors + * -n - The name of the app, this will be the display name in the resource manager and is used by the teardown process + +* HBase Example: + + +./slider_setup -f slider_setup.conf -p hbase -w 5 -n hbase-slider + +* Accumulo Example: + + +./slider_setup -f slider_setup.conf -p accumulo -w 3 -n accumulo-slider + +* Storm Example: + + +./slider_setup -f slider_setup.conf -p storm -w 3 -n storm-slider + +Tear Down +- + +* slider_destroy will do the following + 1. Freeze the slider application based on provided name + 2. Destory the slider application based on provided name + +* The following args are required + * `-f` - The path to the `slider_setup.conf` that has been modified with cluster info + * `-n` - The name of the app, this was provided to the slider_setup tool + +* HBase Example: + + +./slider_destroy -f slider_setup.conf -n hbase-slider + +* Accumulo Example: + + +./slider_destroy -f slider_setup.conf -n accumulo-slider + +* Storm Example: + + +./slider_destroy -f slider_setup.conf -n storm-slider http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/31d22b88/slider-install/src/main/bash/slider-client.xml -- diff --git a/slider-install/src/main/bash/slider-client.xml b/slider-install/src/main/bash/slider-client.xml new file mode 100644 index 000..f7060c1 --- /dev/null +++ b/slider-install/src/main/bash/slider-client.xml @@ -0,0 +1,83 @@ + + + + + + + + +yarn.log-aggregation-enable +true + + + + +slider.yarn.queue +default +YARN queue for the Application Master + + + +yarn.resourcemanager.address +@@RM_ADDRESS@@ + + + +yarn.resourcemanager.scheduler.a
Git Push Summary
Repository: incubator-slider Updated Branches: refs/heads/feature/Slider_190_command_logger_package [created] 31d22b888
git commit: SLIDER-190. Add projects to create command logger package as well as Slider app package
Repository: incubator-slider Updated Branches: refs/heads/feature/Slider_190_command_logger_package 31d22b888 -> b1bc308b8 SLIDER-190. Add projects to create command logger package as well as Slider app package Project: http://git-wip-us.apache.org/repos/asf/incubator-slider/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-slider/commit/b1bc308b Tree: http://git-wip-us.apache.org/repos/asf/incubator-slider/tree/b1bc308b Diff: http://git-wip-us.apache.org/repos/asf/incubator-slider/diff/b1bc308b Branch: refs/heads/feature/Slider_190_command_logger_package Commit: b1bc308b877a75ebf35653c541809acbd080b8bb Parents: 31d22b8 Author: Sumit Mohanty Authored: Mon Jun 30 19:47:04 2014 -0700 Committer: Sumit Mohanty Committed: Mon Jun 30 19:47:04 2014 -0700 -- app-packages/command-logger/README.txt | 22 .../command-logger/application-pkg/pom.xml | 83 ++ .../src/command_logger/README.txt | 18 .../src/command_logger/operations.log | 24 + .../src/packages/tarball/all.xml| 35 ++ .../command-logger/slider-pkg/appConfig.json| 27 + .../slider-pkg/configuration/cl-site.xml| 34 ++ .../command-logger/slider-pkg/metainfo.xml | 52 + .../slider-pkg/package/scripts/cl.py| 89 +++ .../slider-pkg/package/scripts/params.py| 31 ++ .../package/templates/operations.log.j2 | 22 app-packages/command-logger/slider-pkg/pom.xml | 107 +++ .../command-logger/slider-pkg/resources.json| 15 +++ .../slider-pkg/src/assembly/command-logger.xml | 78 ++ app-packages/hbase/appConfig.json | 4 +- pom.xml | 2 + 16 files changed, 641 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/b1bc308b/app-packages/command-logger/README.txt -- diff --git a/app-packages/command-logger/README.txt b/app-packages/command-logger/README.txt new file mode 100644 index 000..56a8a33 --- /dev/null +++ b/app-packages/command-logger/README.txt @@ -0,0 +1,22 @@ + +Command logger is a test application used by Slider for functional tests. + +Like any typical Slider Application, there is a native application package +in the form of a tarball that is created by project under application_pkg and +there is a project under slider_pkg to create the Slider Application Package +that is consumed by Slider. http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/b1bc308b/app-packages/command-logger/application-pkg/pom.xml -- diff --git a/app-packages/command-logger/application-pkg/pom.xml b/app-packages/command-logger/application-pkg/pom.xml new file mode 100644 index 000..7da7259 --- /dev/null +++ b/app-packages/command-logger/application-pkg/pom.xml @@ -0,0 +1,83 @@ + +http://maven.apache.org/POM/4.0.0"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd";> + + +org.apache.slider +slider +0.31.0-incubating-SNAPSHOT +../../../pom.xml + + 4.0.0 + command-logger + pom + Command Logger + Command Logger + +command-logger + + + + + + +org.apache.maven.plugins +maven-assembly-plugin + + gnu + src/packages/tarball/all.xml + false + ${app.package.name} + + + +build-tarball +package + + single + + + + + + +maven-compiler-plugin +3.0 + + + +org.apache.rat +apache-rat-plugin +${apache-rat-plugin.version} + + +check-licenses + + check + + + + + + + +org.apache.maven.wagon +wagon-ssh-external + + + + http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/b1bc308b/app-packages/command-logger/application-pkg/src/command_logger/README.txt -- diff --git a/app-packages/command-logger/application-pkg/src/command_logger/README.txt b/app-packages/command-logger/application-pkg/src/command_logger/README.txt new file mode 100644 index 000..19d2e26 --- /dev/null +++ b/app-packages/command-logger/application-pkg/src/command_logger/README.txt @@ -0,0 +1,18 @@ + + +All this project contains is a tarball that has a sample log file. http://git-wip-us.apache.org/repos/asf/incubator-slider/blob/b1bc308b/app