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

feat: added arm64 build #5420

Merged
merged 8 commits into from
Dec 16, 2024
Merged

feat: added arm64 build #5420

merged 8 commits into from
Dec 16, 2024

Conversation

ponkio-o
Copy link
Contributor

What this PR does: Added linux/arm64 build to all docker images.

Why we need it: To support linux/arm64

Which issue(s) this PR fixes:

Fixes #4896

Does this PR introduce a user-facing change?: No

Signed-off-by: ponkio-o <29038315+ponkio-o@users.noreply.github.com>
Signed-off-by: ponkio-o <29038315+ponkio-o@users.noreply.github.com>
Signed-off-by: ponkio-o <29038315+ponkio-o@users.noreply.github.com>
Signed-off-by: ponkio-o <29038315+ponkio-o@users.noreply.github.com>
Signed-off-by: ponkio-o <29038315+ponkio-o@users.noreply.github.com>
Signed-off-by: ponkio-o <29038315+ponkio-o@users.noreply.github.com>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Currently, binaries built for linux/amd64 on CI are added to the image, but I have changed to build them inside the Dockerfile. This will automatically configure GOARCH and other settings.

As noted in the Issue, the linux/arm64 docker image exists, but the binary that exits in the image is linux/amd64, which is the cause of the current error.

Warashi
Warashi previously approved these changes Dec 16, 2024
Copy link
Contributor

@Warashi Warashi left a comment

Choose a reason for hiding this comment

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

LGTM 👍🏻

Comment on lines 1 to 23
# web builder
FROM node:20.18.1-alpine3.21 AS web

WORKDIR /app

COPY . .

RUN apk add --no-cache make
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

Copy link
Contributor

@Warashi Warashi Dec 16, 2024

Choose a reason for hiding this comment

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

Sorry, we use git in our Makefile in many places, so please install git in web and go builder?

build/go: BUILD_VERSION ?= $(shell git describe --tags --always --dirty --abbrev=7)

"build": "PIPECD_VERSION=`git describe --tags --always --dirty --abbrev=7` webpack build --mode production --env htmlTemplate=./base.html --config ./webpack.config.js",

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Warashi Thank you for your review. I installed git command to builder container on below commit.
beb90e7

And golang:1.23.3 has been installed git already.

$ docker run --rm -it golang:1.23.3 git --help
usage: git [-v | --version] [-h | --help] [-C <path>] [-c <name>=<value>]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           [--super-prefix=<path>] [--config-env=<name>=<envvar>]
           <command> [<args>]

These are common Git commands used in various situations:

start a working area (see also: git help tutorial)
   clone     Clone a repository into a new directory
   init      Create an empty Git repository or reinitialize an existing one

work on the current change (see also: git help everyday)
   add       Add file contents to the index
   mv        Move or rename a file, a directory, or a symlink
   restore   Restore working tree files
   rm        Remove files from the working tree and from the index

examine the history and state (see also: git help revisions)
   bisect    Use binary search to find the commit that introduced a bug
   diff      Show changes between commits, commit and working tree, etc
   grep      Print lines matching a pattern
   log       Show commit logs
   show      Show various types of objects
   status    Show the working tree status

grow, mark and tweak your common history
   branch    List, create, or delete branches
   commit    Record changes to the repository
   merge     Join two or more development histories together
   rebase    Reapply commits on top of another base tip
   reset     Reset current HEAD to the specified state
   switch    Switch branches
   tag       Create, list, delete or verify a tag object signed with GPG

collaborate (see also: git help workflows)
   fetch     Download objects and refs from another repository
   pull      Fetch from and integrate with another repository or a local branch
   push      Update remote refs along with associated objects

'git help -a' and 'git help -g' list available subcommands and some
concept guides. See 'git help <command>' or 'git help <concept>'
to read about a specific subcommand or concept.
See 'git help git' for an overview of the system.

@Warashi Warashi dismissed their stale review December 16, 2024 01:47

I mistakenly approved without checking the behavior.

@Warashi
Copy link
Contributor

Warashi commented Dec 16, 2024

@ponkio-o
Sorry, I checked the behavior after I approved this, and I realized that the git command is absent in the builder container.

Signed-off-by: ponkio-o <29038315+ponkio-o@users.noreply.github.com>
Warashi
Warashi previously approved these changes Dec 16, 2024
Copy link
Contributor

@Warashi Warashi left a comment

Choose a reason for hiding this comment

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

Thank you! LGTM 👍🏻

- uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
cache: true
- name: Determine version
Copy link
Member

Choose a reason for hiding this comment

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

[ASK] Is this line still needed?

Copy link
Member

Choose a reason for hiding this comment

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

@ponkio-o
Sorry for the wrong selection.
I'm asking about only this line.

  - name: Determine version

Copy link
Contributor Author

@ponkio-o ponkio-o Dec 16, 2024

Choose a reason for hiding this comment

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

Sorry, the below line is needed.

run: echo "PIPECD_VERSION=$(git describe --tags --always --abbrev=7)" >> $GITHUB_ENV

Fixed in the following commit.
1fb5523

Signed-off-by: ponkio-o <29038315+ponkio-o@users.noreply.github.com>
Copy link
Member

@t-kikuc t-kikuc left a comment

Choose a reason for hiding this comment

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

Thank you so much!!!!!

Copy link
Contributor

@Warashi Warashi left a comment

Choose a reason for hiding this comment

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

Thank you!

@Warashi Warashi merged commit e83e9d0 into pipe-cd:master Dec 16, 2024
15 checks passed
@ponkio-o ponkio-o deleted the added-arm64-build branch December 16, 2024 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Quickstart: PipeCD control plane does not work on Arm architecture cluster
3 participants