-
Notifications
You must be signed in to change notification settings - Fork 312
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add log_links to GetTaskResponse #2021
Conversation
Signed-off-by: Kevin Su <pingsutw@apache.org>
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #2021 +/- ##
==========================================
- Coverage 85.84% 84.61% -1.24%
==========================================
Files 306 306
Lines 22897 22905 +8
Branches 3470 3471 +1
==========================================
- Hits 19657 19382 -275
- Misses 2645 2919 +274
- Partials 595 604 +9 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Kevin Su <pingsutw@apache.org>
Signed-off-by: Kevin Su <pingsutw@apache.org>
print(f"{self._entity.name} task state: {State.Name(int(state))}, message: {res.resource.message or None}") | ||
for link in res.log_links: | ||
print(f"{link.name}: {link.uri}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we use the logger here?
@@ -215,7 +216,9 @@ async def _get(self, resource_meta: bytes) -> GetTaskResponse: | |||
else: | |||
res = self._agent.get(grpc_ctx, resource_meta) | |||
state = res.resource.state | |||
logger.info(f"Task state: {state}, State message: {res.resource.message}") | |||
print(f"{self._entity.name} task state: {State.Name(int(state))}, message: {res.resource.message or None}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you probably want this in the agent executor mixin?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is in the mixin.
@@ -79,12 +80,20 @@ def create( | |||
def get(self, context: grpc.ServicerContext, resource_meta: bytes) -> GetTaskResponse: | |||
client = bigquery.Client() | |||
metadata = Metadata(**json.loads(resource_meta.decode("utf-8"))) | |||
log_links = [ | |||
TaskLog( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing ttl?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what default value should we set here
lgtm, couple changes |
Signed-off-by: Kevin Su <pingsutw@apache.org>
Signed-off-by: Kevin Su <pingsutw@apache.org>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I've tested it in this PR.
flyteorg/flyte#4529
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to add tests, LGTM!
Signed-off-by: Kevin Su <pingsutw@apache.org>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
Signed-off-by: Kevin Su <pingsutw@apache.org> Signed-off-by: Rafael Raposo <rafaelraposo@spotify.com>
Tracking issue
flyteorg/flyte#3936
Why are the changes needed?
To show the log link on FlyteConsole
What changes were proposed in this pull request?
How was this patch tested?
Setup process
Screenshots
Check all the applicable boxes