Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
DSI Parser Frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
DigitalDynamicMeasurement
DSI Parser Frontend
Commits
d43afc9f
Commit
d43afc9f
authored
10 months ago
by
Benedikt
Browse files
Options
Downloads
Patches
Plain Diff
changed start method of docker file
parent
17cbe2d5
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dockerfile
+2
-11
2 additions, 11 deletions
dockerfile
main.py
+30
-6
30 additions, 6 deletions
main.py
startkBokehAndPrintIp.sh
+13
-0
13 additions, 0 deletions
startkBokehAndPrintIp.sh
with
45 additions
and
17 deletions
dockerfile
+
2
−
11
View file @
d43afc9f
...
...
@@ -2,22 +2,13 @@ FROM python:3.11
# WORKDIR /usr/src/app
ENV
GIT_SSL_NO_VERIFY=1
# Set the environment variable for the HTTP proxy
#ENV http_proxy="http://webproxy.bs.ptb.de:8080"
#ENV https_proxy="http://webproxy.bs.ptb.de:8080"
# Set the environment variable for the NO_PROXY
# This ensures that the proxy is not used for ptb.de
#ENV no_proxy="ptb.de"
# Install any needed packages specified in requirements.txt
RUN
git clone https://gitlab1.ptb.de/digitaldynamicmeasurement/dsi-parser-frontend.git
#RUN pip install --proxy=webproxy.bs.ptb.de:8080 --no-cache-dir -r dsi-parser-frontend/requirements.txt
RUN
pip
install
--no-cache-dir
-r
dsi-parser-frontend/requirements.txt
EXPOSE
5020
CMD
["bokeh", "serve", "dsi-parser-frontend/", "--port", "5020", "--allow-websocket-origin", "*","--use-xheaders","--prefix","dsi-parser-frontend"]
CMD
["./startkBokehAndPrintIp.sh"]
#
CMD ["bokeh", "serve", "dsi-parser-frontend/", "--port", "5020", "--allow-websocket-origin", "*","--use-xheaders","--prefix","dsi-parser-frontend"]
This diff is collapsed.
Click to expand it.
main.py
+
30
−
6
View file @
d43afc9f
import
base64
import
io
import
json
import
tarfile
# This file is part of dsiUnitsFrontend (https://gitlab1.ptb.de/digitaldynamicmeasurement/dsi-parser-frontend)
# Copyright 2024 [Benedikt Seeger(PTB), Vanessa Stehr(PTB)]
#This library is free software; you can redistribute it and/or
#modify it under the terms of the GNU Lesser General Public
#License as published by the Free Software Foundation; either
#version 2.1 of the License, or (at your option) any later version.
#This library is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
#Lesser General Public License for more details.
#You should have received a copy of the GNU Lesser General Public
#License along with this library; if not, write to the Free Software
#Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
import
warnings
import
itertools
import
math
...
...
@@ -16,6 +28,19 @@ from bokeh.events import ValueSubmit
import
numpy
as
np
colors
=
Category10
[
10
]
VERSION
=
"
0.1.0
"
import
socket
def
get_local_ip
():
try
:
# Creates a socket connection to Google's public DNS server to determine the internal network IP
with
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_DGRAM
)
as
s
:
s
.
connect
((
"
8.8.8.8
"
,
80
))
# Using Google DNS, and connecting via dummy request
local_ip
=
s
.
getsockname
()[
0
]
# Returns the IP where the socket is connected
return
local_ip
except
Exception
as
e
:
return
f
"
Unable to get IP:
{
e
}
"
issueTemplate
=
"""
There was an issue with the following unit conversion:
...
...
@@ -284,9 +309,7 @@ class page():
issueUrl
=
r
'
https://gitlab1.ptb.de/digitaldynamicmeasurement/dsi-parser-frontend/-/issues/new?
'
title
=
quote
(
filledTitle
)
body
=
quote
(
filledResult
)
url
=
issueUrl
+
'
issue[title]=
'
+
title
+
'
&issue[description]=
'
+
body
return
url
def
clearComparison
(
self
):
...
...
@@ -300,4 +323,5 @@ class page():
if
self
.
dsiInput1
.
valideUnit
and
self
.
dsiInput2
.
valideUnit
:
self
.
compare
()
thisPage
=
page
()
This diff is collapsed.
Click to expand it.
startkBokehAndPrintIp.sh
0 → 100755
+
13
−
0
View file @
d43afc9f
#!/bin/bash
# Find the local IP address. This line gets the IP address associated with the default route.
LOCAL_IP
=
$(
ip route get 1 |
awk
'{print $7;exit}'
)
# Print the local IP address
echo
"Local IP Address:
$LOCAL_IP
"
# Run the Bokeh server command
CMD
=(
"bokeh"
"serve"
"./"
"--port"
"5020"
"--allow-websocket-origin"
"*"
"--use-xheaders"
"--prefix"
"dsi-parser-frontend"
)
# Execute the command
"
${
CMD
[@]
}
"
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment