Custom Java build pack with C Shared Object


Al West
 

Hi,

I've been trying for a while now to get a C-Library uploaded with a Java application in Cloud Foundry. However, as soon as I introduce the C library I get the following error:

2016-12-30T20:41:58.135+00:00 [API/6] [OUT] Created app with guid 6a6180e9-a04d-4d82-b994-bf236ce01732
2016-12-30T20:41:58.810+00:00 [API/5] [OUT] Updated app with guid 6a6180e9-a04d-4d82-b994-bf236ce01732 ({"route"=>"f46cb847-64a3-4427-9110-b9624d14ab09", :verb=>"add", :relation=>"routes", :related_guid=>"f46cb847-64a3-4427-9110-b9624d14ab09"})
2016-12-30T20:41:59.716+00:00 [API/6] [OUT] Updated app with guid 6a6180e9-a04d-4d82-b994-bf236ce01732 ({"environment_json"=>"PRIVATE DATA HIDDEN"})
2016-12-30T20:42:30.495+00:00 [API/4] [OUT] Updated app with guid 6a6180e9-a04d-4d82-b994-bf236ce01732 ({"state"=>"STARTED"})
2016-12-30T20:42:30.878+00:00 [STG/0] [OUT] Creating container
2016-12-30T20:42:36.466+00:00 [STG/0] [OUT] Downloading app package...
2016-12-30T20:42:36.466+00:00 [STG/0] [OUT] Successfully created container
2016-12-30T20:42:40.517+00:00 [STG/0] [OUT] Downloaded app package (75.9M)
2016-12-30T20:42:40.517+00:00 [STG/0] [OUT] Staging...
2016-12-30T20:42:41.111+00:00 [STG/0] [OUT] Adding crf tagger support
2016-12-30T20:42:41.122+00:00 [STG/0] [ERR] --2016-12-30 20:42:41-- http://tsew.net/libcrftagger-linux.so
2016-12-30T20:42:41.156+00:00 [STG/0] [ERR] Resolving tsew.net (tsew.net)... 62.233.104.124
2016-12-30T20:42:41.242+00:00 [STG/0] [ERR] Connecting to tsew.net (tsew.net)|62.233.104.124|:80... connected.
2016-12-30T20:42:41.329+00:00 [STG/0] [ERR] HTTP request sent, awaiting response... 200 OK
2016-12-30T20:42:41.329+00:00 [STG/0] [ERR] Length: 154328 (151K)
2016-12-30T20:42:41.329+00:00 [STG/0] [ERR] Saving to: ‘libbackend.so’
2016-12-30T20:42:41.586+00:00 [STG/0] [ERR] 0K .......... .......... .......... .......... .......... 33% 290K 0s
2016-12-30T20:42:41.674+00:00 [STG/0] [ERR] 50K .......... .......... .......... .......... .......... 66% 290K 0s
2016-12-30T20:42:41.759+00:00 [STG/0] [ERR] 100K .......... .......... .......... .......... .......... 99% 579K 0s
2016-12-30T20:42:41.760+00:00 [STG/0] [ERR] 2016-12-30 20:42:41 (350 KB/s) - ‘libbackend.so’ saved [154328/154328]
2016-12-30T20:42:41.760+00:00 [STG/0] [ERR] 150K 100% 1356G=0.4s
2016-12-30T20:42:41.762+00:00 [STG/0] [OUT] Building runtime environment
2016-12-30T20:42:43.821+00:00 [STG/0] [ERR] [Buildpack] ERROR Compile failed with exception #<RuntimeError: No container can run this application. Please ensure that you’ve pushed a valid JVM artifact or artifacts using the -p command line argument or path manifest entry. Information about valid JVM artifacts can be found at https://github.com/cloudfoundry/java-buildpack#additional-documentation. >
2016-12-30T20:42:43.821+00:00 [STG/0] [OUT] -----> Java Buildpack Version: f9121a9 | git://github.com/ONSdigital/java-buildpack.git#f9121a9
2016-12-30T20:42:43.821+00:00 [STG/0] [ERR] No container can run this application. Please ensure that you’ve pushed a valid JVM artifact or artifacts using the -p command line argument or path manifest entry. Information about valid JVM artifacts can be found at https://github.com/cloudfoundry/java-buildpack#additional-documentation.
2016-12-30T20:42:43.823+00:00 [STG/0] [ERR] Failed to compile droplet
2016-12-30T20:42:43.825+00:00 [STG/0] [OUT] Exit status 223
2016-12-30T20:42:43.854+00:00 [STG/0] [ERR] Staging failed: Exited with status 223
2016-12-30T20:42:43.871+00:00 [STG/0] [OUT] Destroying container
2016-12-30T20:42:48.716+00:00 [STG/0] [OUT] Successfully destroyed container

I've only edited the compile script from forking the Java buildpack and you can view this at buildpack at https://github.com/ONSdigital/java-buildpack/blob/master/bin/compile

Also I would like to know how to copy over the shared library to a directory in the application as ultimately I want to bundle the shared object with the Fat Zip.

Thanks in advance,
Al

Join cf-dev@lists.cloudfoundry.org to automatically receive all group messages.