Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run: Java Jar file support #127

Merged
merged 1 commit into from
Nov 2, 2014
Merged

run: Java Jar file support #127

merged 1 commit into from
Nov 2, 2014

Conversation

penberg
Copy link
Contributor

@penberg penberg commented Oct 22, 2014

Adds support for running Java Jar files directly without having to
define a Capstanfile. Capstan will automatically pull
"cloudius/osv-openjdk" base image and build new image with the Jar file
in it.

To run a Jar file, simply type:

[penberg@nero capstan-example-java]$ capstan run target/capstan-example-java-1.0-SNAPSHOT-jar-with-dependencies.jar

and you will see something like this:

Building capstan-example-java-1.0-SNAPSHOT-jar-with-dependencies...
Uploading files...
[ ... ]
Created instance: capstan-example-java-1.0-SNAPSHOT-jar-with-dependencies
OSv v0.13
eth0: 192.168.122.15
hello, world!

Signed-off-by: Pekka Enberg penberg@cloudius-systems.com

Adds support for running Java Jar files directly without having to
define a Capstanfile. Capstan will automatically pull
"cloudius/osv-openjdk" base image and build new image with the Jar file
in it.

To run a Jar file, simply type:

  [penberg@nero capstan-example-java]$ capstan run target/capstan-example-java-1.0-SNAPSHOT-jar-with-dependencies.jar

and you will see something like this:

  Building capstan-example-java-1.0-SNAPSHOT-jar-with-dependencies...
  Uploading files...
  [ ... ]
  Created instance: capstan-example-java-1.0-SNAPSHOT-jar-with-dependencies
  OSv v0.13
  eth0: 192.168.122.15
  hello, world!

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
@penberg
Copy link
Contributor Author

penberg commented Oct 22, 2014

@asias Comments on the approach? It feels like an ugly hack especially because we need to change RunConfig... Perhaps this can be done at a higher level?

@asias
Copy link
Contributor

asias commented Oct 22, 2014

On Wed, Oct 22, 2014 at 4:03 PM, Pekka Enberg notifications@github.com
wrote:

@asias https://github.com/asias Comments on the approach? It feels like
an ugly hack especially because we need to change RunConfig... Perhaps
this can be done at a higher level?


Reply to this email directly or view it on GitHub
#127 (comment)
.

Pekka, I did not see any changes for RunConfig. What is the that?

So, we now have both of the following working.

$ capstan run foo.jar

$ capstan run bar.qcow

Asias

@penberg
Copy link
Contributor Author

penberg commented Oct 22, 2014

@asias I we update the contents of RunConfig after building an image. Look at what we do with the return value of buildJarImage.

@tzach
Copy link
Member

tzach commented Oct 22, 2014

@penberg how this will be extend for the next runtime (e.g. node?)
An idle solution would be to allow plugin (build pack?) to be added with out modifying capstan itself.
Clearly we can wait till we have a few before generalizing

@penberg
Copy link
Contributor Author

penberg commented Oct 22, 2014

@tzach It doesn't really generalize well because it's based on the assumption that there's a single Jar file that contains all the necessary dependencies and instructions how to run itself.

Having something like a "build pack" is obviously a much better long-term solution.

@tzach
Copy link
Member

tzach commented Nov 2, 2014

Thanks @penberg clear.
The immediate value is too important to delay further.
Lets merge and include in release 14 announcement

penberg added a commit that referenced this pull request Nov 2, 2014
@penberg penberg merged commit 3dbf940 into cloudius-systems:master Nov 2, 2014
@penberg penberg deleted the run-jar-files branch November 2, 2014 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants