{"id":486,"date":"2011-06-07T06:59:40","date_gmt":"2011-06-07T11:59:40","guid":{"rendered":"http:\/\/crschmidt.net\/blog\/?p=486"},"modified":"2011-06-07T06:59:40","modified_gmt":"2011-06-07T11:59:40","slug":"better-gdal-in-the-cloud-dotcloud-round-2","status":"publish","type":"post","link":"https:\/\/crschmidt.net\/blog\/archives\/486\/better-gdal-in-the-cloud-dotcloud-round-2\/","title":{"rendered":"Better GDAL in the Cloud (DotCloud, Round 2)"},"content":{"rendered":"<p>My previous attempts to make GDAL work in the cloud were sort of silly; compiling directly on the instance is sort of counter to the design of DotCloud, which lets you scale primarily by assuming that a &#8216;push&#8217; to the server establishes all of the configuration you&#8217;ll need. (sshing into the machine is certainly possible, but it seems it is designed more for debugging than it is for active work.) <\/p>\n<p>So, with a few suggestions from the folks in #dotcloud, I started exploring how to set up my dotcloud service in a bit more of a repeatable way &#8212; such that if I theoretically needed to scale, I could do it more easily. Rather than manually installing packages on the host, I moved all of that configuration into a &#8216;postinstall&#8217; file &#8212; fenceposted so it runs only once.<\/p>\n<p>After a bit of experimentation (and reporting a <a href=\"http:\/\/trac.osgeo.org\/gdal\/ticket\/4110\">bug in GDAL<\/a>), I was able to get a repeatable installation going; this means that I no longer have any manual steps in creating and setting up a new service doing OpenAerialMap thumbnailing; in fact, the entire process &#8212; right down to setting up redis as a distributed cache &#8212; can now be completed automatically. <\/p>\n<p>The <a href=\"https:\/\/github.com\/oam\/oam\/blob\/master\/accesstools\/dotcloud-thumbnail\/postinstall\">postinstall<\/a> is pretty simple: download and configure, then install, curl; Download and configure, then install, GDAL. In both cases, use the respective -config tool as a fencepost so we don&#8217;t install multiple times. <\/p>\n<p>Once this is done, setting up a new deployment with the appropriate services is trivial: <a href=\"https:\/\/github.com\/oam\/oam\/blob\/master\/accesstools\/dotcloud-thumbnail\/setup.sh\">that&#8217;s outlined in setup.sh<\/a> &#8212; configure a redis service, grab the config information, and deploy a wsgi service using that config and the rest of the code. <\/p>\n<p>In fact, while I was writing this post, I followed that very set of instructions, running &#8216;.\/setup.sh openaerialmap&#8217; &#8212; before I finished the post, I had a running www.openaerialmap.dotcloud.com instance, which I could then commit in place of the silly-named &#8216;pepperoni&#8217; service that oam.osgeo.org was using before.<\/p>\n<p>The big thing for me about these one-off deployments is that by making available better tools for doing iterative deployment, they allow me to be more disciplined in how I configure services. Normally, the act of installing GDAL or curl is a one-time event: without reformatting my system (or setting up a VM and reinstalling\/rolling back every time), it&#8217;s non-trivial to test what happens on a fresh system. With DotCloud, deploying another service literally takes seconds &#8212; and when I do, it&#8217;s a green field, ready for me to test my deployment scripts all over again. No more mistakes in one-off apt-get install commands that I&#8217;ll never remember if my system goes down. Now, I&#8217;ve got the ability to script deployments of software.<\/p>\n<p>This is of course possible with EC2 directly as well &#8212; building custom AMIs, redeploying them, etc. For me, though, DotCloud took the pain out of having to do such a thing. They did the hard part for me &#8212; and I got to do the more interesting and fun parts.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>My previous attempts to make GDAL work in the cloud were sort of silly; compiling directly on the instance is sort of counter to the design of DotCloud, which lets you scale primarily by assuming that a &#8216;push&#8217; to the server establishes all of the configuration you&#8217;ll need. (sshing into the machine is certainly possible, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-486","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/posts\/486","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/comments?post=486"}],"version-history":[{"count":0,"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/posts\/486\/revisions"}],"wp:attachment":[{"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/media?parent=486"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/categories?post=486"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/tags?post=486"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}