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
5a5d2ac1
Commit
5a5d2ac1
authored
5 years ago
by
Karim Ahmed
Browse files
Options
Downloads
Patches
Plain Diff
extend submission output messages
parent
a5a6f749
No related branches found
No related tags found
1 merge request
!93
feat/reportservice
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
reportservice/report_service.py
+15
-7
15 additions, 7 deletions
reportservice/report_service.py
with
15 additions
and
7 deletions
reportservice/report_service.py
+
15
−
7
View file @
5a5d2ac1
import
argparse
import
argparse
import
asyncio
import
asyncio
from
asyncio.subprocess
import
PIPE
,
STDOUT
from
asyncio.subprocess
import
PIPE
import
copy
import
copy
import
getpass
import
getpass
import
glob
import
glob
...
@@ -38,6 +38,7 @@ def init_config_repo(config):
...
@@ -38,6 +38,7 @@ def init_config_repo(config):
# clone the repo.
# clone the repo.
repo
=
Repo
.
clone_from
(
config
[
'
figures-remote
'
],
repo
=
Repo
.
clone_from
(
config
[
'
figures-remote
'
],
config
[
'
repo-local
'
])
config
[
'
repo-local
'
])
logging
.
info
(
"
Clonning the repository
"
)
# make sure it is updated
# make sure it is updated
repo
.
remote
().
pull
()
repo
.
remote
().
pull
()
logging
.
info
(
"
Config repo is initialized
"
)
logging
.
info
(
"
Config repo is initialized
"
)
...
@@ -201,7 +202,7 @@ async def server_runner(conf_file, jobs_timeout):
...
@@ -201,7 +202,7 @@ async def server_runner(conf_file, jobs_timeout):
logging
.
info
(
'
Requested Configuration: {}
'
.
format
(
req_cfg
))
logging
.
info
(
'
Requested Configuration: {}
'
.
format
(
req_cfg
))
async
def
do_action
(
cfg
,
jobs_timeout
=
3000
):
async
def
do_action
(
cfg
,
jobs_timeout
=
3000
):
logging
.
info
(
'
Run plot production
'
)
logging
.
info
(
'
Run plot production
'
)
all_new_files
=
[]
all_new_files
=
[]
...
@@ -226,21 +227,28 @@ async def server_runner(conf_file, jobs_timeout):
...
@@ -226,21 +227,28 @@ async def server_runner(conf_file, jobs_timeout):
try
:
try
:
output
=
await
asyncio
.
create_subprocess_shell
(
output
=
await
asyncio
.
create_subprocess_shell
(
"
"
.
join
(
run_base
),
stdout
=
PIPE
,
stderr
=
PIPE
)
"
"
.
join
(
run_base
),
stdout
=
PIPE
,
stderr
=
PIPE
)
launched_jobs
.
append
(
output
.
communicate
())
launched_jobs
.
append
(
output
.
communicate
())
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
)
outputs
=
await
asyncio
.
gather
(
*
launched_jobs
)
outputs
=
await
asyncio
.
gather
(
*
launched_jobs
)
job_list
=
[]
job_list
=
[]
for
output
in
outputs
:
for
output
in
outputs
:
if
output
[
0
]:
logging
.
info
(
'
Submission Output: {}
'
.
format
(
output
[
0
].
decode
(
'
utf8
'
)))
if
output
[
1
]:
logging
.
error
(
'
Submission Error: {}
'
.
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
:
# make sure to timeout if waiting for jobs
# make sure to timeout if waiting for jobs
# took more than 10 mins.
# took more than 10 mins.
...
@@ -283,8 +291,8 @@ async def server_runner(conf_file, jobs_timeout):
...
@@ -283,8 +291,8 @@ async def server_runner(conf_file, jobs_timeout):
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
))
# TODO:delete out-folder
#try:
#try:
# TODO:delete out-folder
# asyncio.ensure_future(del_folder(out_folder))
# asyncio.ensure_future(del_folder(out_folder))
#except:
#except:
#logging.error(str(e))
#logging.error(str(e))
...
...
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