-
Notifications
You must be signed in to change notification settings - Fork 17
chore: use sdm cli as dockerfile entrypoint #470
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
base: main
Are you sure you want to change the base?
Changes from all commits
a83bfea
4536c33
c897e13
824c63f
9e1f742
7b75141
99ed234
79f28c0
3c59dbf
878c749
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# Source Declarative Manifest CLI Usage Guide | ||
|
||
This guide explains how to install and use the Source Declarative Manifest (SDM) CLI tool for Airbyte connector development. | ||
|
||
## Installation | ||
|
||
### Standard Installation | ||
|
||
```bash | ||
pipx install airbyte-cdk | ||
``` | ||
|
||
If you encounter an error related to a missing `distutils` module, verify that you are running Python version `<=3.11` and try running: | ||
|
||
```bash | ||
python -m pipx install airbyte-cdk | ||
``` | ||
|
||
## Using the CLI | ||
|
||
The SDM CLI follows standard Airbyte connector command patterns: | ||
|
||
```bash | ||
source-declarative-manifest [command] --config /path/to/config.json | ||
``` | ||
|
||
Where [command] can be: | ||
|
||
spec - Show connector specification | ||
check - Verify connection to the source | ||
discover - List available streams | ||
read - Read data from streams | ||
|
||
:::caution | ||
When developing locally (outside a Docker container), the CLI operates in "remote manifest mode" and expects your manifest to be included in your configuration file. | ||
::: | ||
|
||
### Steps for Local Testing | ||
|
||
1. Convert your manifest from YAML to JSON | ||
|
||
Your manifest is defined in YAML, but must be converted to JSON for the config file. You can use an [online tool](https://onlineyamltools.com/convert-yaml-to-json) to do so. | ||
|
||
Create a config file that includes both your config parameters AND the manifest. Add your entire manifest as a JSON object under the `__injected_declarative_manifest` key | ||
|
||
Example: | ||
|
||
```json | ||
{ | ||
"api_key": "very_secret_key", | ||
"start_time": "04:20", | ||
"__injected_declarative_manifest": { | ||
// Insert the JSON version of your manifest here | ||
} | ||
} | ||
``` | ||
Comment on lines
+46
to
+56
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. JSON snippet contains invalid comments JSON doesn’t support - "__injected_declarative_manifest": {
- // Insert the JSON version of your manifest here
- }
+ "__injected_declarative_manifest": { /* insert your manifest JSON here */ } wdyt?
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @coderabbitai Oh nice! I wasn't aware of that placeholder pattern, please go ahead and make this change. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ChristoGrab Great! I'll plan that change for you now. The JSON comment will be updated to use the proper format: %%{init: {"securityLevel":"loose"}}%%
flowchart TB
A["Fix JSON comment in README"] --> B["Replace // style comment with /* */ style"]
Another agent will execute this change for you shortly. This will ensure that the example JSON in the documentation is properly formatted and won't cause parsing errors when copied by users. ⏳ Preparing changes... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A summary of the edits CodeRabbit can apply:
A plan of each step that CodeRabbit will take in order to execute the edits for each file (with inline rough draft snippets): ✏️ airbyte_cdk/cli/README.mdDelete lines 51–53 (the opening brace, the "__injected_declarative_manifest": { /* insert your manifest JSON here */ } Ensure there are two spaces of indentation before Save the file and preview the Markdown rendering to confirm that the JSON block is syntactically valid and that the comment displays correctly in all rendered views. A summary of the context that CodeRabbit is considering across the codebase:
|
||
|
||
2. Run the command against your config file | ||
|
||
```bash | ||
source-declarative-manifest check --config /relative/path/to/config.json | ||
source-declarative-manifest read --config /relative/path/to/config.json --catalog /relative/path/to/catalog.json | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ChristoGrab - If we move this markdown content into the
cli/__init__.py
docstring, it will automatically render in pdoc when we generate the API docs via GitHub pages. Wdyt?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there's also a syntax to import markdown file into the pdoc generation if you want to keep it a separate file.