Skip to content

Commit

Permalink
feat: build UBI image for arm64 (#1594)
Browse files Browse the repository at this point in the history
* feat: build UBI image for arm64

Signed-off-by: Dominik Rosiek <[email protected]>

* chore: changelog

Signed-off-by: Dominik Rosiek <[email protected]>

* feat: add arm images to manifest

Signed-off-by: Dominik Rosiek <[email protected]>

* chore: fix platforms

Signed-off-by: Dominik Rosiek <[email protected]>

* feat: ensure TAG is set correctly

Signed-off-by: Dominik Rosiek <[email protected]>

---------

Signed-off-by: Dominik Rosiek <[email protected]>
  • Loading branch information
sumo-drosiek authored Jun 4, 2024
1 parent 006bb7a commit 5204a99
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 42 deletions.
1 change: 1 addition & 0 deletions .changelog/1594.changed.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
feat: build UBI image for arm64
15 changes: 7 additions & 8 deletions .github/workflows/dev_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches:
- main
- 'dev-build/*'
- "dev-build/*"

defaults:
run:
Expand All @@ -14,7 +14,6 @@ env:
GO_VERSION: "1.21.4"

jobs:

get-version:
name: Get application version for this revision
runs-on: ubuntu-latest
Expand All @@ -39,7 +38,7 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
arch_os: [ 'linux_amd64' ]
arch_os: ["linux_amd64"]
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -152,7 +151,7 @@ jobs:
- get-version
strategy:
matrix:
arch_os: [ 'linux_amd64', 'linux_arm64' ]
arch_os: ["linux_amd64", "linux_arm64"]
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -361,14 +360,14 @@ jobs:
run: |
make push-container-manifest-dev \
BUILD_TAG=${{ needs.get-version.outputs.version }} \
PLATFORMS="linux/amd64" \
PLATFORMS="linux/amd64 linux/arm64" \
BUILD_TYPE_SUFFIX="-ubi-fips"
- name: Push joint UBI-based FIPS container manifest for all platforms to DockerHub
run: |
make push-container-manifest-dev \
BUILD_TAG=${{ needs.get-version.outputs.version }} \
PLATFORMS="linux/amd64" \
PLATFORMS="linux/amd64 linux/arm64" \
REPO_URL=sumologic/sumologic-otel-collector-dev \
BUILD_TYPE_SUFFIX="-ubi-fips"
Expand All @@ -389,14 +388,14 @@ jobs:
run: |
make push-container-manifest-dev \
BUILD_TAG=${{ needs.get-version.outputs.version }} \
PLATFORMS="linux/amd64" \
PLATFORMS="linux/amd64 linux/arm64" \
BUILD_TYPE_SUFFIX="-ubi"
- name: Push joint UBI-based container manifest for all platforms to DockerHub
run: |
make push-container-manifest-dev \
BUILD_TAG=${{ needs.get-version.outputs.version }} \
PLATFORMS="linux/amd64" \
PLATFORMS="linux/amd64 linux/arm64" \
REPO_URL=sumologic/sumologic-otel-collector-dev \
BUILD_TYPE_SUFFIX="-ubi"
Expand Down
45 changes: 19 additions & 26 deletions .github/workflows/release_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ name: Releases
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-alpha.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+'
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-alpha.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+"

- 'v[0-9]+.[0-9]+.[0-9]+-sumo-[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-sumo-[0-9]+-alpha.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-sumo-[0-9]+-beta.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-sumo-[0-9]+-rc.[0-9]+'
- "v[0-9]+.[0-9]+.[0-9]+-sumo-[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-sumo-[0-9]+-alpha.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-sumo-[0-9]+-beta.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-sumo-[0-9]+-rc.[0-9]+"

defaults:
run:
Expand Down Expand Up @@ -40,7 +40,7 @@ jobs:
build:
name: Build
uses: ./.github/workflows/workflow-build.yml
needs: [ get-version ]
needs: [get-version]
strategy:
matrix:
include:
Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:
- get-version
strategy:
matrix:
arch_os: [ 'linux_amd64', 'linux_arm64']
arch_os: ["linux_amd64", "linux_arm64"]
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -125,7 +125,6 @@ jobs:
path: artifacts/

- name: Build and push FIPS image to Open Source ECR
if: matrix.arch_os == 'linux_amd64'
run: |
cp artifacts/otelcol-sumo-fips-${{matrix.arch_os}} otelcol-sumo
make build-push-container-multiplatform \
Expand All @@ -134,7 +133,6 @@ jobs:
BUILD_TYPE_SUFFIX="-fips"
- name: Build and push FIPS image to DockerHub
if: matrix.arch_os == 'linux_amd64'
run: |
cp artifacts/otelcol-sumo-fips-${{matrix.arch_os}} otelcol-sumo
make build-push-container-multiplatform \
Expand All @@ -144,7 +142,6 @@ jobs:
BUILD_TYPE_SUFFIX="-fips"
- name: Build and push UBI-based FIPS image to Open Source ECR
if: matrix.arch_os == 'linux_amd64'
run: |
cp artifacts/otelcol-sumo-fips-${{matrix.arch_os}} otelcol-sumo
make build-push-container-ubi \
Expand All @@ -153,7 +150,6 @@ jobs:
BUILD_TYPE_SUFFIX="-ubi-fips"
- name: Build and push UBI-based FIPS image to DockerHub
if: matrix.arch_os == 'linux_amd64'
run: |
cp artifacts/otelcol-sumo-fips-${{matrix.arch_os}} otelcol-sumo
make build-push-container-ubi \
Expand All @@ -178,7 +174,6 @@ jobs:
REPO_URL=sumologic/sumologic-otel-collector
- name: Build and push UBI-based image to Open Source ECR
if: matrix.arch_os == 'linux_amd64'
run: |
cp artifacts/otelcol-sumo-${{matrix.arch_os}} otelcol-sumo
make build-push-container-ubi \
Expand All @@ -187,7 +182,6 @@ jobs:
BUILD_TYPE_SUFFIX="-ubi"
- name: Build and push UBI-based image to DockerHub
if: matrix.arch_os == 'linux_amd64'
run: |
cp artifacts/otelcol-sumo-${{matrix.arch_os}} otelcol-sumo
make build-push-container-ubi \
Expand Down Expand Up @@ -249,14 +243,14 @@ jobs:
run: |
make push-container-manifest \
BUILD_TAG=${{ needs.get-version.outputs.version }} \
PLATFORMS="linux/amd64" \
PLATFORMS="linux/amd64 linux/arm64" \
BUILD_TYPE_SUFFIX="-ubi-fips"
- name: Push joint UBI-based FIPS container manifest for all platforms to DockerHub
run: |
make push-container-manifest \
BUILD_TAG=${{ needs.get-version.outputs.version }} \
PLATFORMS="linux/amd64" \
PLATFORMS="linux/amd64 linux/arm64" \
REPO_URL=sumologic/sumologic-otel-collector \
BUILD_TYPE_SUFFIX="-ubi-fips"
Expand All @@ -277,14 +271,14 @@ jobs:
run: |
make push-container-manifest \
BUILD_TAG=${{ needs.get-version.outputs.version }} \
PLATFORMS="linux/amd64" \
PLATFORMS="linux/amd64 linux/arm64" \
BUILD_TYPE_SUFFIX="-ubi"
- name: Push joint UBI-based container manifest for all platforms to DockerHub
run: |
make push-container-manifest \
BUILD_TAG=${{ needs.get-version.outputs.version }} \
PLATFORMS="linux/amd64" \
PLATFORMS="linux/amd64 linux/arm64" \
REPO_URL=sumologic/sumologic-otel-collector \
BUILD_TYPE_SUFFIX="-ubi"
Expand Down Expand Up @@ -332,11 +326,11 @@ jobs:
- name: Sign MSI
uses: skymatic/code-sign-action@v3
with:
certificate: '${{ secrets.MICROSOFT_CERTIFICATE }}'
password: '${{ secrets.MICROSOFT_CERTIFICATE_PASSWORD }}'
certificatesha1: '${{ secrets.MICROSOFT_CERTHASH }}'
certificatename: '${{ secrets.MICROSOFT_CERTNAME }}'
description: '${{ secrets.MICROSOFT_DESCRIPTION }}'
certificate: "${{ secrets.MICROSOFT_CERTIFICATE }}"
password: "${{ secrets.MICROSOFT_CERTIFICATE_PASSWORD }}"
certificatesha1: "${{ secrets.MICROSOFT_CERTHASH }}"
certificatename: "${{ secrets.MICROSOFT_CERTNAME }}"
description: "${{ secrets.MICROSOFT_DESCRIPTION }}"
folder: ./packaging/msi/wix/bin/${{ matrix.platform }}/en-US

- name: Store MSI as action artifact for ${{ matrix.arch_os }}
Expand All @@ -346,7 +340,6 @@ jobs:
path: ./packaging/msi/wix/bin/${{ matrix.platform }}/en-US/*.msi
if-no-files-found: error


# Store the install script from the packaging repository as a release artifact.
# Originally, this script was stored in this repository, and the official download url pointed
# to the most recent release here. The script has since been moved to the packaging repository.
Expand Down
18 changes: 10 additions & 8 deletions Dockerfile_ubi
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,26 @@ ARG BUILD_ARCH
## Build RedHat compliant image
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.10

ARG BUILD_TAG
ENV TAG $BUILD_TAG

ENV SUMMARY="UBI based sumologic-otel-collector" \
DESCRIPTION="Sumo Logic Distribution for OpenTelemetry Collector is a Sumo Logic-supported distribution of the OpenTelemetry Collector. It is a single agent to send logs, metrics and traces to Sumo Logic."

LABEL name="sumologic-otel-collector" \
vendor="Sumo Logic" \
version="$BUILD_TAG" \
release="0" \
summary="$SUMMARY" \
description="$DESCRIPTION" \
io.k8s.description="$DESCRIPTION" \
maintainer="[email protected]"
vendor="Sumo Logic" \
version="$BUILD_TAG" \
release="0" \
summary="$SUMMARY" \
description="$DESCRIPTION" \
io.k8s.description="$DESCRIPTION" \
maintainer="[email protected]"

ADD https://raw.githubusercontent.com/SumoLogic/sumologic-otel-collector/main/LICENSE \
/licenses/LICENSE

RUN microdnf update && microdnf install systemd && microdnf clean all

ENV TAG $BUILD_TAG

COPY otelcol-sumo /
# This shouldn't be necessary but sometimes we end up with execution bit not set
Expand Down

0 comments on commit 5204a99

Please sign in to comment.