Skip to content
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

Move tools/ci_* projects to airbyte-ci, update to use Poetry, bump to python 3.10 #27957

Merged
merged 38 commits into from
Jul 26, 2023
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
d120804
Move ci_connector_ops
bnchrch Jul 4, 2023
be05297
Move ci_credentials
bnchrch Jul 4, 2023
0cc3654
Move tools/ci_common_utils
bnchrch Jul 4, 2023
cbadf69
Rename tools to airbyte-ci
bnchrch Jul 4, 2023
e2f4984
Move to ci
bnchrch Jul 4, 2023
cc96f19
Convert ci_credentials
bnchrch Jul 4, 2023
94e792e
Convert ci_common_utls
bnchrch Jul 5, 2023
3f83d32
Convert ci_connector_ops
bnchrch Jul 5, 2023
dc60bdf
Get pipelines running
bnchrch Jul 5, 2023
22fd289
Move pipelines to own poetry project
bnchrch Jul 5, 2023
ad13486
Update readme
bnchrch Jul 5, 2023
43a7916
Delete
bnchrch Jul 5, 2023
79c47bf
Add ci_code_validator
bnchrch Jul 5, 2023
2617d48
Use pipx to install gha deps
bnchrch Jul 6, 2023
9f7528f
Fix'
bnchrch Jul 7, 2023
45bbd69
Merge remote-tracking branch 'origin/master' into bnchrch/ci/poetry-p…
bnchrch Jul 20, 2023
ecc588e
Merge remote-tracking branch 'origin/master' into bnchrch/ci/poetry-p…
bnchrch Jul 20, 2023
e4fca4c
Ensure every thing is running
bnchrch Jul 20, 2023
e382dbd
Automated Commit - Formatting Changes
bnchrch Jul 20, 2023
3846ba6
Gitignore miss
bnchrch Jul 21, 2023
0de0cff
Add pipx installer
bnchrch Jul 22, 2023
95c98ee
Get local pipx dependencies
bnchrch Jul 25, 2023
00ed3ba
Fix paths
bnchrch Jul 25, 2023
819dd97
Install pipx
bnchrch Jul 25, 2023
704c7fb
Merge remote-tracking branch 'origin/master' into bnchrch/ci/poetry-p…
bnchrch Jul 25, 2023
26884cd
ceremonial source-faker change
bnchrch Jul 25, 2023
37f00e3
Add installation step for ci_code_validator
bnchrch Jul 25, 2023
4e18725
Add comment
bnchrch Jul 25, 2023
370c3fb
remove ci_code_validator
bnchrch Jul 26, 2023
7e92c19
Address code review comments
bnchrch Jul 26, 2023
68758f9
Merge remote-tracking branch 'origin/master' into bnchrch/ci/poetry-p…
bnchrch Jul 26, 2023
0edaf46
add pipx install to acceptance-test-docker.sh
bnchrch Jul 26, 2023
4090391
Run formater
bnchrch Jul 26, 2023
00e93dc
Revert "ceremonial source-faker change"
bnchrch Jul 26, 2023
5aa193a
Merge branch 'master' into bnchrch/ci/poetry-pipelines
bnchrch Jul 26, 2023
261e289
gitignore lecacy pipeline report path
alafanechere Jul 26, 2023
4a0e143
update poetry.lock
alafanechere Jul 26, 2023
ed1bc91
skip upload if logs do not exist
bnchrch Jul 26, 2023
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
339 changes: 339 additions & 0 deletions airbyte-ci/ci/ci_common_utils/poetry.lock

Large diffs are not rendered by default.

25 changes: 25 additions & 0 deletions airbyte-ci/ci/ci_common_utils/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
#

[tool.poetry]
name = "ci_common_utils"
version = "0.0.0"
description = "Suite of all often used classes and common functions"
authors = ["Airbyte <contact@airbyte.io>"]

[tool.poetry.dependencies]
python = "^3.10"
cryptography = "^3.4.7"
requests = "^2.28.2"
pyjwt = "^2.1.0"

[tool.poetry.group.test.dependencies]
pytest = "^7.2.2"

[tool.poetry.group.dev.dependencies]
requests-mock = "^1.9.3"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ development environment of choice. To activate it from the terminal, run:

```bash
source .venv/bin/activate
pip install -e . # assuming you are in the ./tools/ci_connector_ops directory
pip install -e . # assuming you are in the ./airbyte-ci/ci_connector_ops directory
```

pip will make binaries for all the commands in setup.py, so you can run `allowed-hosts-checks` directly from the virtual-env
Expand All @@ -31,5 +31,5 @@ pip install -e ".[tests]"
Unit tests are currently configured to be run from the base `airbyte` directory. You can run the tests from that directory with the following command:

```
pytest -s tools/ci_connector_ops/tests
pytest -s airbyte-ci/ci_connector_ops/tests
```
1,816 changes: 1,816 additions & 0 deletions airbyte-ci/ci/ci_connector_ops/poetry.lock

Large diffs are not rendered by default.

37 changes: 37 additions & 0 deletions airbyte-ci/ci/ci_connector_ops/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "ci_connector_ops"
version = "0.2.1"
description = "Packaged maintained by the connector operations team to perform CI for connectors"
authors = ["Airbyte <contact@airbyte.io>"]

[tool.poetry.dependencies]
python = "^3.10"
click = "^8.1.3"
requests = "^2.28.2"
PyYAML = "^6.0"
GitPython = "^3.1.29"
pydantic = "^1.9"
PyGithub = "^1.58.0"
rich = "^11.0.1"
pydash = "^7.0.4"
google-cloud-storage = "^2.8.0"
ci-credentials = {path = "../ci_credentials"}

[tool.poetry.group.dev.dependencies]
pyinstrument = "^0.24.4"

[tool.poetry.group.test.dependencies]
pytest = "^6.2.5"
pytest-mock = "^3.10.0"
freezegun = "^1.1.0"

[tool.poetry.scripts]
check-test-strictness-level = "ci_connector_ops.acceptance_test_config_checks:check_test_strictness_level"
write-review-requirements-file = "ci_connector_ops.acceptance_test_config_checks:write_review_requirements_file"
print-mandatory-reviewers = "ci_connector_ops.acceptance_test_config_checks:print_mandatory_reviewers"
allowed-hosts-checks = "ci_connector_ops.allowed_hosts_checks:check_allowed_hosts"
run-qa-checks = "ci_connector_ops.qa_checks:run_qa_checks"
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,30 @@ CLI tooling to read and manage GSM secrets:
- `write-to-storage` download a connector's secrets locally in the connector's `secret` folder
- `update-secrets` uploads new connector secret version that were locally updated.

## Requirements

## Development
This project requires Python 3.10 and pipx.

## Installation

Set up the world the same way Google Actions does it in `test-command.yml`.
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 haven't installed pipx, you can do it with pip:

```bash
python -m pip install --user pipx
python -m pipx ensurepath
```
source venv/bin/activate
pip install --quiet tox==3.24.4
tox -r -c ./tools/tox_ci.ini
pip install --quiet -e ./tools/ci_*

Once pipx is installed, navigate to the root directory of the project, then run:

```bash
pipx install airbyte-ci/ci/ci_credentials/
```

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

## Get GSM access
Download a Service account json key that has access to Google Secrets Manager.

### Create Service Account
Expand All @@ -30,35 +42,44 @@ Download a Service account json key that has access to Google Secrets Manager.

### Setup ci_credentials
* In your .zshrc, add: `export GCP_GSM_CREDENTIALS=$(cat <path to JSON file>)`
* Follow README.md under `tools/ci_credentials`

After making a change, you have to reinstall it to run the bash command: `pip install --quiet -e ./tools/ci_*`
## 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
pipx install --editable airbyte-ci/ci/ci_credentials/
```

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

## Usage
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
ci_credentials --help
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
ci_credentials source-bing-ads write-to-storage
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
ci_credentials all write-to-storage
VERSION=dev ci_credentials all write-to-storage
```

### Update secrets
To upload to GSM newly updated configurations from `airbyte-integrations/connectors/source-bings-ads/secrets/updated_configurations`:

```bash
ci_credentials source-bing-ads update-secrets
VERSION=dev ci_credentials source-bing-ads update-secrets
```

Loading