-
Notifications
You must be signed in to change notification settings - Fork 143
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
torsf: testing on Android and Desktop #1917
Comments
Say you have built an experimental `oonimkall.aar` artifact from the `ooni/probe-cli` repo at whatever commit in whatever branch. Say you want to test such an artifact against the current `master` of the `ooni/probe-android` app. How do you achieve that? 1. copy `oonimkall.aar` inside `./engine-experimental`; 2. `./gradlew assembleExperimentalFullRelease` (remember to set `ANDROID_SDK_ROOT`); 3. locate the `apk` using `find` and then use `adb install` to install such an APK on your phone. I'm doing this work as part of ooni/probe#1917 to facilitate quickly testing of `torsf` and co-developing together the `probe-cli` and `probe-android` repositories.
Say you have built an experimental `oonimkall.aar` artifact from the `ooni/probe-cli` repo at whatever commit in whatever branch. Say you want to test such an artifact against the current `master` of the `ooni/probe-android` app. How do you achieve that? 1. copy `oonimkall.aar` inside `./engine-experimental`; 2. `./gradlew assembleExperimentalFullRelease` (remember to set `ANDROID_SDK_ROOT`); 3. locate the `apk` using `find` and then use `adb install` to install such an APK on your phone. I'm doing this work as part of ooni/probe#1917 to facilitate quickly testing of `torsf` and co-developing together the `probe-cli` and `probe-android` repositories.
This diff contains the following changes and enhancements: 1. upgrade snowflake to v2 2. observe that we were not changing defaults from outside of snowflake.go, so remove code allowing to do that; 3. bump the timeout to 600 seconds (it seems 300 was not always enough based on my testing); 4. add useful knob to disable `torsf` progress (it's really annoying on console, we should do something about this); 5. ptx.go: avoid printing an error when the connection has just been closed; 6. snowflake: test AMP cache, see that it's not working currently, so leave it disabled. Related issues: ooni/probe#1845, ooni/probe#1894, and ooni/probe#1917.
Reference issue: ooni/probe#1917
Reference issue: ooni/probe#1917. I needed to change the summary key type returned by `torsf` to be a value. It seems the DB layer assumes that. If we pass it a pointer, it panics because it's experiment a value rather than a pointer 🤷.
This commit message is the same across probe-cli, probe-desktop, and probe-android. With the changes contained in the enclosed diff, I'm starting to add support for torsf for android and for desktop. When smoke testing that torsf was WAI, I also noticed that its progress messages in output are too frequent. We may want to do better in a future version when we'll be able to read `tor`'s output. In the meanwhile, make the progress messages less frequent and indicated the maximum runtime inside of the messages themselves. This improved message, albeit not so nice from the UX PoV, should at least provide a clue that we're not stuck. Reference issue: ooni/probe#1917
This commit message is the same across probe-cli, probe-desktop, and probe-android. With the changes contained in the enclosed diff, I'm starting to add support for torsf for android and for desktop. When smoke testing that torsf was WAI, I also noticed that its progress messages in output are too frequent. We may want to do better in a future version when we'll be able to read `tor`'s output. In the meanwhile, make the progress messages less frequent and indicated the maximum runtime inside of the messages themselves. This improved message, albeit not so nice from the UX PoV, should at least provide a clue that we're not stuck. Reference issue: ooni/probe#1917
This commit message is the same across probe-cli, probe-desktop, and probe-android. With the changes contained in the enclosed diff, I'm starting to add support for torsf for android and for desktop. When smoke testing that torsf was WAI, I also noticed that its progress messages in output are too frequent. We may want to do better in a future version when we'll be able to read `tor`'s output. In the meanwhile, make the progress messages less frequent and indicated the maximum runtime inside of the messages themselves. This improved message, albeit not so nice from the UX PoV, should at least provide a clue that we're not stuck. Reference issue: ooni/probe#1917
This commit message is the same across probe-cli, probe-desktop, and probe-android. With the changes contained in the enclosed diff, I'm starting to add support for torsf for android and for desktop. When smoke testing that torsf was WAI, I also noticed that its progress messages in output are too frequent. We may want to do better in a future version when we'll be able to read `tor`'s output. In the meanwhile, make the progress messages less frequent and indicated the maximum runtime inside of the messages themselves. This improved message, albeit not so nice from the UX PoV, should at least provide a clue that we're not stuck. Reference issue: ooni/probe#1917
This version of the cli already includes support for torsf and it's safe to test using this version knowing that the release will consist of this version plus minor patches in case we found any defect during the QA. Reference issue: ooni/probe#1917
This version of the cli already includes support for torsf and it's safe to test using this version knowing that the release will consist of this version plus minor patches in case we found any defect during the QA. With this change in, we're able to make test releases of the Android app for the purpose of testing torsf. Reference issue: ooni/probe#1917
So, here's an update regarding Bootstrap time issuesThe main issue we've been facing so far has been the total time required to bootstrap We are confident that one of the main reasons why the bootstrap takes so much time is that we're bootstrapping Diff 1: don't bootstrap from scratchTherefore, the first alternative configuration to try is one in which we use a fixed directory for diff --git a/internal/engine/experiment/torsf/torsf.go b/internal/engine/experiment/torsf/torsf.go
index a96b466..6d1785b 100644
--- a/internal/engine/experiment/torsf/torsf.go
+++ b/internal/engine/experiment/torsf/torsf.go
@@ -122,7 +122,7 @@ func (m *Measurer) run(ctx context.Context,
tun, err := m.startTunnel()(ctx, &tunnel.Config{
Name: "tor",
Session: sess,
- TunnelDir: path.Join(sess.TempDir(), "torsf"),
+ TunnelDir: path.Join(sess.TunnelDir(), "torsf"),
Logger: sess.Logger(),
TorArgs: []string{
"UseBridges", "1",
diff --git a/internal/engine/mockable/mockable.go b/internal/engine/mockable/mockable.go
index 690a7c9..1893002 100644
--- a/internal/engine/mockable/mockable.go
+++ b/internal/engine/mockable/mockable.go
@@ -34,6 +34,7 @@ type Session struct {
MockableTempDir string
MockableTorArgs []string
MockableTorBinary string
+ MockableTunnelDir string
MockableUserAgent string
}
@@ -135,6 +136,11 @@ func (sess *Session) TorBinary() string {
return sess.MockableTorBinary
}
+// TunnelDir implements ExperimentSession.TunnelDir.
+func (sess *Session) TunnelDir() string {
+ return sess.MockableTunnelDir
+}
+
// UserAgent implements ExperimentSession.UserAgent
func (sess *Session) UserAgent() string {
return sess.MockableUserAgent
diff --git a/internal/engine/session.go b/internal/engine/session.go
index 4efb4bf..eea5978 100644
--- a/internal/engine/session.go
+++ b/internal/engine/session.go
@@ -98,6 +98,9 @@ type Session struct {
// tunnel is the optional tunnel that we may be using. It is created
// by NewSession and it is cleaned up by Close.
tunnel tunnel.Tunnel
+
+ // tunnelDir is the directory where to create state for persistent tunnels.
+ tunnelDir string
}
// sessionProbeServicesClientForCheckIn returns the probe services
@@ -163,6 +166,7 @@ func NewSession(ctx context.Context, config SessionConfig) (*Session, error) {
tempDir: tempDir,
torArgs: config.TorArgs,
torBinary: config.TorBinary,
+ tunnelDir: config.TunnelDir,
}
proxyURL := config.ProxyURL
if proxyURL != nil {
@@ -204,6 +208,11 @@ func NewSession(ctx context.Context, config SessionConfig) (*Session, error) {
return sess, nil
}
+// TunnelDir exports the directory for persistent tunnels.
+func (s *Session) TunnelDir() string {
+ return s.tunnelDir
+}
+
// KibiBytesReceived accounts for the KibiBytes received by the HTTP clients
// managed by this session so far, including experiments.
func (s *Session) KibiBytesReceived() float64 {
diff --git a/internal/model/experiment.go b/internal/model/experiment.go
index 44b71ea..1e8a8a3 100644
--- a/internal/model/experiment.go
+++ b/internal/model/experiment.go
@@ -23,6 +23,7 @@ type ExperimentSession interface {
TempDir() string
TorArgs() []string
TorBinary() string
+ TunnelDir() string
UserAgent() string
}
Diff 2: use the AMP cacheAnother different configuration could be that of using the AMP cache as opposed to the normal rendezvous with the broker (henceforth, "rendezvous"). We implement this change in diff --git a/internal/ptx/snowflake.go b/internal/ptx/snowflake.go
index bb6a913..190c4b2 100644
--- a/internal/ptx/snowflake.go
+++ b/internal/ptx/snowflake.go
@@ -83,18 +83,17 @@ func (d *SnowflakeDialer) ampCacheURL() string {
//
// So I disabled the AMP cache until we figure it out.
//
- //return "https://cdn.ampproject.org/"
- return ""
+ return "https://cdn.ampproject.org/"
}
// brokerURL returns a suitable broker URL.
func (d *SnowflakeDialer) brokerURL() string {
- return "https://snowflake-broker.torproject.net.global.prod.fastly.net/"
+ return "https://snowflake-broker.torproject.net/"
}
// frontDomain returns a suitable front domain.
func (d *SnowflakeDialer) frontDomain() string {
- return "cdn.sstatic.net"
+ return "www.google.com"
}
// iceAddresses returns suitable ICE addresses.
Diff 3: stop and retry during the testNo diff for now. This is another possible idea: if Summary of tests so farHere's the TL;DR regarding my tests so far. I repeated 40 runs of
I'm now running some tests on mobile. Here's what I learned so far. The default configuration ("rendezvous") has been working on and off with iOS, with 600 s of timeout. The default configuration has always timed out for me on Android, but the "rendezvous + cache" configuration completed the bootstrap in reasonable time on the first run (103 s - a number that seems comparable to desktop) and since then has been predictably bootstrapped in little time. How to run similar testsYou should clone To build It would be useful to test the current version of |
While there, ensure that we print a warning if we cannot find the correct tor binary. Work part of ooni/probe#1917.
While there, ensure that we print a warning if we cannot find the correct tor binary. Work part of ooni/probe#1917.
I repeated all the above-mentioned configurations multiple times (7-8) in my macOS system. Here's the TL;DR regarding my tests.
Also, before running the tests make sure tor is installed in the system. |
Here are the results of Android runs with the rendezvous configuration and 600s of timeout: 10/10 timeouts. Other three tests: I bumped the timeout to 900s. First time: success in 45 s. Second and this time: timeout. Here's the logcat from one of these tests. I think the following log line possibly means that
(Here's another logcat I collected earlier this week that shows the same "Delaying directory fetches" message.) I'm now going to run some tests with the
Here's a logcat of a working run in this configuration. |
Here's a different attempt: what if we wipe the cache every time but we still put the cache inside the same directory in which the application stores persistent data as opposed to using the temporary directory?
[*] The first test could probably already have a cache? I installed this build of the app just after removing the previous build that was keeping the cache, so I'm wondering if this could be the problem. |
I'm going to close this issue now. I did my best to summarize the questions for Snowflake devs in #2004 and the original body of work related to QA has been completed anyway. |
Here are the results of Android tests that I ran from India, with the rendezvous configuration and 600s of timeout.
|
This diff contains the following changes and enhancements: 1. upgrade snowflake to v2 2. observe that we were not changing defaults from outside of snowflake.go, so remove code allowing to do that; 3. bump the timeout to 600 seconds (it seems 300 was not always enough based on my testing); 4. add useful knob to disable `torsf` progress (it's really annoying on console, we should do something about this); 5. ptx.go: avoid printing an error when the connection has just been closed; 6. snowflake: test AMP cache, see that it's not working currently, so leave it disabled. Related issues: ooni/probe#1845, ooni/probe#1894, and ooni/probe#1917.
Reference issue: ooni/probe#1917. I needed to change the summary key type returned by `torsf` to be a value. It seems the DB layer assumes that. If we pass it a pointer, it panics because it's experiment a value rather than a pointer 🤷.
This commit message is the same across probe-cli, probe-desktop, and probe-android. With the changes contained in the enclosed diff, I'm starting to add support for torsf for android and for desktop. When smoke testing that torsf was WAI, I also noticed that its progress messages in output are too frequent. We may want to do better in a future version when we'll be able to read `tor`'s output. In the meanwhile, make the progress messages less frequent and indicated the maximum runtime inside of the messages themselves. This improved message, albeit not so nice from the UX PoV, should at least provide a clue that we're not stuck. Reference issue: ooni/probe#1917
While there, ensure that we print a warning if we cannot find the correct tor binary. Work part of ooni/probe#1917.
This issue is about performing QA of the
torsf
implementation on Desktop and mobile devices. We will close this issue when we have performed enough QA of the implementation to move forwardand release. If there are significant issues, we can also consider releasing. The original plan was to do enough QA until release but it emerged a need to chat with Snowflake devs as it seems it may not be the best use of the next release to release atorsf
only on some platforms rather than releasing it on all of themtorsf
that most often times out on mobile.After the work done in #1717, we want to test how the new experiment is working on mobile devices, as well as on Desktop devices. To this end, we need to integrate together a
cli
that knows abouttorsf
with a mobile app version and a Desktop version that knows about it.Executive summary
Just see #2004
The text was updated successfully, but these errors were encountered: