Ticket #1007 (closed enhancement: worksforme)

Opened 8 years ago

Last modified 7 years ago

Android-specific adaptions to Seattle

Reported by: albert Owned by: albert
Priority: minor Milestone:
Component: multiple components Version: 0.1t
Severity: Medium Keywords:
Cc: justinc, monzum, sportzer, florian.metzger@…, albert.rafetseder@… Blocking:
Blocked By:

Description (last modified by albert) (diff)

There are a few spots where Seattle doesn't quite work on Android at the moment (See wiki:SeattleOnAndroid for details, although I will remove the technicalities from there as we progress).

  • nix_common_api.py: ctypes.util.find_library fails because it  relies on tools not available here. A patch set is in the making solving this and other platform-specific peculiarities.
  • Custom installers. We need integration into the existing packager build script

To my mind, the Android-specific changes to Seattle should eventually be incorporated into the main release so that softwareupdater.py works transparently on all platforms.

Resolved issues:

  • Benchmark vs performance of device: Donating 10 percent of resources is probably too little for ten vessels to run even the smallest programs. Donating more will make Seattle drain the battery quickly. Could we donate only 2-3 vessels? -- Non-issue: The benchmark script does the right thing, see Justin's #comment:1 and my tests.
  • We have a native installer now, obsoleting the following items:
    • seattleinstaller.py: ostype==Linux and cputype==ARM6 make it think Android is a Nokia tablet, but registering for automatic startup doesn't work the same way
    • The installer will probably be different altogether, i.e. an Android Package (.apk file), with all associated headaches such as  more complicated building of customized installers
    • I think there is only one target script you can install through APK. A wrapper script is needed that decides whether to install, uninstall, or run the node manager.
    • start_seattle.sh et al. scripts using the shell or command-line tools: Unixoid /bin/sh is /system/bin/sh here. Android ps is close to useless for checking for running instances of nmmain.py.
    • Separate vessel directories from seattle/seattle_repy/. On Android, writable directories are non-executable (and the other way around). I don't know if this is a real problem, or only a matter of signalling a different base directory to the installer.

Postponed issues (we will solve those, but not now):

  • getruntime() and wallclock time discrepancy: Due to power saving measures, the clock speed varies on mobile devices. I had one issue where the wallclock time displayed by the phone and the runtime as seen by Seattle diverged. I'll check again with a more current ROM version. Cf. next two items, too!
  • Power savings. Some routines in Seattle include while not runnable(): sleep(0.01) and similarly tight loops. We could factor those constants out into a separate file, and use different (i.e. higher) values on mobile devices.
  • Power savings II. Android has "wakelocks" that programs can acquire to keep the device from going into lower-power operating modes. We might use them for our purposes, e.g. register one for nmmain to do its checks more efficiently (i.e. sleeping deep while not checking or running code). Down side, this involves major thinking about platform-specific code changes.

Change History

in reply to: ↑ description ; follow-up: ↓ 3   Changed 8 years ago by justinc

Replying to albert:

* Benchmark vs performance of device: Donating 10 percent of resources is probably too little for ten vessels to run even the smallest programs. Donating more will make Seattle drain the battery quickly. Could we donate only 2-3 vessels?

SeattleGENI will stop trying to split things if there isn't a large enough quantity left. Therefore, you won't get 10 vessels out of your 10% on Android. I would be surprised if it can even get two usable vessels given a 10% donation.

Can you see what happens when running a phone connected to SeattleGENI? In particular, what are the resulting vessels?

  Changed 8 years ago by justinc

  • cc justinc, monzum, sportzer added; justinc@… removed
  • owner set to justinc
  • component changed from - to multiple components

in reply to: ↑ 1   Changed 8 years ago by albert

There are two vessel directories after installing and running the node manager, one for what I think is a usable vessel (v1) and one for nodemanager/softwareupdater (v2). You can check yourselves by sshing into the device. Seattle is installed in /data/data/edu.washington.cs.seattle/seattle/seattle_repy. We tried to connect to v1 using experimentlib, but it didn't work (probably our fault). Here is what the installer logged after benchmarking:

Total resources measured by the script for Linux OS: {'diskused': 180391936L, 'fileread': 62001, 'filewrite': 62001, 'loopsend': None, 'lograte': None, 'netrecv': None, 'random': 60787, 'insockets': 341, 'filesopened': 341, 'looprecv': None, 'cpu': 'cpu cores data not found', 'memory': 430520000L, 'netsend': None, 'outsockets': 341, 'events': None}
Benchmark failed for cpu resource: cpu cores data not found
Installation continued by user. Default values are being used for failed benchmarks.
Final checked resources that we will use: {'diskused': 180391936, 'fileread': 62001, 'filewrite': 62001, 'loopsend': 50000000, 'lograte': 1500000, 'netrecv': 500000, 'random': 60787, 'insockets': 341, 'filesopened': 341, 'looprecv': 50000000, 'cpu': 1, 'memory': 430520000, 'netsend': 500000, 'outsockets': 341, 'events': 500}
User intended to donate :10 percent.
Donated resources:{'diskused': 18039193, 'fileread': 6200, 'loopsend': 5000000, 'lograte': 150000, 'netrecv': 50000, 'random': 6078, 'insockets': 34, 'filewrite': 6200, 'looprecv': 5000000, 'filesopened': 34, 'memory': 43052000, 'netsend': 50000, 'events': 500, 'outsockets': 34, 'cpu': 0.10000000000000001}
Ten percent of the donatedresources (offcut costs removed already): {'diskused': 1783919, 'fileread': 460, 'loopsend': 500000, 'lograte': 14980, 'netrecv': 5000, 'random': 607, 'insockets': 3, 'filewrite': 460, 'looprecv': 500000, 'filesopened': 3, 'memory': 4105200, 'netsend': 5000, 'cpu': 0.0096000000000000009, 'outsockets': 3, 'events': 49}

  Changed 8 years ago by albert

  • description modified (diff)

  Changed 8 years ago by albert

  • description modified (diff)

  Changed 7 years ago by albert

  • cc albert.rafetseder@… added
  • description modified (diff)

  Changed 7 years ago by justinc

  • owner changed from justinc to albert
  • status changed from new to assigned

You're doing most of the heavy lifting so I'll punt the ticket over too.

  Changed 7 years ago by justinc

  • status changed from assigned to closed
  • resolution set to worksforme

I think this has all been fixed given our Android push...

Note: See TracTickets for help on using tickets.