Skip to content

Commit

Permalink
[PERFSCALE-2466]: Updates to the Multi-Arch perfApp (#4)
Browse files Browse the repository at this point in the history
This PR includes the following updates:
1) Updates to ARCH variable
2) Moves to Containerfile to containers/
3) Increase scope of Multi-arch images

Signed-off-by: Krishna Harsha Voora <[email protected]>
  • Loading branch information
krishvoor authored Sep 29, 2023
1 parent ad2e960 commit 999c319
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,25 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
golang-version: [1.16]
golang-version: [1.19]
arch:
- arm64
- amd64
- ppc64le
- s390x

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Install dependencies
run: sudo apt-get install qemu-user-static podman fuse-overlayfs
run: |
sudo apt-get update -y
sudo apt-get install qemu-user-static fuse-overlayfs -y
sudo apt-get install podman -y
if: runner.os == 'Linux'

- name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.golang-version }}

Expand All @@ -33,5 +38,5 @@ jobs:
QUAY_USER: ${{ secrets.QUAY_USER }}
QUAY_TOKEN: ${{ secrets.QUAY_TOKEN }}

- name: Build binary and push container
- name: Build binary and Publish Multi-Arch container
run: ARCH=${{ matrix.arch }} make
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
SRC=$(shell find . -name *.go)
BINARY=perfApp-$(ARCH)
GOCMD=go
ARCH ?= amd64
ARCH ?= $(shell go env GOARCH)
GOOS ?= linux
GO_BUILD_RECIPE:=GOOS=$(GOOS) CGO_ENABLED=0 GOARCH=$(ARCH) go build
ENGINE=podman
Expand Down Expand Up @@ -34,7 +34,8 @@ container: buildContainer pushContainer

buildContainer: build/$(BINARY) Containerfile
@echo -e "\n\033[2mBuilding container $(CONTAINER_NAME)\033[0m"
$(ENGINE) build --pull-always --arch=$(ARCH) --build-arg=ARCH=$(ARCH) -t $(CONTAINER_NAME) .
$(ENGINE) build --pull-always -f containers/Containerfile \
--arch=$(ARCH) --build-arg ARCH=$(ARCH) -t $(CONTAINER_NAME) ./containers

pushContainer:
@echo -e "\n\033[2mPushing container $(CONTAINER_NAME)\033[0m"
Expand Down
2 changes: 1 addition & 1 deletion Containerfile → containers/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ FROM docker.io/busybox:latest

MAINTAINER Raúl Sevilla

ARG ARCH=amd64
ARG ARCH
COPY build/perfApp-${ARCH} /usr/bin/perfApp
CMD perfApp

0 comments on commit 999c319

Please sign in to comment.