Skip to content

Commit

Permalink
Merge branch 'pedrocjdpereira:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrocjdpereira authored Sep 30, 2024
2 parents 541de5b + a57c1bd commit d487691
Show file tree
Hide file tree
Showing 11 changed files with 254 additions and 134 deletions.
4 changes: 2 additions & 2 deletions meao-monitoring/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ FROM python:3.10-alpine
RUN apk add --no-cache gcc curl musl-dev linux-headers librdkafka-dev bash

RUN apk add --no-cache --virtual .make-deps bash make patch wget git gcc g++ && apk add --no-cache musl-dev zlib-dev openssl zstd-dev pkgconfig libc-dev libmagic
RUN wget https://github.com/edenhill/librdkafka/archive/v2.5.0.tar.gz
RUN tar -xvf v2.5.0.tar.gz && cd librdkafka-2.5.0 && ./configure --prefix /usr && make && make install
RUN wget https://github.com/edenhill/librdkafka/archive/v2.5.3.tar.gz
RUN tar -xvf v2.5.3.tar.gz && cd librdkafka-2.5.3 && ./configure --prefix /usr && make && make install

RUN pip install --upgrade pip \
&& pip install requests confluent_kafka pyyaml flask python-dateutil
Expand Down
7 changes: 3 additions & 4 deletions meao-monitoring/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@ services:
build: .
environment:
- PYTHONUNBUFFERED=1
- OSM_HOSTNAME=10.255.32.88:9999
- OSS_HOSTNAME=http://oss:8080/oss/v1
- OSM_HOSTNAME=nbi.10.255.32.132.nip.io
- MEAO_OSS_KAFKA_TOPIC=meao-oss
- METRICS_COLLECTOR_KAFKA_TOPIC=k8s-cluster
- UE_LATENCY_KAFKA_TOPIC=ue-lat
- KAFKA_SERVER=10.255.32.88:14000
- KAFKA_SERVER=10.255.32.132:31999
- KUBECTL_COMMAND=/usr/local/bin/kubectl
- KUBECTL_CONFIG_PATH=kube_config
- UPDATE_CONTAINER_IDS_FREQ=5
networks:
- temp-network
networks:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,22 @@ spec:
containers:
- env:
- name: KAFKA_SERVER
value: 10.255.32.88:14000
value: 10.255.32.132:31999
- name: KUBECTL_COMMAND
value: /usr/local/bin/kubectl
- name: KUBECTL_CONFIG_PATH
value: kube_config
- name: METRICS_COLLECTOR_KAFKA_TOPIC
value: k8s-cluster
- name: OSM_HOSTNAME
value: 10.255.32.88:9999
- name: OSS_HOSTNAME
value: http://10.255.32.88:8080/oss/v1
value: nbi.10.255.32.132.nip.io
- name: MEAO_OSS_KAFKA_TOPIC
value: meao-oss
- name: PYTHONUNBUFFERED
value: "1"
- name: UE_LATENCY_KAFKA_TOPIC
value: ue-lat
- name: UPDATE_CONTAINER_IDS_FREQ
- name: SEND_CONTAINER_INFO_FREQ
value: "5"
image: localhost:5000/meao-monitoring
imagePullPolicy: Always
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ spec:
- name: "8000"
port: 8000
targetPort: 8000
nodePort: 8000
nodePort: 30800
selector:
app: meao-monitoring
7 changes: 5 additions & 2 deletions meao-monitoring/src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,24 @@ def main():
global meao
nbi_k8s_connector = NBIConnector(
os.environ.get("OSM_HOSTNAME"),
os.environ.get("OSS_HOSTNAME"),
os.environ.get("KUBECTL_COMMAND"),
os.environ.get("KUBECTL_CONFIG_PATH")
)

meao = MEAO(
nbi_k8s_connector,
int(os.environ.get("UPDATE_CONTAINER_IDS_FREQ")),
os.environ.get("METRICS_COLLECTOR_KAFKA_TOPIC"),
os.environ.get("UE_LATENCY_KAFKA_TOPIC"),
os.environ.get("MEAO_OSS_KAFKA_TOPIC"),
int(os.environ.get("SEND_CONTAINER_INFO_FREQ")),
{
'bootstrap.servers': os.environ.get("KAFKA_SERVER"),
'group.id': 'monitoring',
'auto.offset.reset': 'latest'
},
{
'bootstrap.servers': os.environ.get("KAFKA_SERVER"),
}
)

meao.start()
Expand Down
Loading

0 comments on commit d487691

Please sign in to comment.