Commit 6ead2b4e authored by Matthias's avatar Matthias
Browse files

remove more flask code

parent 77249d99
Pipeline #16077 passed with stages
in 4 minutes and 12 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
WORKDIR /
ADD setup.py /
RUN pip install -e .
ENV FLASK_APP mediametadatatodb_app
ENV FLASK_ENV development
EXPOSE 5000
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
#./pull-charts.sh
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 http://127.0.0.1:5000/.
# Reads form mediaserver-metadata from kafka and write it into mediaserver-mariaDB
......@@ -8,7 +8,6 @@ from kubernetes import config
class MediametadataToDB():
# Todo write/correct comment for swagger
def run(self):
"""
Import media metadata to 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(
name='mediametadatatodb_app',
packages=['mediametadatatodb_app'],
include_package_data=True,
install_requires=[
'flask',
],
)
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