For geckoview browser apps startup use local configuration file instead of command line args
Categories
(Testing :: Raptor, task, P1)
Tracking
(firefox70 fixed)
Tracking | Status | |
---|---|---|
firefox70 | --- | fixed |
People
(Reporter: rwood, Assigned: rwood)
References
Details
Attachments
(1 file, 1 obsolete file)
Long story short, Bug 1533385 added support for setting geckoview browser prefs/env vars using a local on-device config file. The current method of using the command line arg/intent to pass in the profile [0] will be made obsolete.
This blocks [1] so we should make this Raptor change soon.
Comment 1•6 years ago
|
||
Assignee | ||
Comment 2•6 years ago
|
||
From https://hg.mozilla.org/integration/autoland/rev/b978367ef7bb:
The configuration file format is YAML and looks like:
prefs:
foo.bar.boolean: true
foo.bar.string: "string"
foo.bar.int: 500
env:
MOZ_LOG: nsHttp:5
args: [--marionette]
By default, if the consuming App is debuggable, GeckoView will read
configuration from /data/local/tmp/$PACKAGE-geckoview-config.yaml
at
startup.
Assignee | ||
Comment 3•6 years ago
•
|
||
I have this working locally now on my GP2 with the geckoview example app. Raptor writes this on the device:
walleye:/data/local/tmp # cat org.mozilla.geckoview_example-geckoview-config.yaml
args:
- --profile
- /sdcard/raptor/profile
- use_multiprocess
- true
env:
LOG_VERBOSE: 1
R_LOG_LEVEL: 6
walleye:/data/local/tmp #
Assignee | ||
Comment 4•6 years ago
|
||
Assignee | ||
Comment 5•6 years ago
|
||
Assignee | ||
Comment 6•6 years ago
|
||
05-23 13:40:26.518 20967 20967 I GeckoRuntime: Adding debug configuration from: /data/local/tmp/org.mozilla.geckoview_example-geckoview-config.yaml
05-23 13:40:26.518 20967 20967 D GeckoDebugConfig: Adding environment variables from debug config: {LOG_VERBOSE=1, R_LOG_LEVEL=6}
05-23 13:40:26.518 20967 20967 D GeckoDebugConfig: Adding arguments from debug config: [--profile, /sdcard/raptor/profile, use_multiprocess, true]
05-23 13:40:26.518 20967 20967 D GeckoThread: State changed to LAUNCHED
Assignee | ||
Comment 7•6 years ago
|
||
Also try push with update (added unit test) and jobs for reference browser and fenix:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=7d3c5f5405386e5b4a2c066844156c0b162f5bde
Assignee | ||
Comment 8•6 years ago
|
||
(In reply to Robert Wood [:rwood] from comment #7)
Also try push with update (added unit test) and jobs for reference browser and fenix:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=7d3c5f5405386e5b4a2c066844156c0b162f5bde
Looks like the *-config.yaml is not being picked up by reference browser or fenix. The file is being written (i.e. for Fenix):
3:47:10 INFO - raptor-utils writing {'args': ['--profile', '/sdcard/raptor/profile', 'use_multiprocess', True], 'env': {'R_LOG_LEVEL': 6, 'LOG_VERBOSE': 1}} to /tmp/tmp72nyCD/org.mozilla.fenix.raptor-geckoview-config.yaml
03:47:10 INFO - raptor-main copying /tmp/tmp72nyCD/org.mozilla.fenix.raptor-geckoview-config.yaml to device: data/local/tmp/org.mozilla.fenix.raptor-geckoview-config.yaml
03:47:10 INFO - adb command_output: adb -s HT7B21A02889 wait-for-device push /tmp/tmp72nyCD/org.mozilla.fenix.raptor-geckoview-config.yaml data/local/tmp/org.mozilla.fenix.raptor-geckoview-config.yaml, timeout: None, timedout: None, exitcode: 0, output: /tmp/tmp72nyCD/org.mozilla.fenix.raptor-geckoview-config.yaml: 1 file pushed. 0.0 MB/s (108 bytes in 0.004s)
:nalexander, :csadilek, any ideas why this isn't working for Fenix and Reference browser? It works great for geckoview example. Maybe I need a different config.yaml filename for those apps? Thanks!
Comment 9•6 years ago
|
||
(In reply to Robert Wood [:rwood] from comment #8)
(In reply to Robert Wood [:rwood] from comment #7)
Also try push with update (added unit test) and jobs for reference browser and fenix:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=7d3c5f5405386e5b4a2c066844156c0b162f5bde
Looks like the *-config.yaml is not being picked up by reference browser or fenix. The file is being written (i.e. for Fenix):
3:47:10 INFO - raptor-utils writing {'args': ['--profile', '/sdcard/raptor/profile', 'use_multiprocess', True], 'env': {'R_LOG_LEVEL': 6, 'LOG_VERBOSE': 1}} to /tmp/tmp72nyCD/org.mozilla.fenix.raptor-geckoview-config.yaml
03:47:10 INFO - raptor-main copying /tmp/tmp72nyCD/org.mozilla.fenix.raptor-geckoview-config.yaml to device: data/local/tmp/org.mozilla.fenix.raptor-geckoview-config.yaml
03:47:10 INFO - adb command_output: adb -s HT7B21A02889 wait-for-device push /tmp/tmp72nyCD/org.mozilla.fenix.raptor-geckoview-config.yaml data/local/tmp/org.mozilla.fenix.raptor-geckoview-config.yaml, timeout: None, timedout: None, exitcode: 0, output: /tmp/tmp72nyCD/org.mozilla.fenix.raptor-geckoview-config.yaml: 1 file pushed. 0.0 MB/s (108 bytes in 0.004s):nalexander, :csadilek, any ideas why this isn't working for Fenix and Reference browser? It works great for geckoview example. Maybe I need a different config.yaml filename for those apps? Thanks!
Yes -- the Raptor APKs (and presumably the r-b APKs) are release builds, which don't read the configuration by default. See https://mozilla.github.io/geckoview/tutorials/automation.html#enabling-reading-configuration-from-a-file-for-release-builds. However, what we really want is Bug 1554256, which is how I envisioned addressing this but have not yet gotten to.
Comment 10•6 years ago
|
||
Clearing NI for both of us.
Assignee | ||
Comment 11•5 years ago
|
||
Updated•5 years ago
|
Assignee | ||
Comment 12•5 years ago
|
||
Assignee | ||
Comment 13•5 years ago
|
||
Assignee | ||
Comment 14•5 years ago
|
||
Assignee | ||
Comment 15•5 years ago
|
||
Assignee | ||
Comment 16•5 years ago
|
||
With the addition of setting the debug-app flag (so release apk's will read the config.yml):
https://treeherder.mozilla.org/#/jobs?repo=try&revision=5d2267dc00077888288a457fbbdf22f3d944f43b
Assignee | ||
Comment 17•5 years ago
|
||
Working on gve, fennec, and refbrow, but for some reason not fenix:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=5d2267dc00077888288a457fbbdf22f3d944f43b
Assignee | ||
Comment 18•5 years ago
|
||
Hey Christian,
So using the config.yaml file on android works for geckoview example and reference browser, but doesn't work for fenix. Would you mind having a quick look at my patch? As far as I can tell I am writing the file correctly. Here is a sample log out put from my latest try run [0] (the file is written but when starting Fenix it's not picking up the config.yaml settings so Raptor times out):
09:28:25 INFO - raptor-utils Info: writing {'args': ['--profile', '/sdcard/raptor/profile', 'use_multiprocess', True], 'env': {'R_LOG_LEVEL': 6, 'LOG_VERBOSE': 1}} to /tmp/tmpZcYeBq/org.mozilla.fenix.performancetest-geckoview-config.yaml
09:28:25 INFO - raptor-main Info: copying /tmp/tmpZcYeBq/org.mozilla.fenix.performancetest-geckoview-config.yaml to device: data/local/tmp/org.mozilla.fenix.performancetest-geckoview-config.yaml
09:28:25 INFO - adb shell_output: adb -s HT7AT1A01275 wait-for-device shell rm -r data/local/tmp/org.mozilla.fenix.performancetest-geckoview-config.yaml; echo adb_returncode=$?, timeout: None, root: False, timedout: None, exitcode: 0, output:
09:28:26 INFO - adb command_output: adb -s HT7AT1A01275 wait-for-device push /tmp/tmpZcYeBq/org.mozilla.fenix.performancetest-geckoview-config.yaml data/local/tmp/org.mozilla.fenix.performancetest-geckoview-config.yaml, timeout: None, timedout: None, exitcode: 0, output: /tmp/tmpZcYeBq/org.mozilla.fenix.performancetest-geckoview-config.yaml: 1 file pushed. 0.1 MB/s (108 bytes in 0.002s)
09:28:26 INFO - adb chmod: path=data/local/tmp/org.mozilla.fenix.performancetest-geckoview-config.yaml, recursive=True, mask=777, root=True
09:28:26 INFO - adb shell_output: adb -s HT7AT1A01275 wait-for-device shell su -c "chmod -R 777 data/local/tmp/org.mozilla.fenix.performancetest-geckoview-config.yaml"; echo adb_returncode=$?, timeout: None, root: True, timedout: None, exitcode: 0, output:
09:28:26 INFO - raptor-main Info: starting fenix
09:28:26 INFO - adb shell_output: adb -s HT7AT1A01275 wait-for-device shell am force-stop org.mozilla.fenix.performancetest; echo adb_returncode=$?, timeout: None, root: False, timedout: None, exitcode: 0, output:
09:28:26 INFO - adb Granting important runtime permissions to org.mozilla.fenix.performancetest
09:28:26 INFO - adb shell_output: adb -s HT7AT1A01275 wait-for-device shell pm grant org.mozilla.fenix.performancetest android.permission.WRITE_EXTERNAL_STORAGE; echo adb_returncode=$?, timeout: None, root: False, timedout: None, exitcode: 0, output:
09:28:27 INFO - adb shell_output: adb -s HT7AT1A01275 wait-for-device shell pm grant org.mozilla.fenix.performancetest android.permission.READ_EXTERNAL_STORAGE; echo adb_returncode=$?, timeout: None, root: False, timedout: None, exitcode: 0, output:
09:28:27 [taskcluster:error] Aborting task...
[0] https://treeherder.mozilla.org/#/jobs?repo=try&revision=95aae805307201b0c6e1c219fa8e0a5866fe0798
Comment 19•5 years ago
|
||
(In reply to Robert Wood [:rwood] from comment #18)
Hey Christian,
So using the config.yaml file on android works for geckoview example and reference browser, but doesn't work for fenix. Would you mind having a quick look at my patch? As far as I can tell I am writing the file correctly. Here is a sample log out put from my latest try run [0] (the file is written but when starting Fenix it's not picking up the config.yaml settings so Raptor times out):
09:28:25 INFO - raptor-utils Info: writing {'args': ['--profile', '/sdcard/raptor/profile', 'use_multiprocess', True], 'env': {'R_LOG_LEVEL': 6, 'LOG_VERBOSE': 1}} to /tmp/tmpZcYeBq/org.mozilla.fenix.performancetest-geckoview-config.yaml
09:28:25 INFO - raptor-main Info: copying /tmp/tmpZcYeBq/org.mozilla.fenix.performancetest-geckoview-config.yaml to device: data/local/tmp/org.mozilla.fenix.performancetest-geckoview-config.yaml
09:28:25 INFO - adb shell_output: adb -s HT7AT1A01275 wait-for-device shell rm -r data/local/tmp/org.mozilla.fenix.performancetest-geckoview-config.yaml; echo adb_returncode=$?, timeout: None, root: False, timedout: None, exitcode: 0, output:
09:28:26 INFO - adb command_output: adb -s HT7AT1A01275 wait-for-device push /tmp/tmpZcYeBq/org.mozilla.fenix.performancetest-geckoview-config.yaml data/local/tmp/org.mozilla.fenix.performancetest-geckoview-config.yaml, timeout: None, timedout: None, exitcode: 0, output: /tmp/tmpZcYeBq/org.mozilla.fenix.performancetest-geckoview-config.yaml: 1 file pushed. 0.1 MB/s (108 bytes in 0.002s)
09:28:26 INFO - adb chmod: path=data/local/tmp/org.mozilla.fenix.performancetest-geckoview-config.yaml, recursive=True, mask=777, root=True
09:28:26 INFO - adb shell_output: adb -s HT7AT1A01275 wait-for-device shell su -c "chmod -R 777 data/local/tmp/org.mozilla.fenix.performancetest-geckoview-config.yaml"; echo adb_returncode=$?, timeout: None, root: True, timedout: None, exitcode: 0, output:
09:28:26 INFO - raptor-main Info: starting fenix
09:28:26 INFO - adb shell_output: adb -s HT7AT1A01275 wait-for-device shell am force-stop org.mozilla.fenix.performancetest; echo adb_returncode=$?, timeout: None, root: False, timedout: None, exitcode: 0, output:
09:28:26 INFO - adb Granting important runtime permissions to org.mozilla.fenix.performancetest
09:28:26 INFO - adb shell_output: adb -s HT7AT1A01275 wait-for-device shell pm grant org.mozilla.fenix.performancetest android.permission.WRITE_EXTERNAL_STORAGE; echo adb_returncode=$?, timeout: None, root: False, timedout: None, exitcode: 0, output:
09:28:27 INFO - adb shell_output: adb -s HT7AT1A01275 wait-for-device shell pm grant org.mozilla.fenix.performancetest android.permission.READ_EXTERNAL_STORAGE; echo adb_returncode=$?, timeout: None, root: False, timedout: None, exitcode: 0, output:
09:28:27 [taskcluster:error] Aborting task...[0] https://treeherder.mozilla.org/#/jobs?repo=try&revision=95aae805307201b0c6e1c219fa8e0a5866fe0798
I expected this to be Bug 1554256, but I fetched the APK and it is debuggable.
So my next guess is that you're running a Fenix built against GeckoView 68 (beta), but even that is supposed to have Bug 1533385 applied.
So my guess after that is there's a legit bug here, which will be best diagnosed by substituting a local GeckoView into Fenix; or that the missing leading slash in these commands actually matters:
09:28:26 INFO - adb command_output: adb -s HT7AT1A01275 wait-for-device push /tmp/tmpZcYeBq/org.mozilla.fenix.performancetest-geckoview-config.yaml data/local/tmp/org.mozilla.fenix.performancetest-geckoview-config.yaml, timeout: None, timedout: None, exitcode: 0, output: /tmp/tmpZcYeBq/org.mozilla.fenix.performancetest-geckoview-config.yaml: 1 file pushed. 0.1 MB/s (108 bytes in 0.002s)
(Note the data/...
.) Is the file in the correct place? If you edit the /data/local/tmp/...
file manually, does it work?
Assignee | ||
Comment 20•5 years ago
|
||
Thanks. No adding the forward-slash to the path doesn't help. On the device the config.yaml exists (in the same folder / along-side the *-config.yamls that worked with geckoview and refbrow). Here's the contents of the fenix one (same as the others):
walleye:/data/local/tmp # ls
org.mozilla.fenix.performancetest-geckoview-config.yaml
walleye:/data/local/tmp # cat org.mozilla.fenix.performancetest-geckoview-config.yaml
args:
- --profile
- /sdcard/raptor/profile
- use_multiprocess
- true
env:
LOG_VERBOSE: 1
R_LOG_LEVEL: 6
walleye:/data/local/tmp #
Comment 21•5 years ago
|
||
Nick, Rob,
Proguard strikes again! The reason this doesn't work in Fenix is that org.mozilla.gecko.util.DebugConfig
gets optimized away. When parsing the .yaml file we get a java.lang.InstantiationException
for this class.
I'll put up a PR with an exclusion rule shortly.
Comment 22•5 years ago
|
||
Here's a Fenix PR that fixes the problem: https://github.com/mozilla-mobile/fenix/pull/3911
Assignee | ||
Comment 23•5 years ago
|
||
Another try push after the Fenix PR was merged:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=a55f143a73c803675a4e2cd9c6176051ef2805df
Assignee | ||
Comment 24•5 years ago
|
||
Updated. Changed fenix activity name as the org.mozilla.fenix.browser.BrowserPerformanceTestActivity
will eventually be removed now that moving to on-device config.yaml. Mozbase adb.py requires an activity name, so using org.mozilla.fenix.IntentReceiverActivity
so don't need to change the mozharness/mozdevice module).
https://treeherder.mozilla.org/#/jobs?repo=try&revision=17e5e3cc024fd42747ce8aad659bb5612e2478ca
Assignee | ||
Comment 25•5 years ago
|
||
After updates (thanks for the review :sparky!):
https://treeherder.mozilla.org/#/jobs?repo=try&revision=6b567499f0836f2a5ad92e007511d7dffea40d77
Assignee | ||
Comment 26•5 years ago
|
||
Try run in comment 25 is still queued up on android (except for the power jobs which are green); here's another in case the remaining jobs time out:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=76a3752305d6f8a2fd26bae1de5068c022a7d3e0
Assignee | ||
Comment 27•5 years ago
|
||
Try run in comment 26 timed out; new try run:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=2d38de4723b5cc5c5a3fb8d876f8cdbc11fb2fbf
Assignee | ||
Comment 28•5 years ago
|
||
Try run in comment 27 is still pending, here's another in case ^ times out:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=0a9851a13008b344ef71eb06b3bcd8112d309110
Assignee | ||
Comment 29•5 years ago
|
||
Comment 28 run pending, here's another back-up one:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=91f526e124e805cdc04adcf7a70cf196f2095e64
Comment 30•5 years ago
|
||
Comment 31•5 years ago
|
||
bugherder |
Description
•