Flying over the airport at Moundridge, KS
Memories
Back when I was a child, maybe about the age my children are now, I d be outside in the evening and see this orange plane flying overhead. Our neighbor Don had a small ultralight plane and a grass landing strip next to his house. I remember longing to be up in the sky with Don, exploring the world from up there. At that age, I didn t know all the details of why that wouldn t work I just knew I wanted to ride in it.
It wasn t until I was about 11 that I flew for the first time. I still remember that TWA flight with my grandma, taking off early in the morning and flying just a little ways above the puffy clouds lit up all yellow and orange by the sunrise. Even 25 years later, that memory still holds as one of the most beautiful scenes I have ever seen.
Exploring
I have always been an explorer.
When I go past something interesting, I love to go see what it looks like inside. I enjoy driving around Kansas with Laura, finding hidden waterfalls, old county courthouses, ghost towns, beautiful old churches, even small-town restaurants. I explore things around me, too once taking apart a lawnmower engine as a child, nowadays building HF antennas in my treetops or writing code for Linux. If there is little to learn about something, it becomes less interesting to me.
I see this starting to build in my children, too. Since before they could walk, if we were waiting for something in a large building, we d go exploring.
A patch of rain over Hillsboro, KS
The New World
A pilot once told me, Nobody can become a pilot without it changing the way they see the world and then, changing their life.
I doubted that. But it was true. One of the most poetic sights I know is flying a couple thousand feet above an interstate highway at night, following it to my destination. All those red and white lights, those metal capsules of thousands of lives and thousands of stories, stretching out as far as the eye can see in either direction.
Kansas sunset from the plane
When you re in a plane, that small town nowhere near a freeway that always seemed so far away suddenly is only a 15-minute flight away, not even enough time to climb up to a high cruise altitude. Two minutes after takeoff, any number of cities that are an hour s drive away are visible simultaneously, their unique features already recognizable: a grain elevator, oil refinery, college campus, lake, whatever.
And all the houses you fly over each with people in them. Some pretty similar to you, some apparently not. But pretty soon you realize that we all are humans, and we aren t all that different. You can t tell a liberal from a conservative from the sky, nor a person s race or religion, nor even see the border between states. Towns and cities are often nameless from the sky, unless you re really low; only your navigation will tell you where you are.
I ve had the privilege to fly to small out-of-the-way airports, the kind that have a car that pilots can use for free to go into town and get lunch, and leave the key out for them. There I ve met many friendly people. I ve also landed my little Cessna at a big commercial airport where I probably used only 1/10th of the runway, on a grass runway that was barely maintained at all. I ve flown to towns I d driven to or through many times, discovering the friendly folks at the small airport out of town. I ve flown to parts of Kansas I ve never been to before, discovered charming old downtowns and rolling hills, little bursts of rain and beautiful sunsets that seem to turn into a sea.
Parked at the Smith Center, KS airport terminal, about to meet some wonderful people
For a guy that loves exploring the nooks and crannies of the world that everyone else drives by on their way to a major destination, being a pilot has meant many soul-filling moments.
Hard Work
I knew becoming a pilot would be a lot of hard work, and thankfully I remembered stories like that when I finally concluded it would be worth it. I found that I had an aptitude for a lot of things that many find difficult about being a pilot: my experience with amateur radio made me a natural at talking to ATC, my fascination with maps and navigation meant I already knew how to read aviation sectional maps before I even started my training and knew how to process that information in the cockpit, my years as a system administrator and programmer trained me with a careful and methodical decision-making process. And, much to the surprise of my flight instructor, I couldn t wait to begin the part of training about navigating using VORs (VHF radio beacons). I guess he, like many student pilots, had struggled with that, but I was fascinated by this pre-GPS technology (which I still routinely use in my flight planning, as a backup in case the GPS constellation or a GPS receiver fails). So that left the reflexes of flight, the art of it, as the parts I had to work on the hardest.
The exam with the FAA is not like getting your driver s license. It s a multi-stage and difficult process. So when the FAA Designated Pilot Examiner said congratulations, pilot! and later told my flight instructor that you did a really good job with this one, I felt a true sense of accomplishment.
Some of my prep materials
Worth It
Passengers in a small plane can usually hear all the radio conversations going on. My family has heard me talking to air traffic control, to small and big planes. My 6-year-old son Oliver was playing yesterday, and I saw him pick up a plane and say this:
Two-four-niner-golf requesting to land on runway one-seven . Two-four-niner-golf back-taxi on one-seven Two-four-niner-golf ready to takeoff on runway one-seven!
That was a surprisingly accurate representation of some communication a pilot might have (right down to the made-up tailnumber with the spelling alphabet!)
It just got more involved from there!
Jacob and Oliver love model train shows. I couldn t take them to one near us, but there was one in Joplin, MO. So the day before Easter, while Laura was working on her Easter sermon, two excited boys and I (frankly also excited) climbed into a plane and flew to Joplin.
We had a great time at the train show, discovered a restaurant specializing in various kinds of hot dogs (of course they both wanted to eat there), played in a park, explored the city, and they enjoyed the free cookies at the general aviation terminal building while I traded tips on fun places to fly with other pilots.
When it comes right down to it, the smiles of the people I fly with are the most beautiful thing in the air.
Jacob after his first father-son flight with me
The first time I was paid to do software development came as something of a surprise to me. I was working as a sysadmin in a computational physics research group when a friend asked me if I'd be willing to talk to her PhD supervisor. I had nothing better to do, so said yes. And that was how I started the evening having dinner with David MacKay, and ended the evening better fed, a little drunker and having agreed in principle to be paid to write free software.
(Edit to add: this issue is restricted to the mobile SKUs. Desktop parts have very different power management behaviour)Caution: Long term reliability cannot be assured unless all the Low-Power Idle States are enabled.
Greetings! This is a (4 days delay) copy of the announce I made on the openstack-dev@lists.openstack.org on the 8th of April 2016.
I am overjoyed, thrilled and delighted to announce the release of the Debian packages for Mitaka.
All of the DefCore packages were validated successfully this morning through our package-only-based Tempest CI.
Content of this release
Started in 2008, lldpd is an implementation of
IEEE 802.1AB-2005 (aka LLDP) written in C. While it contains some
unit tests, like many other network-related software at the time, the
coverage of those is pretty poor: they are hard to write because the
code is written in an imperative style and tighly coupled with the
system. It would require extensive mocking1. While a rewrite
(complete or iterative) would help to make the code more
test-friendly, it would be quite an effort and it will likely
introduce operational bugs along the way.
To get better test coverage, the major features of lldpd are now
verified through integration tests. Those tests leverage Linux
network namespaces to setup a lightweight and isolated environment
for each test. They run through pytest, a powerful testing tool.
assert keyword,class testArithmetics(unittest.TestCase): def test_addition(self): self.assertEqual(1 + 3, 4)
def test_addition(): assert 1 + 3 == 4
class testInVM(unittest.TestCase): def setUp(self): self.vm = VM('Test-VM') self.vm.start() self.ssh = SSHClient() self.ssh.connect(self.vm.public_ip) def tearDown(self): self.ssh.close() self.vm.destroy() def test_hello(self): stdin, stdout, stderr = self.ssh.exec_command("echo hello") stdin.close() self.assertEqual(stderr.read(), b"") self.assertEqual(stdout.read(), b"hello\n")
tearDown() method won t be invoked. The VM
will be left running.
Instead, with pytest, we could do this:
@pytest.yield_fixture def vm(): r = VM('Test-VM') r.start() yield r r.destroy() @pytest.yield_fixture def ssh(vm): ssh = SSHClient() ssh.connect(vm.public_ip) yield ssh ssh.close() def test_hello(ssh): stdin, stdout, stderr = ssh.exec_command("echo hello") stdin.close() stderr.read() == b"" stdout.read() == b"hello\n"
@pytest.mark.parametrize("n1, n2, expected", [ (1, 3, 4), (8, 20, 28), (-4, 0, -4)]) def test_addition(n1, n2, expected): assert n1 + n2 == expected
lldpd process in each namespace.lldpcli we get the expected result in the other.@pytest.mark.skipif('LLDP-MED' not in pytest.config.lldpd.features, reason="LLDP-MED not supported") @pytest.mark.parametrize("classe, expected", [ (1, "Generic Endpoint (Class I)"), (2, "Media Endpoint (Class II)"), (3, "Communication Device Endpoint (Class III)"), (4, "Network Connectivity Device")]) def test_med_devicetype(lldpd, lldpcli, namespaces, links, classe, expected): links(namespaces(1), namespaces(2)) with namespaces(1): lldpd("-r") with namespaces(2): lldpd("-M", str(classe)) with namespaces(1): out = lldpcli("-f", "keyvalue", "show", "neighbors", "details") assert out['lldp.eth0.lldp-med.device-type'] == expected
lldpd was compiled with
LLDP-MED support. Second, the test is parametrized. We will execute
four distinct tests, one for each role that lldpd should be able to
take as an LLDP-MED-enabled endpoint.
The signature of the test has four parameters that are not covered by
the parametrize() decorator: lldpd, lldpcli, namespaces and
links. They are fixtures. A lot of magic happen in those to keep
the actual tests short:
lldpd is a factory to spawn an instance of lldpd. When called,
it will setup the current namespace (setting up the chroot,
creating the user and group for privilege separation, replacing
some files to be distribution-agnostic, ), then call lldpd
with the additional parameters provided. The output is recorded and
added to the test report in case of failure. The module also
contains the creation of the pytest.config.lldpd object that is
used to record the features supported by lldpd and skip
non-matching tests. You can read
fixtures/programs.py for more details.
lldpcli is also a factory, but it spawns instances of lldpcli,
the client to query lldpd. Moreover, it will parse the output in
a dictionary to reduce boilerplate.
namespaces is one of the most interesting pieces. It is a
factory for Linux namespaces. It will spawn a new namespace or
refer to an existing one. It is possible to switch from one namespace
to another (with with) as they are contexts. Behind the scene,
the factory maintains the appropriate file descriptors for each
namespace and switch to them with setns(). Once the test is done,
everything is wipped out as the file descriptors are garbage
collected. You can read fixtures/namespaces.py
for more details. It is quite reusable in other
projects2.
links contains helpers to handle network interfaces: creation of
virtual ethernet link between namespaces, creation of bridges,
bonds and VLAN, etc. It relies on the pyroute2 module. You can
read fixtures/network.py for more details.
pytest -n 10 --boxed. To
catch even more bugs, both the address sanitizer (ASAN) and the
undefined behavior sanitizer (UBSAN) are enabled. In case of a
problem, notably a memory leak, the faulty program will exit with a
non-zero exit code and the associated test will fail.
root and
_lldpd). Therefore, the tests have to run as root.
The second limitation is with the PID namespace. It s
not possible for a process to switch from one PID
namespace to another. When you call setns() on a PID
namespace, only children of the current process will
be in the new PID namespace. The PID namespace is
convenient to ensure everyone gets killed once the
tests are terminated but you must keep in mind that
/proc must be mounted in children only. The third
limitation is that, for some namespaces (PID and
user), all threads of a process must be part of the
same namespace. Therefore, don t use threads in
tests. Use multiprocessing module instead.
The Debian repository format was designed a long time ago. The oldest
versions of it were produced with the help of tools such as
dpkg-scanpackages and consumed by dselect access methods such as
dpkg-ftp. The access methods just fetched a Packages file (perhaps
compressed) and used it as an index of which packages were available; each
package had an MD5 checksum to defend against transport errors, but being
from a more innocent age there was no repository signing or other protection
against man-in-the-middle attacks.
An important and intentional feature of the early format was that, apart
from the top-level Packages file, all other files were static in the
sense that, once published, their content would never change without also
changing the file name. This means that repositories can be efficiently
copied around using rsync without having to tell it to re-checksum all
files, and it avoids network races when fetching updates: the repository
you re updating from might change in the middle of your update, but as long
as the repository maintenance software keeps superseded packages around for
a suitable grace period, you ll still be able to fetch them.
The repository format evolved rather organically over time as different
needs arose, by what one might call distributed consensus among the
maintainers of the various client tools that consumed it. Of course all
sorts of fields were added to the index files themselves, which have an
extensible format so that this kind of thing is usually easy to do. At some
point a Sources index for source packages was added, which worked pretty
much the same way as Packages except for having a different set of fields.
But by far the most significant change to the repository structure was the
package pools project.
The original repository layout put the packages themselves under the
dists/ tree along with the index files. The dists/ tree is organised by
suite (modern examples of which would be stable , stable-updates ,
testing , unstable , xenial , xenial-updates , and so on). This meant
that making a release of Debian tended to involve copying lots of data
around, and implementing the testing suite would have been very costly.
Package pools solved this problem by moving individual package files out of
dists/ and into a new pool/ tree, allowing those files to be shared
between multiple suites with only a negligible cost in disk space and mirror
bandwidth. From a database design perspective this is obviously much more
sensible. As part of this project, the original Debian dinstall
repository maintenance scripts were
replaced
by da-katie or dak , which among other things used a new apt-ftparchive
program to build the index files; this replaced dpkg-scanpackages and
dpkg-scansources, and included its own database cache which made a big
difference to performance at the scale of a distribution.
A few months after the initial implementation of package pools, Release
files were added. These formed a sort of meta-index for each suite, telling
APT which index files were available (main/binary-i386/Packages,
non-free/source/Sources, and so on) and what their checksums were.
Detached signatures were added alongside that (Release.gpg) so that it was
now possible to fetch packages securely given a public key for the
repository, and client-side verification
support for
this eventually made its way into Debian and Ubuntu. The repository
structure stayed more or less like this for several years.
At some point along the way, those of us by now involved in repository
maintenance realised that an important property had been lost. I mentioned
earlier that the original format allowed race-free updates, but this was no
longer true with the introduction of the Release file. A client now had
to fetch Release and then fetch whichever other index files such as
Packages they wanted, typically in separate HTTP transactions. If a
client was unlucky, these transactions would fall on either side of a mirror
update and they d get a Hash Sum Mismatch error from APT. Worse, if a
mirror was unlucky and also didn t go to special lengths to verify index
integrity (most don t), its own updates could span an update of its upstream
mirror and then all its clients would see mismatches until the next mirror
update. This was compounded by using detached signatures, so Release and
Release.gpg were fetched separately and could be out of sync.
Fixing this has been a long road (the first time I remember talking about
this was in late 2007!), and we ve had to take care to maintain
client/server compatibility along the way. The first step was to add
inline-signed versions of the Release file, called InRelease, so that
there would no longer be a race between fetching Release and fetching its
signature. APT has had this for a while, Debian s repository supports it as
of stretch, and we finally implemented it for
Ubuntu six months ago.
Dealing with the other index files is more complicated, though; it isn t
sensible to inline them, as clients usually only need to fetch a small
fraction of all the indexes available for a given suite.
The solution we ve ended up with, thanks to Michael Vogt s work implementing
it in APT, is called
by-hash
and should be familiar in concept to people who ve used git: with the
exception of the top-level InRelease file, index files for suites that
support the by-hash mechanism may now be fetched using a URL based on one of
their hashes listed in InRelease. This means that clients can now operate
like this:
dists/xenial/InReleasedists/xenial/main/binary-amd64/by-hash/SHA256/46316a202cdae76a73b555414741b11d08c66620b76c470a1623cedcc8a14740
(and so on)debmirror doesn t support by-hash yet; apt-cacher-ng only supports it as
of xenial, although there s an easy configuration
workaround. Full archive mirrors must make
sure that they put new by-hash files in place before new InRelease files
(I just fixed our recommended two-stage sync
script to do this;
ubumirror still needs some work; Debian s
ftpsync is almost correct but
needs a tweak for its handling of translation files, which I ve sent to its
maintainers). Other mirrors and proxies that have specific handling of the
repository format may need similar changes.
Please let me know if you see strange things happening as a result of this
change. It s useful to check the output of apt -o
Debug::Acquire::http=true update to see exactly what requests are being issued.
The developer uploads their code to gerrit via the git-review tool. There is no further action required on their behalf and the developer simply waits for results.
Gerrit provides a JSON-encoded "firehose" output of everything happening to it. New reviews, votes, updates and more all get sent out over this pipe. Zuul is the overall scheduler that subscribes itself to this information and is responsible for managing the CI jobs appropriate for each change.
Zuul has a configuration that tells it what jobs to run for what projects. Zuul can do lots of interesting things, but for the purposes of this discussion we just consider that it puts the jobs it wants run into gearman for a Jenkins master to consume. gearman is a job-server; as they explain it "[gearman] provides a generic application framework to farm out work to other machines or processes that are better suited to do the work". Zuul puts into gearman basically a tuple (job-name, node-type) for each job it wants run, specifying the unique job name to run and what type of node it should be run on.
A group of Jenkins masters are subscribed to gearman as workers. It is these Jenkins masters that will consume the job requests from the queue and actually get the tests running. However, Jenkins needs two things to be able to run a job a job definition (what to actually do) and a slave node (somewhere to do it). The first part what to do is provided by job-definitions stored in external YAML files and processed by Jenkins Job Builder (jjb) in to job configurations for Jenkins. Each Jenkins master gets these definitions pushed to it constantly by Puppet, thus each Jenkins master instance knows about all the jobs it can run automatically. Zuul also knows about these job definitions; this is the job-name part of the tuple we said it put into gearman. The second part somewhere to run the test takes some more explaining. To the next point...
Several cloud companies donate capacity in their clouds for OpenStack to run CI tests. Overall, this capacity is managed by a customised orchestration tool called nodepool. Nodepool watches the gearman queue and sees what requests are coming out of Zuul. It looks at node-type of jobs in the queue and decides what types of nodes need to start and which cloud providers have capacity to satisfy demand. Nodepool will monitor the start-up of the virtual-machines and register the new nodes to the Jenkins master instances.
At this point, the Jenkins master has what it needs to actually get jobs started. When nodepool registers a host to a Jenkins master as a slave, the Jenkins master can now advertise its ability to consume jobs. For example, if a ubuntu-trusty node is provided to the Jenkins master instance by nodepool, Jenkins can now consume from gearman any job it knows about that is intended to run on an ubuntu-trusty slave. Jekins will run the job as defined in the job-definition on that host ssh-ing in, running scripts, copying the logs and waiting for the result. (It is a gross oversimplification, but for the purposes of OpenStack CI, Jenkins is pretty much used as a glorified ssh/scp wrapper. Zuul Version 3, under development, is working to remove the need for Jenkins to be involved at all).
Eventually, the test will finish. The Jenkins master will put the result back into gearman, which Zuul will consume. The slave will be released back to nodepool, which destroys it and starts all over again (slaves are not reused and also have no sensitive details on them, as they are essentially publicly accessible). Zuul will wait for the results of all jobs for the change and post the result back to Gerrit; it either gives a positive vote or the dreaded negative vote if required jobs failed (it also handles merges to git, but we'll ignore that bit for now).
There's a piece of software called XScreenSaver. It attempts to fill two somewhat disparate roles:
Trusted Platform Modules are fairly unintelligent devices. They can do some crypto, but they don't have any ability to directly monitor the state of the system they're attached to. This is worked around by having each stage of the boot process "measure" state into registers (Platform Configuration Registers, or PCRs) in the TPM by taking the SHA1 of the next boot component and performing an extend operation. Extend works like this:
Firefox has had support for Google's
Safe Browsing since 2005
when it started as
a stand-alone Firefox extension.
At first it was only available in the USA, but it was opened up to the rest of the world in
2006 and moved to the
Google Toolbar.
It then got
integrated directly
into
Firefox 2.0
before the
public launch
of the service in 2007.
Many people seem confused by this phishing and malware protection
system and while there is a
pretty good explanation of how it works
on our support site, it doesn't go into technical details. This will
hopefully be of interest to those who have more questions about it.
browser.safebrowsing.malware.enabled
preference (in about:config) whereas the last one is controlled by
browser.safebrowsing.enabled.
browser.safebrowsing.provider.google.updateURL) and does a
lookup against its local database
before displaying a page to the user.
Downloading the entire list of sites flagged by Safe Browsing would be
impractical due to
its size
so the following transformations are applied:
urlclassifier.malwareTable and urlclassifier.phishTable respectively.
If you want to see some debugging information in your terminal while Firefox
is downloading updated lists, turn on browser.safebrowsing.debug.
Once downloaded, the lists can be found in the cache directory:
~/.cache/mozilla/firefox/XXXX/safebrowsing/ on Linux~/Library/Caches/Firefox/Profiles/XXXX/safebrowsing/ on MacC:\Users\XXXX\AppData\Local\mozilla\firefox\profiles\XXXX\safebrowsing\ on Windowsbrowser.safebrowsing.provider.mozilla.gethashURL) all of the
hashes that start with the affected 32-bit prefix and adds these full-length
hashes to its local database. Turn on browser.safebrowsing.debug to see
some debugging information on the terminal while these "completion" requests
are made.
If the current URL doesn't match any of these full hashes, the load
proceeds as normal. If it does match one of them, a warning interstitial
page is shown and the
load is canceled.
urlclassifier.downloadBlockTable) and block the download
in case of a match.urlclassifier.downloadAllowTable) of known good publishers and
release the download if a match is found.browser.safebrowsing.downloads.remote.url) and block the download if the
server indicates that the file isn't safe.browser.safebrowsing.malware.enabled) is turned off, it can
also be disabled independently via the
browser.safebrowsing.downloads.enabled preference.
Note that Step 5 is the only point at which any information about the
download is shared with Google. That remote lookup can be suppressed via the
browser.safebrowsing.downloads.remote.enabled preference for those users
concerned about sending that metadata to a third party.
browser.safebrowsing.downloads.remote.block_dangerousbrowser.safebrowsing.downloads.remote.block_dangerous_hostbrowser.safebrowsing.downloads.remote.block_potentially_unwantedbrowser.safebrowsing.downloads.remote.block_uncommon
It feels great when I write code in the plane. I wonder if it's the speed I am travelling at or the restricted environment that I feel I am limited in what I can do.
See also my apps list for a more complete list of the apps I have installed on the phone. I welcome recommendations on cool free software apps I should use!I have replaced the stock firmware on the phone with Cyanogenmod 12.1, which was a fairly painful experience, partly because of the difficult ambiance on the #cyanogenmod channel on Freenode, where I had extreme experiences: a brave soul helped me through the first flashing process for around 2 hours, nicely holding my hand at every step. Other times, I have seen flames and obtuse comments from people being vulgar, brutal, obnoxious, if not sometimes downright homophobic and sexist from other users. It is clearly a community that needs to fix their attitude. I have documented everything I could in details in this wiki page, in case others want to resuscitate their old phones, but also because I ended up reinstalling the freaking phone about 4 times, and was getting tired of forgetting how to do it every time. I am somewhat fascinated by Android: here is the Linux-based device that should save us all from the proprietary Apple nightmares of fenced in gardens and censorship. Yet, public Android downloads are hidden behind license agreements, even though the code itself is free, which has led fellow Debian developers to work on making libre rebuilds of Androids to workaround this insanity. But worse: all phones are basically proprietary devices down to the core. You need custom firmware to be loaded on the machine for it to boot at all, from the bootloader all the way down to the GSM baseband and Wifi drivers. It is a minefield of closed source software, and trying to run free software on there is a bit of a delusion, especially since the baseband has so much power over the phone. Still, I think it is really interesting to run free software on those machines, and help people that are stuck with cell phones get familiar with software freedom. It seems especially important to me to make Android developers aware of software freedom considering how many apps are available for free yet on which it is not possible to contribute significantly because the source code is not published at all, or published only on the Google Store, instead of the more open and public F-Droid repository which publishes only free software. So I did contribute. This month, I am happy to announce that I contributed to the following free software projects on Android:
this battery will reach end of life (5%) in 935 days, 19:07:58.336480, on 2018-10-23 12:06:07.270290Which is, to be fair, a good life: it will somewhat work for about three more years.
Favorites list which is populated by the "star"
button in the UI.
I had a lot of fun writing this script. I started using elpy as an
IDE in Emacs. (Notice how
Emacs got a new webpage, which is a huge improvement was had been
basically unchanged since the original version, now almost 20
years old, and probably written by RMS himself.) I wonder how I
managed to stay away from Elpy for so long, as it glues together key
components of Emacs in an elegant and functional bundle:
Signal is a pretty amazing app; it manages
to combine great security with great simplicity. (It literally takes two
minutes, even for an unskilled user, to set it up.)
I looked at the Wikipedia article,
and the list of properties the protocol provides
is impressive; I had hardly any idea you would even want all of these.
But I've tried to decode what they actually mean:
Here is my monthly update covering a large part of what I have been doing in the free software world (previously):
When I started contributing to OpenStack, almost five
years ago, it was a small ecosystem. There were no foundation, a handful of
projects and you could understand the code base in a few days.
Fast forward 2016, and it is a totally different beast. The project grew to
no less than 54 teams,
each team providing one or more deliverable. For example, the Nova and Swift
team each one produces one service and its client, whereas the Telemetry team
produces 3 services and 3 different clients.
In 5 years, OpenStack went to a few
IaaS projects, to
54 different teams tackling different areas related to cloud computing. Once
upon a time, OpenStack was all about starting some virtual machines on a
network, backed by images and volumes. Nowadays, it's also about orchestrating
your network deployment over containers, while managing your application
life-cycle using a database service, everything being metered and billed for.
This exponential growth has been made possible with the decision of the
OpenStack Technical Committee
to open the gates with
the project structure reform voted at the end of 2014.
This amendment suppresses the old OpenStack model of "integrated projects"
(i.e. Nova, Glance, Swift ). The big tent, as it's called, allowed OpenStack to
land new projects every month, growing from the 20 project teams of December
2014 to the 54 we have today multiplying the number of projects by 2.7 in a
little more than a year.
Amazing growth, right?
And this was clearly a good change. I sat at the Technical Committee in 2013,
when projects were trying to apply to be "integrated", after Ceilometer and
Heat were. It was painful to see how the Technical Committee was trying to
assess whether new projects should be brought in or not.
But what I notice these days, is how OpenStack is still stuck between its old
and new models. On one side, it accepted a lot of new teams, but on the other
side, many are considered as second-class citizens. Efforts are made to
continue to build an OpenStack project that does not exist anymore.
For example, there is a team trying to define what's OpenStack core, named
DefCore. That is looking to define
which projects are, somehow, actually OpenStack. This leads to weird
situations,
such as having non-DefCore projects seeing their doc rejected from installation guides.
Again,
I reiterated my proposal
to publish documentation as part of each project code to solve that dishonest
situation and put everything on a level playing field
Some cross-projects specs are also pushed without implication of all OpenStack
projects. For example, The
deprecate-cli
spec which proposes to deprecate command-line interface tools proposed by each
project had a lot of sense in the old OpenStack sense, where the goal was to
build a unified and ubiquitous cloud platform. But when you now have tens of
projects with largely different scopes, this start making less sense. Still,
this spec was merged by the OpenStack Technical Committee this cycle. Keystone
is the first project to proudly force users to rely on
openstack-client,
removing its old keystone command line tool.
I find it odd to push that specs when it's pretty clear that some projects
(e.g. Swift, Gnocchi ) have no intention to go down that path.
Unfortunately, most specs pushed by the Technical Committee are in the realm of
wishful thinking. It somehow makes sense, since only a few of the members are
actively contributing to OpenStack projects, and they can't by themselves
implement all of that magically. But OpenStack is no exception in the free
software world and remains a do-ocracy.
There is good cross-project content in OpenStack, such as
the API working group.
While the work done should probably not be OpenStack specific, there's a lot
that teams have learned by building various HTTP REST API with different
frameworks. Compiling this knowledge and offering it as a guidance to various
teams is a great help.
My fellow developer Chris Dent wrote a post about
what he would do on the Technical Committee.
In this article, he points to a lot of the shortcomings I described here, and
his confusion between OpenStack being a product or being a kit is quite
understandable. Indeed, the message broadcasted by OpenStack is still very
confusing after the big tent openness. There's no enough user experience
improvement being done.
The OpenStack Technical Committee election is opened for April 2016, and from
what I read so far, many candidates are proposing to now clean up the big tent,
kicking out projects that do not match certain criteria anymore. This is
probably a good idea, there is some inactive project laying around. But I don't
think that will be enough to solve the identity crisis that OpenStack is
experiencing.
So this is why, once again this cycle, I will throw my hat in the ring and
submit my candidacy for OpenStack Technical Committee.
Julian has
written
about their efforts to strengthen security in APT, and shortly before that
notified us that Launchpad s
signatures on PPAs use
weak SHA-1 digests. Unfortunately we hadn t noticed that before; GnuPG s
defaults tend to result in weak digests unless carefully tweaked, which is a shame.
I started on the necessary fixes for this immediately we heard of the
problem, but it s taken a little while to get everything in place, and I
thought I d explain why since some of the problems uncovered are interesting
in their own right.
Firstly, there was the relatively trivial matter of using SHA-512 digests
on new
signatures.
This was mostly a matter of adjusting our configuration, although writing
the test was a bit tricky since
PyGPGME isn t as helpful as it could
be. (Simpler repository implementations that call gpg from the command
line should probably just add the --digest-algo SHA512 option instead of
imitating this.)
After getting that in place, any change to a suite in a PPA will result in
it being re-signed with SHA-512, which is good as far as it goes, but we
also want to re-sign PPAs that haven t been modified. Launchpad hosts more
than 50000 active PPAs, though, a significant percentage of which include
packages for sufficiently recent Ubuntu releases that we d want to re-sign
them for this. We can t expect everyone to push new uploads, and we need to
run this through at least some part of our usual publication machinery
rather than just writing a hacky shell script to do the job (which would
have no idea which keys to sign with, to start with); but forcing full
reprocessing of all those PPAs would take a prohibitively long time, and at
the moment we need to interrupt normal PPA publication to do this kind of
work. I therefore had to spend some quality time working out how to make
things go fast enough.
The first couple of changes
(1,
2)
were to add options to our publisher script to let us run just the one step
we need in careful mode: that is, forcibly re-run the Release file
processing step even if it thinks nothing has changed, and entirely disable
the other steps such as generating Packages and Sources files. Then
last week I finally got around to timing things on one of our staging
systems so that we could estimate how long a full run would take. It was
taking a little over two seconds per archive, which meant that if we were to
re-sign all published PPAs then that would take more than 33 hours!
Obviously this wasn t viable; even just re-signing xenial would be
prohibitively slow.
The next question was where all that time was going. I thought perhaps that
the actual signing might be slow for some reason, but it was taking about
half a second per archive: not great, but not enough to account for most of
the slowness. The main part of the delay was in fact when we committed the
database transaction after processing each archive, but not in the actual
PostgreSQL commit, rather in the ORM invalidate method called to prepare for a commit.
Launchpad uses the excellent Storm for all
of its database interactions. One property of this ORM (and possibly of
others; I ll cheerfully admit to not having spent much time with other ORMs)
is that it uses a
WeakValueDictionary
to keep track of the objects it s populated with database results. Before
it commits a transaction, it iterates over all those alive objects to note
that if they re used in future then information needs to be reloaded from
the database first. Usually this is a very good thing: it saves us from
having to think too hard about data consistency at the application layer.
But in this case, one of the things we did at the start of the publisher
script was:
def getPPAs(self, distribution):
"""Find private package archives for the selected distribution."""
if (self.isCareful(self.options.careful_publishing) or
self.options.include_non_pending):
return distribution.getAllPPAs()
else:
return distribution.getPendingPublicationPPAs()
def getTargetArchives(self, distribution):
"""Find the archive(s) selected by the script's options."""
if self.options.partner:
return [distribution.getArchiveByComponent('partner')]
elif self.options.ppa:
return filter(is_ppa_public, self.getPPAs(distribution))
elif self.options.private_ppa:
return filter(is_ppa_private, self.getPPAs(distribution))
elif self.options.copy_archive:
return self.getCopyArchives(distribution)
else:
return [distribution.main_archive]
filter means that we do all the public/private
filtering of PPAs up-front and return a list of all the PPAs we intend to
operate on. This means that all those objects are alive as far as Storm is
concerned and need to be considered for invalidation on every commit, and
the time required for that stacks up when many thousands of objects are
involved: this is essentially accidentally
quadratic behaviour, because all
archives are considered when committing changes to each archive in turn.
Normally this isn t too bad because only a few hundred PPAs need to be
processed in any given run; but if we re running in a mode where we re
processing all PPAs rather than just ones that are pending publication, then
suddenly this balloons to the point where it takes a couple of seconds. The
fix
is very simple, using an
iterator instead
so that we don t need to keep all the objects alive:
from itertools import ifilter
def getTargetArchives(self, distribution):
"""Find the archive(s) selected by the script's options."""
if self.options.partner:
return [distribution.getArchiveByComponent('partner')]
elif self.options.ppa:
return ifilter(is_ppa_public, self.getPPAs(distribution))
elif self.options.private_ppa:
return ifilter(is_ppa_private, self.getPPAs(distribution))
elif self.options.copy_archive:
return self.getCopyArchives(distribution)
else:
return [distribution.main_archive]
signContent method taking a fingerprint
rather than a key, despite the fact that we normally already had the key in
hand; this caused us to have to ask GPGME to reload the key, which requires
two subprocess calls. Converting this to take a key rather than a
fingerprint
gets the per-archive time down to about a quarter of a second on our staging
system, about eight times faster than where we started.
Using this, we ve now re-signed all xenial Release files in PPAs using
SHA-512 digests. On production, this took about 80 minutes to iterate over
around 70000 archives, of which 1761 were modified. Most of the time
appears to have been spent skipping over unmodified archives; even a few
hundredths of a second per archive adds up quickly there. The remaining
time comes out to around 0.4 seconds per modified archive. There s
certainly still room for speeding this up a bit.
We wouldn t want to do this procedure every day, but it s acceptable for
occasional tasks like this. I expect that we ll similarly re-sign wily,
vivid, and trusty Release files soon in the same way.
Next.