Skip to content

Commit

Permalink
Reworking Airbyte CI README: remove legacy connector_ops pieces (#36239)
Browse files Browse the repository at this point in the history
Co-authored-by: Augustin <augustin@airbyte.io>
  • Loading branch information
natikgadzhi and alafanechere committed Mar 20, 2024
1 parent bb478d5 commit e57252b
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 724 deletions.
448 changes: 0 additions & 448 deletions .github/workflows/legacy-publish-command.yml

This file was deleted.

223 changes: 0 additions & 223 deletions .github/workflows/legacy-test-command.yml

This file was deleted.

11 changes: 10 additions & 1 deletion airbyte-ci/README.md
Expand Up @@ -2,4 +2,13 @@

This folder is a collection of systems, tools and scripts that are used to run Airbyte's CI/CD

The installation instructions for the `airbyte-ci` CLI tool cal be found here [airbyte-ci/connectors/pipelines](connectors/pipelines/README.md)
The installation instructions for the `airbyte-ci` CLI tool cal be found here
[airbyte-ci/connectors/pipelines](connectors/pipelines/README.md)

## Tools

| Directory | Description |
| --------------------------------------------- | ------------------------------------------------------------------ |
| [`base_images`](connectors/base_images) | A set of tools to build and publish Airbyte base connector images. |
| [`ci_credentials`](connectors/ci_credentials) | A CLI tool to fetch connector secrets from GCP Secrets Manager. |
| [`connector_ops`](connectors/connector_ops) | A python package with utils reused in internal packages. |
45 changes: 25 additions & 20 deletions airbyte-ci/connectors/ci_credentials/README.md
@@ -1,17 +1,18 @@
# CI Credentials

CLI tooling to read and manage GSM secrets:
- `write-to-storage` download a connector's secrets locally in the connector's `secret` folder
- `write-to-storage` download a connector's secrets locally in the connector's `secrets` folder
- `update-secrets` uploads new connector secret version that were locally updated.

## Requirements

This project requires Python 3.10 and pipx.
This project requires Python 3.10 and `pipx`.

## Installation

The recommended way to install `ci_credentials` is using pipx. This ensures the tool and its dependencies are isolated from your other Python projects.

If you havent installed pyenv, you can do it with brew:
First, install `pyenv`. If you don't have it yet, you can install it using Homebrew:

```bash
brew update
Expand All @@ -27,23 +28,21 @@ python -m pip install --user pipx
python -m pipx ensurepath
```

Once pyenv and pipx is installed then run the following:
Once pyenv and pipx is installed then run the following (assuming you're in Airbyte repo root):

```bash
pipx install --editable --force --python=python3.10 airbyte-ci/connectors/ci_credentials/
```

This command installs `ci_credentials` and makes it globally available in your terminal.

_Note: `--force` is required to ensure updates are applied on subsequent installs._
_Note: `--python=python3.10` is required to ensure the correct python version is used._
_Note: `--editable` is required to ensure the correct python version is used._

If you face any installation problem feel free to reach out the Airbyte Connectors Operations team.

> [!Note]
> - `--force` is required to ensure updates are applied on subsequent installs.
> - `--python=python3.10` is required to ensure the correct python version is used.
## Get GSM access
Download a Service account json key that has access to Google Secrets Manager.
`ci_credentials` expects `GCP_GSM_CREDENTIALS` to be set in environment to be able to access secrets.

### Create Service Account
* Go to https://console.cloud.google.com/iam-admin/serviceaccounts/create?project=dataline-integration-testing
Expand All @@ -60,6 +59,7 @@ Download a Service account json key that has access to Google Secrets Manager.
* In your .zshrc, add: `export GCP_GSM_CREDENTIALS=$(cat <path to JSON file>)`

## Development

During development, you can use the `--editable` option to make changes to the `ci_credentials` package and have them immediately take effect without needing to reinstall the package:

```bash
Expand All @@ -68,31 +68,28 @@ pipx install --editable airbyte-ci/connectors/ci_credentials/

This is useful when you are making changes to the package and want to test them in real-time.

Note:

- The package name is `pipelines`, not `airbyte-ci`. You will need this when uninstalling or reinstalling.
- Even with the above `--editable` method, live changes to the code in the sibling project `/airbyte-ci/connectors/connector_ops/` are not automatically captured. To ensure you are using the latest code, use the command `pipx reinstall pipelines`.
> [!Note]
> - The package name is `ci_credentials`, not `airbyte-ci`. You will need this when uninstalling or reinstalling.
## Usage
After installation, you can use the ci_credentials command in your terminal.
After installation, you can use the `ci_credentials` command in your terminal.

## Run it

The `VERSION=dev` will make it so it knows to use your local current working directory and not the Github Action one.

### Help
```bash
VERSION=dev ci_credentials --help
```

### Write credentials for a specific connector to local storage

To download GSM secrets to `airbyte-integrations/connectors/source-bings-ads/secrets`:

```bash
VERSION=dev ci_credentials source-bing-ads write-to-storage
```

### Write credentials for all connectors to local storage

To download GSM secrets to for all available connectors into their respective `secrets` directories:

```bash
VERSION=dev ci_credentials all write-to-storage
```
Expand All @@ -105,5 +102,13 @@ VERSION=dev ci_credentials source-bing-ads update-secrets
```

## FAQ

### Help

```bash
VERSION=dev ci_credentials --help
```

### What is `VERSION=dev`?

This is a way to tell the tool to write secrets using your local current working directory and not the Github Action runner one.

0 comments on commit e57252b

Please sign in to comment.