Skip to content

Commit 3968223

Browse files
fix(docker-images): align manifest-only Dockerfile with airbyte-ci build process (#61441)
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: AJ Steers <[email protected]>
1 parent 5ec39d5 commit 3968223

File tree

3 files changed

+86
-2
lines changed

3 files changed

+86
-2
lines changed

.github/workflows/docker-connector-base-image-tests.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ on:
1111
- docker-images/Dockerfile.java-connector-base
1212
- docker-images/Dockerfile.python-connector
1313
- docker-images/Dockerfile.python-connector-base
14+
- docker-images/Dockerfile.manifest-only-connector
1415

1516
concurrency:
1617
group: connector-base-images-${{ github.event.pull_request.number }}
@@ -41,11 +42,14 @@ jobs:
4142
- 'docker-images/Dockerfile.python-connector'
4243
python-base:
4344
- 'docker-images/Dockerfile.python-connector-base'
45+
manifest-only:
46+
- 'docker-images/Dockerfile.manifest-only-connector'
4447
outputs:
4548
java-base: ${{ steps.changes.outputs.java-base }}
4649
python-base: ${{ steps.changes.outputs.python-base }}
4750
java-connector: ${{ steps.changes.outputs.java-connector }}
4851
python-connector: ${{ steps.changes.outputs.python-connector }}
52+
manifest-only: ${{ steps.changes.outputs.manifest-only }}
4953

5054
build-java-base-image:
5155
name: Build Java Base Image
@@ -299,3 +303,69 @@ jobs:
299303
output-format: "table"
300304
severity-cutoff: critical # TODO: revert to 'high'
301305
fail-build: true
306+
307+
test-manifest-only-connector-image-matrix:
308+
runs-on: ubuntu-latest
309+
needs: [detect-changes]
310+
if: >
311+
needs.detect-changes.outputs.manifest-only
312+
strategy:
313+
fail-fast: false
314+
matrix:
315+
connector:
316+
- source-pokeapi
317+
name: Build ${{ matrix.connector }} Manifest-Only Test Image
318+
environment:
319+
name: ghcr.io/airbytehq
320+
url: https://ghcr.io/airbytehq/${{ matrix.connector }}
321+
steps:
322+
- name: Checkout code
323+
uses: actions/checkout@v4
324+
with:
325+
fetch-depth: 1
326+
327+
- name: Log in to GHCR
328+
uses: docker/login-action@v3
329+
with:
330+
registry: ghcr.io
331+
username: ${{ github.repository_owner }}
332+
password: ${{ secrets.GITHUB_TOKEN }}
333+
334+
- name: Set up Docker Buildx
335+
uses: docker/setup-buildx-action@v3
336+
337+
- name: Debug BUILD_ARGS
338+
run: |
339+
echo "BASE_IMAGE=docker.io/airbyte/source-declarative-manifest:latest"
340+
echo "CONNECTOR_NAME=${{ matrix.connector }}"
341+
342+
- name: Build Manifest-Only Connector Image
343+
id: docker-build-manifest-only-connector
344+
uses: docker/build-push-action@v5
345+
with:
346+
context: airbyte-integrations/connectors/${{ matrix.connector }}
347+
file: docker-images/Dockerfile.manifest-only-connector
348+
platforms: linux/amd64,linux/arm64
349+
tags: |
350+
ghcr.io/airbytehq/${{ matrix.connector }}:draft-pr-${{ github.event.pull_request.number }}
351+
ghcr.io/airbytehq/${{ matrix.connector }}:draft-pr-${{ github.event.pull_request.number }}-build${{ github.run_number }}
352+
build-args: |
353+
BASE_IMAGE=docker.io/airbyte/source-declarative-manifest:latest
354+
CONNECTOR_NAME=${{ matrix.connector }}
355+
push: true
356+
357+
- name: Run `spec` Image Test
358+
run: |
359+
docker run \
360+
--rm \
361+
ghcr.io/airbytehq/${{ matrix.connector }}:draft-pr-${{ github.event.pull_request.number }} \
362+
spec
363+
364+
- name: Run ${{ matrix.connector }} Image Vulnerability Scan
365+
uses: anchore/scan-action@v6
366+
with:
367+
image: "ghcr.io/airbytehq/${{ matrix.connector }}:draft-pr-${{ github.event.pull_request.number }}"
368+
output-format: "table"
369+
severity-cutoff: high
370+
# Don't fail build for manifest-only connectors since we don't control the base image here
371+
fail-build: false

docker-images/Dockerfile.manifest-only-connector

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,30 @@
22
# check=skip=InvalidDefaultArgInFrom
33

44
# Manifest-Only connector Dockerfile for Airbyte
5+
# Updated to include manifest-only testing in CI workflow
56

6-
# Manifest-Only connector images are built on top of SDM connector image
7-
ARG BASE_IMAGE=airbyte/source-manifest-only:latest
7+
# Manifest-Only connector images are built on top of source-declarative-manifest image
8+
ARG BASE_IMAGE=docker.io/airbyte/source-declarative-manifest:latest
89

910
FROM ${BASE_IMAGE}
1011
ARG CONNECTOR_SNAKE_NAME
1112
ARG CONNECTOR_NAME
13+
ARG CONNECTOR_VERSION
1214

1315
WORKDIR /airbyte/integration_code
1416

17+
# Create source_declarative_manifest directory first
18+
RUN mkdir -p ./source_declarative_manifest
19+
20+
# Copy all files to integration_code
1521
COPY . ./
1622

23+
# Copy manifest.yaml to expected location (required for manifest-only connectors)
24+
RUN cp manifest.yaml ./source_declarative_manifest/manifest.yaml
25+
26+
# Copy components.py if it exists (optional)
27+
RUN if [ -f components.py ]; then cp components.py ./source_declarative_manifest/components.py; fi
28+
29+
# Set entrypoint explicitly as required for manifest-only connectors
1730
ENV AIRBYTE_ENTRYPOINT="python ./main.py"
1831
ENTRYPOINT ["python", "./main.py"]

docker-images/Dockerfile.manifest-only-connector.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ secrets/
99
!pyproject.toml
1010
!poetry.lock
1111
!poetry.toml
12+
!manifest.yaml
1213
!components.py
1314
!requirements.txt
1415
!README.md

0 commit comments

Comments
 (0)