Commit Graph

211 Commits

Author SHA1 Message Date
Brian Warner
4e5b9ee63e introducer: move the relevant interfaces out to introducer/interfaces.py 2008-06-18 17:04:41 -07:00
Brian Warner
5289064dcf move FileTooLargeError out to a common location 2008-06-03 00:01:15 -07:00
Brian Warner
87c1e8e066 dirnode: add overwrite= to most API calls, defaulting to True. When False, this raises ExistingChildError rather than overwriting an existing child 2008-05-16 16:09:47 -07:00
Brian Warner
6c00a70dbc dirnode: add a deep_stats(), like deep-size but with more information. webish adds t=deeps-size too. 2008-05-08 13:21:14 -07:00
Zooko O'Whielacronx
c1184f51e4 docs: fix a few stale comments in code 2008-05-07 08:39:03 -07:00
Brian Warner
a379690b04 mutable: replace MutableFileNode API, update tests. Changed all callers to use overwrite(), but that will change soon 2008-04-17 17:51:38 -07:00
Brian Warner
a1670497a8 mutable WIP: add servermap update status pages 2008-04-16 19:05:41 -07:00
Brian Warner
1334a251ca remove size constraint on ShareData: large directories caused errors which triggered massive memory usage. See #379 for details 2008-04-11 22:51:54 -07:00
robk-tahoe
5578559b85 added offloaded key generation
this adds a new service to pre-generate RSA key pairs.  This allows
the expensive (i.e. slow) key generation to be placed into a process
outside the node, so that the node's reactor will not block when it
needs a key pair, but instead can retrieve them from a pool of already
generated key pairs in the key-generator service.

it adds a tahoe create-key-generator command which initialises an 
empty dir with a tahoe-key-generator.tac file which can then be run
via twistd.  it stashes its .pem and portnum for furl stability and
writes the furl of the key gen service to key_generator.furl, also
printing it to stdout.

by placing a key_generator.furl file into the nodes config directory
(e.g. ~/.tahoe) a node will attempt to connect to such a service, and
will use that when creating mutable files (i.e. directories) whenever
possible.  if the keygen service is unavailable, it will perform the
key generation locally instead, as before.
2008-04-01 18:45:13 -07:00
Zooko O'Whielacronx
fc3bd0c987 use added secret to protect convergent encryption
Now upload or encode methods take a required argument named "convergence" which can be either None, indicating no convergent encryption at all, or a string, which is the "added secret" to be mixed in to the content hash key.  If you want traditional convergent encryption behavior, set the added secret to be the empty string.

This patch also renames "content hash key" to "convergent encryption" in a argument names and variable names.  (A different and larger renaming is needed in order to clarify that Tahoe supports immutable files which are not encrypted content-hash-key a.k.a. convergent encryption.)

This patch also changes a few unit tests to use non-convergent encryption, because it doesn't matter for what they are testing and non-convergent encryption is slightly faster.
2008-03-24 09:46:06 -07:00
Brian Warner
2ef70ab814 mutable.py: split replace() into update() and overwrite(). Addresses #328. 2008-03-12 18:00:43 -07:00
Brian Warner
c21d30c320 client: publish a 'stub client' announcement to the introducer, to provide version/nickname information for each client 2008-03-11 19:20:10 -07:00
Brian Warner
10d3ea5045 increase remote-interface size limits to 16EiB by not casually using 'int' as a constraint 2008-03-11 10:50:31 -07:00
Brian Warner
ca1a1762e2 web: status: add 'started' timestamps to all operations 2008-03-04 18:50:44 -07:00
Brian Warner
68fbd89e66 webish: add primitive publish/retrieve status pages 2008-03-04 01:07:44 -07:00
Brian Warner
18eb00d136 webish: download-results: add per-server response times 2008-03-03 20:53:45 -07:00
Brian Warner
886ef22335 webish: download-results: add server_problems 2008-03-03 20:30:35 -07:00
Brian Warner
def910c391 webish download results: add servermap, decrypt time 2008-03-03 20:09:32 -07:00
Brian Warner
2b49605c51 webish: add 'download results', with some basic timing information 2008-03-03 19:19:21 -07:00
Brian Warner
c8e24f0904 webish: make upload timings visible on the recent uploads/downloads status page 2008-03-03 14:48:52 -07:00
Brian Warner
1a7651ce82 retain 10 most recent upload/download status objects, show them in /status . Prep for showing individual status objects 2008-02-29 22:19:03 -07:00
Zooko O'Whielacronx
99f006c584 wapi: add POST /uri/$DIRECTORY?t=set_children
Unfinished bits: doc in webapi.txt, test handling of badly formed JSON, return reasonable HTTP response, examination of the effect of this patch on code coverage -- but I'm committing it anyway because MikeB can use it and I'm being called to dinner...
2008-02-29 18:40:27 -07:00
Brian Warner
301dd3d489 webish status: distinguish active uploads/downloads from recent ones 2008-02-26 15:35:28 -07:00
Brian Warner
7927495cbe unicode handling: declare dirnodes to contain unicode child names, update webish to match 2008-02-14 15:45:56 -07:00
Brian Warner
e6af3b845c make current upload/download status objects available from the client 2008-02-12 15:39:45 -07:00
Brian Warner
94097affc3 add download-status objects, to track download progress 2008-02-12 15:38:39 -07:00
Brian Warner
d0ce8694c1 add upload-status objects, to track upload progress 2008-02-12 15:36:05 -07:00
Brian Warner
622c477e31 dirnode: add ctime/mtime to metadata, update metadata-modifying APIs. Needs more testing and sanity checking. 2008-02-08 18:43:47 -07:00
Brian Warner
81c5ceae16 upload: rework passing of default encoding parameters: move more responsibility into BaseUploadable 2008-02-06 18:39:03 -07:00
Brian Warner
6cd32c2f5c interfaces: remove spurious line that counted against the figleaf coverage 2008-02-06 16:41:26 -07:00
Brian Warner
124fb5ecdf add upload-results timing info for helper uploads. This changes the Helper protocol, and introduces a compatibility break 2008-02-06 01:52:25 -07:00
Brian Warner
66f33ee504 upload: return an UploadResults instance (with .uri) instead of just a URI 2008-02-05 21:01:38 -07:00
Brian Warner
d146ef7e09 webish: add extra introducer data (version, timestamps) to Welcome page 2008-02-05 17:32:27 -07:00
Brian Warner
daecca6589 big introducer refactoring: separate publish+subscribe. Addresses #271. 2008-02-05 13:05:13 -07:00
Brian Warner
a01f9ce9cc introducer: allow nodes to refrain from publishing themselves, by passing furl=None. This would be useful for clients who do not run storage servers. 2008-02-01 19:48:38 -07:00
robk-tahoe
e5487bbe21 stats: added IStatsProducer interface, fixed stats provider startup
this adds an interface, IStatsProducer, defining the get_stats() method
which the stats provider calls upon and registered producer, and made the
register_producer() method check that interface is implemented.

also refine the startup logic, so that the stats provider doesn't try and
connect out to the stats gatherer until after the node declares the tub
'ready'.  this is to address an issue whereby providers would attach to
the gatherer without providing a valid furl, and hence the gatherer would
be unable to determine the tubid of the connected client, leading to lost
samples.
2008-01-31 21:10:15 -07:00
robk-tahoe
7b9f3207d0 stats: add a simple stats gathering system
We have a desire to collect runtime statistics from multiple nodes primarily
for server monitoring purposes.   This implements a simple implementation of
such a system, as a skeleton to build more sophistication upon.

Each client now looks for a 'stats_gatherer.furl' config file.  If it has
been configured to use a stats gatherer, then it instantiates internally
a StatsProvider.  This is a central place for code which wishes to offer
stats up for monitoring to report them to, either by calling 
stats_provider.count('stat.name', value) to increment a counter, or by
registering a class as a stats producer with sp.register_producer(obj).

The StatsProvider connects to the StatsGatherer server and provides its
provider upon startup.  The StatsGatherer is then responsible for polling
the attached providers periodically to retrieve the data provided.
The provider queries each registered producer when the gatherer queries
the provider.  Both the internal 'counters' and the queried 'stats' are
then reported to the gatherer.

This provides a simple gatherer app, (c.f. make stats-gatherer-run)
which prints its furl and listens for incoming connections.  Once a
minute, the gatherer polls all connected providers, and writes the
retrieved data into a pickle file.

Also included is a munin plugin which knows how to read the gatherer's
stats.pickle and output data munin can interpret.  this plugin, 
tahoe-stats.py can be symlinked as multiple different names within
munin's 'plugins' directory, and inspects argv to determine which
data to display, doing a lookup in a table within that file.
It looks in the environment for 'statsfile' to determine the path to
the gatherer's stats.pickle.  An example plugins-conf.d file is
provided.
2008-01-30 20:11:07 -07:00
Brian Warner
22071c00e0 upload: oops, fix breakage after removing upload_file/upload_data/etc 2008-01-30 19:41:43 -07:00
Brian Warner
492cb92dc8 speedcheck: track SSK creation time separately 2008-01-29 20:44:32 -07:00
Brian Warner
46fe024612 offloaded uploader: don't use a huge amount of memory when skipping over previously-uploaded data 2008-01-24 17:25:33 -07:00
Brian Warner
e9307d3fda offloaded: close the local filehandle after encoding is done, otherwise windows fails 2008-01-17 01:52:33 -07:00
Brian Warner
51321944f0 megapatch: overhaul encoding_parameters handling: now it comes from the Uploadable, or the Client. Removed options= too. Also move helper towards resumability. 2008-01-16 03:03:35 -07:00
Brian Warner
a6ca98ac53 upload: add Encoder.abort(), to abandon the upload in progress. Add some debug hooks to enable unit tests. 2008-01-14 21:22:55 -07:00
Brian Warner
7ac2b94aba remove wait_for_numpeers and the when_enough_peers call in mutable.Publish 2008-01-14 14:55:59 -07:00
Brian Warner
964edadf44 offloaded: add a system test, make it pass. files are now being uploaded through the helper. 2008-01-11 05:42:55 -07:00
Brian Warner
6ac01fde4c offloaded: more test coverage on client side, change interfaces a bit 2008-01-11 04:53:37 -07:00
Brian Warner
e825406fc2 offloaded: move interfaces to interfaces.py, start implementing backend 2008-01-09 21:25:47 -07:00
Brian Warner
ea24864544 offloaded: more code, fix pyflakes problems, change IEncryptedUploader a bit 2008-01-09 17:58:47 -07:00
Brian Warner
9a8f68c41f dirnode: add set_uris() and set_nodes() (plural), to set multiple children at once. Use it to set up a new webapi test for issue #237. 2007-12-18 23:30:02 -07:00
Zooko O'Whielacronx
a5a54ac5ca remove the DirnodeURI foolscap schema and mv those regexes into uri.py
We currently do not pass dirnode uris over foolscap.
2007-12-18 17:44:24 -07:00
Zooko O'Whielacronx
9848d2043d make more precise regexp for WriteableSSKFileURI and DirnodeURI and use it in unit tests
Also allow an optional leading "http://127.0.0.1:8123/uri/".
Also fix a few unit tests to generate bogus Dirnode URIs of the modern form instead of the former form.
2007-12-18 13:15:08 -07:00
Brian Warner
f6b2072af1 check-speed: test SSK upload/download speed too. SDMF imposes a limit on the file sizes, no 10MB or 100MB test 2007-12-14 02:05:31 -07:00
Brian Warner
0dc84963f1 the wait_for_numpeers= argument to client.upload() is optional: make both the code and the Interface reflect this 2007-12-06 18:36:58 -07:00
Brian Warner
f190382d5e refactor web tests, and interfaces.IFileNode 2007-12-04 23:01:37 -07:00
Brian Warner
0f5ef5184d test_dirnode.py: obtain full coverage of dirnode.py 2007-12-04 14:32:04 -07:00
Zooko O'Whielacronx
59d6c3c822 decentralized directories: integration and testing
* use new decentralized directories everywhere instead of old centralized directories
 * provide UI to them through the web server
 * provide UI to them through the CLI
 * update unit tests to simulate decentralized mutable directories in order to test other components that rely on them
 * remove the notion of a "vdrive server" and a client thereof
 * remove the notion of a "public vdrive", which was a directory that was centrally published/subscribed automatically by the tahoe node (you can accomplish this manually by making a directory and posting the URL to it on your web site, for example)
 * add a notion of "wait_for_numpeers" when you need to publish data to peers, which is how many peers should be attached before you start.  The default is 1.
 * add __repr__ for filesystem nodes (note: these reprs contain a few bits of the secret key!)
 * fix a few bugs where we used to equate "mutable" with "not read-only".  Nowadays all directories are mutable, but some might be read-only (to you).
 * fix a few bugs where code wasn't aware of the new general-purpose metadata dict the comes with each filesystem edge
 * sundry fixes to unit tests to adjust to the new directories, e.g. don't assume that every share on disk belongs to a chk file.
2007-12-03 14:52:42 -07:00
Zooko O'Whielacronx
ae727a550a IMutableFileNode is a subtype of IFileNode
I'm not 100% sure that this is correct, but it looks reasonable, it passes unit
tests (although note that unit tests are currently not covering the new mutable
files very well), and it makes the "view JSON" link on a directory work instead
of raising an assertion error.
2007-11-10 16:37:18 -07:00
Brian Warner
be94960680 mutable: test roundtrip, make it work 2007-11-07 14:19:01 -07:00
Brian Warner
7e43c7b5f9 mutable: fix use of storage API 2007-11-06 18:53:34 -07:00
Brian Warner
c4f7412f1c stabilize on 20-byte nodeids everywhere, printed with foolscap's base32 2007-11-06 18:49:59 -07:00
Brian Warner
e08b091d9f storage: rewrite slot API, now use testv_and_readv_and_writev or readv 2007-11-05 20:17:14 -07:00
Brian Warner
8f21424449 storage: add readv_slots: get data from all shares 2007-11-05 00:37:01 -07:00
Brian Warner
516ce89a1e trailing-whitespace eradication, no functional changes 2007-11-01 15:33:47 -07:00
Brian Warner
f4946bc22e trailing-whitespace eradication, no functional changes 2007-11-01 15:22:57 -07:00
Brian Warner
1d8a4cdfe7 mutable: first pass at dirnodes, filenodes, new URIs. Some test coverage.
The URI typenames need revision, and only a few dirnode methods are
implemented. Filenodes are non-functional, but URI/key-management is in
place. There are a lot of classes with names like "NewDirectoryNode" that
will need to be rename once we decide what (if any) backwards compatibility
want to retain.
2007-11-01 15:15:29 -07:00
Brian Warner
fb3eddafdb move NotMutableError from dirnode.py into interfaces.py 2007-11-01 15:03:07 -07:00
Brian Warner
68d3d62002 mutable slots: finish up basic coding on server-side containers, add some tests. Remove all caching from MutableShareFile. 2007-10-31 00:10:40 -07:00
Brian Warner
b24c2925e8 checkpointing mutable-file work. Storage layer is 80% in place. 2007-10-30 19:47:36 -07:00
Brian Warner
046bda2b47 webish: add checker results and a 'Check' button to the web interface 2007-10-23 17:23:57 -07:00
Brian Warner
afca99c485 interfaces: clarify IChecker.checker_results_for a bit 2007-10-22 18:10:46 -07:00
Brian Warner
57f994fb02 checker: remember checker results, but only in ram for now 2007-10-22 17:46:24 -07:00
Brian Warner
9da1d70676 add a simple checker, for both files and directories 2007-10-15 16:16:39 -07:00
Zooko O'Whielacronx
426721f3f2 update a few documents, comments, and defaults to mention 3-of-10 instead of 25-of-100 2007-10-15 19:53:59 -07:00
Brian Warner
c301b41f50 control: add measure_peer_response_time(), to estimate RTT for the mesh 2007-09-26 12:21:15 -07:00
Brian Warner
d58d794757 check_speed: do both upload and download tests 2007-09-20 18:52:44 -07:00
Brian Warner
2632c0ad8c check_speed: upload multiple files, measure Ax+B 2007-09-20 16:55:33 -07:00
Brian Warner
b9d5a4ead4 check_speed.py: run two 1MB uploads and measure the time it takes 2007-09-19 18:40:18 -07:00
Zooko O'Whielacronx
09ff5af99c loosen constraint on share data size 2007-09-11 11:29:18 -07:00
Brian Warner
76be4a582c webish: implement 'PUT /uri?t=mkdir' (to create anonymous dirnodes) 2007-09-05 17:23:06 -07:00
wilcoxjg
33bae16ed2 created DirnodeURI schema 2007-08-28 23:28:26 -07:00
Brian Warner
2a63fe8b01 deletion phase3: add a sqlite database to track renew/cancel-lease secrets, implement renew/cancel_lease (but nobody calls them yet). Also, move the shares from BASEDIR/storage/* down to BASEDIR/storage/shares/* 2007-08-27 23:41:40 -07:00
Brian Warner
739ae1ccde deletion phase1: send renew/cancel-lease secrets, but my_secret is fake, and the StorageServer discards them 2007-08-27 17:28:51 -07:00
Brian Warner
fe06b3be8b dirnode: change the defined behavior of RIVirtualDriveServer.set to allow replace-in-place without raising an exception 2007-08-16 17:03:19 -07:00
Brian Warner
42dcc3088e IDirectoryNode: add has_child() method 2007-08-15 13:22:01 -07:00
Brian Warner
c3293f4f37 interfaces: move signatures into docstrings, to reduce lines of code and improve code-coverage numbers 2007-07-24 19:43:21 -07:00
Brian Warner
e6e9ddc588 refactor upload/encode, to split encrypt and encode responsibilities 2007-07-23 19:31:53 -07:00
Brian Warner
9c5ab89afe truncate storage index to 128 bits, since it's derived from a 128 bit AES key 2007-07-22 19:48:44 -07:00
Brian Warner
1d9a58977f uri: implement URI-processing classes, IFileURI/IDirnodeURI, use internally 2007-07-21 15:40:36 -07:00
Brian Warner
9af506900b upload: refactor to enable streaming upload. not all tests pass yet 2007-07-19 18:21:44 -07:00
Brian Warner
20c980d02b reduce MAX_SEGMENT_SIZE from 2MB to 1MB, to compensate for the large blocks that 3-of-10 produces 2007-07-16 13:48:34 -07:00
Brian Warner
5c08be170e interfaces: increase ShareSize now that our default k is smaller (hence blocks are bigger) 2007-07-13 19:29:31 -07:00
Brian Warner
1f8e407d9c more #85 work, system test still fails 2007-07-13 15:09:01 -07:00
Brian Warner
cd8648d39b storage: use one file per share instead of 7 (#85). work-in-progress, tests still fail 2007-07-13 14:04:49 -07:00
Brian Warner
b0c65ed232 note that setting k=1 is equivalent to replication 2007-07-12 16:22:12 -07:00
Brian Warner
5399395c27 allow the introducer to set default encoding parameters. Closes #84.
By writing something like "25 75 100" into a file named 'encoding_parameters'
in the central Introducer's base directory, all clients which use that
introducer will be advised to use 25-out-of-100 encoding for files (i.e.
100 shares will be produced, 25 are required to reconstruct, and the upload
process will be happy if it can find homes for at least 75 shares). The
default values are "3 7 10". For small meshes, the defaults are probably
good, but for larger ones it may be appropriate to increase the number of
shares.
2007-07-12 15:33:30 -07:00
Brian Warner
b62252183d interfaces.py: increase RIVirtualDriveServer.list constraint from 100 entries to 1000, for now 2007-07-12 13:23:52 -07:00
Brian Warner
dce1dc2730 storage: wrap buckets in a local proxy
This will make it easier to change RIBucketWriter in the future to reduce the wire
protocol to just open/write(offset,data)/close, and do all the structuring on the
client end. The ultimate goal is to store each bucket in a single file, to reduce
the considerable filesystem-quantization/inode overhead on the storage servers.
2007-07-08 23:27:46 -07:00
Brian Warner
a34040df99 interfaces: remove spurious 'self' from interface declarations 2007-07-06 19:39:47 -07:00
Brian Warner
9e42dda6a4 add IDirectoryNode.get_child_at_path 2007-07-06 19:38:37 -07:00
Brian Warner
c4a8db3eb2 webish: provide a valid Content-Length header on downloads 2007-07-03 15:09:00 -07:00