Commit Graph

3589 Commits

Author SHA1 Message Date
Brian Warner
ea473cdc76 remove pickle-based stats output altogether
* update munin plugin to read JSON, not pickle
* update docs
2016-04-27 17:27:33 -07:00
Corbin Simpson
e1dba4abeb stats: Dump a JSON file next to the pickle file.
Extremely useful for interoperating with non-Python (e.g. Monte) tooling.
2016-04-27 14:45:37 -07:00
Brian Warner
96c625920c Teach tub to start synchronously even with ip autodetect
* remove when_tub_ready() from all code
* synchronous-ify all node/client/introducer startup code

refs ticket:2491
2016-04-26 21:54:45 -07:00
Brian Warner
ffc2f48cfe compute tub location before creating Tub
This can be done synchronously because we now know the port number
earlier. This still uses get_local_addresses_sync() (not _async) to do
automatic IP-address detection if the config file didn't set
tub.location or used the special word "AUTO" in it.

The new implementation slightly changes the mapping from tub.location to
the assigned location string. The old code removed all instances of
"AUTO" from the location and then extended the hints with the local
ones (so "hint1:AUTO:hint2" turns into "hint1:hint2:auto1:auto2"). The
new code exactly replaces each "AUTO" with the local hints (so that
example turns into "hint1:auto1:auto2:hint2", and a silly
"hint1:AUTO:AUTO" would turn into "hint1:auto1:auto2:auto1:auto2"). This
is unlikely to affect anybody.
2016-04-26 18:39:47 -07:00
Brian Warner
bdf1f8460d iputil.py: expose get_local_addresses_sync 2016-04-26 18:39:47 -07:00
Brian Warner
cf5b02b487 clean up tub.port processing, reject tcp:0
This is the first step towards making node startup be synchronous: the
tub.port is entirely determined (including any TCP port allocation that
might be necessary) before creating the Tub, so the portnumber part of
FURLs can be determined earlier.
2016-04-26 18:39:47 -07:00
Brian Warner
7637d70f1b test_introducer.ClientSeqnums: disable storage
This test was depending upon the storage announcement happening *after*
startup, but the upcoming synchronous-Tub-startup change will modify the
ordering. Fix it in both cases by disabling storage in the client being
tested.
2016-04-26 18:39:47 -07:00
Brian Warner
1f6c04518e Client: init_helper() must run after init_client()
This has worked so far because everything waited for the Tub to be
ready. We'll soon be making Tub setup synchronous, so we won't have to
wait anymore, so the order will matter.
2016-04-26 18:35:03 -07:00
Brian Warner
62d847663c Revert "test/common: add a slight stall in tearDown"
This reverts commit bb7184163e.

We changed test_runner.BinTahoe.run_bintahoe since this commit landed:
the new version can no longer cause the test to be skipped late (we've
gotten rid of the bin/tahoe script entirely, so it's no longer possible
for us to miss it). Hence I think we don't need this unsightly stall any
longer.
2016-04-26 14:18:40 -07:00
Brian Warner
17cd487dc8 bump Twisted dependency to 16.1.0
closes ticket:2781
2016-04-26 13:56:08 -07:00
Brian Warner
e9e12653f8 SystemTestMixin: don't auto-detect IP addresses
The tubs created for test_system should always use 127.0.0.1 .

refs ticket:2491
2016-04-26 13:55:59 -07:00
Brian Warner
6dfcd52b06 iputil.py: copy allocate_tcp_port() from foolscap
refs ticket:2491
2016-04-26 13:55:51 -07:00
meejah
b834b71dac Change API to a listener-style, with helper 2016-04-26 13:40:02 -06:00
meejah
55898941da Get rid of the 'connected_threshold' argument, too
- use 'when_connected_to', which takes a threshold
2016-04-26 12:26:40 -06:00
meejah
4c619ac98d fix StorageFarmBroker constructors after connected_d gone 2016-04-26 12:26:40 -06:00
meejah
b65a8fe142 Switch to when_connected_enough()
- instead of passing in a Deferred(), we use an observer
- fix up the tests
- TODO: fix magic-folder
2016-04-26 12:26:40 -06:00
meejah
be2576f15d test covering StorageBroker's connected_threshold code 2016-04-26 12:26:39 -06:00
Daira Hopwood
a56a3adaae Teach StorageFarmBroker to fire a deferred when a connection threshold is reached. refs #1449
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-04-26 12:26:39 -06:00
Brian Warner
d2ab4c593b initial tahoe.cfg: explain encoding params better
Meejah pointed out that new users might think the encoding parameters
are fixed, something you must pick correctly when you first set up the
node, and then are never allowed to change again, which is kind of
anxiety-inducing. This updates the comment to explain that the encoding
is stored in each filecap, and the tahoe.cfg values are only used for
newly-uploaded files.
2016-04-26 11:18:44 -07:00
Brian Warner
d05da27ae8 hush pyflakes 2016-04-26 10:43:26 -07:00
meejah
6910309e8f use Resource instead of Page for web-status 2016-04-26 10:33:59 -06:00
meejah
01b09f3bac Only accept 'token' in POST fields (stop using get_arg()) 2016-04-25 15:42:54 -07:00
Brian Warner
f665d0690e test_util: remove obsolete flushLoggedErrors check
We now depend on a much newer version of Twisted than the one that
lacked TestCase.flushLoggedErrors.
2016-04-22 18:48:58 -07:00
Brian Warner
cffa682ddc test_util: fix skip-on-32bit-platform behavior
I set up a raspberry pi buildslave (which, on the "raspbian jesse"
image, uses a 32-bit python, and perhaps a 32-bit kernel too). It fails
test_util.TimeFormat.test_format_time_y2038 with a ValueError inside the
call to time.gmtime(). The test was looking for the equality check to
fail instead. I think catching ValueError is the more-correct way to
detect a system with a 32-bit time type.
2016-04-22 18:45:29 -07:00
Daira Hopwood
5186e68f6b Add ignore_count to deferredutil 2016-04-19 15:16:13 -06:00
Daira Hopwood
1c9a3b4b01 Simplify run_bintahoe and make it work post-pippification.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-04-19 17:47:00 +01:00
Daira Hopwood
ee8bddbb1a Allow tahoe to be run using 'python -m allmydata.scripts.runner'.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-04-19 17:22:34 +01:00
meejah
6e17328eb5 teach abbreviate_time to understand timedelta
original review wanted to do this instead of depending on "humanize"
2016-04-12 18:42:53 -06:00
meejah
308bb8c41f match get_or_create_private_config API (closes ticket:2775) 2016-04-12 12:58:42 -06:00
meejah
4a25573e2d Add simple auth-token to get JSON data 2016-04-12 12:58:27 -06:00
Brian Warner
d385bb7a21 hush pyflakes 2016-04-12 00:39:03 -07:00
Brian Warner
04a9c51e3a download_to_data: fix comment 2016-04-12 00:38:08 -07:00
meejah
db517e8edd Progress API
- IProgress interface + PercentProgress implementation
 - progress= args to many upload/download APIs
 - ultimately for magic-folder
2016-04-12 00:30:50 -07:00
Brian Warner
bb7184163e test/common: add a slight stall in tearDown
With the new Foolscap-0.11.0 (which changed the way connections are
established), I'm seeing DirtyReactorErrors getting thrown by
allmydata.test.test_system.SystemTest.test_filesystem_with_cli_in_subprocess
, on a host that has three IP addresses (one is 127.0.0.1, two is wifi,
three is a VPN). The test itself is getting skipped because bin/tahoe
isn't in the expected place, but by that point, the nodes have already
been launched and have established connections over one of the three
hints (probably 127.0.0.1). The test terminates so quickly that the
connections to the other two addresses have not finished being
abandoned. The extra stall seems to give Foolscap enough time to reap
the cancelled connections and makes the DRT go away.

I think an offline test, or maybe one with a single external IP address,
wouldn't hit this case.

Arbitrary stalls are never very satisfactory, of course. Usually there
is some threshold delay value, below which it fails reliably, above
which it works on my own machine (for now). This one is weird: the
threshold seems to be below the resolution of the system clock. Stalling
for one nanosecond was enough to fix the problem, but using a simple
fireEventually() didn't work.
2016-04-07 20:59:42 -10:00
Brian Warner
8279d919f3 remove "manhole" (ssh-accessible REPL)
This little-used debugging feature allowed you to SSH or Telnet "into" a
Tahoe node, and get an interactive Read-Eval-Print-Loop (REPL) that
executed inside the context of the running process. The SSH
authentication code used a deprecated feature of Twisted, this code had
no unit-test coverage, and I haven't personally used it in at least 6
years (despite writing it in the first place). Time to go.

Also experiment with a Twisted-style "topfiles/" directory of NEWS
fragments. The idea is that we require all user-visible changes to
include a file or two (named as $TICKETNUM.$TYPE), and then run a script
to generate NEWS during the release process, instead of having a human
scan the commit logs and summarize the changes long after they landed.

Closes ticket:2367
2016-04-06 13:40:06 -10:00
Brian Warner
ce548687f8 iputil.py: avoid DirtyReactorError when running tests offline
The udpprot.transport.connect() fails if we don't have a network
connection, but the port is still listening, so trial gives us a
DirtyReactorError. The fix is a "finally:" which does
port.stopListening() even in this case.

Closes ticket:2769
2016-04-03 19:26:57 -10:00
Brian Warner
d57c8d5e39 bump Twisted dependency (>=15.1.0) to get the [tls] extra
We only really need "Twisted >= 13.0.0", but we must add "[tls]" because
otherwise pip won't install it when Foolscap asks for it later, and we
need ">= 15.1.0" because that's the first version that provided "[tls]".

Fixes ticket:2760.
2016-03-30 11:33:36 -07:00
Brian Warner
017fec16a4 test/check_memory: stop using .tac files 2016-03-25 16:26:29 -07:00
Brian Warner
77b3ab019d add __main__.py so "python -m allmydata" works
Thanks to dstufft for the suggestion. I know this can make it slightly
easier to run tahoe in some funny environments (where an appropriate
"python" is on your path but the generated "tahoe" executable is not).
2016-03-25 14:49:18 -07:00
Daira Hopwood
0598c830ed Rename distribution from allmydata-tahoe to tahoe-lafs. fixes ticket:2011
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-03-25 19:16:01 +00:00
Daira Hopwood
c3d54e0221 Back out the dependency on the conch extra for Twisted. refs ticket:2740
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-03-25 18:44:15 +00:00
Daira Hopwood
1db2419655 Update Twisted dependency to include tls and conch extras.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-03-25 18:33:04 +00:00
Brian Warner
b5aad1ba4c test_system: remove foolscap version check
Our install_requires= want foolscap>=0.10.1, and this check only fired
if we were given <0.6.4, so the check should be obsolete.

Also, the check was breaking my attempt to test Tahoe against a
development release of Foolscap, as the NormalizedVersion call threw an
IrrationalVersionError at my Versioneer-based "0.10.1+14.g37d8279"
version string.
2016-03-23 02:16:50 -07:00
Brian Warner
dd84abd9f2 setup.py: work with tox under py3
This allows a python3-based "tox" (as shipped with modern debian and
ubuntu systems) to run setup.py egg_info, update_version, and sdist
commands. It moves the main "tahoe requires py2" check out of setup.py
and into allmydata.scripts.runner.run, where it gets applied at runtime
rather than build time.

It also changes the execfile(_auto_deps.py) and Versioneer-like "ask git
what our version string should be" code to work under both py2 and py3.

fixes ticket:2747
2016-03-22 22:34:42 -07:00
Brian Warner
b8ad887823 Reduce setuptools dep to >=11.3
We don't necessarily need this ourselves (__init__.py's version-checking
code is the only thing in tahoe per se that uses setuptools, and our
setup.py's use of setuptools isn't something that install_requires= can
say anything about). But at least one old environment failed because a
sub-dependency needed a newer version than Tahoe asked for. I'm not sure
if this ought to be here, but it may help for a transitional period
until these ancient environments get updated.

closes ticket:2744
2016-03-18 11:28:58 -07:00
Brian Warner
141ff17b91 auto_deps: bump to setuptools>=20.3
20.3 is the current version as of today. I'm not really sure what
version we need, but this is better than the previous zetuptoolz "0.6c6"
requirement. Closes ticket:2744.
2016-03-17 22:12:04 -07:00
Brian Warner
36865a329c fix test_runner.BinTahoe.test_the_right_code
With our new tox/pip/virtualenv -based environment, we no longer need
the bin/tahoe script, so the tests that examine it needed to change.
In particular, we no longer need to be running tests from the root of a
source tree. Instead, what we care about is that the subprocess 'tahoe'
is importing code from the same place that the unit test .py files live.
2016-03-15 18:15:29 -07:00
Daira Hopwood
2e91068da1 Use version information from pkg_resources when we can't get it from import.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-03-15 17:31:32 +00:00
Daira Hopwood
8ddfc3def0 Tolerate IrrationalVersionError when parsing version numbers of dependencies,
without a warning. fixes ticket:2733

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-03-15 17:31:32 +00:00
Daira Hopwood
fe360ee47b Fix tests that were incorrectly skipping due to not being able to find the 'tahoe' script.
TODO: this may have broken testing "frozen" builds.
refs ticket:1582

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-03-15 17:31:32 +00:00