简体   繁体   中英

play! framework 2.2.2 diy build failed on openshift

i have downloaded play 2.2.2 zip file.

and added action_hooks for start/stop.

but the build was failed due to the following info:

  play-2.2.2/framework/build: line 23: 320514 Killed
  "$JAVA" ${DEBUG_PARAM} -Xms512M -Xmx1536M -Xss1M
   -XX:ReservedCodeCacheSize=192m
   -XX:+CMSClassUnloadingEnabled
   -XX:MaxPermSize=512M ${JAVA_OPTS} 
   -Dfile.encoding=UTF-8 
   -Dplay.version="${PLAY_VERSION}" 
   -Dplay.home=`dirname $0` 
   -Dsbt.boot.properties=`dirname $0`/sbt/sbt.boot.properties
   -Dsbt.scala.version=${SBT_SCALA_VERSION} 
   ${PLAY_OPTS} -jar `dirname $0`/sbt/sbt-launch.jar "$@"
 remote: -------------------------
 remote: Git Post-Receive Result: failure
 remote: Activation status: failure

how can i make it work? thanks!

This is a little late, but you would have to set -Xmx1536M to a limit your current gear supports (like 512M with standard small gear size).

To accomplish this, you can alter the file play-2.2.2/framework/build to adapt this setting.

Otherwise, the supervising openshift process will ungracefully kill your build process as it consumes a lot of memory.

UPDATE:

I faced the same issues today and ran into the need to solve this properly so I investigated possible solutions a bit further:

  1. The play command appends _JAVA_OPTIONS to each commands it runs. So setting environment variable _JAVA_OPTIONS => -Xmx=512M removes the build failure on smaller gears without having to modify anything

  2. Setting PLAY_OPTS as well appends a string to each of the commands so I can mix and match different environment variables with an appropriate openshift.conf file.

To sum this up and revise my initial answer:

  1. set environment variable _JAVA_OPTIONS to contain a appropriate memory limit Java flag like -Xmx=512M , where 512M should match small gear sizes

  2. customize any further Play! behaviour with an additional enviroment variable PLAY_OPTS

This should work just fine with Play! 2.2.2-I dont know if it does with the upcoming 2.3. But that's another story as the play cartridge would have to be rewritten to only work with sbt.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM