Commit Graph

301 Commits

Author SHA1 Message Date
Benjamin Elder
a0cd54a7f1 fix trivial shell quoting issues surfaced by shellcheck v0.7.1 2021-03-06 13:19:17 -08:00
Kubernetes Prow Robot
2e39df89ac
Merge pull request #97743 from dims/support-m1-macbook-darwin/arm64-as-client
Support M1 MacBooks darwin/arm64 on the client-side
2021-03-04 04:18:09 -08:00
Kubernetes Prow Robot
9658145f8a
Merge pull request #99655 from liggitt/min-go-version
Update go version check to 1.16+
2021-03-03 20:13:59 -08:00
Davanum Srinivas
f719624654
Support M1 MacBooks darwin/arm64 on the client-side
testing using:
```
build/run.sh make generated_files && make quick-release-images
```

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2021-03-02 20:50:00 -05:00
Kubernetes Prow Robot
28feb8e30d
Merge pull request #96882 from saschagrunert/parallel-build-configurable
Make parallel build memory threshold configurable
2021-03-02 16:51:19 -08:00
Jordan Liggitt
5e9189289e Update go version check to 1.16+ 2021-03-02 15:11:46 -05:00
Jake Sanders
a3cfb0f2ce Prevent CGO and STATIC_OVERRIDES from trampling themselves if sourced multiple times 2021-02-26 20:49:46 -08:00
Maciej Szulik
0a0c80c553
Add kubectl-convert to client-binaries 2021-02-22 17:01:34 +01:00
Tonis Tiigi
fd01467c0c avoid hardcoding amd64 specifics on cross compiling
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-02-07 21:08:00 -08:00
Tonis Tiigi
f19f22b43e enable cross-compile CC config for non-amd64
Currently target CC can only be set if the host platform
is linux/amd64 . If target is already set in the environment
it is always safe to use it and enable cgo.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2021-01-28 07:11:04 -08:00
Sascha Grunert
9428ad78fd
Make parallel build memory threshold configurable
The amount of memory required to build binaries in parallel is right now
set to 40GiB. We now make this variable to be able to build artifacts in
parallel even with a lower amount of memory.

This enables SIG Release to speed-up the build time drastically in
Google Cloud Build (GCB).

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2021-01-11 11:59:57 +01:00
Abhisek Banerjee
462326afba Support cross compilation only on amd64.
Based on a patch to Bottlerocket by Ben Cressey <bcressey@amazon.com>
41a72fe214/packages/kubernetes-1.17/0001-always-set-relevant-variables-for-cross-compiling.patch
2020-10-21 00:13:01 +00:00
bnrjee
6b672863c7 Always set relevant variables for cross compiling
Based on a patch to Bottlerocket by Ben Cressey <bcressey@amazon.com>
41a72fe214/packages/kubernetes-1.17/0001-always-set-relevant-variables-for-cross-compiling.patch
2020-10-21 00:13:01 +00:00
Kubernetes Prow Robot
aa084d4919
Merge pull request #92491 from BenTheElder/fuzz-only-test
compile out gofuzz from prod binaries
2020-08-27 17:57:36 -07:00
Odin Ugedal
1524794231
Fix building with GOFLAGS=-v
With go1.15 running go version with "-v" fails, and we should support
it.
2020-08-15 17:44:07 +02:00
Jordan Liggitt
bdcffdced3 [go115] Require go1.15 in build helper scripts 2020-08-13 13:46:52 -04:00
Stephen Augustus
05ffc95347 [go1.15] Remove client support for darwin/386
Removed in go1.15 (GH/golang/go/issues/37610).

Signed-off-by: Stephen Augustus <saugustus@vmware.com>
2020-07-25 16:45:01 -04:00
Benjamin Elder
42acb51e2c disable goffuzz in binaries 2020-06-30 20:30:59 -07:00
Jordan Liggitt
c82fe149a6 go1.14: update minimum required go version 2020-06-23 16:40:22 -04:00
bjrara
c8ac95321d Enhance kube-aggregator in standalone mode 2020-06-09 13:29:27 +08:00
Tim Hockin
8d7adb7d94 Fix umask better
While the umask was previously set for builds (and in fact `docker run`
sets it to 0022 by default), the release pipeline `cp`'s files (with
`-a`) which respect the user's umask, and is outside of the build path.

This sets the umask in a common function called by all build tools,
which Stephen agreed was the simplest and most complete fix.  The
`verify-prereqs` function is already poorly named for what it does, and
this only makes it epsilon worse.
2020-05-11 13:23:54 -07:00
Tim Hockin
dff449ee9e Set umask 0022 when building
Some binaries now run as non-root (kube-scheduler).  When umask is 0027,
for example, the container image we build has the binary 0750, which is
not executable by the non-root UID.
2020-05-05 16:28:43 -07:00
Davanum Srinivas
d70d04f92b
zero out the build id for reproducible builds
We have been having issues with making builds reproducible, especially
with the `.note.go.buildid` ELF section. One tip from a golang issue was
to set `-ldflags=-buildid=` which seems to work well. You can confirm
that the buildid is set to empty by inspecting the binaries with the go
command example `go tool buildid _output/local/go/bin/kubectl`

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-03-15 20:43:19 -04:00
Davanum Srinivas
dfd8e4e467
Enable selinux tags in make targets
In 24d105995d, a fix was made in bazel
based builds to ensure that we add `selinux` tag when we build all
binaries especially the `kubelet`. We need to do the same for in our
hack scripts so things like `make release` will work properly as well.

Some scripts use `GOFLAGS=-tags=providerless` for example, So we should
support the tags to be specified in GOFLAGS as well. We parse out the
tags from there and ensure selinux is added to the list of tags we used
for building the binaries. Note that we add our own `-tags` with the
full set of tags and since we specify our parameter at the end, ours
full list takes precendence
2020-01-31 15:48:44 -05:00
Kubernetes Prow Robot
7a1eaa112e
Merge pull request #84696 from dims/BenTheElder-byebyehacke2e
Remove hack/e2e.go
2019-11-07 09:05:04 -08:00
Jordan Liggitt
e3ff39ffa0 Update build to go1.13.4 2019-11-06 17:39:05 -05:00
Benjamin Elder
83c56a0373
remove hack/e2e.go 2019-11-03 19:36:59 -05:00
Odin Ugedal
cce1f32ea5
Fix shellcheck failures SC2034 2019-10-23 22:47:46 +02:00
Jonathan Tomer
d34f49b913 Up minimum go version to 1.12.4
https://github.com/kubernetes/kubernetes/pull/77222 removed a workaround for a
Go standard library bug (https://github.com/golang/go/issues/31125) that was
not fixed until that version, so we need to require it.
2019-10-07 15:55:33 -07:00
Davanum Srinivas
138571b23f
Remove hyperkube from release artifacts
Change-Id: Ie09248d6fc688ffffbeb0271824817a5129346a0
2019-10-03 13:33:17 -04:00
Davanum Srinivas
adbd1800c8 Drop cloud-controller-manager artifacts from k/k release 2019-08-06 13:51:27 -04:00
Davanum Srinivas
543093e775
Add go-runner to the list of e2e test targets
Change-Id: I9c837d8f0a74014434308b46291ad1f81d67109a
2019-07-04 13:34:44 -04:00
John Schnake
b3f5a086ab Adds an optional golang runner to the conformance test image
Adds a go app which runs the e2e tests with ginkgo.

 - Supports all the existing env vars of the bash script
 - Improved flow control to avoid and better report issues
regarding the process PID
 - Adds flags for modifying where to find the test binary and
ginkgo binary so that you can run it locally
 - Adds 3 flags for specifying extra args before the double-dash,
extra args after the double-dash, and the seperator to use between
values in those env vars. This allows setting arbitrary, complex
values for use on the command such as flags which include spaces
or other characters.
2019-07-01 16:26:13 -05:00
hui luo
6c8aabc832 Check KUBE_SERVER_PLATFORMS existence
when compile kubectl on platform other than
linux/amd64, we need to check the KUBE_SERVER_PLATFORMS
array emptiness before assign it.

the example command is:
make WHAT=cmd/kubectl KUBE_BUILD_PLATFORMS="darwin/amd64 windows/amd64"
2019-05-18 09:17:22 -07:00
Christoph Blecker
b8481b62fc
Don't use declare -g in build 2019-05-17 12:22:42 -07:00
adisky
7e2aa46f64
fix unbound variable release.sh 2019-05-16 23:09:19 +05:30
adisky
38b7f2125f
fix unbound array variable 2019-05-15 13:47:48 +05:30
Christoph Blecker
eaafa5952f
Don't use mapfile as it isn't bash 3 compatible 2019-05-06 15:55:12 -07:00
Michael Taufen
dcee810a3f Restrict builds to officially supported platforms
Prior to this change, including windows/amd64 in KUBE_BUILD_PLATFORMS
would, for example, attempt to build the server binaries/tars/images for
Windows, which is not supported. This can break downstream build steps.
2019-04-25 14:05:44 -07:00
Christoph Blecker
4543e68ae5
Fix shellcheck in hack/lib/golang.sh 2019-04-18 18:53:13 -07:00
Davanum Srinivas
7e01702a88
Move "-s -w" flags to GOLDFLAGS as an overridable default.
If GOLDFLAGS is set, whether it is empty or not, we should honor it.
Only if the GOLDFLAGS is totally not set, then we use "-s -w"

See Parameter Expansion section in the urls below:

https://stackoverflow.com/questions/3601515/how-to-check-if-a-variable-is-set-in-bash/16753536
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_02

Change-Id: I826c34efc63c77f0e3e9677fff30a3eb2219a377
2019-04-17 21:55:13 -04:00
Jordan Liggitt
2ea3cbdcbc Update hack scripts to use go mod 2019-04-03 10:19:39 -04:00
Kubernetes Prow Robot
f6c51d6e99
Merge pull request #75751 from BenTheElder/bash-fun
fix kube::golang::is_instrumented_package
2019-03-26 23:19:01 -07:00
Benjamin Elder
0833a9cc38 fix kube::golang::is_instrumented_package 2019-03-26 17:17:16 -07:00
Ed Bartosh
3d5d38607d fix 'make generated_files' build on MacOS
Recent change to hack/lib/golang.sh broke the build on MacOS this way:

$ make clean && make generated_files
+++ [0325 13:38:22] Verifying Prerequisites....
+++ [0325 13:38:23] Removing _output directory
k8s.io/kubernetes/vendor/github.com/spf13/pflag
k8s.io/kubernetes/hack/make-rules/helpers/go2make
+++ [0325 13:38:40] Building go targets for darwin/amd64:
    ./vendor/k8s.io/code-generator/cmd/deepcopy-gen
can't load package: package k8s.io/kubernetes: no Go files in k8s.io/kubernetes/_output/local/go/src/k8s.io/kubernetes
!!! [0325 13:38:40] Call tree:
!!! [0325 13:38:40]  1: k8s.io/kubernetes/hack/lib/golang.sh:629 kube::golang::build_some_binaries(...)
!!! [0325 13:38:40]  2: k8s.io/kubernetes/hack/lib/golang.sh:764 kube::golang::build_binaries_for_platform(...)
!!! [0325 13:38:40]  3: hack/make-rules/build.sh:27 kube::golang::build_binaries(...)
make[1]: *** [_output/bin/deepcopy-gen] Error 1
make: *** [generated_files] Error 2

It was caused by 'binaries' array not being declared with 'local -a'.
It looks like MacOS' old bash version makes an array to contain first
empty element if declared this way.

The fix has been tested on MacOS High Sierra and Linux openSUSE 42.3 (x86_64)

Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
2019-03-25 17:08:13 +01:00
toyoda
a52af3a9d5 fix shellcheck failure golang.sh 2019-03-22 13:29:26 +09:00
Han Kang
a5ddc3943a bump required minimum go version to 1.12.1 (strings package compatibility) 2019-03-20 16:07:07 -07:00
Roy Lenferink
b18bc2ea79 Improved some more bash script variable definitions 2019-01-21 23:11:58 +01:00
Roy Lenferink
a5d0616bdc Improving syntax for bash scripts 2019-01-18 19:17:16 +01:00
Kubernetes Prow Robot
152226c557
Merge pull request #71198 from cofyc/go1.11-GOFLAGS-env
No need to pass GOFLAGS to $goflags variables with go 1.11
2019-01-09 23:35:09 -08:00