Skip to content

Kraft can not run multiple program at one time #2302

@bettermultiply

Description

@bettermultiply

Describe the bug

When I try to run two program at the same time , it failed and report below message to me:

 i  using arch=x86_64 plat=qemu
<!> building rootfs via Dockerfile                                                                                                                                              x86_64 [5.9s]
 i  creating ephemeral buildkit container
 W  could not connect to BuildKit client '' is BuildKit running?
 W  
 W  By default, KraftKit will look for a native install which
 W  is located at /run/buildkit/buildkit.sock.  Alternatively, you
 W  can run BuildKit in a container (recommended for macOS users)
 W  which you can do by running:
 W  
 W    docker run --rm -d --name buildkit --privileged moby/buildkit:v0.20.0
 W  
 W  Depending on your container runtime, you should connect to Buildkit via:
 W  
 W    export KRAFTKIT_BUILDKIT_HOST=docker-container://buildkit # for docker
 W  or
 W    export KRAFTKIT_BUILDKIT_HOST=podman-container://buildkit # for podman
 W  
 W  For more usage instructions visit: https://unikraft.org/buildkit
 W  
 E  creating buildkit container: start container: started hook: wait until ready: container ex ited with code 1
 E  creating buildkit container: start container: started hook: wait until ready: container exited with code 1

And the error also happened when I use -p option of kraft run. However, if I use command kraft remove my_machine, and use kraft run -p ...... instantly(not the same time), this error also happened. If I wait for a few seconds, everything went well. So I think the reason is remove hasn't finished, so that produce a same situation run two program at the same time.

Steps to reproduce

  1. Choose one program that do not exit directly.(e.g. add sleep to catalog/helloworld), and run the following command:
kraft run .

^Z

bg

kraft run .
git clone [email protected]:unikraft/catalog.git

cd catalog/example/http-c

kraft run -p 8080:8080 .

^Z

bg

kraft remove my_machine

kraft run -p 8081:8081 .

Expected behavior

error happened.

KraftKit version

0.11.6

Which architectures were you using or does this bug affect?

No response

Which operating system were you using or does this bug affect?

No response

Relevant log output

i  using arch=x86_64 plat=qemu
<!> building rootfs via Dockerfile                                                                                                                                              x86_64 [5.9s]
 i  creating ephemeral buildkit container
 W  could not connect to BuildKit client '' is BuildKit running?
 W  
 W  By default, KraftKit will look for a native install which
 W  is located at /run/buildkit/buildkit.sock.  Alternatively, you
 W  can run BuildKit in a container (recommended for macOS users)
 W  which you can do by running:
 W  
 W    docker run --rm -d --name buildkit --privileged moby/buildkit:v0.20.0
 W  
 W  Depending on your container runtime, you should connect to Buildkit via:
 W  
 W    export KRAFTKIT_BUILDKIT_HOST=docker-container://buildkit # for docker
 W  or
 W    export KRAFTKIT_BUILDKIT_HOST=podman-container://buildkit # for podman
 W  
 W  For more usage instructions visit: https://unikraft.org/buildkit
 W  
 E  creating buildkit container: start container: started hook: wait until ready: container ex ited with code 1
 E  creating buildkit container: start container: started hook: wait until ready: container exited with code 1

Metadata

Metadata

Assignees

Labels

kind/bugSomething isn't working

Type

No type

Projects

Status

🧊 Icebox

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions