diff --git a/.gitignore b/.gitignore index 01d7c18..12904fe 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,14 @@ target/ target/ /.target dependency-reduced-pom.xml +pom.xml.tag +pom.xml.releaseBackup +pom.xml.versionsBackup +pom.xml.next +release.properties +dependency-reduced-pom.xml +buildNumber.properties +.mvn/timing.properties + +# Exclude maven wrapper +!/.mvn/wrapper/maven-wrapper.jar diff --git a/JobProxyChronos/pom.xml b/JobProxyChronos/pom.xml index 6107523..7f7c30a 100644 --- a/JobProxyChronos/pom.xml +++ b/JobProxyChronos/pom.xml @@ -5,7 +5,7 @@ JobProxy de.unibi.cebitec.bibiserv - beta.1.2.release + 0.1.0.beta.1.7 4.0.0 @@ -14,7 +14,7 @@ de.unibi.cebitec.bibiserv JobProxyModel - beta.1.2.release + ${project.version} com.fasterxml.jackson.dataformat diff --git a/JobProxyDRMAA/pom.xml b/JobProxyDRMAA/pom.xml index 897cc89..fee2d65 100644 --- a/JobProxyDRMAA/pom.xml +++ b/JobProxyDRMAA/pom.xml @@ -4,10 +4,9 @@ de.unibi.cebitec.bibiserv JobProxy - beta.1.2.release + 0.1.0.beta.1.7 JobProxyDRMAA - jar ${project.groupId} @@ -20,4 +19,4 @@ 6.2u5 - \ No newline at end of file + diff --git a/JobProxyJavaDocker/pom.xml b/JobProxyLocal/pom.xml similarity index 71% rename from JobProxyJavaDocker/pom.xml rename to JobProxyLocal/pom.xml index 7a7e980..22875f7 100644 --- a/JobProxyJavaDocker/pom.xml +++ b/JobProxyLocal/pom.xml @@ -5,25 +5,20 @@ JobProxy de.unibi.cebitec.bibiserv - beta.1.2.release + 0.1.0.beta.1.7 4.0.0 - JobProxyJavaDocker + JobProxyLocal de.unibi.cebitec.bibiserv JobProxyModel - beta.1.2.release + ${project.version} com.spotify docker-client 5.0.2 - - com.google.guava - guava - 19.0 - \ No newline at end of file diff --git a/JobProxyJavaDocker/src/main/java/de/unibi/cebitec/bibiserv/jobproxy/javadocker/JavaDocker.java b/JobProxyLocal/src/main/java/de/unibi/cebitec/bibiserv/jobproxy/local/Local.java similarity index 78% rename from JobProxyJavaDocker/src/main/java/de/unibi/cebitec/bibiserv/jobproxy/javadocker/JavaDocker.java rename to JobProxyLocal/src/main/java/de/unibi/cebitec/bibiserv/jobproxy/local/Local.java index 9421f85..7bab895 100644 --- a/JobProxyJavaDocker/src/main/java/de/unibi/cebitec/bibiserv/jobproxy/javadocker/JavaDocker.java +++ b/JobProxyLocal/src/main/java/de/unibi/cebitec/bibiserv/jobproxy/local/Local.java @@ -1,6 +1,7 @@ -package de.unibi.cebitec.bibiserv.jobproxy.javadocker; +package de.unibi.cebitec.bibiserv.jobproxy.local; import com.spotify.docker.client.DefaultDockerClient; +import com.spotify.docker.client.DockerClient; import com.spotify.docker.client.exceptions.DockerException; import com.spotify.docker.client.messages.*; import de.unibi.cebitec.bibiserv.jobproxy.model.JobProxyInterface; @@ -12,24 +13,22 @@ import de.unibi.cebitec.bibiserv.jobproxy.model.task.Task; -import java.util.Arrays; +import java.io.IOException; import java.util.List; import java.util.Properties; import java.util.stream.Collectors; -public class JavaDocker extends JobProxyInterface { +public class Local extends JobProxyInterface { private final DefaultDockerClient dockerClient; - public JavaDocker(Properties properties) { + public Local(Properties properties) { super(properties); dockerClient = new DefaultDockerClient("unix:///var/run/docker.sock"); } - @Override - public String addTask(Task task) throws FrameworkException { - + private String handleDockerTask(Task task){ HostConfig.Builder hostConfigBuilder = HostConfig.builder(); task.getContainer().getMounts().forEach(mounts -> { @@ -82,6 +81,27 @@ public String addTask(Task task) throws FrameworkException { return id; } + private String handleLocalCommand(Task task) throws FrameworkException { + try { + Runtime.getRuntime().exec(task.getCmd()); + } catch (IOException e) { + e.printStackTrace(); + throw new FrameworkException(e.getMessage()); + } + return ""; + } + + @Override + public String addTask(Task task) throws FrameworkException { + + if (task.getContainer() == null) { + return handleLocalCommand(task); + } else { + return handleDockerTask(task); + } + } + + @Override public Task getTask(String id) throws FrameworkException { @@ -128,7 +148,6 @@ public Task getTask(String id) throws FrameworkException { tmounts.setMount(mount); container.getMounts().add(tmounts); }); - task.setContainer(container); return task; @@ -150,9 +169,9 @@ public void delTask(String id) throws FrameworkException { @Override public State getState(String id) throws FrameworkException { - ExecState inspect; + ContainerInfo container; try { - inspect = dockerClient.execInspect(id); + container = dockerClient.inspectContainer(id); } catch (DockerException e) { e.printStackTrace(); throw new FrameworkException(e.getMessage()); @@ -161,11 +180,13 @@ public State getState(String id) throws FrameworkException { throw new FrameworkException(e.getMessage()); } State state = new State(); - state.setId(inspect.container().id()); - if (!inspect.running()) { - state.setCode(String.valueOf(inspect.exitCode())); + state.setId(container.id()); + state.setDescription(container.name()); + + if (!container.state().running()) { + state.setCode(String.valueOf(container.state().exitCode())); } - state.setDescription(inspect.container().name()); + state.setDescription(container.name()); return state; } @@ -173,12 +194,13 @@ public State getState(String id) throws FrameworkException { public States getState() throws FrameworkException { States states = new States(); try { - List containers = dockerClient.listContainers(); + List containers = dockerClient.listContainers(DockerClient.ListContainersParam.allContainers()); for (Container container : containers) { states.getState().add(getState(container.id())); } } catch (FrameworkException e) { - + e.printStackTrace(); + throw new FrameworkException(e.getMessage()); } catch (DockerException e) { e.printStackTrace(); throw new FrameworkException(e.getMessage()); @@ -191,12 +213,15 @@ public States getState() throws FrameworkException { @Override public String getName() { - return "JavaDocker"; + return "JobProxyLocal"; } @Override public String help() { - throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + return "Simple Jobproxy implementation for executing commands and docker container on the local system.\n" + + "Note!: \n " + + "Ressources for system native commands can not be restricted! This means that fields like mem,cpu and cputime are ignored\n" + + "Executed native commands are not reported by using the 'state' or 'states' endpoint."; } } diff --git a/JobProxyModel/pom.xml b/JobProxyModel/pom.xml index 325e091..1c5dfc3 100644 --- a/JobProxyModel/pom.xml +++ b/JobProxyModel/pom.xml @@ -5,7 +5,7 @@ JobProxy de.unibi.cebitec.bibiserv - beta.1.2.release + 0.1.0.beta.1.7 4.0.0 @@ -32,6 +32,12 @@ org.glassfish.jersey.core jersey-client 2.23.1 + + + org.javassist + javassist + + org.glassfish.jersey.ext diff --git a/JobProxyModel/src/main/java/de/unibi/cebitec/bibiserv/jobproxy/model/JobProxyFactory.java b/JobProxyModel/src/main/java/de/unibi/cebitec/bibiserv/jobproxy/model/JobProxyFactory.java index 3763fa4..4f9b68e 100644 --- a/JobProxyModel/src/main/java/de/unibi/cebitec/bibiserv/jobproxy/model/JobProxyFactory.java +++ b/JobProxyModel/src/main/java/de/unibi/cebitec/bibiserv/jobproxy/model/JobProxyFactory.java @@ -6,7 +6,10 @@ import java.util.Map; import java.util.Properties; import java.util.Set; + import org.reflections.Reflections; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Provides a list of all FRAMEWORKS found within the classpath @@ -18,6 +21,7 @@ public class JobProxyFactory { private static final Map> FRAMEWORKS = new HashMap<>(); + private static final Logger LOGGER = LoggerFactory.getLogger(JobProxyFactory.class); static { Reflections reflections = new Reflections("de.unibi.cebitec.bibiserv.jobproxy"); @@ -71,7 +75,7 @@ public static JobProxyInterface getFramework(String name, Properties properties) framework = FRAMEWORKS.get(name).getConstructor(Properties.class).newInstance(properties); return framework; } - throw new FrameworkException("Unknown framework '"+name+"'!"); + throw new FrameworkException("Unknown framework '"+name+"'!"); } catch (NoSuchMethodException | InstantiationException | IllegalAccessException e) { throw new FrameworkException("Error instantiating framework '"+name+"'!",e); } catch (InvocationTargetException e) { @@ -79,9 +83,9 @@ public static JobProxyInterface getFramework(String name, Properties properties) } } - /** + /** * Return a set of found FRAMEWORKS. - * @return + * @return */ public static Set list() { return FRAMEWORKS.keySet(); diff --git a/JobProxyModel/src/main/java/de/unibi/cebitec/bibiserv/jobproxy/model/rest/Delete.java b/JobProxyModel/src/main/java/de/unibi/cebitec/bibiserv/jobproxy/model/rest/Delete.java index 435cf8e..85281c4 100644 --- a/JobProxyModel/src/main/java/de/unibi/cebitec/bibiserv/jobproxy/model/rest/Delete.java +++ b/JobProxyModel/src/main/java/de/unibi/cebitec/bibiserv/jobproxy/model/rest/Delete.java @@ -46,7 +46,6 @@ public class Delete { @DELETE @Path("/{id}") - @Consumes({MediaType.TEXT_PLAIN}) public void delete(@PathParam("id")String id){ try { JobProxyFactory.getFramework().delTask(id); diff --git a/JobProxyServer/pom.xml b/JobProxyServer/pom.xml index 0180cb2..3e5c80c 100644 --- a/JobProxyServer/pom.xml +++ b/JobProxyServer/pom.xml @@ -5,7 +5,7 @@ de.unibi.cebitec.bibiserv JobProxy - beta.1.2.release + 0.1.0.beta.1.7 4.0.0 @@ -14,29 +14,39 @@ de.unibi.cebitec.bibiserv JobProxyModel - beta.1.2.release + ${project.version} + + + jackson-core + com.fasterxml.jackson.core + + + guava + com.fasterxml.jackson.core + + de.unibi.cebitec.bibiserv JobProxyModel - beta.1.2.release + ${project.version} test-jar test de.unibi.cebitec.bibiserv JobProxyDRMAA - beta.1.2.release + ${project.version} de.unibi.cebitec.bibiserv JobProxyChronos - beta.1.2.release + ${project.version} de.unibi.cebitec.bibiserv - JobProxyJavaDocker - beta.1.2.release + JobProxyLocal + ${project.version} junit diff --git a/JobProxyServer/src/main/java/de/unibi/cebitec/bibiserv/jobproxy/server/JobProxyServer.java b/JobProxyServer/src/main/java/de/unibi/cebitec/bibiserv/jobproxy/server/JobProxyServer.java index 1ee6ca5..f754c37 100644 --- a/JobProxyServer/src/main/java/de/unibi/cebitec/bibiserv/jobproxy/server/JobProxyServer.java +++ b/JobProxyServer/src/main/java/de/unibi/cebitec/bibiserv/jobproxy/server/JobProxyServer.java @@ -1,4 +1,4 @@ -package de.unibi.cebitec.bibiserv.jobproxy.model; +package de.unibi.cebitec.bibiserv.jobproxy.server; /* * Copyright 2016 Jan Krueger. @@ -16,6 +16,8 @@ * limitations under the License. */ import com.sun.net.httpserver.HttpServer; +import de.unibi.cebitec.bibiserv.jobproxy.model.JobProxyFactory; +import de.unibi.cebitec.bibiserv.jobproxy.model.JobProxyInterface; import de.unibi.cebitec.bibiserv.jobproxy.model.exceptions.FrameworkException; import de.unibi.cebitec.bibiserv.jobproxy.model.rest.Delete; import de.unibi.cebitec.bibiserv.jobproxy.model.rest.Ping; diff --git a/JobProxyServer/src/test/java/de/unibi/cebitec/bibiserv/jobproxy/server/JobProxyServerTest.java b/JobProxyServer/src/test/java/de/unibi/cebitec/bibiserv/jobproxy/server/JobProxyServerTest.java index 64a9b0d..32d783c 100644 --- a/JobProxyServer/src/test/java/de/unibi/cebitec/bibiserv/jobproxy/server/JobProxyServerTest.java +++ b/JobProxyServer/src/test/java/de/unibi/cebitec/bibiserv/jobproxy/server/JobProxyServerTest.java @@ -1,4 +1,4 @@ -package de.unibi.cebitec.bibiserv.jobproxy.model; +package de.unibi.cebitec.bibiserv.jobproxy.server; import de.unibi.cebitec.bibiserv.jobproxy.DummyFramework; import de.unibi.cebitec.bibiserv.jobproxy.model.exceptions.FrameworkException; diff --git a/JobProxyServerCLI/pom.xml b/JobProxyServerCLI/pom.xml index a0b8beb..a49e857 100644 --- a/JobProxyServerCLI/pom.xml +++ b/JobProxyServerCLI/pom.xml @@ -5,27 +5,53 @@ JobProxy de.unibi.cebitec.bibiserv - beta.1.2.release + 0.1.0.beta.1.7 4.0.0 JobProxyServerCLI + + ch.qos.logback + logback-classic + 1.1.7 + + + org.slf4j + slf4j-api + + + de.unibi.cebitec.bibiserv JobProxyServer - beta.1.2.release + ${project.version} commons-cli commons-cli 1.3.1 + + org.codehaus.plexus + plexus-utils + 2.0.5 + org.jbehave jbehave-maven-plugin 4.0.5 test + + + org.codehaus.plexus + plexus-utils + + + junit + junit + + de.codecentric @@ -35,7 +61,7 @@ de.unibi.cebitec.bibiserv JobProxyModel - beta.1.2.release + ${project.version} test-jar test @@ -96,6 +122,18 @@ + + + org.slf4j + slf4j-api + 1.7.21 + + + ch.qos.logback + logback-classic + 1.1.7 + + diff --git a/JobProxyServerCLI/src/main/java/de/unibi/cebitec/bibiserv/jobproxy/server/cli/CLI.java b/JobProxyServerCLI/src/main/java/de/unibi/cebitec/bibiserv/jobproxy/server/cli/CLI.java index 578eace..21b4dc8 100644 --- a/JobProxyServerCLI/src/main/java/de/unibi/cebitec/bibiserv/jobproxy/server/cli/CLI.java +++ b/JobProxyServerCLI/src/main/java/de/unibi/cebitec/bibiserv/jobproxy/server/cli/CLI.java @@ -1,25 +1,43 @@ package de.unibi.cebitec.bibiserv.jobproxy.server.cli; +import ch.qos.logback.classic.Level; +import ch.qos.logback.classic.Logger; import de.unibi.cebitec.bibiserv.jobproxy.model.JobProxyFactory; -import de.unibi.cebitec.bibiserv.jobproxy.model.JobProxyServer; +import de.unibi.cebitec.bibiserv.jobproxy.server.JobProxyServer; import de.unibi.cebitec.bibiserv.jobproxy.model.exceptions.FrameworkException; import org.apache.commons.cli.*; -import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.File; import java.io.FileInputStream; import java.io.IOException; +import java.util.Optional; import java.util.Properties; import java.util.Scanner; public class CLI { + + private static String OPTION_FRAMEWORK_SELECT = "f"; - static final Logger LOGGER = LoggerFactory.getLogger(JobProxyServer.class); + private static String OPTION_FRAMEWORK_LIST = "l"; + + private static String OPTION_FRAMEWORK_PROPERTIES = "p"; + + private static String OPTION_FRAMEWORK_DEMONISE = "d"; + + private static String OPTION_FRAMEWORK_DEBUG = "debug"; + + private static String OPTION_FRAMEWORK_LOG = "log"; + + private static String OPTION_FRAMEWORK_HELP = "h"; + + private org.slf4j.Logger LOGGER = LoggerFactory.getLogger(CLI.class); private Result result; + private JobProxyServer server; + public CLI() { result = new SystemResult(); } @@ -41,48 +59,50 @@ private void listFrameworks() { sb.append(n); } result.message(sb.toString()); - // and exit result.exit(0); } - private void handleServer(JobProxyServer server, boolean isDebug, boolean isDaemon) { + private void handleServer(boolean isDebug, boolean isDaemon) { server.startServer(isDebug); if (isDaemon) { - LOGGER.info(String.format("Server run on %s !",server.getURI())); + LOGGER.info(String.format("Server run on %s !", server.getURI())); try { Thread.currentThread().join(); } catch (InterruptedException ex) { LOGGER.error(ex.getMessage()); } } else { - LOGGER.info(String.format("Server run on %s ! Press key to stop service.", server.getURI())); + LOGGER.info(String.format("Server runs on %s ! Press key to stop service.", server.getURI())); Scanner scanner = new Scanner(System.in); scanner.nextLine(); server.stopServer(); - - } } public void run(String args[]) { Options options = new Options(); - Option frameworkOption = new Option("f", true, "Framework/Plugin to be used by JobProxy."); + Option frameworkOption = new Option(OPTION_FRAMEWORK_SELECT, true, "Framework/Plugin to be used by JobProxy."); frameworkOption.setRequired(false); - Option listFrameworkOption = new Option("l", false, "List all available frameworks/plugins."); + Option listFrameworkOption = new Option(OPTION_FRAMEWORK_LIST, false, "List all available frameworks/plugins."); listFrameworkOption.setRequired(false); - - Option propertiesOption = new Option("p",true,"Configuration file (java properties style)"); + + Option propertiesOption = new Option(OPTION_FRAMEWORK_PROPERTIES, true, "Configuration file (java properties style)"); propertiesOption.setRequired(false); - - Option demoniseOption = new Option("d",false,"start server in daemon mode"); + + Option demoniseOption = new Option(OPTION_FRAMEWORK_DEMONISE, false, "start server in daemon mode"); propertiesOption.setRequired(false); - - Option debugOption = new Option("debug",false,"run server in debug mode. Logs all http request/responses. "); + + Option debugOption = new Option(OPTION_FRAMEWORK_DEBUG, false, "run server in debug mode. Logs all http request/responses. "); propertiesOption.setRequired(false); - - Option helpOption = new Option("h",false,"Print general help or help for a specified framework together with '-f' option"); + + String[] levels = {Level.ERROR.toString(), Level.INFO.toString(), Level.TRACE.toString(), Level.WARN.toString(), + Level.DEBUG.toString(), Level.ALL.toString(), Level.OFF.toString()}; + Option loggingOption = new Option(OPTION_FRAMEWORK_LOG, true, "Set Logging Level. Available Levels:" + String.join(",", levels)); + loggingOption.setRequired(false); + + Option helpOption = new Option(OPTION_FRAMEWORK_HELP, false, "Print general help or help for a specified framework together with '-f' option"); propertiesOption.setRequired(false); @@ -90,36 +110,45 @@ public void run(String args[]) { options.addOption(listFrameworkOption); options.addOption(propertiesOption); options.addOption(demoniseOption); - options.addOption(debugOption); + options.addOption(debugOption); + options.addOption(loggingOption); options.addOption(helpOption); CommandLineParser parser = new DefaultParser(); try { CommandLine cmd = parser.parse(options, args); - if (cmd.hasOption("l")) { - // list all frameworks + + Level level = Optional.ofNullable(cmd.getOptionValue(OPTION_FRAMEWORK_LOG)) + .map(levelStr -> Level.toLevel(levelStr)).orElse(Level.INFO); + + if(LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME) instanceof ch.qos.logback.classic.Logger){ + ch.qos.logback.classic.Logger logger = (ch.qos.logback.classic.Logger)LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME); + logger.setLevel(level); + } + + if (cmd.hasOption(OPTION_FRAMEWORK_LIST)) { listFrameworks(); return; } - if (cmd.hasOption("f")) { - String frameworkType = cmd.getOptionValue("f"); + if (cmd.hasOption(OPTION_FRAMEWORK_SELECT)) { + String frameworkType = cmd.getOptionValue(OPTION_FRAMEWORK_SELECT); Properties prop = new Properties(); - if (cmd.hasOption("p")) { + if (cmd.hasOption(OPTION_FRAMEWORK_PROPERTIES)) { try { - prop.load(new FileInputStream(new File(cmd.getOptionValue("p")))); + prop.load(new FileInputStream(new File(cmd.getOptionValue(OPTION_FRAMEWORK_PROPERTIES)))); } catch (IOException e) { LOGGER.error(e.getMessage()); } } try { - JobProxyServer server = new JobProxyServer(frameworkType, prop); - if (cmd.hasOption("h")) { + server = new JobProxyServer(frameworkType, prop); + if (cmd.hasOption(OPTION_FRAMEWORK_HELP)) { result.message(JobProxyFactory.getFramework().help()); return; } else { - handleServer(server, cmd.hasOption("debug"), cmd.hasOption("d")); + handleServer(cmd.hasOption(OPTION_FRAMEWORK_DEBUG), cmd.hasOption(OPTION_FRAMEWORK_DEMONISE)); } } catch (FrameworkException e) { LOGGER.error(e.getMessage()); @@ -134,6 +163,7 @@ public void run(String args[]) { } public static void main(String args[]) { + CLI cli = new CLI(); cli.run(args); } @@ -145,4 +175,12 @@ public Result getResult() { public void setResult(Result result) { this.result = result; } + + /** + * Getter for Testing + * @return JobProxyServer server + */ + public JobProxyServer getServer() { + return server; + } } diff --git a/JobProxyServerCLI/src/test/java/de/unibi/cebitec/bibiserv/jobproxy/server/cli/CLISteps.java b/JobProxyServerCLI/src/test/java/de/unibi/cebitec/bibiserv/jobproxy/server/cli/CLISteps.java index 445bfab..d8f1414 100644 --- a/JobProxyServerCLI/src/test/java/de/unibi/cebitec/bibiserv/jobproxy/server/cli/CLISteps.java +++ b/JobProxyServerCLI/src/test/java/de/unibi/cebitec/bibiserv/jobproxy/server/cli/CLISteps.java @@ -7,9 +7,12 @@ import javax.ws.rs.client.ClientBuilder; import javax.ws.rs.core.Response; import java.io.*; -import java.util.*; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import java.util.Properties; +import java.util.concurrent.TimeUnit; -import static java.lang.Thread.sleep; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @@ -84,7 +87,13 @@ public void start(String command) { try { res = client.target(properties.getProperty("serveruri", "http://localhost:9999/")).path("/ping").request().get(); } catch (ProcessingException e) { + //ProcessingException is thrown until server is available } + try { + TimeUnit.SECONDS.sleep(5); + } catch (InterruptedException e) { + e.printStackTrace(); + } } }; Thread webtargetThread = new Thread(webTargetRunnable); @@ -127,10 +136,11 @@ public void testIsAlive(String request) { assertEquals(Response.Status.Family.SUCCESSFUL, res.getStatusInfo().getFamily()); } - @AfterStory + @AfterScenario public void afterStory() { if (cliThread != null) { - cliThread.stop(); + cli.getServer().stopServer(); + cliThread = null; } properties.clear(); } diff --git a/JobProxyServerCLI/src/test/resources/CLI.story b/JobProxyServerCLI/src/test/resources/CLI.story index caba5a7..e104b0c 100644 --- a/JobProxyServerCLI/src/test/resources/CLI.story +++ b/JobProxyServerCLI/src/test/resources/CLI.story @@ -4,7 +4,7 @@ When I run jobproxy with the parameters: -h Then the exit status should be 0 -Scenario: Start framework in background +Scenario: Run a framework Given jobproxy is installed. When I start the jobproxy server with the parameters: -f ExampleFramework @@ -15,7 +15,7 @@ Given jobproxy is installed. When I run jobproxy with the parameters: -l Then the exit status should be 0 -And the output should contain the values DRMAA JavaDocker Chronos +And the output should contain the values DRMAA Local Chronos Scenario: Use Configuration File Given jobproxy is installed. @@ -23,4 +23,16 @@ And I create a file config.properties with the contents: serveruri=http://localhost:9998/ When I start the jobproxy server with the parameters: -f ExampleFramework -p config.properties -Then the GET request using the url http://localhost:9998/v1/jobproxy/ping should be successful \ No newline at end of file +Then the GET request using the url http://localhost:9998/v1/jobproxy/ping should be successful + +Scenario: Use Debug Option +Given jobproxy is installed. +When I start the jobproxy server with the parameters: +-f ExampleFramework -debug +Then the GET request using the url http://localhost:9999/v1/jobproxy/ping should be successful + +Scenario: Use Logging Option +Given jobproxy is installed. +When I start the jobproxy server with the parameters: +-f ExampleFramework -log INFO +Then the GET request using the url http://localhost:9999/v1/jobproxy/ping should be successful \ No newline at end of file diff --git a/README.md b/README.md index 4f79e37..c40d645 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ [![](https://jitpack.io/v/BiBiServ/jobproxy.svg)](https://jitpack.io/#BiBiServ/jobproxy) +[![CircleCI](https://circleci.com/gh/BiBiServ/jobproxy/tree/development.svg?style=svg)](https://circleci.com/gh/BiBiServ/jobproxy/tree/development) + JobProxy is (should be) a proxy between an application that needs access to compute resources like starting a docker container or just starting a simple shell script and the various existing resource providing frameworks. ## Motivation @@ -39,6 +41,10 @@ usage example. ## Developer Guide +### Development-Guidelines + +https://github.com/BiBiServ/Development-Guidelines + ### Release/Development Branch Workflow There are two branches one is the **master** branch with latest working version of JobProxy and the other one is @@ -53,6 +59,8 @@ If the code is updated, the corresponding module version number must be updated. ### How to use jobProxy as a dependency? Just go to [this site](https://jitpack.io/#BiBiServ/jobproxy) and follow the instructions. +Please keep in mind that you can import single subproject artifacts like **JobProxyServer** and +not the whole **JobProxy** parent artifact. ### How to build to build JobProxy? @@ -104,3 +112,16 @@ The following call produces an java client from swagger specification: swagger-codegen-cli.sh generate -i doc/REST/swagger.yaml -l java ~~~ +#### How to version the project? + +We decided that all modules should have the same version as the parent module. +By using the below command in the project root you can update all child modules at once. + +~~~BASH +mvn versions:set -DnewVersion= +~~~ + +where + + * version = **2.1.0.alpha.2** + diff --git a/circle.yml b/circle.yml new file mode 100644 index 0000000..c6ac985 --- /dev/null +++ b/circle.yml @@ -0,0 +1,11 @@ +machine: + java: + version: oraclejdk8 + services: + - docker +dependencies: + override: + - mvn --fail-never dependency:go-offline || true +test: + override: + - mvn clean compile install package && mvn test diff --git a/pom.xml b/pom.xml index 11be374..72a27a9 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 de.unibi.cebitec.bibiserv JobProxy - beta.1.2.release + 0.1.0.beta.1.7 pom @@ -18,11 +18,35 @@ https://jitpack.io + + + + org.apache.maven.plugins + maven-enforcer-plugin + 1.4.1 + + + enforce-maven + + enforce + + + + + 3.2 + + + + + + + + JobProxyModel JobProxyServer JobProxyChronos - JobProxyJavaDocker + JobProxyLocal JobProxyServerCLI JobProxyDRMAA