Skip to content

Commit

Permalink
Merge pull request #359 from aiven/hacka-removed-extra-entrypoints
Browse files Browse the repository at this point in the history
Removed extra entrypoints
  • Loading branch information
tvainika authored Mar 21, 2022
2 parents 8d53b17 + a7b88fd commit 6c81823
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 68 deletions.
4 changes: 2 additions & 2 deletions container/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ case $1 in
echo "{}" > /opt/karapace/rest.config.json

echo "Starting Karapace REST API"
exec python3 -m karapace.kafka_rest_apis /opt/karapace/rest.config.json
exec python3 -m karapace.karapace_all /opt/karapace/rest.config.json
;;
registry)
# Reexport variables for compatibility
Expand All @@ -46,7 +46,7 @@ case $1 in
echo "{}" > /opt/karapace/registry.config.json

echo "Starting Karapace Schema Registry"
exec python3 -m karapace.schema_registry_apis /opt/karapace/registry.config.json
exec python3 -m karapace.karapace_all /opt/karapace/registry.config.json
;;
*)
echo "usage: start-karapace.sh <registry|rest>"
Expand Down
34 changes: 0 additions & 34 deletions karapace/kafka_rest_apis/__main__.py

This file was deleted.

32 changes: 0 additions & 32 deletions karapace/schema_registry_apis.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
from avro.errors import SchemaParseException
from contextlib import closing
from enum import Enum, unique
from http import HTTPStatus
from kafka import KafkaProducer
from karapace import version as karapace_version
from karapace.compatibility import check_compatibility, CompatibilityModes
from karapace.compatibility.jsonschema.checks import is_incompatible
from karapace.config import DEFAULT_LOG_FORMAT_JOURNAL, read_config
from karapace.karapace import KarapaceBase
from karapace.master_coordinator import MasterCoordinator
from karapace.rapu import HTTPRequest
from karapace.schema_reader import InvalidSchema, KafkaSchemaReader, SchemaType, TypedSchema
from karapace.utils import json_encode, KarapaceKafkaClient
from typing import Any, Dict, Optional, Tuple

import argparse
import asyncio
import logging
import sys
import time


Expand Down Expand Up @@ -907,29 +901,3 @@ def no_master_error(self, content_type):
content_type=content_type,
status=HTTPStatus.INTERNAL_SERVER_ERROR,
)


def main() -> int:
parser = argparse.ArgumentParser(prog="karapace", description="Karapace: Your Kafka essentials in one tool")
parser.add_argument("--version", action="version", help="show program version", version=karapace_version.__version__)
parser.add_argument("config_file", help="configuration file path", type=argparse.FileType())
arg = parser.parse_args()

with closing(arg.config_file):
config = read_config(arg.config_file)

logging.basicConfig(level=logging.INFO, format=DEFAULT_LOG_FORMAT_JOURNAL)
logging.getLogger().setLevel(config["log_level"])
kc = KarapaceSchemaRegistry(config=config)
try:
kc.run(host=kc.config["host"], port=kc.config["port"])
except Exception: # pylint: disable-broad-except
if kc.raven_client:
kc.raven_client.captureException(tags={"where": "karapace"})
raise

return 0


if __name__ == "__main__":
sys.exit(main())

0 comments on commit 6c81823

Please sign in to comment.