cloudius-systems / capstan

Capstan, a tool for packaging and running your application on OSv. http://osv.io/capstan
Other
363 stars 82 forks source link

Cannot build gce images #146

Open favila opened 9 years ago

favila commented 9 years ago

Using https://github.com/cloudius-systems/capstan-example-clojure as an example:

$ capstan build -p gce -v
Building capstan-example-clojure...
/build/buildd/qemu-2.1+dfsg/nbd.c:nbd_trip():L1150: From: 512, Len: 512, Size: 512, Offset: 0

/build/buildd/qemu-2.1+dfsg/nbd.c:nbd_trip():L1151: requested operation past EOF--bad client?
qemu-system-x86_64: -drive file=/home/favila/.capstan/repository/capstan-example-clojure/capstan-example-clojure.gce,if=none,id=hd0,aio=native,cache=none: could not open disk image /home/favila/.capstan/repository/capstan-example-clojure/capstan-example-clojure.gce: Could not read image for determining its format: Invalid argument
dial tcp 127.0.0.1:10000: connection refused
favila commented 9 years ago

Looking into this a bit more, the .capstan/repository/cloudius/osv-openjdk/openjdk.gce file contains the text string gs://osv/v0.22/osv-openjdk.gce.tar.gz instead of a binary disk image. I'm not sure what this means.

saturnism commented 8 years ago

I'm having the same issue :(

$ capstan build -p gce
Building capstan-example-java...
Downloading cloudius/osv-openjdk/index.yaml...
169 B / 169 B [====================================================================================================================================] 100.00 % 
Downloading cloudius/osv-openjdk/osv-openjdk.gce.gz...
55 B / 55 B [======================================================================================================================================] 100.00 % 
WARNING: Image format was not specified for '/Users/rayt/.capstan/repository/capstan-example-java/capstan-example-java.gce' and probing guessed raw.
         Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
         Specify the 'raw' format explicitly to remove the restrictions.
nbd.c:nbd_trip():L1303: From: 512, Len: 512, Size: 512, Offset: 0

nbd.c:nbd_trip():L1304: requested operation past EOF--bad client?
penberg commented 8 years ago

Ping @asias

asias commented 8 years ago

The downloaded gce image file from capstan repo is not a normal image on purpose.

It is an address for an image on google cloud storage, e.g., to same the time to upload load image to gce.

gs://osv/v0.22/osv-openjdk.gce.tar.gz

Francis, capstan build with gce does not work. Can you try capstan build with qemu?

On Wed, Jul 29, 2015 at 7:03 AM, Francis Avila notifications@github.com wrote:

Looking into this a bit more, the .capstan/repository/cloudius/osv-openjdk/openjdk.gce file contains the text string gs://osv/v0.22/osv-openjdk.gce.tar.gz instead of a binary disk image. I'm not sure what this means.

— Reply to this email directly or view it on GitHub https://github.com/cloudius-systems/capstan/issues/146#issuecomment-125777362 .

Asias

favila commented 8 years ago

Updated capstan using the prebuilt binary.

Qemu building works (and did before IIRC).

Building for gce errors out. It looks like some tool (qemu?) is confused that the image contains only a url (which is why I mentioned it earlier). I understand that this is how google compute images work, but the image itself needs to be built somewhere locally and it doesn't look like it is. Further, the capstan-example-clojure.gce image contains the url of the openjdk image (gs://osv/v0.23/osv-openjdk.gce.tar.gz) which can't be right.

New output below:

$ capstan -v
capstan version v0.1.8

$ capstan build -p gce -v
Building capstan-example-clojure...
Downloading cloudius/osv-openjdk/index.yaml...
169 B / 169 B [======================================================] 100.00 % 
Downloading cloudius/osv-openjdk/osv-openjdk.gce.gz...
55 B / 55 B [========================================================] 100.00 % 
WARNING: Image format was not specified for '/home/favila/.capstan/repository/capstan-example-clojure/capstan-example-clojure.gce' and probing guessed raw.
         Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
         Specify the 'raw' format explicitly to remove the restrictions.
/build/qemu-5HduZn/qemu-2.3+dfsg/nbd.c:nbd_trip():L1246: From: 512, Len: 512, Size: 512, Offset: 0

/build/qemu-5HduZn/qemu-2.3+dfsg/nbd.c:nbd_trip():L1247: requested operation past EOF--bad client?

$ capstan build -p qemu -v
Building capstan-example-clojure...
Downloading cloudius/osv-openjdk/index.yaml...
169 B / 169 B [======================================================] 100.00 % 
Downloading cloudius/osv-openjdk/osv-openjdk.qemu.gz...
74.27 MB / 74.27 MB [================================================] 100.00 % 
OSv v0.23
eth0: 192.168.122.15
Waiting for connection from host...
Uploading files...
./target/capstan-example-clojure-0.1.0-SNAPSHOT-standalone.jar  --> /capstan-example-clojure.jar
Adding /capstan-example-clojure.jar...

$ capstan run capstan-example-clojure
Created instance: capstan-example-clojure
OSv v0.23
eth0: 192.168.122.15
Hello Clojure!
saturnism commented 8 years ago

yeah, i'm not quite sure how that works w/ the URL to the base image. It feels like it was downloaded but the final image doesn't get built.