Unfortunately I didn't manage to get bridgedb's tests running but its use of leekspin looks pretty simple. Replacing it with Stem. There was a comment warning that descriptor creation takes a while but for what it's worth that doesn't seem to be the case. I'm running on an antiquated ten year old desktop and I can generate nineteen signed descriptors a second...
atagar@odin:~/Desktop/tor/bridgedb$ time ./scripts/create-descriptors 250 real 0m13.087suser 0m12.753ssys 0m0.320satagar@odin:~/Desktop/tor/bridgedb$ cat test_descriptors/descriptor_15router Unnamed2006509655 194.39.149.152 9001 0 0 published 2005-06-15 02:26:44bandwidth 153600 256000 104590reject *:* onion-key-----BEGIN RSA PUBLIC KEY-----NGExNDZmMDU2YWRkYWUwODhiM2ZkNjg3NmNhNDM0YmMzYjc5ZmE5MDViNTRkYjA1OGMwOGJmNTNmM2NiNzg3NTRjNTdjMDA1MmZlY2QxNzc5YTAwNTQ1OWYyNmRiN2JmYWFkM2RlNDRhOTQ1ZmRiZjExYTdmOTE4NzkyMTIwNTQ2YzY1NTAzNmM1MDM=-----END RSA PUBLIC KEY-----signing-key-----BEGIN RSA PUBLIC KEY-----MIGJAoGBALS1NGORgH3xEVOSd5Zs92z3bcrvjEK6WMYNkUiFUVvi7HhEFOT7vinPvxUtPRakjDD7Kxg8LbL7PtyEtm29uSL9ggzZTZIHmMd4dIqAYSVfuN2wj/Stk5qp2286BrmhuWyU/ZKLZXrz3g3JOkx9feJ9UxaxGeTGLK626WwMKuHjAgMBAAE=-----END RSA PUBLIC KEY-----router-signature-----BEGIN SIGNATURE-----pIEyuX8oUjMu2W1bqZ1KagpKDlRxMGBH8rupoWIuIjkvfBXC4goch9MHsa3S/Mf30Tb0PWS/KVFnQyTIPPIi5+iV5J/9ol87HPmrnCP4yP3NlE/nnlpbIOfuB+vdZv6nBApDNLkWuuZCirNOqeps6BVBsH58v35nQoUY+HYOK60=-----END SIGNATURE-----
Attached is a patch file you should be apple to apply with 'git am stem_descriptor_creation.patch'. Note that this requires the version of stem in the git repo to work. I say 'stem 1.6' in the output despite that version not yet being tagged since that's the next release.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items ...
Show closed items
Linked items 0
Link issues together to show that they're related.
Learn more.
Btw, this should be filed with BridgeDB rather than Leekspin but I can't seem to find a trac component for the former. If this patch looks good to you maybe we should create a BridgeDB trac component and perhaps deprecate Leekspin? Stem should now have all the capabilities it has.
Ahhh, great - thanks cypherpunks. :)
No problem. Quick tip: disabling JavaScript turns the component combo boxes into one and it becomes easier to browse through them.
This is great, thanks atagar! I've applied your patch in my feature/22755-stem-descgenbranch, and added a couple extra tiny patches to ensure that we use your scripts/create-descriptors script to generate the mocked descriptors in tests/CI instead of leekspin.
It's not ready to switch yet, though. One thing that leekspin does, which this doesn't do yet, is it creates the networkstatus-bridges, bridge-descriptors, cached-extrainfo{.new} files all at once. That is, a mocked bridge whose networkstatus entry is included in networkstatus-bridges will also have a bridge server descriptor in the bridge-descriptors file (and a bridge extrainfo in either cached-extrainfo or cached-extrainfo.new. I'd need a way to do this, since one of the things that the mocked descriptors test for BridgeDB is that BridgeDB's logic on whether or not a bridge should be distributed is functioning in a sane manner.
Trac: Status: new to needs_revision Keywords: N/Adeleted, python, bridgedb-ci, bridgedb-parsers, stem added
Thanks for taking a look Isis! No problem, we can easily make router status entries and extrainfo descriptors too. If you have a tarball with the set of files leekspin generates for you I can ensure create-descriptors matches. If not then no worries - I can make look at it tomorrow.
Bah! Spotted your update right as I was about to send ya a patch. Gotta head to the bus but the attached will help move this along. Note that this needs the new commits I just pushed to stem.
This doesn't bundle all the descriptors into a single file as leekspin does. Also, it creates a full consensus rather than the truncated version in networkstatus-bridges. If you'd care for me to adjust the output to match the attached just let me know.
This is great! I changed it a bit to write the descriptors all into the same files, the same way as the files which come in to BridgeDB from the BridgeAuth.
@purpose bridge router noether 192.99.11.54 63848 0 0 identity-ed25519 -----BEGIN ED25519 CERT----- AQQABlybAYL6e+WjJYnWXtD2/bEhTQyikmzNUHWR4xxU5igkPzgdAQAgBADFQnrw B0ffcBEUpeWZM2Y8H0qhvgB+r7fh4FcaLQv0EczLikcu5s8hqoKBT8+8o+QT2RRM W7kH0XNRm9QL0vCO1wiXwEXm4nGE9gMCKu5//ttTolCPt2dcNIdyw3PNxQU= -----END ED25519 CERT----- master-key-ed25519 xUJ68AdH33ARFKXlmTNmPB9Kob4Afq+34eBXGi0L9BE platform Tor 0.2.8.7 on Linux protocols Link 1 2 Circuit 1 published 2017-07-06 15:52:40 fingerprint 7B12 6FAB 960E 5AC6 A629 C729 434F F84F B507 4EC2 uptime 26600081 bandwidth 1073741824 1073741824 9520756 extra-info-digest 9AFBEFB604AED8846C433DE19ED5BEAE630F0F40 CLpvIYPSqIh/eBYdTkuzTB4sxOkIiHP5CeJssYvILaw onion-key -----BEGIN RSA PUBLIC KEY----- MIGJAoGBAMWQ2jIGdJd6YvpIJSZYy/ELzuXX/FR3QoKpXvsxJNRxNkYmvOAAsm2E puRI2Xznm0q1YUiufDUHfG7J0x/N1AhZrfpYbcbQCtIhDCr2l7b6IpMENdts8bWv T5eXkUwXv/7Eb0Ur2HaLkGuACYN1Sd38/VQQLK0mXBRavkGgrd2HAgMBAAE= -----END RSA PUBLIC KEY----- signing-key -----BEGIN RSA PUBLIC KEY----- MIGJAoGBALbDk5BGi0N8V0eOoQTmOdw6CgkzeRjnMaEOAQpYRCbUnI0XVUjIMqA7 LHo7vbB91YCKZa1zsR2iKh5AnrrWe5wpLujMSRZA2yqwLW3V8/1fltF/1IndGlQD okZr2uRNnDUKRckZzF4Naoo4PAzH9PT4wDSPzkPj+qENUdTWLlsnAgMBAAE= -----END RSA PUBLIC KEY----- onion-key-crosscert -----BEGIN CROSSCERT----- Qvi+cyQnlsThRnW/kiuhNf2LHzTZoPM/aqQbE4gvncEWP8CQc0XmtPkoCHlea3nZ O3Dq6pGK8BDzK2DgYS1ZcpO9aPH9GfycZot1xEkg+z0NOYs3aoRZlM3skkLCWmgo Hym76SzFMefH0vLWHfdSIsoqS+Tx/k59s12IZa5jZx8= -----END CROSSCERT----- ntor-onion-key-crosscert 0 -----BEGIN ED25519 CERT----- AQoABluQAcVCevAHR99wERSl5ZkzZjwfSqG+AH6vt+HgVxotC/QRAKX3/P8JXZGs TeOtNdPAIP96eWyZUBUksMsP535aQiJolw9nFR5bFswdX08GbQ3xwZ4zNzosDi77 qtUaywjC9AA= -----END ED25519 CERT----- hidden-service-dir contact Henry de Valence <tor at hdevalence.ca> ntor-onion-key xxgycE7BKQguv+uVqoAwwkb4tv9BOh5p9vH9MBo8M2w= reject *:* tunnelled-dir-server router-sig-ed25519 ZU/p6qvbgdSdQfXC6/IBzk/gF7WYHXCzzOcQfkw3H3RvYRdICHnzNl0W0/Cty0Ks9hLYo3BWkCYuoMgvfsbeDQ router-signature -----BEGIN SIGNATURE----- grlgvXFB337Sxj5J07Q3cC9sI57JB07dIlFHCWTAS4N30F6GgB/7WDUtpxG9DFwJ ZomIdO5vA9AKfVarlnJFqF8Ks4IfJafqhi5mX+Qgr7ppfuwQc10UNIfJrADZXJP+ 00HSOsQP0T9ZpLQz3BquMIQjHiWkc9fDXu3fZ12EaFM= -----END SIGNATURE-----
I'm a bit scared of exercising less of the parsing code if the descriptors are more sparse.
2. Same as above but for the extrainfo descriptors. (I'll attach all of noether's descriptors in a second so that there's some good examples.)
3. Sort of inline with the last two things, we need the extra-info-digest lines in the server descriptors for BridgeDB to know which extra info is correct.
4. Some CI tests are broken because the extrainfo descriptors don't mock transport lines.
5. Something is writing all the server and extrainfo descriptors to disk in separate files, e.g. server_descriptor_{0,1,2,…} and extrainfo_descriptor_{0,1,2,…}; is there a way to disable that?
Is there a way to make the descriptors less sparse?
Certainly, no problem. When not provided with any data stem creates a minimal valid descriptor. If you'd care to provide extra fields then simply specify them. This goes for extrainfo descriptors, extra-info-digest, and transport lines too.
With this change the os.path.join() no longer does anything. Actually, if I was in your shoes I'd simply drop this constant and replace the spots that use OUTPUT_DIR with os.getcwd().
descriptor_file.flush()
You should be able to drop this line. As the last line in the 'with' block this is immediately followed by close() which will flush the content.
If you have any questions or need an example of anything don't heasitate to let me know!
Thanks phw! I'm not familiar enough with bridgedb to review this to the degree I like, but skimmed the stem usage and this looks spot on! Great work.
I authored descriptor generation specifically for BridgeDB. Is there anything I can adjust within Stem (either in the form of new capabilities or api adjustments) that would make this better for BridgeDB?
Thanks phw! I'm not familiar enough with bridgedb to review this to the degree I like, but skimmed the stem usage and this looks spot on! Great work.
Thanks, atagar! No worries, I already asked sysrqb to take a look at this patch.
I authored descriptor generation specifically for BridgeDB. Is there anything I can adjust within Stem (either in the form of new capabilities or api adjustments) that would make this better for BridgeDB?
For what it's worth, this is really useful. The other day, I started working on updating BridgeDB's requirements.txt and retiring leekspin will help a lot with this.
As for functionality, I think we're good for now. I'll let you know if anything comes up in the future!
Do we want to add a make clean step that removes the descriptors from the current directory?
Hmm, I don't think we should because our Makefile's clean target handles build artifacts that are created during installation. The test descriptors are only for testing, and not needed during installation.