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

Jjaakola aiven rebase main gh actions run #1029

Closed
wants to merge 80 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
fdf749b
chore: pip-compile to upgrade requirements
jjaakola-aiven Oct 17, 2024
a6feae5
chore: upgrade requirement versions
jjaakola-aiven Oct 17, 2024
6be18b2
wip: Karapace SR runs on FastAPI
jjaakola-aiven Nov 14, 2024
5c27da3
fix: omit null fields in schema get response
jjaakola-aiven Nov 14, 2024
1b8bc9e
fix: healthcheck response type, interactive doc works
jjaakola-aiven Nov 14, 2024
13ccb05
fix: tests/integration/test_schema.py passes
jjaakola-aiven Nov 15, 2024
acfa765
chore: remove trail from test_schema.py integration test
jjaakola-aiven Nov 15, 2024
591fcd8
fix: healthcheck corrected
jjaakola-aiven Nov 15, 2024
e32a03e
chore: remove trail from test_schema_registry_mode.py
jjaakola-aiven Nov 15, 2024
73ecbf7
fix: corrected test_karapace.py test
jjaakola-aiven Nov 15, 2024
43419b6
fix: test_schema_reader.py integration test corrected
jjaakola-aiven Nov 15, 2024
022d3b8
fix: added reference support for protobuf back
jjaakola-aiven Nov 15, 2024
4bb80db
fix: depencies integration test corrected
jjaakola-aiven Nov 15, 2024
6a76335
fix: corrected master coordinator test
jjaakola-aiven Nov 15, 2024
e5ebb45
fix: add missing root router file
jjaakola-aiven Nov 15, 2024
5ada334
fix: add missing content type and errors files
jjaakola-aiven Nov 15, 2024
dc9ff78
fix: added forwarding back
jjaakola-aiven Nov 18, 2024
de32c70
fix: fixed remote client test
jjaakola-aiven Nov 18, 2024
a529e30
chore: added missing license headers
jjaakola-aiven Nov 18, 2024
b6bd89c
fix: basic and no authentication integrated
jjaakola-aiven Nov 19, 2024
d707b6f
fix: fixed schema response to have schemaType
jjaakola-aiven Nov 19, 2024
3e85598
fix: run Karapace as a module, __main__
jjaakola-aiven Nov 19, 2024
0835bc0
fix: corrected backup tests
jjaakola-aiven Nov 19, 2024
681fec0
wip: Karapace SR runs on FastAPI
jjaakola-aiven Nov 14, 2024
78ec164
fix: added reference support for protobuf back
jjaakola-aiven Nov 15, 2024
b5a505f
fix: added forwarding back
jjaakola-aiven Nov 18, 2024
79ca8a3
fix: basic and no authentication integrated
jjaakola-aiven Nov 19, 2024
70c8f24
feat: move schema-registry to own module with DI
nosahama Nov 27, 2024
a68f266
chore: drop manual dependencies in-favour of DI
nosahama Nov 27, 2024
d95de9b
chore: fix config and set defaults
nosahama Nov 27, 2024
cb72504
feat: add karapace docker CLI
nosahama Nov 27, 2024
90d66ca
feat: run unit-tests in the cli docker container
nosahama Nov 27, 2024
9bd192a
feat: github actions to run docker unit tests
nosahama Nov 27, 2024
df5961f
feat: e2e tests within docker
nosahama Nov 27, 2024
cf03577
fix: StatsD host default required to be None
jjaakola-aiven Dec 9, 2024
61f1606
fix: use model_dump, not dict
jjaakola-aiven Dec 9, 2024
c20d86c
fix: add hosts to process wait tuple
jjaakola-aiven Dec 9, 2024
02ec21e
fix: re-raise from catched exception
jjaakola-aiven Dec 9, 2024
e49a351
fix: misc linting fixes
jjaakola-aiven Dec 9, 2024
fd0714a
fix: misc typing fixes
jjaakola-aiven Dec 9, 2024
af5e349
test: add forwarding client test
jjaakola-aiven Dec 10, 2024
35914f6
chore: remove Python 3.9 support
jjaakola-aiven Dec 10, 2024
f41947b
chore: git ignore coverage files
jjaakola-aiven Dec 10, 2024
8432aac
chore: pyugrade 3.10 plus
jjaakola-aiven Dec 10, 2024
00c2293
ci: multi-python docker image for GHA matrix
nosahama Dec 9, 2024
180fff5
forwarding_client: use single session and close on shutdown
nosahama Dec 10, 2024
9e95cd4
chore: remove unnecessary trail for test paths
jjaakola-aiven Dec 18, 2024
bf08821
fix: schema error codes need to be JSON serializable
jjaakola-aiven Dec 18, 2024
2875bc1
chore: move more files to schema_registry
nosahama Dec 16, 2024
3aab2a4
requirements: drop opentelemetry-instrumentation-fastapi
nosahama Dec 16, 2024
6b9eb82
feat: add OTel tracing setup
nosahama Dec 16, 2024
253268b
feat: use tracing in healthcheck endpoint
nosahama Dec 16, 2024
9370f26
otel: use dedicated container
nosahama Dec 16, 2024
40692a8
tracer: trace also KafkaAdminClient.describe_topics()
nosahama Dec 17, 2024
464b785
tracing: inject into __init__.py rather than methods
nosahama Dec 18, 2024
b1a16a4
ci: extract version from git tags
nosahama Dec 18, 2024
0417187
di: do not wire core karapace
nosahama Dec 19, 2024
a0dd281
chore: make tracer a private member
jjaakola-aiven Dec 20, 2024
ce79c32
chore: dropped `span.add_event()` usage
nosahama Jan 7, 2025
e26ba35
tracer: added noop exporter support
nosahama Jan 7, 2025
dfa9828
chore: resolve otel version from import
jjaakola-aiven Dec 20, 2024
634e497
chore: use ruff
jjaakola-aiven Jan 8, 2025
0b156f5
chore: format with ruff
jjaakola-aiven Jan 8, 2025
273b94d
chore: remove pylint
jjaakola-aiven Jan 8, 2025
692f37c
fix: use server host and port instead of host header values
jjaakola-aiven Jan 7, 2025
230e39f
logging: cconfigure FastAPI logging
nosahama Jan 8, 2025
fe97ed7
tests: test configure logging
nosahama Jan 9, 2025
9812687
fix: max http request size for Karapace REST
jjaakola-aiven Jan 9, 2025
778b4c9
fix: no forwarding if primary url own
jjaakola-aiven Jan 9, 2025
76c9ec1
chore: don't wait for primary on lifespan
jjaakola-aiven Jan 13, 2025
bfede41
fix: rejoin always when dropped from coordinator
jjaakola-aiven Jan 13, 2025
2173e30
fix: max request size always set to aio app
jjaakola-aiven Jan 13, 2025
0c31e6b
gha: use docker layer caching
nosahama Jan 17, 2025
9a03a43
fix: backup tool shall still use the JSON config file
jjaakola-aiven Jan 21, 2025
4068d9b
feat: OTel metrics metering
nosahama Dec 19, 2024
4a66266
metering: add middleware for HTTP metrics
nosahama Dec 19, 2024
21a8e86
metrics: extract metric objects from meter
nosahama Jan 17, 2025
5f04e8c
metrics: scope http requests metrics
nosahama Jan 21, 2025
b840de3
metrics: added `noop` exporter
nosahama Jan 22, 2025
0702364
gha: use docker targets
nosahama Jan 21, 2025
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
6 changes: 5 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
[run]
branch = true
relative_files = true
source = src/karapace
source = src
disable_warnings = module-not-measured, no-data-collected

[report]
skip_empty = true
4 changes: 2 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

# Include source directories and files required for building.
!go
!src
!src/karapace
!src/schema_registry
!requirements/*.txt
!README.rst
!LICENSE
!pyproject.toml
!setup.py
!container/start.sh
!container/healthcheck.py

# Ignore some files in source directories.
Expand Down
14 changes: 0 additions & 14 deletions .flake8

This file was deleted.

34 changes: 20 additions & 14 deletions .github/workflows/container-smoke-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
jobs:
smoke-test-container:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.10', '3.11', '3.12' ]
env:
BUILDKIT_PROGRESS: plain
steps:
Expand All @@ -17,23 +20,26 @@ jobs:
with:
fetch-depth: 0

- name: Install requirements
run: make install

- name: Resolve Karapace version
run: |
source ./venv/bin/activate
KARAPACE_VERSION=$(python -c "from karapace import version; print(version.__version__)")
echo KARAPACE_VERSION=$KARAPACE_VERSION >> $GITHUB_ENV
run: echo KARAPACE_VERSION="$(git describe --tags | cut -d '-' -f -2 | sed 's/-/.dev/g')" >> $GITHUB_ENV

- name: Build container
run: docker build --build-arg KARAPACE_VERSION=${{ env.KARAPACE_VERSION }} --file=container/Dockerfile .
- run: echo "RUNNER_UID=$(id -u)" >> $GITHUB_ENV
- run: echo "RUNNER_GID=$(id -g)" >> $GITHUB_ENV

- name: Run container
run: docker compose --file=container/compose.yml up --build --wait --detach

- name: Smoke test registry
run: bin/smoke-test-registry.sh
run: make start-karapace-docker-resources
env:
PYTHON_VERSION: ${{ matrix.python-version }}
KARAPACE_VERSION: ${{ env.KARAPACE_VERSION }}
RUNNER_UID: ${{ env.RUNNER_UID }}
RUNNER_GID: ${{ env.RUNNER_GID }}

- name: Smoke test schema registry
run: bin/smoke-test-schema-registry.sh
env:
KARAPACE_PORT: 8081

- name: Smoke test REST proxy
run: bin/smoke-test-rest.sh
run: bin/smoke-test-rest-proxy.sh
env:
KARAPACE_PORT: 8082
1 change: 1 addition & 0 deletions .github/workflows/container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,6 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
build-args: |
KARAPACE_VERSION=${{ steps.ctx.outputs.version }}
PYTHON_VERSION=3.10.11
file: container/Dockerfile
platforms: "linux/amd64,linux/arm64"
29 changes: 18 additions & 11 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,24 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Need fetch-depth 0 to fetch tags, see https://github.com/actions/checkout/issues/701
with:
fetch-depth: 0

- uses: actions/setup-python@v5
with:
cache: pip
python-version: '3.12'
- name: Install libsnappy-dev
run: sudo apt install libsnappy-dev
- name: Install requirements and typing requirements
run: |
python -m venv venv
source ./venv/bin/activate
pip --require-virtualenv install .[typing]
- run: |
source ./venv/bin/activate
mypy src

- name: Resolve Karapace version
run: echo KARAPACE_VERSION="$(git describe --tags | cut -d '-' -f -2 | sed 's/-/.dev/g')" >> $GITHUB_ENV

- run: echo "RUNNER_UID=$(id -u)" >> $GITHUB_ENV
- run: echo "RUNNER_GID=$(id -g)" >> $GITHUB_ENV

- name: Run mypy
run: make type-check-mypy-in-docker
env:
PYTHON_VERSION: 3.12
KARAPACE_VERSION: ${{ env.KARAPACE_VERSION }}
RUNNER_UID: ${{ env.RUNNER_UID }}
RUNNER_GID: ${{ env.RUNNER_GID }}
65 changes: 56 additions & 9 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,42 +20,89 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.9', '3.10', '3.11', '3.12' ]
python-version: [ '3.10', '3.11', '3.12' ]
env:
PYTEST_ADDOPTS: >-
--log-dir=/tmp/ci-logs
--log-file=/tmp/ci-logs/pytest.log
--showlocals
steps:
- uses: actions/checkout@v4
# Need fetch-depth 0 to fetch tags, see https://github.com/actions/checkout/issues/701
with:
fetch-depth: 0

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
cache: pip
python-version: ${{ matrix.python-version }}

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21.0'

- run: make install-dev
- run: make unit-tests
- name: Resolve Karapace version
run: echo KARAPACE_VERSION="$(git describe --tags | cut -d '-' -f -2 | sed 's/-/.dev/g')" >> $GITHUB_ENV

- run: echo "RUNNER_UID=$(id -u)" >> $GITHUB_ENV
- run: echo "RUNNER_GID=$(id -g)" >> $GITHUB_ENV

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Cache docker layers
uses: docker/build-push-action@v4
env:
PYTHON_VERSION: ${{ matrix.python-version }}
KARAPACE_VERSION: ${{ env.KARAPACE_VERSION }}
PR_TAG: aiven-open/karapace-pr:${{ env.KARAPACE_VERSION }}
with:
context: .
cache-from: type=gha
cache-to: type=gha,mode=max
tags: ${{ env.PR_TAG }}
push: false
build-args: |
KARAPACE_VERSION=${{ env.KARAPACE_VERSION }}
PYTHON_VERSION=${{ matrix.python-version }}
file: container/Dockerfile
platforms: linux/amd64

- run: make unit-tests-in-docker
env:
PYTHON_VERSION: ${{ matrix.python-version }}
KARAPACE_VERSION: ${{ env.KARAPACE_VERSION }}
RUNNER_UID: ${{ env.RUNNER_UID }}
RUNNER_GID: ${{ env.RUNNER_GID }}
COVERAGE_FILE: "/opt/karapace/coverage/.coverage.${{ matrix.python-version }}"
PYTEST_ARGS: "--cov=karapace --cov=schema_registry --cov-append --numprocesses 4"

- run: make e2e-tests-in-docker
env:
COVERAGE_FILE: ".coverage.${{ matrix.python-version }}"
PYTEST_ARGS: "--cov=karapace --cov-append --numprocesses 4"
- run: make integration-tests
PYTHON_VERSION: ${{ matrix.python-version }}
KARAPACE_VERSION: ${{ env.KARAPACE_VERSION }}
RUNNER_UID: ${{ env.RUNNER_UID }}
RUNNER_GID: ${{ env.RUNNER_GID }}
COVERAGE_FILE: "/opt/karapace/coverage/.coverage.${{ matrix.python-version }}"
PYTEST_ARGS: "--cov=karapace --cov=schema_registry --cov-append --numprocesses 4"

- run: make integration-tests-in-docker
env:
COVERAGE_FILE: ".coverage.${{ matrix.python-version }}"
PYTEST_ARGS: "--cov=karapace --cov-append --random-order --numprocesses 4"
PYTHON_VERSION: ${{ matrix.python-version }}
KARAPACE_VERSION: ${{ env.KARAPACE_VERSION }}
RUNNER_UID: ${{ env.RUNNER_UID }}
RUNNER_GID: ${{ env.RUNNER_GID }}
COVERAGE_FILE: "/opt/karapace/coverage/.coverage.${{ matrix.python-version }}"
PYTEST_ARGS: "--cov=karapace --cov=schema_registry --cov-append --random-order --numprocesses 4"

- name: Archive logs
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: karapace-integration-test-logs-${{ matrix.python-version }}
path: /tmp/ci-logs

- name: Archive coverage file
uses: actions/upload-artifact@v4
with:
Expand Down
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@
__pycache__/
/build/
/dist/
/karapace.egg-info/
src/karapace.egg-info/
/karapace-rpm-src.tar
/kafka_*.tgz
/kafka_*/
venv
/karapace/version.py
*.so
src/karapace/version.py
.run
.python-version
.hypothesis/
.DS_Store
*.coverage.*
43 changes: 8 additions & 35 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,36 +30,6 @@ repos:
hooks:
- id: shfmt

- repo: https://github.com/asottile/pyupgrade
rev: v3.4.0
hooks:
- id: pyupgrade
args: [ --py39-plus ]

- repo: https://github.com/pycqa/autoflake
rev: v2.1.1
hooks:
- id: autoflake
args:
- --in-place
- --remove-all-unused-imports
- --ignore-init-module-imports

- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort

- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black

- repo: https://github.com/PyCQA/flake8
rev: 7.1.0
hooks:
- id: flake8

- repo: https://github.com/hadolint/hadolint
rev: v2.12.0
hooks:
Expand All @@ -70,9 +40,12 @@ repos:
# https://github.com/hadolint/hadolint/issues/497
- --ignore=DL3042

- repo: https://github.com/PyCQA/pylint
# Note: pre-commit autoupdate changes to an alpha version. Instead, manually find the
# latest stable version here: https://github.com/pylint-dev/pylint/releases
rev: v3.2.6
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.8.6
hooks:
- id: pylint
# Run the linter.
- id: ruff
args: [ --fix ]
# Run the formatter.
- id: ruff-format
43 changes: 0 additions & 43 deletions .pylintrc

This file was deleted.

Loading
Loading