-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: wire more dependencies and modules
we drop the dependency managers and use the DI containers and providers
- Loading branch information
Showing
71 changed files
with
1,090 additions
and
959 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# Current versions of avro and zstandard don't yet have wheels for 3.11. | ||
FROM python:3.10.11-bullseye AS builder | ||
|
||
ARG KARAPACE_VERSION | ||
|
||
# Create, activate, and enforce usage of virtualenv. | ||
RUN python3 -m venv /venv | ||
ENV PATH="/venv/bin:$PATH" | ||
ENV PIP_REQUIRE_VIRTUALENV=true | ||
|
||
# Install golang needed by extensions | ||
ENV GO_VERSION=1.21.0 | ||
ENV PATH="/usr/local/go/bin:${PATH}" | ||
RUN wget --progress=dot:giga "https://go.dev/dl/go${GO_VERSION}.linux-$(dpkg --print-architecture).tar.gz" \ | ||
&& tar -C /usr/local -xzf "go${GO_VERSION}.linux-$(dpkg --print-architecture).tar.gz" \ | ||
&& rm "go${GO_VERSION}.linux-$(dpkg --print-architecture).tar.gz" | ||
|
||
# Copy the requirements.txt and install dependencies in venv. Using a separate | ||
# command to use layer caching. | ||
# | ||
# Note: the requirements.txt is pinned, if any of the dependencies is updated | ||
# the cache will be invalidated and the image regenerated, which is the | ||
# intended behavior. | ||
COPY ./requirements/requirements.txt /build/ | ||
COPY ./requirements/requirements-dev.txt /build/ | ||
RUN --mount=type=cache,target=/root/.cache/pip \ | ||
python3 -m pip install -r /build/requirements.txt -r /build/requirements-dev.txt | ||
|
||
COPY . /build/karapace-repo | ||
WORKDIR /build/karapace-repo | ||
RUN --mount=type=cache,target=/root/.cache/pip \ | ||
if [ -z "${KARAPACE_VERSION}" ]; then \ | ||
PRETEND_VERSION="$(python -c 'from src.karapace import version; print(version.__version__)')"; \ | ||
else \ | ||
PRETEND_VERSION=$KARAPACE_VERSION; \ | ||
fi; \ | ||
SETUPTOOLS_SCM_PRETEND_VERSION=$PRETEND_VERSION python3 -m pip install --no-deps . | ||
|
||
# Karapace image, i.e. production. | ||
FROM python:3.10.11-slim-bullseye AS karapace | ||
|
||
# Setup user and directories. | ||
RUN groupadd --system karapace \ | ||
&& useradd --system --gid karapace karapace \ | ||
&& mkdir /opt/karapace /opt/karapace/runtime /var/log/karapace \ | ||
&& chown --recursive karapace:karapace /opt/karapace /var/log/karapace | ||
|
||
# Install protobuf compiler. | ||
ARG PROTOBUF_COMPILER_VERSION="3.12.4-1+deb11u1" | ||
RUN apt-get update \ | ||
&& apt-get install --assume-yes --no-install-recommends \ | ||
protobuf-compiler=$PROTOBUF_COMPILER_VERSION \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Copy virtualenv from builder and activate it. | ||
COPY --from=builder /venv /venv | ||
ENV PATH="/venv/bin:$PATH" | ||
|
||
COPY ./container/healthcheck.py /opt/karapace | ||
|
||
WORKDIR /opt/karapace | ||
USER karapace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
KARAPACE_DOTENV=/opt/karapace/karapace.env | ||
ACCESS_LOGS_DEBUG=False | ||
# ACCESS_LOG_CLASS=karapace.utils.DebugAccessLogger | ||
ACCESS_LOG_CLASS=aiohttp.web_log.AccessLogger | ||
ADVERTISED_HOSTNAME=karapace-rest-proxy | ||
ADVERTISED_PORT=8082 | ||
ADVERTISED_PROTOCOL=http | ||
BOOTSTRAP_URI=kafka:29092 | ||
CLIENT_ID=karapace-rest-proxy | ||
COMPATIBILITY=BACKWARD | ||
CONNECTIONS_MAX_IDLE_MS=15000 | ||
CONSUMER_ENABLE_AUTO_COMMIT=True | ||
CONSUMER_REQUEST_TIMEOUT_MS=11000 | ||
CONSUMER_REQUEST_MAX_BYTES=67108864 | ||
CONSUMER_IDLE_DISCONNECT_TIMEOUT=0 | ||
FETCH_MIN_BYTES=1 | ||
GROUP_ID=karapace-rest-proxy | ||
HOST=0.0.0.0 | ||
PORT=8082 | ||
REGISTRY_HOST=karapace-schema-registry | ||
REGISTRY_PORT=8081 | ||
REST_AUTHORIZATION=False | ||
LOG_HANDLER=stdout | ||
LOG_LEVEL=WARNING | ||
LOG_FORMAT=%(asctime)s [%(threadName)s] %(filename)s:%(funcName)s:%(lineno)d %(message)s | ||
MASTER_ELIGIBILITY=True | ||
REPLICATION_FACTOR=1 | ||
SECURITY_PROTOCOL=PLAINTEXT | ||
SSL_CHECK_HOSTNAME=True | ||
TOPIC_NAME=_schemas | ||
METADATA_MAX_AGE_MS=60000 | ||
ADMIN_METADATA_MAX_AGE=5 | ||
PRODUCER_ACKS=1 | ||
PRODUCER_COUNT=5 | ||
PRODUCER_LINGER_MS=100 | ||
PRODUCER_MAX_REQUEST_SIZE=1048576 | ||
SESSION_TIMEOUT_MS=10000 | ||
KARAPACE_REST=True | ||
KARAPACE_REGISTRY=False | ||
KARAPACE_PORT=8082 | ||
NAME_STRATEGY=topic_name | ||
NAME_STRATEGY_VALIDATION=True | ||
MASTER_ELECTION_STRATEGY=lowest | ||
PROTOBUF_RUNTIME_DIRECTORY=runtime | ||
STATSD_HOST=statsd-exporter | ||
STATSD_PORT=8125 | ||
KAFKA_SCHEMA_READER_STRICT_MODE=False | ||
KAFKA_RETRIABLE_ERRORS_SILENCED=True | ||
USE_PROTOBUF_FORMATTER=False | ||
HTTP_REQUEST_MAX_SIZE=1048576 | ||
TAGS='{ "app": "karapace-rest-proxy" }' |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.