Unverified Commit d056cc9c authored by Sebastian Schüpbach's avatar Sebastian Schüpbach
Browse files

Merge remote-tracking branch 'origin/master' into master

parents 1e02c5f1 16763c1b
Pipeline #16149 passed with stages
in 4 minutes and 41 seconds
......@@ -3,21 +3,10 @@ FROM python:3.8
WORKDIR /mediametadatatodb_app
ADD mediametadatatodb_app /mediametadatatodb_app/
ADD requirements.txt /mediametadatatodb_app/
WORKDIR /mediametadatatodb_app/kubectl
#install kubectl so that helm can work in the docker container
RUN wget https://storage.googleapis.com/kubernetes-release/release/v1.16.2/bin/linux/amd64/kubectl && chmod +x ./kubectl
ENV PATH /mediametadatatodb_app/kubectl:$PATH
WORKDIR /mediametadatatodb_app
#install helm
#RUN wget https://get.helm.sh/helm-v3.2.1-linux-amd64.tar.gz && tar -xvzf helm-v3.2.1-linux-amd64.tar.gz && mv linux-amd64 helm
#ENV PATH /mediametadatatodb_app/helm:$PATH
#RUN ./pull-charts.sh
RUN pip install -r requirements.txt
ADD setup.py /
RUN pip install -e .
ENV FLASK_APP mediametadatatodb_app
ENV FLASK_ENV development
ENTRYPOINT ["python"]
CMD ["/mediametadatatodb_app/main.py"]
# mediametadatatodb
# Read form mediaserve-metadata from kafka and write it into mediaserver-mariaDB
cd kubernetes-manifests
kubectl apply -f .
# Start the app
python3 -m venv venv
. venv/bin/activate
pip3 install -r requirements.txt
pip3 install -e .
cd mediametadatatodb_app
#mkdir charts
python3 main.py
cd ..
export FLASK_APP=mediametadatatodb_app
export FLASK_ENV=development
flask run
This will start a development web server hosting your application, which you will be able to see by navigating to
# Reads form mediaserver-metadata from kafka and write it into mediaserver-mariaDB
from datetime import timezone
def generate_helm_name(process_id, job_name):
return process_id + '-' + job_name
def get_job_info(job):
job is a Kubernetes V1Job
utc_start_time = job.status.start_time
local_start_time = utc_start_time.replace(tzinfo=timezone.utc).astimezone(tz=None)
status = 'Unknown'
if job.status.failed:
status = 'Failed'
elif (job.status.active):
status = 'Running'
return {
"status": status,
"started": local_start_time.strftime("%m/%d/%Y, %H:%M:%S")
......@@ -4,7 +4,4 @@ setup(
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment