Saturday, July 30, 2005

Running a condorcet election

Here's a quick write-up on what needs to be done (from a technical standpoint)
to run one of the Gentoo Condorcet elections. Since these elections are ones
that only involve Gentoo devs, we handle authentication by the simple process
of running the election on, collecting and counting the ballots
that eligible devs create and store in their home directories on that machine.

We use agriffis's code to handle ballot distribution and vote collection and
counting, and that code lives in ~agriffis on d.g.o. The necessary code is
~agriffis/votify (which uses ~agriffis/elections/ and
~agriffis/countify. An election needs three files to run: ballot-$name
(where $name is the name of the election--"council2005" in the most recent
case), a randomized version of which will be distributed to voters,
officials-$name which lists the voting officials (specifically the Gentoo
usernames of the officials, one per line), and voters-$name which lists
eligible voters (again listing the usernames of the voters, one per line). This
last list is generally obtained from devrel, although for a gentoo-wide vote
getent passwd | cut -d: -f1 > voters-$name suffices. One also needs to
touch the files start-$name and stop-$name with the start and stop
dates (and times) for the election. Currently all of these files must reside
in ~agriffis/elections, but that will hopefully change when somebody has a
bit of time to put into doing some recoding. All of this is done before the
polls open, and infra copies or links /usr/local/bin/votify from
~agriffis/votify (if the link doesn't already exist), but nothing needs to
be done to officially "open" or "close" the polls, since that's what the
start-$name and stop-$name files are for.

After the polls close, somebody from infra runs (as root on d.g.o) perl
~agriffis/countify --collect $name
to collect all of the ballots. Then each
official runs perl ~agriffis/countify --rank $name to count the ballots.
Not only are the results reported (of course), but the master ballot (which
resides in the officials' results-$name directory as master-$name) is
mailed out. Also, voting confirmation e-mails are mailed out, which agriffis
has done using the following one-liner from the results-$name directory:

while read num user; do grep -q "confirmation $num" master-$name
|| continue; (echo "To: $"; sed
"s/^INSERT.*/Your confirmation number is $num./" email; )
| /usr/lib/sendmail -oi $; done < confs-$name

So far I've spent about five minutes getting this upcoming election ready to
go. Thanks, agriffis!

No comments:

Post a Comment


Label Cloud