-
Notifications
You must be signed in to change notification settings - Fork 54
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
fix: provide good default input for dnscheck and stunreachability #539
Conversation
This doesn't actually work as it crashes with the following stacktrace:
|
@hellais ouch, so I guess we gotta figure out why :-( |
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.
We need to figure out why it's crashing, so I'm using the "request changes" feature to signal that we're not quite done here yet.
@hellais I have fixed the way in which the code works and it should be okay now. Could you please test it? I am going to figure out why it was crashing after your initial diff and apply fixes/write tests as a follow up step. |
Dismissing my review since I introduced significant changes on the same branch :^)
I tested this branch and I can confirm that it's not crashing on the running of the test anymore. However the show command for both the stunreachability and the dnscheck tests is not working as expected. This is the output of a show command:
I believe the reason for it failing to do the lookup is that it's not passing the |
We're about to make the stun experiment a first class citizen of ooniprobe as part of the `ooniprobe run experimental` command. All ooniprobe tests require a URL as their input. So, make stun no exception and add require the `stun://` scheme now.
1. the input MUST now be an URL 2. there is no default input anymore See ooni/probe-cli#539
1. the input MUST now be an URL 2. there is no default input anymore See ooni/probe-cli#539
I still think I _may_ have broken oonimkall for stunreachability.
Yare yare daze
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.
Did a round of self code review
if err != nil { | ||
return nil, err | ||
} | ||
return ctl.BuildAndSetInputIdxMap(ctl.Probe.DB(), testlist) |
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.
Explanation of the changes in this file: DNSCheck
now has a lookupURLs
method that uses the engine's InputLoader
with the InputOrStaticDefault
policy. The end result is that we use --input
or --input-files
if they are provided. Otherwise, we fallback to a static input list defined in the engine.
} | ||
|
||
// Run starts the nettest. | ||
func (n DNSCheck) Run(ctl *Controller) error { | ||
builder, err := ctl.Session.NewExperimentBuilder("run") | ||
builder, err := ctl.Session.NewExperimentBuilder("dnscheck") |
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.
This two-lines change above is what we started from. Originally dnscheck
here used the engine's run
functionality to run tests with many options. Yet, we cannot do that easily. So, we fallback to running dnscheck
directly with the afore-mentioned "static input" mechanism.
urls = append(urls, url.URL) | ||
} | ||
c.inputIdxMap = urlIDMap | ||
return urls, nil |
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.
This function factors code that previously was Web-Connectivity specific. We now have a mechanism that all tests can use to configure their input so that it's stored into the inputs URL. Because the data model assumes an URL, this means we also changed stunreachability
to require URLs as input for consistency (you'll see this later).
} | ||
return ctl.BuildAndSetInputIdxMap(ctl.Probe.DB(), testlist) | ||
} | ||
|
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.
This diff is simular to the dnscheck
one. Also here we use the default static input if no input is provided.
internal/engine/inputloader.go
Outdated
// StaticBareInputForExperiment returns the list of strings an | ||
// experiment should use as static input. In case there is no | ||
// static input for this experiment, we return an error. | ||
func StaticBareInputForExperiment(name string) ([]string, error) { |
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.
This function is public because pkg/oonimkall
does not use InputLoader
directly for loading inputs. There is need to refactor how we run experiments on mobile. (やれやれ)
internal/ptx/snowflake.go
Outdated
"stun:stun.voipgate.com:3478", | ||
"stun:stun.voys.nl:3478", | ||
} | ||
return stuninput.AsSnowflakeInput() |
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.
Rather than having two static copies of STUN targets (one for snowflake and one for stunreachability), I have created a single package that keeps those copies.
} | ||
r.settings.Inputs = inputs | ||
default: | ||
r.settings.Inputs = append(r.settings.Inputs, "") |
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.
Ouch, these two lines are wrong, we should make the switch
exhaustive I think
The code in here is not ready yet. I think it starts to be clear that we need to improve testing a bit inside the |
The work mentioned in #539 (comment) has now been done in ooni/probe#1903. It's now time to resume work on this PR and land it at last! |
Conflicts: internal/engine/allexperiments.go pkg/oonimkall/internal/tasks/runner_integration_test.go pkg/oonimkall/taskrunner.go
Here we're refactoring stunreachability to not provide internally a default input and to take in input an URL rather than a string. The related ooni/spec change is ooni/spec#227. This diff has been extracted from #539. Because the original diff was large, I'm splitting it in a set of more easily manageable diffs. The reference issue is ooni/probe#1814, which is complex enough to require us to proceed incrementally. This diff WILL need to be backported to release/3.11.
We want stunreachability to use the same STUN servers used by snowflake, so let's start by making a common package holding the servers. Let's also use this new package in Snowflake. We're currently not using this package in stunreachability, but I am going to apply this as a subsequent diff. Reference issue: ooni/probe#1814. This issue is a bit complex to address in a single PR, so we are going to proceed incremntally. This diff was extracted from #539.
This commit introduces a new `InputLoader` policy by which, if no input is provided, we use a static default input list. We also modify the code to use this policy for dnscheck and stunreachability, with proper input. We also modify `miniooni` to pass the new `ExperimentName` field to the `InputLoader` to indicate which default input list to use. This diff is part of a set of diffs aiming at fixing ooni/probe#1814 and has been extracted from #539. What remains to be done, after this diff has landed is to ensure things also work for ooniprobe and oonimkall.
This commit introduces a new `InputLoader` policy by which, if no input is provided, we use a static default input list. We also modify the code to use this policy for dnscheck and stunreachability, with proper input. We also modify `miniooni` to pass the new `ExperimentName` field to the `InputLoader` to indicate which default input list to use. This diff is part of a set of diffs aiming at fixing ooni/probe#1814 and has been extracted from #539. What remains to be done, after this diff has landed is to ensure things also work for ooniprobe and oonimkall.
Conflicts: internal/engine/inputloader.go internal/engine/inputloader_test.go
This diff is part of ooni/probe#1814 and teaches `ooniprobe` to run dnscheck and stunreachability by using the default static input feature of the `InputLoader`. I've manually tested that we can still run `websites` like we did before (including category filtering). I've also manually tested that now we can run `experimental` and get parseable results for dnscheck and stunreachability. With this diff in, we have fixed the original problem highlighted in the ooni/probe#1814 issue. Yet, because of the way in which I solved the problem, there is more work to do. My changes have broken stunreachability for mobile and now it's time I apply fixes to make it work again. This diff was extracted from #539, which at this point only basically contains the remaining fixes to ensure we can run stunreachability on mobile. Co-authored-by: Arturo Filastò <arturo@filasto.net>
This diff is part of ooni/probe#1814 and teaches `ooniprobe` to run dnscheck and stunreachability by using the default static input feature of the `InputLoader`. I've manually tested that we can still run `websites` like we did before (including category filtering). I've also manually tested that now we can run `experimental` and get parseable results for dnscheck and stunreachability. With this diff in, we have fixed the original problem highlighted in the ooni/probe#1814 issue. Yet, because of the way in which I solved the problem, there is more work to do. My changes have broken stunreachability for mobile and now it's time I apply fixes to make it work again. This diff was extracted from #539, which at this point only basically contains the remaining fixes to ensure we can run stunreachability on mobile. Co-authored-by: Arturo Filastò <arturo@filasto.net> Co-authored-by: Arturo Filastò <arturo@filasto.net>
Previous work to make ooni/probe#1814 possible has broken running stunreachability on mobile. This diff repairs the blunder and allows to run any experiment using InputOrStaticDefault with oonimkall. Diff extracted from #539.
Previous work to make ooni/probe#1814 possible has broken running stunreachability on mobile. This diff repairs the blunder and allows to run any experiment using InputOrStaticDefault with oonimkall. Diff extracted from #539.
Conflicts: pkg/oonimkall/taskrunner.go
All the work that was part of this PR has been split into smaller patches and applied separately. We can close now. |
…URL (#630) Here we're refactoring stunreachability to not provide internally a default input and to take in input an URL rather than a string. The related ooni/spec change is ooni/spec#227. This diff has been extracted from #539. Because the original diff was large, I'm splitting it in a set of more easily manageable diffs. The reference issue is ooni/probe#1814, which is complex enough to require us to proceed incrementally. This diff WILL need to be backported to release/3.11.
We want stunreachability to use the same STUN servers used by snowflake, so let's start by making a common package holding the servers. Let's also use this new package in Snowflake. We're currently not using this package in stunreachability, but I am going to apply this as a subsequent diff. Reference issue: ooni/probe#1814. This issue is a bit complex to address in a single PR, so we are going to proceed incremntally. This diff was extracted from #539.
This commit introduces a new `InputLoader` policy by which, if no input is provided, we use a static default input list. We also modify the code to use this policy for dnscheck and stunreachability, with proper input. We also modify `miniooni` to pass the new `ExperimentName` field to the `InputLoader` to indicate which default input list to use. This diff is part of a set of diffs aiming at fixing ooni/probe#1814 and has been extracted from #539. What remains to be done, after this diff has landed is to ensure things also work for ooniprobe and oonimkall.
…nput (#633) This diff is part of ooni/probe#1814 and teaches `ooniprobe` to run dnscheck and stunreachability by using the default static input feature of the `InputLoader`. I've manually tested that we can still run `websites` like we did before (including category filtering). I've also manually tested that now we can run `experimental` and get parseable results for dnscheck and stunreachability. With this diff in, we have fixed the original problem highlighted in the ooni/probe#1814 issue. Yet, because of the way in which I solved the problem, there is more work to do. My changes have broken stunreachability for mobile and now it's time I apply fixes to make it work again. This diff was extracted from #539, which at this point only basically contains the remaining fixes to ensure we can run stunreachability on mobile. Co-authored-by: Arturo Filastò <arturo@filasto.net> Co-authored-by: Arturo Filastò <arturo@filasto.net>
…#634) Previous work to make ooni/probe#1814 possible has broken running stunreachability on mobile. This diff repairs the blunder and allows to run any experiment using InputOrStaticDefault with oonimkall. Diff extracted from #539.
* [backport] refactor(stunreachability): input required and must be an URL (#630) Here we're refactoring stunreachability to not provide internally a default input and to take in input an URL rather than a string. The related ooni/spec change is ooni/spec#227. This diff has been extracted from #539. Because the original diff was large, I'm splitting it in a set of more easily manageable diffs. The reference issue is ooni/probe#1814, which is complex enough to require us to proceed incrementally. This diff WILL need to be backported to release/3.11. * [backport] refactor: create common package for holding STUN input (#631) We want stunreachability to use the same STUN servers used by snowflake, so let's start by making a common package holding the servers. Let's also use this new package in Snowflake. We're currently not using this package in stunreachability, but I am going to apply this as a subsequent diff. Reference issue: ooni/probe#1814. This issue is a bit complex to address in a single PR, so we are going to proceed incremntally. This diff was extracted from #539. * [backport] refactor: introduce and use InputOrStaticDefault (#632) This commit introduces a new `InputLoader` policy by which, if no input is provided, we use a static default input list. We also modify the code to use this policy for dnscheck and stunreachability, with proper input. We also modify `miniooni` to pass the new `ExperimentName` field to the `InputLoader` to indicate which default input list to use. This diff is part of a set of diffs aiming at fixing ooni/probe#1814 and has been extracted from #539. What remains to be done, after this diff has landed is to ensure things also work for ooniprobe and oonimkall. * [backport] fix(ooniprobe): dnscheck,stunreachability run w/ default input (#633) This diff is part of ooni/probe#1814 and teaches `ooniprobe` to run dnscheck and stunreachability by using the default static input feature of the `InputLoader`. I've manually tested that we can still run `websites` like we did before (including category filtering). I've also manually tested that now we can run `experimental` and get parseable results for dnscheck and stunreachability. With this diff in, we have fixed the original problem highlighted in the ooni/probe#1814 issue. Yet, because of the way in which I solved the problem, there is more work to do. My changes have broken stunreachability for mobile and now it's time I apply fixes to make it work again. This diff was extracted from #539, which at this point only basically contains the remaining fixes to ensure we can run stunreachability on mobile. Co-authored-by: Arturo Filastò <arturo@filasto.net> Co-authored-by: Arturo Filastò <arturo@filasto.net> * [backport] fix(oonimkall): run tests with InputOrStaticDefault policy (#634) Previous work to make ooni/probe#1814 possible has broken running stunreachability on mobile. This diff repairs the blunder and allows to run any experiment using InputOrStaticDefault with oonimkall. Diff extracted from #539. Co-authored-by: Arturo Filastò <arturo@filasto.net>
Here we're refactoring stunreachability to not provide internally a default input and to take in input an URL rather than a string. The related ooni/spec change is ooni/spec#227. This diff has been extracted from ooni#539. Because the original diff was large, I'm splitting it in a set of more easily manageable diffs. The reference issue is ooni/probe#1814, which is complex enough to require us to proceed incrementally. This diff WILL need to be backported to release/3.11.
We want stunreachability to use the same STUN servers used by snowflake, so let's start by making a common package holding the servers. Let's also use this new package in Snowflake. We're currently not using this package in stunreachability, but I am going to apply this as a subsequent diff. Reference issue: ooni/probe#1814. This issue is a bit complex to address in a single PR, so we are going to proceed incremntally. This diff was extracted from ooni#539.
This commit introduces a new `InputLoader` policy by which, if no input is provided, we use a static default input list. We also modify the code to use this policy for dnscheck and stunreachability, with proper input. We also modify `miniooni` to pass the new `ExperimentName` field to the `InputLoader` to indicate which default input list to use. This diff is part of a set of diffs aiming at fixing ooni/probe#1814 and has been extracted from ooni#539. What remains to be done, after this diff has landed is to ensure things also work for ooniprobe and oonimkall.
) This diff is part of ooni/probe#1814 and teaches `ooniprobe` to run dnscheck and stunreachability by using the default static input feature of the `InputLoader`. I've manually tested that we can still run `websites` like we did before (including category filtering). I've also manually tested that now we can run `experimental` and get parseable results for dnscheck and stunreachability. With this diff in, we have fixed the original problem highlighted in the ooni/probe#1814 issue. Yet, because of the way in which I solved the problem, there is more work to do. My changes have broken stunreachability for mobile and now it's time I apply fixes to make it work again. This diff was extracted from ooni#539, which at this point only basically contains the remaining fixes to ensure we can run stunreachability on mobile. Co-authored-by: Arturo Filastò <arturo@filasto.net> Co-authored-by: Arturo Filastò <arturo@filasto.net>
Previous work to make ooni/probe#1814 possible has broken running stunreachability on mobile. This diff repairs the blunder and allows to run any experiment using InputOrStaticDefault with oonimkall. Diff extracted from ooni#539.
|
Checklist
Description
This diff aims to solve the problem that dnscheck and stunreachability are not easily runnable from
ooniprobe
. We started with a small diff, and then we needed to hammer other pieces of the codebase to make it WAI.This diff will need to be backported to the release/3.11 branch. (Also, this diff will work better when using the release/3.11 branch because ooni/probe#1816 and ooni/probe#1808 make the
master
branch not always ideal, but we started onmaster
and I'd say we merge onmaster
and then backport.)