Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
main
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
zoe
main
Merge requests
!11
Various fixes
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Various fixes
devel/fixes
into
master
Overview
0
Commits
1
Pipelines
1
Changes
3
Merged
Daniele Venzano
requested to merge
devel/fixes
into
master
7 years ago
Overview
0
Commits
1
Pipelines
1
Changes
3
Expand
remove executions with fatal errors form the scheduling queue
set services to error state when they fatally fail starting
re-implement log streaming that was not working
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
eba363c8
1 commit,
7 years ago
3 files
+
15
−
10
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
Search (e.g. *.vue) (Ctrl+P)
zoe_api/rest_api/service.py
+
13
−
10
Options
@@ -17,8 +17,8 @@
import
logging
from
tornado.web
import
RequestHandler
,
asynchronous
import
tornado.
iostream
from
tornado.web
import
RequestHandler
import
tornado.
gen
from
zoe_api.rest_api.utils
import
catch_exceptions
,
get_auth
,
manage_cors_headers
from
zoe_api.api_endpoint
import
APIEndpoint
# pylint: disable=unused-import
@@ -84,7 +84,6 @@ class ServiceLogsAPI(RequestHandler):
self
.
finish
()
@catch_exceptions
@asynchronous
def
get
(
self
,
service_id
):
"""
HTTP GET method.
"""
@@ -92,13 +91,17 @@ class ServiceLogsAPI(RequestHandler):
self
.
service_id
=
service_id
self
.
log_obj
=
self
.
api_endpoint
.
service_logs
(
uid
,
role
,
service_id
,
stream
=
True
)
self
.
stream
=
tornado
.
iostream
.
PipeIOStream
(
self
.
log_obj
.
fileno
())
self
.
stream
.
read_until
(
b
'
\n
'
,
callback
=
self
.
_stream_log_line
)
def
_stream_log_line
(
self
,
log_line
):
self
.
write
(
log_line
)
self
.
flush
()
self
.
stream
.
read_until
(
b
'
\n
'
,
callback
=
self
.
_stream_log_line
)
self
.
_stream_log_line
()
@tornado.gen.coroutine
def
_stream_log_line
(
self
):
while
True
:
line
=
self
.
log_obj
.
read
(
4096
)
if
line
is
not
None
:
self
.
write
(
line
)
self
.
flush
()
else
:
yield
tornado
.
gen
.
sleep
(
0.2
)
def
data_received
(
self
,
chunk
):
"""
Not implemented as we do not use stream uploads
"""
Loading