Skip to content
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

Improve task debugging. #4343

Merged
merged 1 commit into from
Oct 22, 2024
Merged

Improve task debugging. #4343

merged 1 commit into from
Oct 22, 2024

Conversation

jonathanmetzman
Copy link
Collaborator

Add an env var so we don't need to comment out code.

Add an env var so we don't need to comment out code.
@@ -285,8 +285,8 @@ def process_command_impl(task_name,
# A misconfiguration led to this point. Clean up the job if necessary.
# TODO(ochang): Remove the first part of this check once we migrate off the
# old untrusted worker architecture.
# Comment this "if" out to run a task locally.
if (not environment.is_trusted_host(ensure_connected=False) and
if (not environment.get_value('DEBUG_TASK') and
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: no need for parens here, since AND is commutative

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's for formatting.

@@ -285,8 +285,8 @@ def process_command_impl(task_name,
# A misconfiguration led to this point. Clean up the job if necessary.
# TODO(ochang): Remove the first part of this check once we migrate off the
# old untrusted worker architecture.
# Comment this "if" out to run a task locally.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What situation should I comment this in? I was able to run fuzz task locally without touching this

Copy link
Collaborator Author

@jonathanmetzman jonathanmetzman Oct 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do remember things hanging when running tasks on my own machine because of this block. I'll have to run it without this and find out.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that is indeed true. I take that back

Copy link
Collaborator

@vitorguidi vitorguidi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@jonathanmetzman jonathanmetzman merged commit 08ca600 into master Oct 22, 2024
7 checks passed
@jonathanmetzman jonathanmetzman deleted the localrun branch October 22, 2024 17:55
vitorguidi added a commit that referenced this pull request Nov 13, 2024
### Motivation

We currently lack awareness on how old builds are during fuzz task. This
PR implements that, by making the assumption that the Last Update Time
metadata field in GCS is a good proxy for build age. [Documentation
reference](https://cloud.google.com/storage/docs/json_api/v1/objects#resource)

### Approach

Symbolized and custom builds do not matter, thus all builds of interest
will be fetched from ```build_manager.setup_regular_build```. Logic for
collecting all bucket paths and the latest revision was refactored, so
that ```setup_regular_build``` can also figure out the latest revision
for a given build and conditionally emit the proposed metric.

### Testing strategy

!Todo: test this for fuzz, analyze, progression

Locally ran tasks, with instructions from #4343 and #4345 , and verified
the _emmit_build_age_metric function gets invoked and produces sane
output.

Commands used:
```
fuzz libFuzzer libfuzzer_asan_log4j2
```

![image](https://github.com/user-attachments/assets/66937297-20ec-44cf-925e-0004a905c92e)

```
progression 4992158360403968 libfuzzer_asan_qt
```

![image](https://github.com/user-attachments/assets/0e1f1199-d1d8-4da5-814e-8d8409d1f806)

```
analyze 4992158360403968 libfuzzer_asan_qt (disclaimer: build revision was overriden mid flight to force a trunk build, since this testcase was already tied to a crash revision)
```

![image](https://github.com/user-attachments/assets/dd3d5a60-36a1-4a9e-a21b-b72177ffdecd)


Part of #4271
vitorguidi added a commit that referenced this pull request Nov 21, 2024
### Motivation

We currently lack awareness on how old builds are during fuzz task. This
PR implements that, by making the assumption that the Last Update Time
metadata field in GCS is a good proxy for build age. [Documentation
reference](https://cloud.google.com/storage/docs/json_api/v1/objects#resource)

### Approach

Symbolized and custom builds do not matter, thus all builds of interest
will be fetched from ```build_manager.setup_regular_build```. Logic for
collecting all bucket paths and the latest revision was refactored, so
that ```setup_regular_build``` can also figure out the latest revision
for a given build and conditionally emit the proposed metric.

### Testing strategy

!Todo: test this for fuzz, analyze, progression

Locally ran tasks, with instructions from #4343 and #4345 , and verified
the _emmit_build_age_metric function gets invoked and produces sane
output.

Commands used:
```
fuzz libFuzzer libfuzzer_asan_log4j2
```

![image](https://github.com/user-attachments/assets/66937297-20ec-44cf-925e-0004a905c92e)

```
progression 4992158360403968 libfuzzer_asan_qt
```

![image](https://github.com/user-attachments/assets/0e1f1199-d1d8-4da5-814e-8d8409d1f806)

```
analyze 4992158360403968 libfuzzer_asan_qt (disclaimer: build revision was overriden mid flight to force a trunk build, since this testcase was already tied to a crash revision)
```

![image](https://github.com/user-attachments/assets/dd3d5a60-36a1-4a9e-a21b-b72177ffdecd)


Part of #4271
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants