#2569 closed enhancement (fixed)

Magic-Folder: add status command-line tool

Reported by: dawuud Owned by: daira
Priority: normal Milestone: undecided
Component: code-frontend-magic-folder Version: 1.10.1
Keywords: status magic-folder Cc:
Launchpad Bug:

Description

We need a tool to display which files are currently syncing. User's will want to know when some local data is finished persisting to a remote grid. The status command could have many iterations. I am only interested in making a simple command-line tool that displays a list of files that are currently being synced... but perhaps this could in the future specify percentage synced per file... and have many other interfaces for different operating systems.

Attachments (1)

magic-status.png (59.0 KB) - added by meejah at 2015-11-17T00:42:22Z.
status

Download all attachments as: .zip

Change History (19)

comment:1 Changed at 2015-11-12T14:51:34Z by dawuud

i added the boiler plate for the status command... https://github.com/david415/tahoe-lafs/tree/2569.magic-status-cli.0 https://github.com/david415/tahoe-lafs/commit/aa40fd0c2f03b773de3380982521b9ac9a9505ec

perhaps the existing tahoe-lafs http api has enough power to create the status command? or perhaps we must create additional http "commands"?

comment:2 Changed at 2015-11-17T00:32:25Z by meejah

On https://github.com/meejah/tahoe-lafs/tree/2569.magic-status-cli.1 I have been working on this further. So far:

  • an IProgress API (modifieds IReadable also)
  • modified all IReadable things to use progress API properly
  • simple HTML status page
  • status page can emit JSON too
  • flesh out "tahoe magic-folder status" further to print information about local + remote DMDs and in-progress downloads

Note that the CLI adds a dependency on "humanize" currently, as it's awesome for printing out human-readable times, deltas, and file-sizes.

Changed at 2015-11-17T00:42:22Z by meejah

status

comment:4 Changed at 2015-11-17T18:39:45Z by meejah

Based on discussion during N&B today, I will add at least a token-based authentication to the status API to prove that you're a local client with access to the "private" area of your tahoe install (e.g. to prevent a malicious web request revealing filenames of shared items etc).

Similar to https://github.com/warner/petmail/blob/master/docs/steal_this_software.md#secure-all-http-frontend-access-tokens-event-channels

comment:5 Changed at 2015-11-18T13:27:55Z by dawuud

another divide by zero error fix here:

also... should we have another feature:

  • exit-on-sync!

this might be useful for writing bash scripts that need to perform an operation after the magic-folder is done syncing local or remote content. In this case the user would specify a time duration in which if no remote or local changes are observed then we exit... that is the status command exits... the tahoe gateway of course continues to run!

Version 1, edited at 2015-11-18T13:30:00Z by dawuud (previous) (next) (diff)

comment:6 Changed at 2015-11-18T16:33:10Z by meejah

There's also already a whole IUploadStatus and IDownloadStatus status-collecting interface. I haven't figured out how it works yet though, nor how to tie in magic-folder ... but I presume that's "the" way, rather than the pass-in-progress indicator I added?

comment:8 Changed at 2015-11-19T12:23:01Z by dawuud

my latest branch: https://github.com/david415/tahoe-lafs/tree/2569.magic-status-cli.2

fixes : https://tahoe-lafs.org/trac/tahoe-lafs/ticket/2577

it appears that status files in progress only display downloading files but not uploads. i think "in progress" is too vague and it should have two sections; downloads and uploads.

comment:9 Changed at 2015-11-19T16:39:17Z by meejah

Yes, I agree about the two sections.

Uploads don't work at all yet, really.

comment:10 Changed at 2015-12-03T20:46:39Z by daira

This is not a blocker for merging Magic Folder to trunk.

comment:11 Changed at 2015-12-07T15:47:37Z by meejah

Daira reviewed the diff to give a preliminary opinion on new progress interface etc; these are my notes from that (any errors are my fault):

  • look in collections for limited-length queue abstraction
  • 'deque' is the right abstraction for the down/up-load history
  • likes QueueItem? refactoring
  • just want PercentProgress? (and change interface to include set_progress_total())
  • @implementer -> implements (and/or when did zope.interface introduce decorator?)
  • there's some commented-out-code in downloader that should go to queue mixin
Last edited at 2015-12-07T15:48:06Z by meejah (previous) (diff)

comment:12 Changed at 2015-12-14T20:09:47Z by daira

deque has a maxlen parameter to its constructor:

If maxlen is not specified or is None, deques may grow to an arbitrary length. Otherwise, the deque is bounded to the specified maximum length. Once a bounded length deque is full, when new items are added, a corresponding number of items are discarded from the opposite end. Bounded length deques provide functionality similar to the tail filter in Unix. They are also useful for tracking transactions and other pools of data where only the most recent activity is of interest.

comment:13 Changed at 2015-12-14T20:19:57Z by daira

According to the changelog, zope.interface added @implementer in version 3.6.0. Tahoe already requires at least that version, so there is no compatibility problem. I've opened #2636 to switch to the new syntax everywhere.

comment:14 Changed at 2015-12-21T20:22:08Z by dawuud

what's the next step to resolve this ticket?

comment:15 Changed at 2016-01-01T00:35:42Z by daira

Sorry, I lost track of this. Are the issues from comment:11 resolved? It needs rebasing onto 2438.magic-folder-stable.8, also.

comment:17 Changed at 2016-01-28T15:39:23Z by meejah

2569.magic-status.3 can be reviewed

comment:18 Changed at 2016-02-11T15:08:30Z by daira

  • Resolution set to fixed
  • Status changed from new to closed

This is now on 2438.magic-folder-stable.12.

Note: See TracTickets for help on using tickets.