Date
1 - 5 of 5
Deploying a shell script driven java application to cf
Ben Hale <bhale@...>
Dammina,
toggle quoted message
Show quoted text
Unfortunately, Daniel’s suggestion won’t work. The buildpack expects the filesystem to look like an exploded JAR/WAR and will refuse to stage if it does not. Instead of trying to get your shell script to run inside of the container, you should actually be trying to run your application without a shell script. What exactly does your shell script do? I think you’ll find that the buildpack already does the same things removing the need for it. -Ben Hale Cloud Foundry Java Experience, Lead On Nov 16, 2015, at 04:39, Daniel Mikusa <dmikusa(a)pivotal.io> wrote: |
|
Daniel Mikusa
I haven't tried this, but I think it should work.
toggle quoted message
Show quoted text
1.) Make a directory. In that directory put your JAR file, your start script and anything else the app needs to run. 2.) From that directory, run `cf push <app-name> -b java_buildpack -c '$PWD/start-script.sh'`. This will upload your script, the JAR file and everything else in the current directory. It will also tell CF that you specifically want to use the Java build pack (which will install Java) and that you want to use your script to start your app. What could be tricky about this is your start script. It's going to need to reference JAVA_HOME as `/home/vcap/app/.java-buildpack/open_jdk_jre`, and `java` as `$JAVA_HOME/bin/java` since `java` is not going to be on the $PATH. You're also going to need to handle some of the things that the JBP would normally do like set -Xmx and other JVM memory settings to keep the JVM from exceeding the containers MEMORY_LIMIT. Note, *all* memory needs to fit under the limit, not just the JVM's heap. In other words, setting -Xmx == MEMORY_LIMIT is 100% wrong. Beyond that, you'd need to make sure the app is listening on $PORT or if it's not taking web requests, disable that health check (`cf push --no-route` & `cf set-health-check none`). Dan On Fri, Nov 13, 2015 at 12:47 AM, dammina sahabandu <dammina(a)adroitlogic.com
wrote: Hi All, |
|
Noburou TANIGUCHI
Hi Dammina,
I think your case doesn't seem to fit the Cloud Foundry standard Java buildpack. One thing I can suggest is to use heroku-buildpack-runnable-jar [1]. With this buildpack, you can start your app with a shell script. But you probably have to modify it to fit your purpose. Also you should calculate and specify appropriate memory for your app in the start script by yourself. Or if you can use Diego, it may be a solution to create and use a Docker image for your app. But I don't know much about Diego, so this may be wrong. [1] https://github.com/energizedwork/heroku-buildpack-runnable-jar dammina sahabandu wrote Hi All, ----- I'm not a ... noburou taniguchi -- View this message in context: http://cf-dev.70369.x6.nabble.com/cf-dev-Deploying-a-shell-script-driven-java-application-to-cf-tp2697p2717.html Sent from the CF Dev mailing list archive at Nabble.com. |
|
Juan Antonio Breña Moral <bren at juanantonio.info...>
What is the purpose of that Shell Script?
In my humble opinion, Buildpacks interacts with a unique software artifact in your case in Java. Another approach could be, the development of a Docker container with your system and deploy later on a Diego Cell. Juan Antonio |
|
dammina sahabandu
Hi All,
I have a java application which is a composition of several jars in the running environment. The main jar is invoked by a shell script. Is it possible to push such application into cloud foundry? And if it is possible can you please help me on how to achieve that. A simple guide will be really helpful. Thank you in advance, Dammina |
|