Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
access-node
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
LuFG VR VIS
VR-Group
In Situ Pipeline
access-node
Commits
72e36f78
Commit
72e36f78
authored
5 years ago
by
Simon Oehrl
Browse files
Options
Downloads
Patches
Plain Diff
Fix errors
parent
16a32302
No related branches found
No related tags found
1 merge request
!4
Feature/add arbor support
Pipeline
#163338
failed
5 years ago
Stage: test
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
access_node/__main__.py
+5
-5
5 additions, 5 deletions
access_node/__main__.py
with
5 additions
and
5 deletions
access_node/__main__.py
+
5
−
5
View file @
72e36f78
...
@@ -12,12 +12,12 @@ import time
...
@@ -12,12 +12,12 @@ import time
import
requests
import
requests
import
psycopg2
import
psycopg2
def
ConnectToDatabase
():
def
ConnectToDatabase
(
postgres_username
,
postgres_password
,
port
):
return
psycopg2
.
connect
(
database
=
"
postgres
"
,
user
=
postgres_username
,
return
psycopg2
.
connect
(
database
=
"
postgres
"
,
user
=
postgres_username
,
password
=
postgres_password
,
host
=
"
database
"
,
port
=
str
(
port
))
password
=
postgres_password
,
host
=
"
database
"
,
port
=
str
(
port
))
def
SetupNestTables
(
postgres_username
,
postgres_password
,
port
):
def
SetupNestTables
(
postgres_username
,
postgres_password
,
port
):
con
=
ConnectToDatabase
()
con
=
ConnectToDatabase
(
postgres_username
,
postgres_password
,
port
)
print
(
"
Database connection opened successfully!
"
)
print
(
"
Database connection opened successfully!
"
)
cur
=
con
.
cursor
()
cur
=
con
.
cursor
()
...
@@ -54,7 +54,7 @@ def SetupNestTables(postgres_username, postgres_password, port):
...
@@ -54,7 +54,7 @@ def SetupNestTables(postgres_username, postgres_password, port):
print
(
"
Nest tables created successfully!
\n
"
)
print
(
"
Nest tables created successfully!
\n
"
)
def
SetupArborTables
(
postgres_username
,
postgres_password
,
port
):
def
SetupArborTables
(
postgres_username
,
postgres_password
,
port
):
con
=
ConnectToDatabase
()
con
=
ConnectToDatabase
(
postgres_username
,
postgres_password
,
port
)
print
(
"
Database connection opened successfully!
"
)
print
(
"
Database connection opened successfully!
"
)
cur
=
con
.
cursor
()
cur
=
con
.
cursor
()
cur
.
execute
(
"
DROP TABLE IF EXISTS PROBES CASCADE
"
)
cur
.
execute
(
"
DROP TABLE IF EXISTS PROBES CASCADE
"
)
...
@@ -107,11 +107,11 @@ def main():
...
@@ -107,11 +107,11 @@ def main():
#SetupArborTables('postgres', 'docker', 5432)
#SetupArborTables('postgres', 'docker', 5432)
# Wait for simulation nodes to post to database
# Wait for simulation nodes to post to database
time
.
sleep
(
10
)
time
.
sleep
(
5
)
# get simulation nodes
# get simulation nodes
con
=
ConnectToDatabase
()
con
=
ConnectToDatabase
(
'
postgres
'
,
'
docker
'
,
5432
)
cur
=
con
.
cursor
()
cur
=
con
.
cursor
()
# NEST
# NEST
cur
.
execute
(
"
SELECT ADDRESS FROM SIMULATION_NODES
"
)
cur
.
execute
(
"
SELECT ADDRESS FROM SIMULATION_NODES
"
)
...
...
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