Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
pyDccDisplayer
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
pyDccDisplayer
Commits
a90fc93f
Commit
a90fc93f
authored
1 year ago
by
Benedikt
Browse files
Options
Downloads
Patches
Plain Diff
chnaged remotedebugging added ip print
parent
b6456aa8
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Dockerfile
+8
-6
8 additions, 6 deletions
Dockerfile
src/main.py
+31
-4
31 additions, 4 deletions
src/main.py
with
39 additions
and
10 deletions
Dockerfile
+
8
−
6
View file @
a90fc93f
...
...
@@ -3,22 +3,24 @@ 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"
#
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"
#
ENV no_proxy="ptb.de"
#RUN curl --header "PRIVATE-TOKEN: FcuX-ACu_Lp928iy_1nG" "https://gitlab1.ptb.de/api/v4/projects/2806/repository/files/requirements.txt/raw?ref=main" -o requirements.txt
# Install any needed packages specified in requirements.txt
RUN
git clone https://dockerPull:Wz2547C6UNSQkkbuqhMY@gitlab1.ptb.de/digitaldynamicmeasurement/pydccdisplayer.git
RUN
pip
install
--proxy
=
webproxy.bs.ptb.de:8080
--no-cache-dir
-r
pydccdisplayer/requirements.txt
#
RUN pip install --proxy=webproxy.bs.ptb.de:8080 --no-cache-dir -r pydccdisplayer/requirements.txt
RUN
pip
install
--no-cache-dir
-r
pydccdisplayer/requirements.txt
#RUN pip install --no-cache-dir -r pydccdisplayer/requirements.txt
#COPY . .
# Set the environment variable for enabling remote debugging
ENV
ENABLE_REMOTE_DEBUG=1
EXPOSE
5003
12345
EXPOSE
5003
6003
#WORKDIR ./pydccdisplayer/src
CMD
["bokeh", "serve", "pydccdisplayer/src/.", "--port", "5003", "--allow-websocket-origin", "*","--use-xheaders","--prefix","pydccdisplayer"]
This diff is collapsed.
Click to expand it.
src/main.py
+
31
−
4
View file @
a90fc93f
import
base64
import
io
import
json
import
os
import
sys
import
socket
import
tarfile
import
warnings
import
bokehCssPTB
...
...
@@ -19,10 +22,34 @@ from dcc_XMLJSONConv.dcc_Conv import dcc as converterDcc
VERSION
=
"
0.1.0
"
import
pydevd_pycharm
# The host and port should match the configuration in PyCharm's debug server settings
pydevd_pycharm
.
settrace
(
'
host.docker.internal
'
,
port
=
12345
,
stdoutToServer
=
True
,
stderrToServer
=
True
)
# Function to get the system's IP address
def
get_ip_address
():
s
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_DGRAM
)
try
:
# This doesn't actually make a request
s
.
connect
((
"
8.8.8.8
"
,
80
))
IP
=
s
.
getsockname
()[
0
]
except
Exception
:
IP
=
"
127.0.0.1
"
finally
:
s
.
close
()
return
IP
# Check if the specific environment variable is set
if
os
.
getenv
(
'
ENABLE_REMOTE_DEBUG
'
)
==
'
1
'
:
try
:
import
pydevd_pycharm
# Set the debugger to connect back to PyCharm using the specified port
pydevd_pycharm
.
settrace
(
'
host.docker.internal
'
,
port
=
6003
,
stdoutToServer
=
True
,
stderrToServer
=
True
)
print
(
f
"
Remote debugging is enabled. Connecting to debug server at host.docker.internal:6003
"
)
except
ImportError
:
print
(
"
pydevd_pycharm is not installed. Please install it for remote debugging.
"
)
sys
.
exit
(
1
)
except
Exception
as
e
:
print
(
f
"
Failed to start remote debugging:
{
e
}
"
)
sys
.
exit
(
1
)
print
(
"
Starting DCCVwier server at
"
,
get_ip_address
())
class
page
:
def
__init__
(
self
):
self
.
fileUploader
=
fileUploader
(
self
.
readFile
)
...
...
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