-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
170 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
name: Build docker images | ||
description: Build Docker Images | ||
inputs: | ||
dockerfile: | ||
description: Dockerfile to build | ||
required: true | ||
tags: | ||
description: Docker tags to publish | ||
required: true | ||
platforms: | ||
description: Platforms to build (csv) | ||
required: false | ||
default: 'linux/arm64,linux/amd64' | ||
test: | ||
description: Test command to run on the created image (Optional) | ||
required: false | ||
default: '' | ||
build-args: | ||
description: Explicit docker build-args | ||
required: false | ||
default: '' | ||
skip-init: | ||
description: Skip docker init (if ran after another invocation of this action) | ||
required: false | ||
default: '' | ||
docker-user: | ||
required: true | ||
description: Docker Hub User | ||
docker-password: | ||
required: true | ||
description: Docker Hub User | ||
skip-push: | ||
required: false | ||
description: Optionally skip push | ||
default: '' | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
# - name: Setup docker (missing on MacOS) | ||
# if: matrix.platform == 'linux/arm64' | ||
# uses: douglascamata/setup-docker-macos-action@v1-alpha | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
if: ${{ inputs.skip-init == '' }} | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
if: ${{ inputs.skip-init == '' }} | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
if: ${{ inputs.skip-init == '' }} | ||
with: | ||
registry: ghcr.io | ||
username: ${{ inputs.docker-user }} | ||
password: ${{ inputs.docker-password }} | ||
|
||
- name: Build Runner Image | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
file: ${{ inputs.dockerfile }} | ||
platforms: ${{ inputs.platforms }} | ||
push: ${{ inputs.skip-push == '' }} | ||
load: ${{ inputs.test != '' }} | ||
tags: ${{ inputs.tags }} | ||
build-args: | | ||
${{ inputs.build-args }} | ||
- name: Verify Built Image | ||
shell: bash | ||
if: ${{ inputs.test != '' }} | ||
run: | | ||
SINGLE_TAG=$(echo "${{ inputs.tags }}" | awk -F ',' '{print $1};' ) | ||
SINGLE_PLATFORM=$(echo "${{ inputs.platforms }}" | awk -F ',' '{print $1};' ) | ||
docker run --platform "${SINGLE_PLATFORM}" --rm --entrypoint bash "${SINGLE_TAG}" -c '${{ inputs.test }}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Build infra images | ||
on: | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
detect-changes: | ||
uses: ./.github/workflows/detect-changes-matrix.yml | ||
build-infra: | ||
# runs-on: ${{ matrix.platform == 'linux/arm64' && 'macos-13' || 'ubuntu-latest' }} | ||
runs-on: 'ubuntu-latest' | ||
needs: detect-changes | ||
if: ${{ needs.detect-changes.outputs.infra == 'true' }} | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build Docker Image | ||
uses: ./.github/workflows/actions/build-docker-image | ||
with: | ||
dockerfile: ./integrations/_infra/Dockerfile.base.builder | ||
platforms: linux/amd64,linux/arm64 | ||
tags: ghcr.io/port-labs/port-ocean-base-builder:latest | ||
docker-user: ${{ secrets.DOCKER_MACHINE_USER }} | ||
docker-password: ${{ secrets.DOCKER_MACHINE_TOKEN }} | ||
|
||
|
||
- name: Build Docker Image | ||
uses: ./.github/workflows/actions/build-docker-image | ||
with: | ||
dockerfile: ./integrations/_infra/Dockerfile.base.runner | ||
platforms: linux/amd64,linux/arm64 | ||
tags: ghcr.io/port-labs/port-ocean-base-runner:latest | ||
docker-user: ${{ secrets.DOCKER_MACHINE_USER }} | ||
docker-password: ${{ secrets.DOCKER_MACHINE_TOKEN }} | ||
skip-init: 'yupp' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
ARG BASE_PYTHON_IMAGE=debian:trixie-slim | ||
FROM ${BASE_PYTHON_IMAGE} | ||
|
||
LABEL org.opencontainers.image.source=https://github.com/port-labs/ocean | ||
|
||
ENV LIBRDKAFKA_VERSION=1.9.2 \ | ||
PYTHONUNBUFFERED=1 \ | ||
POETRY_VIRTUALENVS_IN_PROJECT=1 \ | ||
PIP_ROOT_USER_ACTION=ignore | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y \ | ||
--no-install-recommends \ | ||
wget \ | ||
g++ \ | ||
libssl-dev \ | ||
autoconf \ | ||
automake \ | ||
libtool \ | ||
curl \ | ||
librdkafka-dev \ | ||
python3 \ | ||
python3-pip \ | ||
python3-poetry \ | ||
&& apt-get clean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
ARG BASE_PYTHON_IMAGE=debian:trixie-slim | ||
FROM ${BASE_PYTHON_IMAGE} | ||
|
||
LABEL org.opencontainers.image.source=https://github.com/port-labs/ocean | ||
|
||
ENV LIBRDKAFKA_VERSION=1.9.2 | ||
|
||
ENV PIP_ROOT_USER_ACTION=ignore | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends librdkafka-dev python3 \ | ||
&& apt-get clean |