0

I have have free Openshift account with 3 gears, I have established a gear as a Jenkins server and configured a DIY cartridge as a slave node following the steps explained here:

https://developer.jboss.org/people/lkrzyzanek/blog/2012/12/12/jenkins-on-openshift-with-own-slaves?_sscc=t

The ssh connection between master and slave node works fine. I have fixed the problem of the jenkins cache on the slave.jar following the instructions posted here:

Change user.home system property

I have uploaded on the slave the android-sdk with only the build tools downloaded. This reduced version of the sdk, builds android-studio projects on my local machine successfully, it generates the corresponding APK.

When I create a new jenkins job pointing to a git repository, the code gets downloaded and the ./gradlew assembleRelease starts. All steps work fine until gradle reaches the task app:preDexRelease, jenkins becomes unavailable.

I have also tried to run gradlew manually doing a ssh to the slave machine, though the ssh timeout (unset TMOUT) is disabled, the ssh session disconnects suddenly when the build step preDexRelease is reached. Gradle logs (--debug) don't give any hint of what is happening.

Does anyone have experienced a similar behaviour?

Gradle debug:

...
processing android/support/annotation/Keep.class...
processing android/support/annotation/FractionRes.class...
processing android/support/annotation/DimenRes.class...
processing android/support/annotation/BoolRes.class...
processing android/support/annotation/BinderThread.class...
processing android/support/annotation/CallSuper.class...
processing android/support/annotation/MenuRes.class...
processing android/support/annotation/RequiresPermission$Read.class...
processing android/support/annotation/AnimRes.class...
processing android/support/annotation/Nullable.class...
processing android/support/annotation/ColorRes.class...
processing android/support/annotation/RequiresPermission$Write.class...
processing android/support/annotation/CheckResult.class...
processing android/support/annotation/InterpolatorRes.class...
processing android/support/annotation/LayoutRes.class...
processing android/support/annotation/TransitionRes.class...
processing android/support/annotation/IntRange.class...
processing android/support/annotation/RequiresPermission.class...
processing android/support/annotation/Size.class...
processing android/support/annotation/StringDef.class...
processing android/support/annotation/NonNull.class...
processing android/support/annotation/MainThread.class...
processing android/support/annotation/ArrayRes.class...
processing android/support/annotation/ColorInt.class...
processing android/support/annotation/IntegerRes.class...
processing android/support/annotation/StyleRes.class...
processing android/support/annotation/VisibleForTesting.class...
writing classes.dex; size 6576...

> Building 85% > :app:preDexReleaseConnection to xxxxxxxx.rhcloud.com closed by remote host.
Connection to xxxxxxxx.rhcloud.com closed.

As a test I'm using a simple one activity Android Studio project.

Thank you for your help and advice.

Community
  • 1
  • 1
Martin
  • 1

2 Answers2

1

note that I have opened a feature request for an Openshift Jenkins Cartridge including the Android SDK, please vote for it here: https://openshift.uservoice.com/forums/258655-ideas/suggestions/10128225-include-use-of-android-sdk-in-jenkins-catridge

Peter
  • 10,910
  • 3
  • 35
  • 68
0

Since you are using small gears (512MB of memory, 256MB of which is allocated to the jvm) you might be running out of memory. You should check for memory limit violations (https://help.openshift.com/hc/en-us/articles/202399600-How-to-check-for-memory-limit-violations), you can also dedicate more memory to the JVM using these instructions (https://developers.openshift.com/en/jbossas-jvm-memory.html), the instructions are for the JBoss server, but it would also work for your case. Make sure you are doing this on the slave node where the actual build is happening.