Skip to content

Commit 54abd94

Browse files
committed
add multi arch build to postsubmit in GCB
Signed-off-by: Patrik Cyvoct <[email protected]>
1 parent ffd4c1d commit 54abd94

File tree

3 files changed

+31
-14
lines changed

3 files changed

+31
-14
lines changed

Dockerfile.in

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,9 @@ RUN clean-install libsystemd0 bash
2121
# Avoid symlink of /etc/localtime.
2222
RUN test -h /etc/localtime && rm -f /etc/localtime && cp /usr/share/zoneinfo/UTC /etc/localtime || true
2323

24-
<<<<<<< HEAD
25-
ADD ./bin/node-problem-detector /node-problem-detector
24+
ADD ./bin/node-problem-detector-BINARCH /node-problem-detector
2625

2726
# Below command depends on ENABLE_JOURNAL=1.
28-
29-
ADD ./bin/log-counter-BINARCH /home/kubernetes/bin/log-counter
30-
ADD ./bin/node-problem-detector-BINARCH /node-problem-detector
3127
ADD ./bin/log-counter-BINARCH /home/kubernetes/bin/log-counter
3228
ADD config /config
3329
ENTRYPOINT ["/node-problem-detector", "--system-log-monitors=/config/kernel-monitor.json"]

Makefile

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
clean vet fmt version \
1919
Dockerfile build-binaries docker-builder build-in-docker \
2020
build-all build-all-container \
21-
build-tar-all push-all push-all-container push-manifest push-tar-all qemu-register
21+
build-tar-all push-all push-all-container push-manifest push-tar-all qemu-register \
22+
release-staging
2223

2324
TEMP_DIR := $(shell mktemp -d)
2425

@@ -40,6 +41,9 @@ export DOCKER_CLI_EXPERIMENTAL := enabled
4041
# REGISTRY is the container registry to push into.
4142
REGISTRY?=staging-k8s.gcr.io
4243

44+
# STAGING_REGISTRY is the new registry for staging
45+
STAGING_REGISTRY?=gcr.io/k8s-staging-npd
46+
4347
# UPLOAD_PATH is the cloud storage path to upload release tar.
4448
UPLOAD_PATH?=gs://kubernetes-release
4549
# Trim the trailing '/' in the path
@@ -123,6 +127,7 @@ version:
123127
@echo $(VERSION)
124128

125129
./bin/log-counter: $(PKG_SOURCES)
130+
ifeq ($(ENABLE_JOURNALD), 1)
126131
CGO_ENABLED=$(CGO_ENABLED) GOOS=linux GOARCH=$(ARCH) GO111MODULE=on go build \
127132
-mod vendor \
128133
-o bin/log-counter-$(ARCH) \
@@ -190,20 +195,16 @@ build-container-%: qemu-register
190195
build-container: clean build-in-docker Dockerfile
191196
docker build -t $(IMAGE_WITH_ARCH) .
192197

193-
build-tar: build-in-docker
194-
cp bin/node-problem-detector-amd64 bin/node-problem-detector
195-
cp bin/log-counter-amd64 bin/log-counter
196-
cp bin/problem-maker-amd64 bin/problem-maker
197-
tar -zcvf $(TARBALL) bin/ config/ test/e2e-install.sh
198+
build-tar: ./bin/node-problem-detector ./bin/log-counter ./test/bin/problem-maker
199+
tar -zcvf $(TARBALL) bin/ config/ test/e2e-install.sh test/bin/problem-maker
198200
sha1sum $(TARBALL)
199201
md5sum $(TARBALL)
200202

201203
build-tar-all:
202204
@for arch in $(ALL_ARCH); do $(MAKE) ARCH=$${arch} build-in-docker; done
203205
cp bin/node-problem-detector-amd64 bin/node-problem-detector
204206
cp bin/log-counter-amd64 bin/log-counter
205-
cp bin/problem-maker-amd64 bin/problem-maker
206-
tar -zcvf $(TARBALL-ALL) bin/ config/ test/e2e-install.sh
207+
tar -zcvf $(TARBALL-ALL) bin/ config/ test/e2e-install.sh
207208
sha1sum $(TARBALL-ALL)
208209
md5sum $(TARBALL-ALL)
209210

@@ -221,7 +222,7 @@ build-in-docker: clean docker-builder
221222
-v `pwd`:/gopath/src/k8s.io/node-problem-detector/ npd-builder:latest bash \
222223
-c 'cd /gopath/src/k8s.io/node-problem-detector/ && make build-binaries'
223224

224-
push-all-container: build-all-container
225+
push-all-container: build-all-container $(addprefix push-container-,$(ALL_ARCH))
225226

226227
push-container-%:
227228
$(MAKE) ARCH=$* push-container
@@ -246,6 +247,9 @@ push-all: push-all-container push-manifest push-tar-all
246247

247248
push: push-container push-tar
248249

250+
release-staging:
251+
REGISTRY=$(STAGING_REGISTRY) $(MAKE) push-all
252+
249253
clean:
250254
rm -f bin/log-counter*
251255
rm -f bin/node-problem-detector*

cloudbuild.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
timeout: 1200s
2+
options:
3+
substitution_option: ALLOW_LOOSE
4+
steps:
5+
- name: 'gcr.io/k8s-testimages/gcb-docker-gcloud:v20190906-745fed4'
6+
entrypoint: make
7+
env:
8+
- TAG=$_GIT_TAG
9+
- BASE_REF=$_PULL_BASE_REF
10+
- DOCKER_CLI_EXPERIMENTAL=enabled
11+
args:
12+
- release-staging
13+
substitutions:
14+
# _GIT_TAG will be filled with a git-based tag for the image, of the form vYYYYMMDD-hash, and
15+
# can be used as a substitution
16+
_GIT_TAG: '12345'
17+
_PULL_BASE_REF: 'dev'

0 commit comments

Comments
 (0)