Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minikube fails to build ISO in Docker: cannot find package "k8s.io/minikube/pkg/minikube/cluster" #11902

Closed
alban opened this issue Jul 5, 2021 · 6 comments
Labels
kind/process Process oriented issues, like setting up CI kind/support Categorizes issue or PR as a support question. triage/needs-information Indicates an issue needs more information in order to work on it.

Comments

@alban
Copy link
Contributor

alban commented Jul 5, 2021

Steps to reproduce the issue:

Following https://minikube.sigs.k8s.io/docs/contrib/building/iso/:

  1. git checkout v1.22.0-beta.0 (same problem on master as of 27d7386)
  2. make buildroot-image
  3. make out/minikube.iso

Full output of the build logs:

[alban@neptune minikube]$ make out/minikube.iso
docker run --rm --workdir /mnt --volume /home/alban/go/src/k8s.io/minikube:/mnt  \
	--user 1000:1000 --env HOME=/tmp --env IN_DOCKER=1 \
	gcr.io/k8s-minikube/buildroot-image /usr/bin/make out/minikube.iso
/usr/bin/make minikube_iso
make[1]: Entering directory '/mnt'
GOOS=linux GOARCH=amd64 go build -o deploy/iso/minikube-iso/board/coreos/minikube/rootfs-overlay/usr/bin/auto-pause cmd/auto-pause/auto-pause.go
cmd/auto-pause/auto-pause.go:26:2: cannot find package "k8s.io/minikube/pkg/minikube/cluster" in any of:
	/usr/lib/go-1.10/src/k8s.io/minikube/pkg/minikube/cluster (from $GOROOT)
	/tmp/go/src/k8s.io/minikube/pkg/minikube/cluster (from $GOPATH)
cmd/auto-pause/auto-pause.go:27:2: cannot find package "k8s.io/minikube/pkg/minikube/command" in any of:
	/usr/lib/go-1.10/src/k8s.io/minikube/pkg/minikube/command (from $GOROOT)
	/tmp/go/src/k8s.io/minikube/pkg/minikube/command (from $GOPATH)
cmd/auto-pause/auto-pause.go:28:2: cannot find package "k8s.io/minikube/pkg/minikube/cruntime" in any of:
	/usr/lib/go-1.10/src/k8s.io/minikube/pkg/minikube/cruntime (from $GOROOT)
	/tmp/go/src/k8s.io/minikube/pkg/minikube/cruntime (from $GOPATH)
cmd/auto-pause/auto-pause.go:29:2: cannot find package "k8s.io/minikube/pkg/minikube/exit" in any of:
	/usr/lib/go-1.10/src/k8s.io/minikube/pkg/minikube/exit (from $GOROOT)
	/tmp/go/src/k8s.io/minikube/pkg/minikube/exit (from $GOPATH)
cmd/auto-pause/auto-pause.go:30:2: cannot find package "k8s.io/minikube/pkg/minikube/out" in any of:
	/usr/lib/go-1.10/src/k8s.io/minikube/pkg/minikube/out (from $GOROOT)
	/tmp/go/src/k8s.io/minikube/pkg/minikube/out (from $GOPATH)
cmd/auto-pause/auto-pause.go:31:2: cannot find package "k8s.io/minikube/pkg/minikube/reason" in any of:
	/usr/lib/go-1.10/src/k8s.io/minikube/pkg/minikube/reason (from $GOROOT)
	/tmp/go/src/k8s.io/minikube/pkg/minikube/reason (from $GOPATH)
cmd/auto-pause/auto-pause.go:32:2: cannot find package "k8s.io/minikube/pkg/minikube/style" in any of:
	/usr/lib/go-1.10/src/k8s.io/minikube/pkg/minikube/style (from $GOROOT)
	/tmp/go/src/k8s.io/minikube/pkg/minikube/style (from $GOPATH)
make[1]: *** [deploy/iso/minikube-iso/board/coreos/minikube/rootfs-overlay/usr/bin/auto-pause] Error 1
Makefile:875: recipe for target 'deploy/iso/minikube-iso/board/coreos/minikube/rootfs-overlay/usr/bin/auto-pause' failed
make[1]: Leaving directory '/mnt'
make: *** [out/minikube.iso] Error 2
Makefile:302: recipe for target 'out/minikube.iso' failed
make: *** [Makefile:304: out/minikube.iso] Error 2

Additional logs

[alban@neptune minikube]$ make iso_in_docker
docker run -it --rm --workdir /mnt --volume /home/alban/go/src/k8s.io/minikube:/mnt  \
	--user 1000:1000 --env HOME=/tmp --env IN_DOCKER=1 \
	gcr.io/k8s-minikube/buildroot-image /bin/bash
groups: cannot find name for group ID 1000
I have no name!@a466b28d3ef1:/mnt$ env|grep GO
I have no name!@a466b28d3ef1:/mnt$ go version
go version go1.10.4 linux/amd64
@RA489
Copy link

RA489 commented Jul 8, 2021

/kind support

@k8s-ci-robot k8s-ci-robot added the kind/support Categorizes issue or PR as a support question. label Jul 8, 2021
@medyagh
Copy link
Member

medyagh commented Sep 1, 2021

@alban curious why are trying to build ISO ? in our automation we don't use building iso in docker

I am not sure when was last time we used that

we are using make release-iso

I am curious have u tried this one ?

make iso_in_docker

if you find a fix for it I would accept a PR

@medyagh medyagh added kind/process Process oriented issues, like setting up CI triage/needs-information Indicates an issue needs more information in order to work on it. labels Sep 1, 2021
@alban
Copy link
Contributor Author

alban commented Sep 1, 2021

@medyagh I was trying to build the Minikube iso with a kernel that has the following options:

  • CONFIG_IKHEADERS
  • CONFIG_FTRACE_SYSCALLS
  • CONFIG_DEBUG_INFO_BTF

See #8556

At the moment, we are using this fork to be able to make BPF workshops on Minikube:
https://github.com/kinvolk/cloud-native-bpf-workshop/blob/master/minikube.md

Thanks for the alternative make commands. I'll try make release-iso.

About the command make iso_in_docker, it was not working (see "Additional logs" section in the issue description)

@johnmuth81
Copy link

@alban curious why are trying to build ISO ? in our automation we don't use building iso in docker

@medyagh I'm not sure why @alban was trying to build the ISO, but I fell into make out/minikube.iso from https://minikube.sigs.k8s.io/docs/contrib/building/iso/ (which you can get to from the 'Contributing' link on the top README.md. I got further and found another issue with what appears to be a bogus SHA256 sum for CRIO 1.22.0, but I think I'll try make iso-in-docker instead.

@cameronbrunner
Copy link
Contributor

I was trying the same thing and determined the issue to be 1.10 version of golang in the buildroot-image ISO Dockerfile. Following the instructions at https://github.com/golang/go/wiki/Ubuntu I installed golang 1.17 to get past the initial error. This led to a build error due to PWD not being set inside of the docker container due to the launching of make directly and not from inside a shell. With a change to wrap the make call inside of a bash login prompt I was able to build an ISO on MacOS.

I will create a PR with changes.

cameronbrunner added a commit to cameronbrunner/minikube that referenced this issue Sep 21, 2021
For issue kubernetes#11902

Two changes required to get MacOS ISO builds working:
1. Include a 'go module' compatible golang environment in the
   buildroot docker image
2. Run the build within a shell environment to have $PWD set
cameronbrunner added a commit to cameronbrunner/minikube that referenced this issue Sep 21, 2021
For issue kubernetes#11902

Two changes required to get MacOS ISO builds working:
1. Include a 'go module' compatible golang environment in the
   buildroot docker image
2. Run the build within a shell environment to have $PWD set
@spowelljr
Copy link
Member

Fixed with @cameronbrunner's PR #12539, closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/process Process oriented issues, like setting up CI kind/support Categorizes issue or PR as a support question. triage/needs-information Indicates an issue needs more information in order to work on it.
Projects
None yet
Development

No branches or pull requests

7 participants