Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
SMART
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UNI-KLU
SMART
Commits
e5010b4c
Commit
e5010b4c
authored
Feb 11, 2020
by
Alexander Lercher
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/bin-scripts-feedback' into develop
parents
4c83bce4
e52460d2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
62 additions
and
17 deletions
+62
-17
build.py
bin/build.py
+10
-1
deploy.py
bin/deploy.py
+6
-12
Dockerfile
src/data-hub/community-detection-microservice/Dockerfile
+2
-0
requirements.txt
...hub/community-detection-microservice/app/requirements.txt
+44
-4
No files found.
bin/build.py
View file @
e5010b4c
...
...
@@ -21,6 +21,7 @@ command_args = [{'path': path,
for
path
in
paths
]
error
:
int
=
0
res_str
=
[]
for
command_arg
in
command_args
:
path
=
command_arg
[
'path'
]
...
...
@@ -34,11 +35,19 @@ for command_arg in command_args:
os
.
remove
(
os
.
path
.
join
(
ROOT
,
DOCKER_COMPOSE_NAME
))
res_str
.
append
(
f
"{image_name} built with exit code {exit_val}"
)
if
exit_val
!=
0
:
error
=
exit_val
os
.
system
(
f
"docker push {image_name}"
)
# push created Docker image
exit_val
=
os
.
system
(
f
"docker push {image_name}"
)
res_str
.
append
(
f
"{image_name} pushed with exit code {exit_val}"
)
if
exit_val
!=
0
:
error
=
exit_val
print
(
f
"Found {len(command_args)} images"
)
for
s
in
res_str
:
print
(
s
)
sys
.
exit
(
1
if
error
>
0
else
0
)
\ No newline at end of file
bin/deploy.py
View file @
e5010b4c
import
os
import
sys
EXTERNAL_IP
=
"143.205.173.225"
# apply or delete config
kube_command
=
'apply'
if
len
(
sys
.
argv
)
==
2
:
...
...
@@ -14,14 +12,10 @@ for p, _, f in os.walk('./'):
if
'deployment.yml'
==
file
:
paths
.
append
(
os
.
path
.
normpath
(
p
))
error
:
int
=
0
for
path
in
paths
:
os
.
system
(
f
"kubectl {kube_command} -f {path}"
)
# if kube_command == 'apply':
# # apply external ip
# service_name = path.split(os.path.normpath('/'))[-2] # -1 is deployment folder
# if service_name.split('-')[-1] == 'microservice':
# # remove microservice suffix
# service_name = service_name[:len(service_name)-len('-microservice')]
# os.system(f"kubectl patch service {service_name} -p '{{\"spec\":{{\"externalIPs\":[\"{EXTERNAL_IP}\"]}}}}'")
\ No newline at end of file
exit_val
=
os
.
system
(
f
"kubectl {kube_command} -f {path}"
)
if
exit_val
!=
0
:
error
=
exit_val
sys
.
exit
(
1
if
error
>
0
else
0
)
\ No newline at end of file
src/data-hub/community-detection-microservice/Dockerfile
View file @
e5010b4c
...
...
@@ -9,7 +9,9 @@ RUN apt-get update
EXPOSE
5000
WORKDIR
/app
COPY
src/modules/ /app/
COPY
src/data-hub/community-detection-microservice/app/ /app/
RUN
pip
install
-r
requirements.txt
RUN
chmod
a+x main.py
...
...
src/data-hub/community-detection-microservice/app/requirements.txt
View file @
e5010b4c
connexion[swagger-ui]
numpy
matplotlib
scikit-learn
\ No newline at end of file
astroid==2.3.3
attrs==19.3.0
autopep8==1.5
certifi==2019.11.28
chardet==3.0.4
Click==7.0
clickclick==1.2.2
connexion==2.6.0
cycler==0.10.0
Flask==1.1.1
idna==2.8
importlib-metadata==1.5.0
inflection==0.3.1
isort==4.3.21
itsdangerous==1.1.0
Jinja2==2.11.1
joblib==0.14.1
jsonschema==3.2.0
kiwisolver==1.1.0
lazy-object-proxy==1.4.3
MarkupSafe==1.1.1
matplotlib==3.1.3
mccabe==0.6.1
numpy==1.18.1
openapi-spec-validator==0.2.8
# pkg-resources==0.0.0
pycodestyle==2.5.0
pylint==2.4.4
pymongo==3.10.1
pyparsing==2.4.6
pyrsistent==0.15.7
python-dateutil==2.8.1
PyYAML==5.3
requests==2.22.0
rope==0.16.0
scikit-learn==0.22.1
scipy==1.4.1
six==1.14.0
swagger-ui-bundle==0.0.6
typed-ast==1.4.1
urllib3==1.25.8
Werkzeug==0.16.1
wrapt==1.11.2
zipp==2.1.0
Write
Preview
Markdown
is supported
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