Skip to content

Commit

Permalink
Update docs (#26935)
Browse files Browse the repository at this point in the history
Co-authored-by: Octavia Squidington III <octavia-squidington-iii@sers.noreply.github.com>
  • Loading branch information
bnchrch and Octavia Squidington III committed Jun 2, 2023
1 parent 4e7ab95 commit 623391b
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 33 deletions.
34 changes: 32 additions & 2 deletions airbyte-ci/connectors/metadata_service/orchestrator/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Connector Orchestrator (WIP)
# Connector Orchestrator
This is the Orchestrator for Airbyte metadata built on Dagster.


Expand Down Expand Up @@ -53,12 +53,13 @@ To create a development bucket:
- Storage Object Admin
- Storage Object Creator
- Storage Object Viewer
2. Create a GCS bucket
2. Create a PUBLIC GCS bucket
3. Add the service account as a member of the bucket with the following permissions:
- Storage Admin
- Storage Object Admin
- Storage Object Creator
- Storage Object Viewer

4. Add the following environment variables to your `.env` file:
- `METADATA_BUCKET`
- `GCS_CREDENTIALS`
Expand Down Expand Up @@ -126,3 +127,32 @@ dagster-cloud config
cd orchestrator
DAGSTER_CLOUD_API_TOKEN=<YOU-DAGSTER-CLOUD-TOKEN> airbyte-ci metadata deploy orchestrator
```

# Using the Orchestrator to create a Connector Registry for Development
The orchestrator can be used to create a connector registry for development purposes.

## Setup
First you will need to setup the orchestrator as described above.

Then you will want to do the following

### 1. Mirror the production bucket
Use the Google Cloud Console to mirror the production bucket (prod-airbyte-cloud-connector-metadata-service) to your development bucket.

[Docs](https://cloud.google.com/storage-transfer/docs/cloud-storage-to-cloud-storage)

### 2. Upload any local metadata files you want to test changes with
```bash
# assuming your terminal is in the same location as this readme
cd ../lib
export GCS_CREDENTIALS=`cat /path/to/gcs_credentials.json`
poetry run metadata_service upload <PATH TO METADATA FILE> <NAME OF YOUR BUCKET>
```

### 3. Generate the registry
```bash
poetry run dagster dev
open http://localhost:3000
```

And run the `generate_registry` job
Original file line number Diff line number Diff line change
@@ -1,46 +1,36 @@
# Testing The Local Catalog
# Testing A Custom Registry

## Purpose of this document
This document describes how to
1. Generate the OSS catalog in the `airbyte` repo
1. Move the OSS catalog to the `airbyte-platform` repo
1. Point the platform to the new catalog
1. Run the platform
1. Modify the connector catalog used by the platform
2. Use the newly modified catalog in the platform

## Why you might need to
1. You've added/updated/deleted a generally available connector and want to test it in the platform UI
1. You've added/updated/deleted a generally available connector and want to test it in the platform API

## Steps
## Method 1: Edit the registry by hand (easiest)

### 1. Generate the OSS Catalog
In the `airbyte` repo run
```sh
SUB_BUILD=ALL_CONNECTORS ./gradlew :airbyte-config:specs:generateOssConnectorCatalog
```
### 1. Download the current OSS Registry
Download the current registry from [here](https://connectors.airbyte.com/files/registries/v0/oss_registry.json) to somewhere on your local machine.

### 2. Move the OSS catalog to platform
In the `airbyte` repo run
```sh
cp airbyte-config-oss/init-oss/src/main/resources/seed/oss_catalog.json <PATH_TO_PLATFORM_REPO>/airbyte-config-oss/init-oss/src/main/resources/seed/local_dev_catalog.json
```
### 2. Modify the registry
Modify the registry as you see fit. For example, you can add a new connector, update an existing connector, or delete a connector.

### 3. Point the platform to the new catalog
In the `airbyte-platform` repo modify `.env` add the environment variable
```sh
LOCAL_CONNECTOR_CATALOG_PATH=seed/local_dev_catalog.json
```
### 3. Upload the modified registry to a public location
Upload the modified registry to a public location. For example, you can upload it to a public S3 bucket, or you can upload it to a public GitHub repo, or a service like file.io

### 4. Build the platform
In the `airbyte-platform` run
```sh
SUB_BUILD=PLATFORM ./gradlew build -x test
### 4. Point the platform to the modified registry
Run the platform with the following environment variable set:
```

### 4. Run platform
In the `airbyte-platform` run
```sh
VERSION=dev docker-compose up
REMOTE_CONNECTOR_CATALOG_URL = <url of the modified registry>
```

Success! Your new catalog should now be loaded into the database.
## Method 2: Use the registry generator (more involved)

Follow the steps in the [Metadata Orchestrator Readme](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/metadata_service/orchestrator/README.md)) to setup the orchestrator.

You can then use the public GCS url of the registry created by the orchestrator to point the platform to the modified registry.
```
REMOTE_CONNECTOR_CATALOG_URL = <url of the modified registry>
```

0 comments on commit 623391b

Please sign in to comment.