Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
envsetup
Manage
Activity
Members
Plan
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor 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
mediaserver
envsetup
Commits
b10fd135
Commit
b10fd135
authored
4 years ago
by
Stéphane Diemer
Browse files
Options
Downloads
Patches
Plain Diff
Removed CELERITY_WORKER_IP variable | refs
#32546
parent
3b34059a
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
global-conf.sh
+0
-3
0 additions, 3 deletions
global-conf.sh
tests/test_mediaworker.py
+28
-5
28 additions, 5 deletions
tests/test_mediaworker.py
with
28 additions
and
8 deletions
global-conf.sh
+
0
−
3
View file @
b10fd135
...
...
@@ -100,9 +100,6 @@ DB_PG_ROOT_PWD=''
CELERITY_SIGNING_KEY
=
'test'
# ⚠ CELERITY_SERVER is used in ubicast-mediaserver package when adding an instance
CELERITY_SERVER
=
'127.0.0.1'
# ⚠ CELERITY_WORKER_IP is used in ubicast-mediaserver package when adding an instance
# worker IP adresses, use commas to separate values
CELERITY_WORKER_IP
=
'127.0.0.1'
# -- Network configuration --
# applied with client configuration step
...
...
This diff is collapsed.
Click to expand it.
tests/test_mediaworker.py
+
28
−
5
View file @
b10fd135
...
...
@@ -96,6 +96,30 @@ def run_tests(ip):
return
False
def
get_remote_workers_ips
():
'''
Returns the list of IP addresses of all non local celerity workers.
'''
ips
=
set
()
# get worker IPs
try
:
from
celerity_utils
import
api
success
,
response
=
api
.
list_workers
(
'
celerity_config_updater
'
)
if
not
success
:
raise
Exception
(
str
(
response
))
for
worker
in
response
[
'
workers
'
]:
if
worker
[
'
remote_ip
'
]:
ips
.
add
(
worker
[
'
remote_ip
'
])
except
Exception
as
e
:
u
.
error
(
'
Failed to get workers list using celerity API: %s
'
%
e
)
# remove local IP
p
=
subprocess
.
run
([
'
ip
'
,
'
addr
'
],
stdin
=
subprocess
.
DEVNULL
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
STDOUT
,
encoding
=
'
utf-8
'
)
local_ips
=
re
.
findall
(
r
'
inet ([\d\.]+)/
'
,
p
.
stdout
)
u
.
log
(
'
Local IP addresses are: %s.
'
%
local_ips
)
ips
.
difference
(
set
(
local_ips
))
return
ips
def
main
():
try
:
import
mediaserver
...
...
@@ -107,11 +131,10 @@ def main():
all_ok
=
True
tested
=
False
mediaserver_ip
=
u
.
get_conf
(
'
NETWORK_IP
'
)
worker_ips
=
u
.
get_conf
(
'
CELERITY_WORKER_IP
'
)
for
worker_ip
in
worker_ips
.
split
(
'
,
'
):
worker_ips
=
get_remote_workers_ips
()
for
worker_ip
in
worker_ips
:
worker_ip
=
worker_ip
.
strip
()
if
worker_ip
and
not
worker_ip
.
startswith
(
'
127.
0.
'
)
and
worker_ip
!=
mediaserver_ip
:
if
worker_ip
and
not
worker_ip
.
startswith
(
'
127.
'
)
:
tested
=
True
if
not
check_ssh
(
worker_ip
):
all_ok
=
False
...
...
@@ -123,7 +146,7 @@ def main():
# if not run_tests(worker_ip):
# all_ok = False
if
not
tested
:
u
.
log
(
'
Celerity IP not set or running locally
, skipping test.
'
)
u
.
log
(
'
No remote worker found
, skipping test.
'
)
return
2
if
not
all_ok
:
...
...
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