Compare commits

7 Commits

Author SHA1 Message Date
c776971267 update dockerhub
All checks were successful
continuous-integration/drone/push Build is passing
2022-01-31 22:55:55 +01:00
71ffd8707d update python
Some checks failed
continuous-integration/drone/push Build is failing
2022-01-31 22:26:01 +01:00
7e1c67e394 add dockerhub step 2022-01-31 22:09:30 +01:00
eecb65894d Fixed routing keys
All checks were successful
continuous-integration/drone/push Build is passing
2021-08-18 15:56:24 +02:00
17bf93f8fd fixed sentry dsn
All checks were successful
continuous-integration/drone/push Build is passing
2021-08-18 14:43:38 +02:00
1ddc40a8cc Merge branch 'master' of ssh://git.kmlabz.com:2222/birbnetes/input-service
All checks were successful
continuous-integration/drone/push Build is passing
2021-08-18 14:05:50 +02:00
947ac144b1 Updated k8s stuff
All checks were successful
continuous-integration/drone/push Build is passing
2021-08-18 14:05:27 +02:00
6 changed files with 52 additions and 17 deletions

View File

@ -24,6 +24,18 @@ steps:
- latest
- ${DRONE_BUILD_NUMBER}
- name: dockerhub
image: plugins/docker
settings:
repo: birbnetes/${DRONE_REPO_NAME}
username:
from_secret: DOCKERHUB_USER
password:
from_secret: DOCKERHUB_PASSWORD
tags:
- latest
- ${DRONE_BUILD_NUMBER}
- name: ms-teams
image: kuperiu/drone-teams
settings:

View File

@ -1,4 +1,4 @@
FROM python:3.9-slim
FROM python:3.10-slim
ENV TZ Europe/Budapest
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

View File

@ -6,16 +6,17 @@ metadata:
app: input-service
namespace: birbnetes
data:
SENTRY_DSN: https://b181edf362e549f4967c6cd42629693d@sentry.kmlabz.com/3
RELEASE_ID: luna-k8s
SENTRY_DSN: https://f2fa88f1a13a42d3993d96024ce31b48@glitchtip.kmlabz.com/3
RELEASE_ID: kmlabz-k8s
INPUT_SERVICE_RELEASEMODE: release
INPUT_RABBITMQ_HOSTNAME: birb-rabbitmq
INPUT_RABBITMQ_EXCHANGE: "wave"
INPUT_RABBITMQ_QUEUE: wave-ready
INPUT_RABBITMQ_EXCHANGE_META: "sample-meta"
INPUT_RABBITMQ_EXCHANGE_CACHE: "sample-cache"
INPUT_RABBITMQ_USERNAME: user
INPUT_RABBITMQ_PASSWORD: 1wZVQnP5vy
INPUT_POSTGRES_HOSTNAME: input-postgres
INPUT_POSTGRES_USERNAME: input-service
INPUT_POSTGRES_PASSWORD: input-service-supersecret
INPUT_POSTGRES_DB: input-service
INPUT_STORAGE_HOSTNAME: storage-service
INPUT_RABBITMQ_PASSWORD: ZgCiSiSO8t
INFLUX_HOST: input-influx
INFLUX_PORT: "8086"
INFLUX_USERNAME: input-service
INFLUX_PASSWORD: input-service-supersecret
INFLUX_DB: input-service
CACHE_REDIS_URL: "redis://input-redis:6379/0"

View File

@ -19,12 +19,34 @@ spec:
spec:
containers:
- name: input-service
image: registry.kmlabz.com/birbnetesgit/input-service
image: registry.kmlabz.com/birbnetes/input-service
imagePullPolicy: Always
envFrom:
- configMapRef:
name: input-service
ports:
- containerPort: 8080
- name: jaeger-agent
image: jaegertracing/jaeger-agent:latest
imagePullPolicy: IfNotPresent
ports:
- containerPort: 5775
name: zk-compact-trft
protocol: UDP
- containerPort: 5778
name: config-rest
protocol: TCP
- containerPort: 6831
name: jg-compact-trft
protocol: UDP
- containerPort: 6832
name: jg-binary-trft
protocol: UDP
- containerPort: 14271
name: admin-http
protocol: TCP
args:
- --reporter.grpc.host-port=dns:///woolsey.tormakristof.eu:14250
- --reporter.type=grpc
imagePullSecrets:
- name: regcred

View File

@ -75,7 +75,7 @@ class MagicAMQP:
if total_time > 1:
self.app.logger.warning(f"Loop: Total loop took {total_time:5f} sec")
def _publish(self, exchange: str, payload=None):
def _publish(self, exchange: str, routing_key: str, payload=None):
"""
Publish a simple json serialized message to the configured queue.
If the connection is broken, then this call will block until the connection is restored
@ -94,7 +94,7 @@ class MagicAMQP:
try:
self._pika_channel.basic_publish(
exchange=exchange,
routing_key='feature',
routing_key=routing_key,
body=json.dumps(payload).encode('UTF-8')
)
self.app.logger.debug(f"Published: {payload}")
@ -125,10 +125,10 @@ class MagicAMQP:
self.app.logger.warning(f"Publish: Total publish took {total_time:5f} sec")
def publish_cache(self, payload=None):
return self._publish(self.app.config['EXCHANGE_NAME_CACHE'], payload)
return self._publish(self.app.config['EXCHANGE_NAME_CACHE'], "cache", payload)
def publish_meta(self, payload=None):
return self._publish(self.app.config['EXCHANGE_NAME_META'], payload)
return self._publish(self.app.config['EXCHANGE_NAME_META'], "meta", payload)
def is_healthy(self) -> bool:
with self._lock: