solo-io / unik

The Unikernel & MicroVM Compilation and Deployment Platform
Apache License 2.0
2.72k stars 191 forks source link

Failing to run go vm with firecracker as provider. #184

Open ashish235 opened 5 years ago

ashish235 commented 5 years ago

Hi Guys,

I 'm trying to use unik to create vms for firecracker and run them. I can build the image following the steps on github but when i 'm running the image I 'm getting errors.

Build:

ubuntu@ip-172-35-102-151:~/unik$ unik build --name writeOS_miVM --path ./demo/ --base firecracker --language go --provider firecracker --force INFO[0000] running unik build args= base=firecracker force=true host="localhost:3000" language=go mountPoints="[]" name=writeOS_miVM path=./demo/ provider=firecracker INFO[0000] App packaged as tarball: /tmp/sources.tar.gz.708149797 NAME ID INFRASTRUCTURE CREATED SIZE(MB) MOUNTPOINTS writeOS_miVM writeOS_miVM FIRECRACKER 2019-03-05 07:08:02.081358097 50

Run: ubuntu@ip-172-35-102-151:~/unik$ unik run --instanceName writeOS_vm1 --imageName writeOS_miVM INFO[0000] running unik run env="map[]" host="localhost:3000" imageName=writeOS_miVM instanceName=writeOS_vm1 mounts="map[]" ERRO[0003] failed running instance: [cmd/run.go:98] running image failed: %v: {[client/instances.go:103] failed with status 500: Firecracker did not create API socket /home/ubuntu/.unik/firecracker/instances/writeOS_vm1/firecracker.sock: context deadline exceeded}

Debug logs from Unik.

time="2019-03-05T07:13:20Z" level=debug msg="Started POST /instances/run for 127.0.0.1:46952"
time="2019-03-05T07:13:20Z" level=debug msg="Received run request" request={writeOS_vm1 writeOS_miVM map[] map[] 0 false false}
time="2019-03-05T07:13:20Z" level=info msg="running instance writeOS_vm1" env=map[] image-id="writeOS_miVM" mounts=map[]
time="2019-03-05T07:13:20Z" level=debug msg="creating firecracker vm"
INFO[0945] Called startVMM(), setting up a VMM on /home/ubuntu/.unik/firecracker/instances/writeOS_vm1/firecracker.sock
time="2019-03-05T07:13:23Z" level=error msg="Firecracker Init returned error Firecracker did not create API socket /home/ubuntu/.unik/firecracker/instances/writeOS_vm1/firecracker.sock: context deadline exceeded"
time="2019-03-05T07:13:23Z" level=error msg="error handling request" error="Firecracker did not create API socket /home/ubuntu/.unik/firecracker/instances/writeOS_vm1/firecracker.sock: context deadline exceeded"
time="2019-03-05T07:13:23Z" level=debug msg="Completed 500 Internal Server Error in 3.001619102s\n"

I 'm using target as local and this is my config file.

providers: firecracker:

Also I can see the vm has been created.

ubuntu@ip-172-35-102-151:~/.unik$ ll firecracker/images/writeOS_miVM/boot.img

Please help.

Irooniam commented 5 years ago

Hello, I'm having issues with getting unik running with firecracker but I can't even finish local build:

go-bindata -pkg versiondata -o containers/container-versions.go containers/versions.json
GOOS=linux go build -v .
go: finding github.com/solo-io/unik/instance-listener/bindata latest
go: finding github.com/solo-io/unik/instance-listener latest
go: finding github.com/solo-io/unik latest
Fetching https://github.com?go-get=1
go: finding github.com/rackspace/gophercloud/openstack/imageservice/v2/images latest
go: finding github.com/rackspace/gophercloud/openstack/imageservice/v2 latest
go: finding github.com/rackspace/gophercloud/openstack/imageservice latest
go: finding github.com/rackspace/gophercloud/openstack latest
go: finding github.com/aws/aws-sdk-go/private/endpoints latest
go: finding github.com/aws/aws-sdk-go/private/waiter latest
go: finding github.com/aws/aws-sdk-go/private/signer/v4 latest
go: finding github.com/aws/aws-sdk-go/private latest
go: finding github.com/aws/aws-sdk-go/private/signer latest
Parsing meta tags from https://github.com?go-get=1 (status code 200)
../../go/pkg/mod/github.com/djannot/aws-sdk-go@v1.1.34/aws/session/session.go:17:2: unknown import path "github.com/aws/aws-sdk-go/private/endpoints": cannot find module providing package github.com/aws/aws-sdk-go/private/endpoints
../../go/pkg/mod/github.com/djannot/aws-sdk-go@v1.1.34/service/s3/service.go:11:2: unknown import path "github.com/aws/aws-sdk-go/private/signer/v4": cannot find module providing package github.com/aws/aws-sdk-go/private/signer/v4
../../go/pkg/mod/github.com/djannot/aws-sdk-go@v1.1.34/service/s3/waiters.go:6:2: unknown import path "github.com/aws/aws-sdk-go/private/waiter": cannot find module providing package github.com/aws/aws-sdk-go/private/waiter
../../go/pkg/mod/github.com/solo-io/unik@v0.0.0-20190411111517-08cae4dad5c9/pkg/providers/openstack/delete_image.go:8:2: unknown import path "github.com/rackspace/gophercloud/openstack/imageservice/v2/images": cannot find module providing package github.com/rackspace/gophercloud/openstack/imageservice/v2/images
../../go/pkg/mod/github.com/solo-io/unik@v0.0.0-20190411111517-08cae4dad5c9/pkg/util/container.go:15:2: unknown import path "github.com/solo-io/unik/containers": cannot find package
../../go/pkg/mod/github.com/solo-io/unik@v0.0.0-20190411111517-08cae4dad5c9/pkg/providers/common/compile_instance_listener.go:9:2: unknown import path "github.com/solo-io/unik/instance-listener/bindata": cannot find module providing package github.com/solo-io/unik/instance-listener/bindata
make: *** [Makefile:263: localbuild] Error 1

I've set export GO111MODULE=on and off, I've run go clean cache, but nothing works.

Any help would be appreciated.

crackcomm commented 5 years ago

@ashish235 I had the same error message, can you try with console: stdio?