Currently the bwauthority is quite out of date with the current python ecosystem and doesn't play nice in a dev environment.
The submitted patch makes the following updates:
Removes the cron setup to a separate script (so running setup.sh doesn't alter your crontab)
Changes the shell script to use a modern pip instead of peep (peep is deprecated and hash checking is incorporated into pip as of version 8.0 (https://pypi.python.org/pypi/peep/)
Updated dependencies as far as possible (Elixer's last version is 0.7.1 and is only compatible with SQLAlchemy <= 0.7.8, obvious future enhancement to move away from Elixir)
Added a convenience script to kill all the spun up processes
Updated the ReadMe and the .gitignore to reflect these changes.
Trac: Username: davidwf
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items 0
Show closed items
No child items are currently assigned. Use child items to break down this issue into smaller parts.
Linked items 0
Link issues together to show that they're related.
Learn more.
Trac: Cc: chelseakomlo, mikeperry, teor, AgentSeb, davidwf to chelseakomlo, mikeperry, teor, AgentSeb, davidwf, tom Reviewer: chelseakomlo, tjr to chelseakomlo, tom
Why did you downgrade from SQLAlchemy 0.7.10 to 0.7.8?
Whichever way you choose to go, please find all instances of SQLAlchemy-0.7.* and make them consistent.
For future patches, it is ok to provide a branch and use multiple commits - in fact, we prefer it!
In particular, it is nice if whitespace changes are in a separate commit to functional changes.
In particular:
In setup.sh and setup_cron.sh:
readlink -f works with gnu readlink, but not with BSD readlink. It is possible to install BSD readlink on Linux, and GNU readlink on BSD or macOS. So we can't depend on uname, we should just try basename if readlink doesn't work here:
+# readlink -f does not work on Mac+if [ `uname` != "Darwin" ]+then+ SCANNER_DIR=$(readlink -f "$SCANNER_DIR")+fi
Also, let's use the same code in all the scripts to do this, for consistency.
Some OSs only have a non-versioned python (e.g. macOS), so we should fall back to "which python" here:
+PYTHON=$(which python2.7 || which python2.6)
In stop_scan.sh:
This is a dangerous strategy if the process has already died, and its PID is being used by something else. Can we check the process has the right name in a cross-platform way?
kill -9 `head -1 $PIDFILE` && rm $PIDFILE
You may also be better making the parent scanner script Tor's __OwningControllerProcess, so tor exits automatically when the script exits. But you'll just have to kill the bwauthority child processes.
Please don't copy environmental variables like this:
It makes it easy for them to get out of sync with the launch script.
Also, if someone changes the variables, then stops the scanners, some will be left over.
Instead, why not do:
Please see changes at 'git@github.com:davidfaulkner12/bwauth.git', branch 'nicedev'.
Why did you downgrade from SQLAlchemy 0.7.10 to 0.7.8?
Whichever way you choose to go, please find all instances of SQLAlchemy-0.7.* and make them consistent.
Updated -- the PYTHONPATH variables in the shell scripts had no impact (and didn't resolve to anything on my machine at least), so I removed them. I used 0.7.8 because that's the last documented "compatible" version with Elixer.
For future patches, it is ok to provide a branch and use multiple commits - in fact, we prefer it!
Noted! It was actually always in Github, I just through patches were preferred. :-)
readlink -f works with gnu readlink, but not with BSD readlink. It is possible to install BSD readlink on Linux, and GNU readlink on BSD or macOS. So we can't depend on uname, we should just try basename if readlink doesn't work here:
I checked to see if the command fails, and only set the variable if necessary. This should work!
Some OSs only have a non-versioned python (e.g. macOS), so we should fall back to "which python" here:
Done.
In stop_scan.sh: ...
stop_scan.sh is actually just copy and pasted from the first lines of the run_scan.sh. I don't disagree with anything you said, but I'm not confident that I can make those changes in a way that works reliably without digging too deeply past the initial scope of "get this working on a laptop".
stop_scan.sh is actually just copy and pasted from the first lines of the run_scan.sh. I don't disagree with anything you said, but I'm not confident that I can make those changes in a way that works reliably without digging too deeply past the initial scope of "get this working on a laptop".
If we don't want to introduce tech debt in multiple places, stop_scan.sh doesn't need to be added as part of this patch, but I agree having this as a convenience would be useful.
When I lost the bwauth box that my bwauth was runnign on, I lost the ability to keep working on this. Now that I have a new box I can resume the bwauth queue of patches. Feel free to bug me ~weekly about them.
I'm going to try running a second bwauth (on the same box), see if that causes any abnormalities in the existing one, compare results, and then start testing changes...
Single tickets that deal with multiple issues are really hard to resolve. Please split up any issues that you'd like to continue working on into their own tickets, and make this ticket the parent.
Removes the cron setup to a separate script (so running setup.sh doesn't alter your crontab)
wontfix - In #24088 (moved), we want to get rid of setup.sh, it's just too fragile. We need to write good instructions instead.
Changes the shell script to use a modern pip instead of peep (peep is deprecated and hash checking is incorporated into pip as of version 8.0 (https://pypi.python.org/pypi/peep/)
revise - this needs to become a change to the requirements file, see #24089 (moved)
Updated dependencies as far as possible (Elixer's last version is 0.7.1 and is only compatible with SQLAlchemy <= 0.7.8, obvious future enhancement to move away from Elixir)
split off into its own ticket, please
Added a convenience script to kill all the spun up processes
split off into its own ticket, please
Updated the ReadMe and the .gitignore to reflect these changes.
put these in the branches for the relevant ticket(s), please