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

Do dockerized builds for minikube and localkube #1656

Merged
merged 2 commits into from
Jun 29, 2017

Conversation

r2d4
Copy link
Contributor

@r2d4 r2d4 commented Jun 27, 2017

BUILD_IN_DOCKER=y will build both localkube and minikube in docker
LOCALKUBE_BUILD_IN_DOCKER=y, MINIKUBE_BUILD_IN_DOCKER=y will toggle docker builds for each
respective binary

Regardless of the options provided, if you attempt to build localkube on a
non-linux platform, it will run in docker. This ensures that make
still works as expected on darwin.

The only thing that I couldn't get working was the extra platform detection when cross building. So BUILD_IN_DOCKER=y is required when make cross. Any suggestions on how to avoid that would be great

I originally planned something like ifneq(,$(or $(filter $(MINIKUBE_BUILD_IN_DOCKER),y),$(filter-out $(BUILD_OS),$*))), but automatic variables like $* aren't expanded in GNU make conditionals.

We might want to just move a lot of this to bash for simplicity and debugging.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 27, 2017
@codecov-io
Copy link

codecov-io commented Jun 27, 2017

Codecov Report

Merging #1656 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1656   +/-   ##
=======================================
  Coverage   38.65%   38.65%           
=======================================
  Files          51       51           
  Lines        2667     2667           
=======================================
  Hits         1031     1031           
  Misses       1455     1455           
  Partials      181      181

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 109fa16...f998882. Read the comment docs.

@dlorenc
Copy link
Contributor

dlorenc commented Jun 28, 2017

Nice, this looks really good.

Makefile Outdated
LOCALKUBE_BUILD_IN_DOCKER=y
endif

ifeq ($(IN_DOCKER),1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just a quick comment here explaining that this prevents infinite recursion, at first this reads incorrect.

Makefile Outdated

# $(call MINIKUBE_GO_BUILD_CMD, output file, OS)
define MINIKUBE_GO_BUILD_CMD
$($(shell echo MINIKUBE_ENV_$(2) | tr a-z A-Z)) go build --installsuffix cgo -ldflags="$(MINIKUBE_LDFLAGS) $(K8S_VERSION_LDFLAGS)" -o $(1) k8s.io/minikube/cmd/minikube
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick question: I accidently dropped the -a flag to go build here, but I don't think we need it. What was the reasoning initially?

        -a
                force rebuilding of packages that are already up-to-date.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added it back

r2d4 added 2 commits June 29, 2017 11:24
BUILD_IN_DOCKER=y will build both localkube and minikube in docker
LOCALKUBE_BUILD_IN_DOCKER=y, MINIKUBE_BUILD_IN_DOCKER=y will toggle
docker builds for each respective binary

Regardless of the options provided, if you attempt to build localkube on
a non-linux platform, it will run in docker.  This ensures that `make`
still works as expected on darwin.
minikube-linux-amd64 and minikube-darwin-amd64 cannot be cross built
natively on different platforms and must be built in the container.
@r2d4
Copy link
Contributor Author

r2d4 commented Jun 29, 2017

@minikube-bot retest this please

@r2d4 r2d4 merged commit 93a474e into kubernetes:master Jun 29, 2017
@r2d4 r2d4 deleted the docker-build branch June 29, 2017 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants