Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-video-worker
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-video-worker
Commits
fe053a9a
Commit
fe053a9a
authored
Oct 13, 2017
by
Gregory Martin
Committed by
GitHub
Oct 13, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #15 from edx/yro/update_celery_queue
Update Celery Queuenames
parents
5f8a4021
3eb261bc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 additions
and
75 deletions
+1
-75
tests/test_node_connect.py
+0
-74
worker.sh
+1
-1
No files found.
tests/test_node_connect.py
deleted
100644 → 0
View file @
5f8a4021
import
os
import
sys
import
unittest
sys
.
path
.
append
(
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))))
from
video_worker.config
import
WorkerSetup
"""
test connection to celery cluster
"""
class
TestCeleryConnect
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
WS
=
WorkerSetup
()
if
os
.
path
.
exists
(
self
.
WS
.
instance_yaml
):
self
.
WS
.
run
()
self
.
settings
=
self
.
WS
.
settings_dict
def
test_celery_setup
(
self
):
if
not
os
.
path
.
exists
(
self
.
WS
.
instance_yaml
):
self
.
assertTrue
(
True
)
return
None
salient_variables
=
[
'celery_app_name'
,
'celery_receiver_queue'
,
'rabbitmq_user'
,
'rabbitmq_pass'
,
'rabbitmq_broker'
]
for
s
in
salient_variables
:
self
.
assertFalse
(
len
(
self
.
settings
[
s
])
==
0
)
@unittest.skip
(
"not implemented"
)
def
test_celery_credentials
(
self
):
if
not
os
.
path
.
exists
(
self
.
WS
.
instance_yaml
):
self
.
assertTrue
(
True
)
return
None
"""
This is yuck, but I am in a hurry
"""
os
.
chdir
(
os
.
path
.
dirname
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))))
worker_call
=
'python celeryapp.py worker --loglevel=info --concurrency=1 -Q '
\
+
str
(
self
.
settings
[
'celery_receiver_queue'
])
a1
=
subprocess
.
Popen
(
worker_call
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
STDOUT
,
shell
=
True
)
print
'** 10 sec of sleep while node connects to cluster **'
time
.
sleep
(
10
)
a1
.
kill
()
# Otherwise it's forever
test_command
=
'Connected to amqp://'
+
self
.
settings
[
'rabbitmq_user'
]
+
\
':**@'
+
self
.
settings
[
'rabbitmq_broker'
]
+
':5672//'
for
line
in
iter
(
a1
.
stdout
.
readline
,
b
''
):
print
line
if
test_command
in
line
:
self
.
assertTrue
(
True
)
return
None
self
.
assertFalse
(
True
)
def
main
():
unittest
.
main
()
if
__name__
==
'__main__'
:
sys
.
exit
(
main
())
worker.sh
View file @
fe053a9a
...
@@ -9,7 +9,7 @@ ROOTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
...
@@ -9,7 +9,7 @@ ROOTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd
${
ROOTDIR
}
cd
${
ROOTDIR
}
# Get vars from yaml
# Get vars from yaml
QUEUE
=
$(
cat
${
ROOTDIR
}
/instance_config.yaml |
grep
celery_
receiv
er_queue
)
QUEUE
=
$(
cat
${
ROOTDIR
}
/instance_config.yaml |
grep
celery_
work
er_queue
)
QUEUE
=
${
QUEUE
#*
:
}
QUEUE
=
${
QUEUE
#*
:
}
CONCUR
=
$(
cat
${
ROOTDIR
}
/instance_config.yaml |
grep
celery_threads
)
CONCUR
=
$(
cat
${
ROOTDIR
}
/instance_config.yaml |
grep
celery_threads
)
CONCUR
=
${
CONCUR
#*
:
}
CONCUR
=
${
CONCUR
#*
:
}
...
...
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