Skip to content

Commit

Permalink
feat: added arm64 build (#5420)
Browse files Browse the repository at this point in the history
* fix: remove build steps on ci

Signed-off-by: ponkio-o <[email protected]>

* chore: update actions

Signed-off-by: ponkio-o <[email protected]>

* chore: format

Signed-off-by: ponkio-o <[email protected]>

* update dockerfile

Signed-off-by: ponkio-o <[email protected]>

* fix conflict

Signed-off-by: ponkio-o <[email protected]>

* added git command

Signed-off-by: ponkio-o <[email protected]>

* revert step to set PIPECD_VERSION

Signed-off-by: ponkio-o <[email protected]>

---------

Signed-off-by: ponkio-o <[email protected]>
  • Loading branch information
ponkio-o authored Dec 16, 2024
1 parent d5ba3d2 commit e83e9d0
Show file tree
Hide file tree
Showing 8 changed files with 113 additions and 53 deletions.
45 changes: 8 additions & 37 deletions .github/workflows/publish_image_chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ env:
GHCR: ghcr.io
GCR: gcr.io
HELM_VERSION: 3.8.2
GO_VERSION: 1.22.4
NODE_VERSION: 16.13.0

jobs:
artifacts:
Expand Down Expand Up @@ -59,40 +57,13 @@ jobs:
container_registry: gcr.io/pipecd

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
cache: true
- name: Determine version
run: echo "PIPECD_VERSION=$(git describe --tags --always --abbrev=7)" >> $GITHUB_ENV

# Building go modules.
- name: Build go modules
run: make build/go

# Building web.
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Update web dependencies
run: make update/web-deps
- name: Build web static
run: make build/web

# Setup QEMU and Buildx.
# Setup QEMU and Buildx.
- name: Set up QEMU
uses: docker/setup-qemu-action@8b122486cedac8393e77aa9734c3528886e4a1a8 #v2.0.0
- name: Set up Docker Buildx
Expand All @@ -115,14 +86,14 @@ jobs:

# Building and pushing container images.
- name: Build and push ${{ matrix.image }} image
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 #v5.0.0
uses: docker/build-push-action@48aba3b46d1b1fec4febb7c5d0c644b249a11355 # v6.10.0
with:
push: true
context: .
file: ${{ matrix.dockerfile }}
platforms: linux/amd64,linux/arm64
tags: ${{ matrix.container_registry }}/${{ matrix.image }}:${{ env.PIPECD_VERSION }}

# Building and pushing Helm charts.
- name: Install helm
uses: Azure/setup-helm@v1
Expand Down Expand Up @@ -161,7 +132,7 @@ jobs:
uses: Azure/setup-helm@v1
with:
version: ${{ env.HELM_VERSION }}
- uses: actions/checkout@v3
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
ref: master
Expand All @@ -175,9 +146,9 @@ jobs:
- name: Publish quickstart manifests
uses: peter-evans/create-pull-request@v6
with:
title: "[bot] Publish quickstart manifests"
commit-message: "[bot] Publish quickstart manifests"
branch: "create-pull-request/publish-quickstart-manifests"
title: '[bot] Publish quickstart manifests'
commit-message: '[bot] Publish quickstart manifests'
branch: 'create-pull-request/publish-quickstart-manifests'
body: |
Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action.
The workflow is defined [here](https://github.com/pipe-cd/pipecd/blob/master/.github/workflows/publish_image_chart.yaml).
Expand Down
13 changes: 12 additions & 1 deletion cmd/helloworld/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
FROM golang:1.23.3 AS builder

WORKDIR /app

COPY go.* ./
RUN go mod download

COPY . ./

RUN make build/go MOD=helloworld

FROM alpine:3.21.0

ADD .artifacts/helloworld /usr/local/bin/helloworld
COPY --from=builder /app/.artifacts/helloworld /usr/local/bin/helloworld

ENTRYPOINT ["helloworld"]
17 changes: 14 additions & 3 deletions cmd/launcher/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
# https://github.com/pipe-cd/pipecd/pkgs/container/piped-base/301720292?tag=v0.49.3
FROM ghcr.io/pipe-cd/piped-base@sha256:e5ce81bfd81b6d8d24b2caf9ec482c3f6d11fff7ab96f6cc6fc854e82376fb3d
FROM golang:1.23.3 AS builder

ADD .artifacts/launcher /usr/local/bin/launcher
WORKDIR /app

COPY go.* ./
RUN go mod download

COPY . ./

RUN make build/go MOD=launcher

# https://github.com/pipe-cd/pipecd/pkgs/container/piped-base/321463679?tag=v0.50.0-26-ga8527d2
FROM ghcr.io/pipe-cd/piped-base@sha256:9960b45a5aa822ae45ca2966056d8d2e98795b51681df25afd1fecf96360981c

COPY --from=builder /app/.artifacts/launcher /usr/local/bin/launcher

ENTRYPOINT ["launcher"]
17 changes: 14 additions & 3 deletions cmd/launcher/Dockerfile-okd
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
# https://github.com/pipe-cd/pipecd/pkgs/container/piped-base-okd/237191933?tag=v0.47.3-rc0-21-ge20cd0b
FROM ghcr.io/pipe-cd/piped-base-okd@sha256:afb1bfee70d445986d04c2066d2887da7b1e2e454cecabec5bf37e3201cd7e7e
FROM golang:1.23.3 AS builder

ADD .artifacts/launcher /usr/local/bin/launcher
WORKDIR /app

COPY go.* ./
RUN go mod download

COPY . ./

RUN make build/go MOD=launcher

# https://github.com/pipe-cd/pipecd/pkgs/container/piped-base-okd/321464518?tag=v0.50.0-26-ga8527d2
FROM ghcr.io/pipe-cd/piped-base-okd@sha256:da9bd5a1dae3aa5c2df4baba81ff836ba4a55159d85984605549ef2d1f136895

COPY --from=builder /app/.artifacts/launcher /usr/local/bin/launcher

ENTRYPOINT ["launcher"]
27 changes: 25 additions & 2 deletions cmd/pipecd/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
# web builder
FROM node:20.18.1-alpine3.21 AS web

WORKDIR /app

COPY . .

RUN apk add --no-cache make git
RUN make update/web-deps
RUN make build/web

# pipecd builder
FROM golang:1.23.3 AS builder

WORKDIR /app

COPY go.* ./
RUN go mod download

COPY . ./

RUN make build/go MOD=pipecd

FROM alpine:3.21.0

ARG GOOGLE_CLOUD_SDK_VERSION=477.0.0
Expand All @@ -15,7 +38,7 @@ ENV PATH="/google-cloud-sdk/bin:${PATH}"

RUN mkdir -p web/static

ADD .artifacts/pipecd /usr/local/bin/pipecd
ADD .artifacts/web-static web/static
COPY --from=builder /app/.artifacts/pipecd /usr/local/bin/pipecd
COPY --from=web /app/.artifacts/web-static web/static

ENTRYPOINT ["pipecd"]
13 changes: 12 additions & 1 deletion cmd/pipectl/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
FROM golang:1.23.3 AS builder

WORKDIR /app

COPY go.* ./
RUN go mod download

COPY . ./

RUN make build/go MOD=pipectl

FROM alpine:3.21.0

RUN apk add --no-cache git

ADD .artifacts/pipectl /usr/local/bin/pipectl
COPY --from=builder /app/.artifacts/pipectl /usr/local/bin/pipectl

ENTRYPOINT ["pipectl"]
17 changes: 14 additions & 3 deletions cmd/piped/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
# https://github.com/pipe-cd/pipecd/pkgs/container/piped-base/301720292?tag=v0.49.3
FROM ghcr.io/pipe-cd/piped-base@sha256:e5ce81bfd81b6d8d24b2caf9ec482c3f6d11fff7ab96f6cc6fc854e82376fb3d
FROM golang:1.23.3 AS builder

ADD .artifacts/piped /usr/local/bin/piped
WORKDIR /app

COPY go.* ./
RUN go mod download

COPY . ./

RUN make build/go MOD=piped

# https://github.com/pipe-cd/pipecd/pkgs/container/piped-base/321463679?tag=v0.50.0-26-ga8527d2
FROM ghcr.io/pipe-cd/piped-base@sha256:9960b45a5aa822ae45ca2966056d8d2e98795b51681df25afd1fecf96360981c

COPY --from=builder /app/.artifacts/piped /usr/local/bin/piped

ENTRYPOINT ["piped"]
17 changes: 14 additions & 3 deletions cmd/piped/Dockerfile-okd
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
# https://github.com/pipe-cd/pipecd/pkgs/container/piped-base-okd/237191933?tag=v0.47.3-rc0-21-ge20cd0b
FROM ghcr.io/pipe-cd/piped-base-okd@sha256:afb1bfee70d445986d04c2066d2887da7b1e2e454cecabec5bf37e3201cd7e7e
FROM golang:1.23.3 AS builder

ADD .artifacts/piped /usr/local/bin/piped
WORKDIR /app

COPY go.* ./
RUN go mod download

COPY . ./

RUN make build/go MOD=piped

# https://github.com/pipe-cd/pipecd/pkgs/container/piped-base-okd/321464518?tag=v0.50.0-26-ga8527d2
FROM ghcr.io/pipe-cd/piped-base-okd@sha256:da9bd5a1dae3aa5c2df4baba81ff836ba4a55159d85984605549ef2d1f136895

COPY --from=builder /app/.artifacts/piped /usr/local/bin/piped

ENTRYPOINT ["piped"]

0 comments on commit e83e9d0

Please sign in to comment.