Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
memoriav
Memobase 2020
services
postprocessing
Media Metadata Indexer
Commits
d056cc9c
Unverified
Commit
d056cc9c
authored
Oct 26, 2020
by
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
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Dockerfile
View file @
d056cc9c
...
...
@@ -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"]
README.md
View file @
d056cc9c
# 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
mediametadatatodb_app/assets/favicon.ico
deleted
100644 → 0
View file @
1e02c5f1
1.12 KB
mediametadatatodb_app/utility.py
deleted
100644 → 0
View file @
1e02c5f1
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"
)
}
setup.py
View file @
d056cc9c
...
...
@@ -4,7 +4,4 @@ setup(
name
=
'mediametadatatodb_app'
,
packages
=
[
'mediametadatatodb_app'
],
include_package_data
=
True
,
install_requires
=
[
'flask'
,
],
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment