Skip to content

Commit 34c9366

Browse files
authored
🐙 Bootstrap octavia-cli project (#9070)
1 parent 37c4a75 commit 34c9366

File tree

17 files changed

+320
-9
lines changed

17 files changed

+320
-9
lines changed

.github/workflows/gradle.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,76 @@ jobs:
275275
SLACK_TITLE: "Build failure"
276276
SLACK_FOOTER: ""
277277

278+
- name: Slack Notification - Success
279+
if: success() && github.ref == 'refs/heads/master'
280+
uses: rtCamp/action-slack-notify@master
281+
env:
282+
SLACK_WEBHOOK: ${{ secrets.BUILD_SLACK_WEBHOOK }}
283+
SLACK_USERNAME: Buildbot
284+
SLACK_TITLE: "Build Success"
285+
SLACK_FOOTER: ""
286+
octavia-cli-build:
287+
runs-on: ubuntu-latest
288+
name: "Octavia CLI: Build"
289+
timeout-minutes: 90
290+
steps:
291+
- name: Checkout Airbyte
292+
uses: actions/checkout@v2
293+
294+
# this intentionally does not use restore-keys so we don't mess with gradle caching
295+
- name: Gradle Caching
296+
uses: actions/cache@v2
297+
with:
298+
path: |
299+
~/.gradle/caches
300+
~/.gradle/wrapper
301+
**/.venv
302+
key: ${{ secrets.CACHE_VERSION }}-${{ runner.os }}-${{ hashFiles('**/*.gradle*') }}-${{ hashFiles('**/package-lock.json') }}
303+
304+
- uses: actions/setup-java@v1
305+
with:
306+
java-version: "17"
307+
308+
# octavia-cli install and testing requires Python.
309+
# We use 3.8 in this project because 3.7 is not supported on Apple M1.
310+
- uses: actions/setup-python@v2
311+
with:
312+
python-version: "3.8"
313+
314+
- name: Set up CI Gradle Properties
315+
run: |
316+
mkdir -p ~/.gradle/
317+
cat > ~/.gradle/gradle.properties <<EOF
318+
org.gradle.jvmargs=-Xmx8g -Xss4m --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
319+
--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \
320+
--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \
321+
--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \
322+
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
323+
org.gradle.workers.max=8
324+
org.gradle.vfs.watch=false
325+
EOF
326+
327+
- name: Format
328+
run: SUB_BUILD=OCTAVIA_CLI ./gradlew format --scan --info --stacktrace
329+
330+
- name: Ensure no file change
331+
run: git --no-pager diff && test -z "$(git --no-pager diff)"
332+
333+
- name: Build
334+
run: |
335+
SUB_BUILD=OCTAVIA_CLI ./gradlew :octavia-cli:build javadoc --scan
336+
337+
- name: Slack Notification - Failure
338+
if: failure() && github.ref == 'refs/heads/master'
339+
uses: rtCamp/action-slack-notify@master
340+
env:
341+
SLACK_WEBHOOK: ${{ secrets.BUILD_SLACK_WEBHOOK }}
342+
SLACK_USERNAME: Buildozer
343+
SLACK_ICON: https://avatars.slack-edge.com/temp/2020-09-01/1342729352468_209b10acd6ff13a649a1.jpg
344+
SLACK_COLOR: DC143C
345+
SLACK_TITLE: "Build failure"
346+
SLACK_FOOTER: ""
347+
278348
- name: Slack Notification - Success
279349
if: success() && github.ref == 'refs/heads/master'
280350
uses: rtCamp/action-slack-notify@master

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.gradle
22
.idea
3+
.vscode
34
*.iml
45
*.swp
56
build

octavia-cli/.coveragerc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[report]
2+
# show lines missing coverage
3+
show_missing = true

octavia-cli/.dockerignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
build
2+
.venv
3+
octavia_cli.egg-info

octavia-cli/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.coverage
2+
.venv

octavia-cli/.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.8.12

octavia-cli/CHANGELOG.md

Whitespace-only changes.

octavia-cli/Dockerfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM python:3.8.12-slim as base
2+
3+
RUN apt-get upgrade \
4+
&& pip install --upgrade pip
5+
6+
WORKDIR /home/octavia-cli
7+
COPY . ./
8+
9+
RUN pip install --no-cache-dir .
10+
11+
RUN useradd --create-home --shell /bin/bash octavia-cli
12+
USER octavia-cli
13+
14+
ENTRYPOINT ["octavia"]
15+
16+
LABEL io.airbyte.version=dev
17+
LABEL io.airbyte.name=airbyte/octavia-cli

octavia-cli/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 Airbyte, Inc.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

octavia-cli/README.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# 🐙 Octavia CLI
2+
3+
Octavia CLI is a tool to manage Airbyte configuration in YAML.
4+
It has the following features:
5+
* Scaffolding of a readable directory architecture that will host the YAML configs.
6+
* Auto-generation of YAML config file that matches the resources' schemas.
7+
* Manage Airbyte resources with YAML config files.
8+
* Safe resources update through diff display and validation.
9+
* Simple secret management to avoid versioning credentials.
10+
11+
The project is under development: readers can refer to our [tech spec deck](https://docs.google.com/presentation/d/10RjkCzBiVhCivnjSh63icYI7wG6S0N0ZIErEIsmXTqM/edit?usp=sharing) for an introduction to the tool.
12+
13+
# Usage
14+
We encourage users to use the CLI with docker to avoid the hassle of setting up a Python installation.
15+
The project is under development: we have not yet published any docker image to our Docker registry.
16+
17+
1. Build the image locally:
18+
```bash
19+
docker build -t octavia-cli:dev --rm .
20+
```
21+
2. Run the CLI from docker:
22+
```bash
23+
docker run octavia-cli:dev
24+
````
25+
3. Create an `octavia` alias in your `.bashrc` or `.zshrc`:
26+
````bash
27+
echo 'alias octavia="docker run octavia-cli:dev"' >> ~/.zshrc
28+
source ~/.zshrc
29+
octavia
30+
````
31+
32+
# Current development status
33+
Octavia is currently under development.
34+
You can find a detailed and updated execution plan [here](https://docs.google.com/spreadsheets/d/1weB9nf0Zx3IR_QvpkxtjBAzyfGb7B0PWpsVt6iMB5Us/edit#gid=0).
35+
We welcome community contributions!
36+
37+
Summary of achievements:
38+
39+
| Date | Milestone |
40+
|------------|-------------------------------------|
41+
| 2021-12-22 | Bootstrapping the project's code base |
42+
43+
# Developing locally
44+
1. Install Python 3.10.0. We suggest doing it through `pyenv`
45+
2. Create a virtualenv: `python -m venv .venv`
46+
3. Activate the virtualenv: `source .venv/bin/activate`
47+
4. Install dev dependencies: `pip install -e .\[dev\]`
48+
5. Install `pre-commit` hooks: `pre-commit install`
49+
6. Run the test suite: `pytest --cov=octavia_cli unit_tests`
50+
7. Iterate; please check the [Contributing](#contributing) for instructions on contributing.
51+
52+
# Contributing
53+
1. Please sign up to [Airbyte's Slack workspace](https://slack.airbyte.io/) and join the `#octavia-cli`. We'll sync up community efforts in this channel.
54+
2. Read the [execution plan](https://docs.google.com/spreadsheets/d/1weB9nf0Zx3IR_QvpkxtjBAzyfGb7B0PWpsVt6iMB5Us/edit#gid=0) and find a task you'd like to work on.
55+
3. Open a PR, make sure to test your code thoroughly.

0 commit comments

Comments
 (0)