Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pycalibration
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Analyze
Contributor 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
calibration
pycalibration
Commits
5da2d3cb
Commit
5da2d3cb
authored
5 years ago
by
Karim Ahmed
Browse files
Options
Downloads
Patches
Plain Diff
copy conf.yaml after a trigger
parent
d8c5bf2f
No related branches found
No related tags found
1 merge request
!130
fix/cpy_conf_after_req
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
reportservice/report_service.py
+7
-10
7 additions, 10 deletions
reportservice/report_service.py
with
7 additions
and
10 deletions
reportservice/report_service.py
+
7
−
10
View file @
5da2d3cb
...
@@ -168,15 +168,17 @@ async def server_runner(conf_file):
...
@@ -168,15 +168,17 @@ async def server_runner(conf_file):
socket
.
bind
(
"
{}:{}
"
.
format
(
config
[
'
GLOBAL
'
][
'
report-service
'
][
'
bind-to
'
],
socket
.
bind
(
"
{}:{}
"
.
format
(
config
[
'
GLOBAL
'
][
'
report-service
'
][
'
bind-to
'
],
config
[
'
GLOBAL
'
][
'
report-service
'
][
'
port
'
]))
config
[
'
GLOBAL
'
][
'
report-service
'
][
'
port
'
]))
asyncio
.
ensure_future
(
copy_files
(
conf_file
,
config
[
'
GLOBAL
'
][
'
git
'
][
'
figures-local
'
],
sem
=
None
))
while
True
:
while
True
:
response
=
await
socket
.
recv_pyobj
()
response
=
await
socket
.
recv_pyobj
()
await
socket
.
send_pyobj
(
'
Build DC reports through -->
'
)
await
socket
.
send_pyobj
(
'
Build DC reports through -->
'
)
logging
.
info
(
"
response: {}
"
.
format
(
response
))
logging
.
info
(
"
response: {}
"
.
format
(
response
))
# Send the conf.yaml file after receiving a zmq-req.
asyncio
.
ensure_future
(
copy_files
(
conf_file
,
config
[
'
GLOBAL
'
][
'
git
'
]
[
'
figures-local
'
],
sem
=
None
))
# Check if response is a list or a dict.
# Check if response is a list or a dict.
# if list, it should either have instrument names or ['all'].
# if list, it should either have instrument names or ['all'].
# if dict, it should acquires the details of the requested reports
# if dict, it should acquires the details of the requested reports
...
@@ -238,7 +240,6 @@ async def server_runner(conf_file):
...
@@ -238,7 +240,6 @@ async def server_runner(conf_file):
logging
.
info
(
'
Submission information: {}:
'
logging
.
info
(
'
Submission information: {}:
'
.
format
(
run_base
))
.
format
(
run_base
))
except
Exception
as
e
:
except
Exception
as
e
:
logging
.
error
(
'
Submission failed: {}
'
.
format
(
e
))
logging
.
error
(
'
Submission failed: {}
'
.
format
(
e
))
exit
(
1
)
exit
(
1
)
...
@@ -254,16 +255,13 @@ async def server_runner(conf_file):
...
@@ -254,16 +255,13 @@ async def server_runner(conf_file):
logging
.
error
(
'
Submission Error: {}
'
logging
.
error
(
'
Submission Error: {}
'
.
format
(
output
[
1
].
decode
(
'
utf8
'
)))
.
format
(
output
[
1
].
decode
(
'
utf8
'
)))
job_list
+=
await
parse_output
(
output
[
0
].
decode
(
'
utf8
'
))
job_list
+=
await
parse_output
(
output
[
0
].
decode
(
'
utf8
'
))
try
:
try
:
await
asyncio
.
wait_for
(
wait_jobs
(
job_list
),
await
asyncio
.
wait_for
(
wait_jobs
(
job_list
),
timeout
=
jobs_timeout
)
timeout
=
jobs_timeout
)
logging
.
info
(
'
All jobs are finished
'
)
logging
.
info
(
'
All jobs are finished
'
)
except
asyncio
.
TimeoutError
:
except
asyncio
.
TimeoutError
:
asyncio
.
ensure_future
(
del_folder
(
'
./tmp
'
))
logging
.
error
(
'
Jobs have timed-out!
'
)
logging
.
error
(
'
Jobs timeout!
'
)
# Copy all plots
# Copy all plots
for
det_name
,
det_conf
in
instrument
.
items
():
for
det_name
,
det_conf
in
instrument
.
items
():
...
@@ -296,7 +294,6 @@ async def server_runner(conf_file):
...
@@ -296,7 +294,6 @@ async def server_runner(conf_file):
logging
.
info
(
'
{} figures of {} are copied into {}
'
.
format
(
logging
.
info
(
'
{} figures of {} are copied into {}
'
.
format
(
len
(
figures
),
det_name
,
path
))
len
(
figures
),
det_name
,
path
))
asyncio
.
ensure_future
(
asyncio
.
ensure_future
(
push_figures
(
cfg
[
'
GLOBAL
'
][
'
git
'
][
'
repo-local
'
],
push_figures
(
cfg
[
'
GLOBAL
'
][
'
git
'
][
'
repo-local
'
],
all_new_files
))
all_new_files
))
...
...
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