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: enable CI to build base image for arm64 and amd64 #96

Merged
merged 7 commits into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ jobs:
with:
fetch-depth: 0
lfs: true
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
Expand All @@ -52,4 +54,5 @@ jobs:
cache-from: type=gha
cache-to: type=gha,mode=max
target: root-user
platforms: linux/amd64,linux/arm64
push: true
20 changes: 18 additions & 2 deletions .github/workflows/build-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,20 @@ jobs:
build-package-cpp:
name: Build C++ Package
runs-on: ubuntu-latest
strategy:
matrix:
architecture: [amd64, arm64]
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
fetch-depth: 0
lfs: true
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
if: matrix.architecture == 'arm64'
with:
platforms: arm64
- name: Login to DockerHub
uses: docker/login-action@v2
with:
Expand All @@ -41,7 +49,7 @@ jobs:
- name: Pull Development Image
run: docker pull ${{ env.DOCKER_REGISTRY_PATH }}/${{ inputs.project_name }}-development:${{ inputs.project_version }}
- name: Build C++ Package
run: make build-packages-cpp-standalone
run: make build-packages-cpp-standalone PLATFORM=${{ matrix.architecture }}
- name: Upload C++ Package
uses: actions/upload-artifact@v3
with:
Expand All @@ -51,12 +59,20 @@ jobs:
build-package-python:
name: Build Python Package
runs-on: ubuntu-latest
strategy:
matrix:
architecture: [amd64, arm64]
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
fetch-depth: 0
lfs: true
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
if: matrix.architecture == 'arm64'
with:
platforms: arm64
- name: Login to DockerHub
uses: docker/login-action@v2
with:
Expand All @@ -65,7 +81,7 @@ jobs:
- name: Pull Development Image
run: docker pull ${{ env.DOCKER_REGISTRY_PATH }}/${{ inputs.project_name }}-development:${{ inputs.project_version }}
- name: Build Python Package
run: make build-packages-python-standalone
run: make build-packages-python-standalone PLATFORM=${{ matrix.architecture }}
- name: Upload Python Package
uses: actions/upload-artifact@v3
with:
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Apache License 2.0

name: Build

on:
push:
branches:
- main
pull_request:


concurrency:
group: main-${{ github.ref }}
cancel-in-progress: true

env:
PROJECT_NAME: open-space-toolkit-base

jobs:
prepare-environment:
name: Prepare Environment Variables
runs-on: ubuntu-latest
outputs:
project_name: ${{ steps.project-name.outputs.value }}
project_version: ${{ steps.project-version.outputs.value }}
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
fetch-depth: 0
lfs: true
- id: project-name
name: Get Project Name
run: |
echo "Project name: ${{ env.PROJECT_NAME }}"
echo "value=${{ env.PROJECT_NAME }}" >> $GITHUB_OUTPUT
- id: project-version
name: Get Project Version
run: |
project_version=$(git describe --tags --always)
echo "Project version: ${project_version}"
echo "value=${project_version}" >> $GITHUB_OUTPUT

build-development-image:
name: Build Development Image
needs:
- prepare-environment
uses: ./.github/workflows/build-image.yml
with:
project_name: ${{ needs.prepare-environment.outputs.project_name }}
project_version: ${{ needs.prepare-environment.outputs.project_version }}
secrets: inherit
4 changes: 2 additions & 2 deletions docker/development/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Apache License 2.0

FROM ubuntu:20.04
FROM ubuntu:20.04 as root-user

LABEL maintainer="lucas.bremond@gmail.com"

Expand Down Expand Up @@ -169,7 +169,7 @@ RUN cd /tmp \

# Dependencies

## Pybind11
# ## Pybind11

ARG PYBIND_11_VERSION="2.10.3-1"

Expand Down
Loading