Skip to content

feat(cli): Add image build command to airbyte-cdk CLI #489

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

Open
wants to merge 51 commits into
base: aj/feat/add-standard-tests-cli
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
c65d832
feat: Add build command to CDK CLI
devin-ai-integration[bot] Apr 16, 2025
bd7a765
fix: Update formatting for build command files
devin-ai-integration[bot] Apr 16, 2025
2a32e27
feat: Add Click-based CLI interface
devin-ai-integration[bot] Apr 17, 2025
653bda1
chore: Update poetry.lock
devin-ai-integration[bot] Apr 17, 2025
9510f2d
fix: Add type annotations to CLI functions
devin-ai-integration[bot] Apr 17, 2025
84d649b
feat: Always build for both AMD64 and ARM64 architectures
devin-ai-integration[bot] Apr 17, 2025
f3e1743
fix: Format code with ruff
devin-ai-integration[bot] Apr 17, 2025
2bc8848
fix: Address PR comments - remove infer_connector_language, use build…
devin-ai-integration[bot] Apr 17, 2025
ca1bbbe
fix: Update Dockerignore to use * pattern and fix formatting
devin-ai-integration[bot] Apr 17, 2025
373f263
fix: Format all files with ruff
devin-ai-integration[bot] Apr 17, 2025
430dd8d
docs: Move build.md content to __init__.py docstring
devin-ai-integration[bot] Apr 17, 2025
fe946ac
docs: Update __init__.py docstring with build command documentation
devin-ai-integration[bot] Apr 17, 2025
af3e56e
Delete airbyte_cdk/cli/entrypoint/run.py
aaronsteers Apr 17, 2025
7b6dc5d
fix: Clean up duplicate code in _run.py and update imports
devin-ai-integration[bot] Apr 17, 2025
2b1db11
refactor: Move build functionality to utils/docker and metadata model…
devin-ai-integration[bot] Apr 17, 2025
4d45bab
fix: Remove unsupported --ignorefile flag and implement proper cleanu…
devin-ai-integration[bot] Apr 17, 2025
7e68925
fix: Add fallback to single platform build when multi-platform not av…
devin-ai-integration[bot] Apr 17, 2025
df4b315
fix: Update dockerignore to include source_* directories
devin-ai-integration[bot] Apr 17, 2025
83eaca9
enhancement: Improve build process to match airbyte-ci's approach wit…
devin-ai-integration[bot] Apr 18, 2025
789f109
fix: Apply ruff formatting to fix CI checks
devin-ai-integration[bot] Apr 18, 2025
ba09434
fix: Add run_command function to build.py and update imports
devin-ai-integration[bot] Apr 18, 2025
b25671b
fix: Add run_command function to build.py
devin-ai-integration[bot] Apr 18, 2025
d7ee4f1
Merge branch 'aj/feat/add-standard-tests-cli' into devin/1744841809-a…
aaronsteers Apr 18, 2025
e1c7c13
delete unnecessay
aaronsteers Apr 18, 2025
ba0ab6b
move docstring
aaronsteers Apr 18, 2025
61fdced
fully move model to models.connector_metadata
aaronsteers Apr 18, 2025
f293e7e
clean up
aaronsteers Apr 18, 2025
7daa7f0
fix docstring
aaronsteers Apr 18, 2025
4ba7e5c
clean up cli module
aaronsteers Apr 18, 2025
49c9045
revert format update
aaronsteers Apr 18, 2025
d9c1ced
lean into pydantic model
aaronsteers Apr 18, 2025
3103d0c
clean up
aaronsteers Apr 18, 2025
52546be
clean up
aaronsteers Apr 18, 2025
63cbc9b
fix: Address PR feedback - fix typo in __all__, update docstring, and…
devin-ai-integration[bot] Apr 18, 2025
c8f91cf
fix: Correct CLI entry point in pyproject.toml
devin-ai-integration[bot] Apr 18, 2025
71652ef
Apply suggestions from code review
aaronsteers Apr 18, 2025
78b173c
add-back the help text
aaronsteers Apr 18, 2025
598d454
refactor, tidy up
aaronsteers Apr 18, 2025
bcf5d9f
Merge branch 'aj/feat/add-standard-tests-cli' into devin/1744841809-a…
aaronsteers Apr 19, 2025
871cb71
refactor docker implementation
aaronsteers Apr 21, 2025
42af39d
toggle default arch, fix return value for verify step
aaronsteers Apr 21, 2025
964a215
better err handling
aaronsteers Apr 21, 2025
d7f9c7b
clean up
aaronsteers Apr 21, 2025
3e9183b
tidy docstring
aaronsteers Apr 21, 2025
6ea0623
ruff fix
aaronsteers Apr 21, 2025
ea5fd85
poe lock
aaronsteers Apr 21, 2025
0229421
fix mypy
aaronsteers Apr 21, 2025
297a98c
fix base image
aaronsteers Apr 21, 2025
f7b19e1
use uv instead of pip for installs
aaronsteers Apr 21, 2025
7a87b62
use rich click
aaronsteers Apr 21, 2025
f7e4ddf
refactor, use build args
aaronsteers Apr 21, 2025
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
27 changes: 27 additions & 0 deletions airbyte_cdk/cli/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,28 @@
# Copyright (c) 2024 Airbyte, Inc., all rights reserved.
"""Airbyte CDK CLI.

The Airbyte CDK provides command-line tools for working with connectors and related resources.


```bash
pip install airbyte-cdk

pipx run airbyte-cdk [command]
```



- `airbyte-cdk-build`: Build connector Docker images (legacy entry point)
- `source-declarative-manifest`: Run a declarative YAML manifest connector
- `airbyte-cdk`: Main CLI entry point with subcommands


The `airbyte-cdk` command includes subcommands organized by category:

```bash
airbyte-cdk image build [OPTIONS] CONNECTOR_DIR
```


For details on specific commands, see the documentation for each command module.
"""
41 changes: 41 additions & 0 deletions airbyte_cdk/cli/build/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
"""Airbyte CDK Build Command.

The `airbyte-cdk-build` command provides a simplified way to build connector Docker images without requiring the full Airbyte CI pipeline.


```bash
pip install airbyte-cdk

pipx run airbyte-cdk-build [arguments]
```


```bash
airbyte-cdk-build /path/to/connector

airbyte-cdk image build /path/to/connector

airbyte-cdk image build /path/to/connector --tag custom_tag

airbyte-cdk image build /path/to/connector --no-verify

airbyte-cdk image build /path/to/connector --verbose
```


- `connector_dir`: Path to the connector directory (required)
- `--tag`: Tag to apply to the built image (default: "dev")
- `--no-verify`: Skip verification of the built image
- `--verbose`, `-v`: Enable verbose logging


The command reads the connector's metadata from the `metadata.yaml` file, builds a Docker image using the connector's Dockerfile, and verifies the image by running the `spec` command. The image is tagged according to the repository name specified in the metadata and the provided tag.

This command is designed to be a simpler alternative to the `airbyte-ci build` command, using Docker directly on the host machine instead of Dagger.
"""

from airbyte_cdk.cli.build._run import run

__all__ = [
"run",
]
Loading