Skip to content

Commit

Permalink
feat(*): added arm build and release pipline (#4231)
Browse files Browse the repository at this point in the history
* feat(*): use image with arm support and update ports
upgrade jaeger all in one to support arm
added workflow for arm64
added kubectl image which has bash

Signed-off-by: Łukasz Dziedziak <lukidzi@gmail.com>
  • Loading branch information
lukidzi authored and pull[bot] committed Dec 13, 2022
1 parent 447ec48 commit 1c84497
Show file tree
Hide file tree
Showing 25 changed files with 254 additions and 79 deletions.
109 changes: 96 additions & 13 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ commands:
# See https://github.com/rancher/k3d/issues/807 (runc's default version on the instance fails k3d)
command: |
if [[ `uname -s` == "Linux" ]]; then
sudo sh -c 'curl -s --fail --location https://github.com/opencontainers/runc/releases/download/v1.0.3/runc.amd64 > /usr/bin/runc'
sudo sh -c 'curl -s --fail --location https://github.com/opencontainers/runc/releases/download/v1.1.0/runc.<<parameters.go_arch>> > /usr/bin/runc'
sudo chown root:root /usr/bin/runc ; sudo chmod o+x /usr/bin/runc
fi
Expand All @@ -103,6 +103,14 @@ executors:
GO_VERSION: *go_version
GO111MODULE: "on"

vm-arm64:
resource_class: arm.large
machine:
image: *ubuntu_vm_image
environment:
GO_VERSION: *go_version
GO111MODULE: "on"

mac:
resource_class: medium
macos:
Expand Down Expand Up @@ -199,28 +207,37 @@ jobs:
command: make check

test:
executor: vm
parameters:
target:
description: The test make target.
type: string
default: test
go_arch:
description: The golang arch.
type: string
default: amd64
workflow_executor:
type: string
default: vm
executor:
name: << parameters.workflow_executor >>
environment:
GOPATH: /home/circleci/.go-kuma-go
steps:
- install_build_tools
- install_build_tools:
go_arch: << parameters.go_arch >>
- checkout
- restore_cache:
keys:
# prefer the exact match
- vm-executor-go.mod-{{ .Branch }}-{{ checksum "go.sum" }}
- <<parameters.workflow_executor>>-executor-go.mod-{{ .Branch }}-{{ checksum "go.sum" }}
- run:
name: "Download Go modules"
command: |
go mod download
# since execution of go commands might change contents of "go.sum", we have to save cache immediately
- save_cache:
key: vm-executor-go.mod-{{ .Branch }}-{{ checksum "go.sum" }}
key: <<parameters.workflow_executor>>-executor-go.mod-{{ .Branch }}-{{ checksum "go.sum" }}
paths:
- "/home/circleci/.go-kuma-go"
- run:
Expand Down Expand Up @@ -255,7 +272,6 @@ jobs:
path: /tmp/ginkgo-test-results

e2e:
executor: vm
parameters:
api:
description: XDS API version
Expand All @@ -277,11 +293,27 @@ jobs:
description: makefile target
type: string
default: "test/e2e"
go_arch:
description: The golang arch
type: string
default: amd64
workflow_executor:
type: string
default: vm
make_parameters:
type: string
default: -j2
ginkgo_flags:
type: string
default: ""
executor:
name: << parameters.workflow_executor >>
parallelism: << parameters.parallelism >>
environment:
GOPATH: /home/circleci/.go-kuma-go
steps:
- install_build_tools
- install_build_tools:
go_arch: << parameters.go_arch >>
- checkout
- restore_cache:
keys:
Expand Down Expand Up @@ -331,6 +363,7 @@ jobs:
export KUMA_DEFAULT_RETRIES=60
export KUMA_DEFAULT_TIMEOUT="6s"
export GINKGO_TEST_RESULTS_DIR=/tmp/ginkgo-test-results
export GINKGO_E2E_FLAGS=<<parameters.ginkgo_flags>>
make -j2 << parameters.target >>
- store_test_results:
path: /tmp/ginkgo-test-results
Expand All @@ -346,12 +379,18 @@ jobs:
export E2E_PKG_LIST=${E2E_PKG_LIST:-$(circleci tests glob ./test/e2e/* | circleci tests split | xargs printf "./%s/... ")}
export API_VERSION=<< parameters.api >>
export GINKGO_TEST_RESULTS_DIR=/tmp/ginkgo-test-results
export GINKGO_E2E_FLAGS=<<parameters.ginkgo_flags>>
export K3D=true
make -j2 << parameters.target >>
make <<parameters.make_parameters>> << parameters.target >>
- store_test_results:
path: /tmp/ginkgo-test-results

build:
parameters:
go_arch:
description: The golang arch
type: string
default: amd64
executor: golang
steps:
- checkout
Expand All @@ -367,20 +406,20 @@ jobs:
- run:
name: Build Docker images
command: |
make images
GOARCH=<<parameters.go_arch>> make images
- run:
name: Save Docker images into TAR archives
command: |
make docker/save
GOARCH=<<parameters.go_arch>> make docker/save
# Persist the specified paths into the workspace for use in downstream jobs
- persist_to_workspace:
root: build
paths:
- docker-images
- artifacts-linux-amd64
- docker-images-<<parameters.go_arch>>
- artifacts-linux-<<parameters.go_arch>>

release:
executor: vm
executor: golang
steps:
- install_build_tools
- checkout
Expand All @@ -403,6 +442,10 @@ jobs:
name: Push Docker
command: |
./tools/releases/docker.sh --push
- run:
name: Create and Push multiarch manifest for Docker images
command: |
./tools/releases/docker.sh --manifest
workflows:
version: 2
Expand All @@ -422,9 +465,47 @@ workflows:
- build:
requires:
- go_cache
- build:
name: build-arm64
go_arch: arm64
requires:
- go_cache
- test:
requires:
- check
- test:
name: test-arm64
workflow_executor: vm-arm64
go_arch: arm64
requires:
- check
- e2e:
name: test/e2e-ipv4-arm64
workflow_executor: vm-arm64
go_arch: arm64
make_parameters: "-j1"
ginkgo_flags: "--label-filter=\"!arm-not-supported\""
requires:
- build-arm64
- check
- e2e:
name: e2e-kubernetes-arm64
target: test/e2e-kubernetes
workflow_executor: vm-arm64
go_arch: arm64
requires:
- build-arm64
- check
parallelism: 1
- e2e:
name: e2e-universal-arm64
target: test/e2e-universal
workflow_executor: vm-arm64
go_arch: arm64
requires:
- build-arm64
- check
parallelism: 1
- e2e:
name: test/e2e-ipv4
requires:
Expand Down Expand Up @@ -502,6 +583,8 @@ workflows:
- dev_mac
- dev_ubuntu
- test
- test-arm64
- test/e2e-ipv4
- test/e2e-ipv4-arm64
- test/e2e-ipv6
- test/e2e-ipv4-oldk8s
Original file line number Diff line number Diff line change
Expand Up @@ -395,15 +395,15 @@ kumactl:
tag:

kubectl:
# bitnami maintains an image for all k8s versions */ } }
# see: https://hub.docker.com/r/bitnami/kubectl */ } }
# rancher maintains an image for all k8s versions */ } }
# see: https://hub.docker.com/r/rancher/kubectl */ } }
image:
# -- The kubectl image registry
registry: bitnami
registry: kumahq
# -- The kubectl image repository
repository: kubectl
# -- The kubectl image tag
tag: "1.20"
tag: "v1.20.15"
hooks:
# -- Node selector for the HELM hooks
nodeSelector:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ items:
- env:
- name: COLLECTOR_ZIPKIN_HOST_PORT
value: "9411"
image: jaegertracing/all-in-one:1.23
image: jaegertracing/all-in-one:1.24
name: jaeger
ports:
- containerPort: 5775
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ items:
- env:
- name: COLLECTOR_ZIPKIN_HOST_PORT
value: "9411"
image: jaegertracing/all-in-one:1.23
image: jaegertracing/all-in-one:1.24
name: jaeger
ports:
- containerPort: 5775
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ items:
- env:
- name: COLLECTOR_ZIPKIN_HOST_PORT
value: "9411"
image: jaegertracing/all-in-one:1.23
image: jaegertracing/all-in-one:1.24
name: jaeger
ports:
- containerPort: 5775
Expand Down
4 changes: 2 additions & 2 deletions deployments/charts/kuma/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ A Helm chart for the Kuma Control Plane
| egress.containerSecurityContext | object | `{}` | Security context at the container level for egress |
| kumactl.image.repository | string | `"kumactl"` | The kumactl image repository |
| kumactl.image.tag | string | `nil` | The kumactl image tag. When not specified, the value is copied from global.tag |
| kubectl.image.registry | string | `"bitnami"` | The kubectl image registry |
| kubectl.image.registry | string | `"kumahq"` | The kubectl image registry |
| kubectl.image.repository | string | `"kubectl"` | The kubectl image repository |
| kubectl.image.tag | string | `"1.20"` | The kubectl image tag |
| kubectl.image.tag | string | `"v1.20.15"` | The kubectl image tag |
| hooks.nodeSelector | object | `{"kubernetes.io/arch":"amd64","kubernetes.io/os":"linux"}` | Node selector for the HELM hooks |
| hooks.podSecurityContext | object | `{}` | Security context at the pod level for crd/webhook/ns |
| hooks.containerSecurityContext | object | `{}` | Security context at the container level for crd/webhook/ns |
Expand Down
8 changes: 4 additions & 4 deletions deployments/charts/kuma/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -395,15 +395,15 @@ kumactl:
tag:

kubectl:
# bitnami maintains an image for all k8s versions */ } }
# see: https://hub.docker.com/r/bitnami/kubectl */ } }
# kuma image that support v1.20.15 image */ } }
# see: https://hub.docker.com/r/kumahq/kubectl */ } }
image:
# -- The kubectl image registry
registry: bitnami
registry: kumahq
# -- The kubectl image repository
repository: kubectl
# -- The kubectl image tag
tag: "1.20"
tag: "v1.20.15"
hooks:
# -- Node selector for the HELM hooks
nodeSelector:
Expand Down
2 changes: 1 addition & 1 deletion mk/build.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ BUILD_INFO_BUILD_DATE ?= $(shell date -u +"%Y-%m-%dT%H:%M:%SZ" || echo unknown)
BUILD_INFO_VERSION ?= $(shell $(TOOLS_DIR)/releases/version.sh)

build_info_fields := \
version=$(BUILD_INFO_VERSION) \
version=$(BUILD_INFO_VERSION)-${GOARCH} \
gitTag=$(BUILD_INFO_GIT_TAG) \
gitCommit=$(BUILD_INFO_GIT_COMMIT) \
buildDate=$(BUILD_INFO_BUILD_DATE)
Expand Down
Loading

0 comments on commit 1c84497

Please sign in to comment.