use null-buildpack to support standalone non-web


Balaramaraju JLSP <balaramaraju@...>
 

So far we are unable to push a sample c++ application using null-buildpack;
seems it has worked for others (as documented here :
https://groups.google.com/a/cloudfoundry.org/forum/#!searchin/vcap-dev/null-buildpack/vcap-dev/oTYbHg_JJXU/_e30a2m3qr4J)
, but we are not able to get it to work yet.



Steps followed :



1. build a sample c++ application using g++ compiler on the linux vm;

2. Transfer that file to windows system;

3. Push that application using null-buildpack to both pivotal CF


Source :-


#include <stdio.h>



int main(int argc, char* argv[]) {

while(1==1) {

printf("Hello World\n");



}

return 0;

}

Build Command :- gcc -Wall helloWorld.c -o bin/helloWorld.sh

OS :- Cent OS 6.5 x64

CF command [from win 7] :- D:\Cloud\Native>*cf push helloWorld -b
https://github.com/ryandotsmith/null-buildpack
<https://github.com/ryandotsmith/null-buildpack> --no-route -c
"helloWorld.sh"*

is this native application need to build on Ubuntu alone, since CF uses it ?

CF logs :-

*Creating app helloworld1 in org ClinicalPF / space ClinicalPF_learning as
santhosh.kulandaiyan(a)philips.com <santhosh.kulandaiyan(a)philips.com>...*

*OK*



*App helloworld1 is a worker, skipping route creation*

*Uploading helloworld1...*

*Uploading app files from: d:\pcf\cpp\sample*

*Uploading 6.9K, 1 files*

*Done uploading*

*OK*



*Starting app helloworld1 in org ClinicalPF / space ClinicalPF_learning as
santhosh.kulandaiyan(a)philips.com <santhosh.kulandaiyan(a)philips.com>...*

*-----> Downloaded app package (4.0K)*

* Cloning into '/tmp/buildpacks/null-buildpack'...*

*fatal: unable to access 'https://github.com/ryandotsmith/null-buildpack/
<https://github.com/ryandotsmith/null-buildpack/>': Failed connect to
github.com:443 <http://github.com:443>; Operation now in progress*

--



App logs from Server :

*2015-04-22 11:03:26 +0000 [STG]* ERR Cloning into
'/tmp/buildpacks/null-buildpack'...

*2015-04-22 11:03:26 +0000 [STG]* OUT -----> Downloaded app package (4.0K)

*2015-04-22 11:03:26 +0000 [API]* OUT Updated app with guid
f9b1e566-23c4-469b-b2b1-035c200380be ({"state"=>"STARTED"})

*2015-04-22 11:03:25 +0000 [DEA]* OUT Got staging request for app with id
f9b1e566-23c4-469b-b2b1-035c200380be

*2015-04-22 11:03:19 +0000 [API]* OUT Created app with guid
f9b1e566-23c4-469b-b2b1-035c200380be




J L S P Balaramaraju


Daniel Mikusa
 

On Thu, May 7, 2015 at 2:09 AM, Balaramaraju JLSP <balaramaraju(a)gmail.com>
wrote:


So far we are unable to push a sample c++ application using
null-buildpack; seems it has worked for others (as documented here :
https://groups.google.com/a/cloudfoundry.org/forum/#!searchin/vcap-dev/null-buildpack/vcap-dev/oTYbHg_JJXU/_e30a2m3qr4J)
, but we are not able to get it to work yet.



Steps followed :



1. build a sample c++ application using g++ compiler on the linux vm;

2. Transfer that file to windows system;

3. Push that application using null-buildpack to both pivotal CF


Source :-


#include <stdio.h>



int main(int argc, char* argv[]) {

while(1==1) {

printf("Hello World\n");



}

return 0;

}

Build Command :- gcc -Wall helloWorld.c -o bin/helloWorld.sh

OS :- Cent OS 6.5 x64

CF command [from win 7] :- D:\Cloud\Native>*cf push helloWorld -b
https://github.com/ryandotsmith/null-buildpack
<https://github.com/ryandotsmith/null-buildpack> --no-route -c
"helloWorld.sh"*

is this native application need to build on Ubuntu alone, since CF uses it
?
I think it would depend, you'd probably be OK with your simple hello world
app. Something more complicated using third party libraries, may have
trouble. I'd personally try to avoid that and just compile on a machine
that is as close to the runtime environment as possible. To match the
cflinuxfs2 stack, you could use an Ubuntu 14.04 VM (Vagrant makes this very
easy) or this docker repo.

https://registry.hub.docker.com/u/cloudfoundry/cflinuxfs2/



CF logs :-

*Creating app helloworld1 in org ClinicalPF / space ClinicalPF_learning as
santhosh.kulandaiyan(a)philips.com <santhosh.kulandaiyan(a)philips.com>...*

*OK*



*App helloworld1 is a worker, skipping route creation*

*Uploading helloworld1...*

*Uploading app files from: d:\pcf\cpp\sample*

*Uploading 6.9K, 1 files*

*Done uploading*

*OK*



*Starting app helloworld1 in org ClinicalPF / space ClinicalPF_learning as
santhosh.kulandaiyan(a)philips.com <santhosh.kulandaiyan(a)philips.com>...*

*-----> Downloaded app package (4.0K)*

* Cloning into '/tmp/buildpacks/null-buildpack'...*

*fatal: unable to access 'https://github.com/ryandotsmith/null-buildpack/
<https://github.com/ryandotsmith/null-buildpack/>': Failed connect to
github.com:443 <http://github.com:443>; Operation now in progress*

--


This looks like you're having trouble connecting to github to download the
build pack. Do you have a network or security group that might prevent
this?

Another option if you have admin access would be to download the src [1]
and use `cf create-buildpack` to upload the build pack manually. You can
then just use "-b null_buildpack" or whatever name you give it with `cf
create-buildpack`.

[1] - https://github.com/ryandotsmith/null-buildpack/archive/master.zip

Dan


App logs from Server :

*2015-04-22 11:03:26 +0000 [STG]* ERR Cloning into
'/tmp/buildpacks/null-buildpack'...

*2015-04-22 11:03:26 +0000 [STG]* OUT -----> Downloaded app package (4.0K)

*2015-04-22 11:03:26 +0000 [API]* OUT Updated app with guid
f9b1e566-23c4-469b-b2b1-035c200380be ({"state"=>"STARTED"})

*2015-04-22 11:03:25 +0000 [DEA]* OUT Got staging request for app with id
f9b1e566-23c4-469b-b2b1-035c200380be

*2015-04-22 11:03:19 +0000 [API]* OUT Created app with guid
f9b1e566-23c4-469b-b2b1-035c200380be




J L S P Balaramaraju

_______________________________________________
cf-dev mailing list
cf-dev(a)lists.cloudfoundry.org
https://lists.cloudfoundry.org/mailman/listinfo/cf-dev