<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Robert Lin on Medium]]></title>
        <description><![CDATA[Stories by Robert Lin on Medium]]></description>
        <link>https://medium.com/@bobheadxi?source=rss-d9eaded8f572------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*UcrImF5ViRUghe_b15pSog@2x.jpeg</url>
            <title>Stories by Robert Lin on Medium</title>
            <link>https://medium.com/@bobheadxi?source=rss-d9eaded8f572------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 14:11:33 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@bobheadxi/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Introducing the New UBC Launch Pad Website]]></title>
            <link>https://medium.com/ubc-launch-pad-software-engineering-blog/introducing-the-new-launch-pad-website-42175181d644?source=rss-d9eaded8f572------2</link>
            <guid isPermaLink="false">https://medium.com/p/42175181d644</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[vuejs]]></category>
            <category><![CDATA[software]]></category>
            <category><![CDATA[students]]></category>
            <category><![CDATA[typescript]]></category>
            <dc:creator><![CDATA[Robert Lin]]></dc:creator>
            <pubDate>Sat, 25 Apr 2020 18:00:00 GMT</pubDate>
            <atom:updated>2020-10-09T06:38:12.705Z</atom:updated>
            <content:encoded><![CDATA[<h4>We rebuilt our website from the ground up with a fresh coat of paint (in 8 days!)</h4><p>We’re happy to announce that we’ve finally decided to get to work and churn out a brand new, from-the-ground-up refresh of our 4-year-old website to showcase our new branding and this semester’s projects!</p><h3>🎉 The New Website</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*h9yorpSox-UQmFvJ.gif" /></figure><p>We’re launching our new website today on <a href="https://ubclaunchpad.com/">ubclaunchpad.com</a>! The revamped website features:</p><ul><li>🚀 <strong>a completely refreshed design</strong></li><li>🎁 brand new sections highlighting current and past projects</li><li>🔗 each project now has a shareable modal where teams can showcase their work with a quick pitch, media, and other links</li><li>📱 everything is still fully responsive!</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ku1YnB7yHuTJxgjP.png" /></figure><p>This project has been in the works for a long time, but development only started less than 8 days ago — so if you find any issues <a href="https://github.com/ubclaunchpad/ubclaunchpad.com/issues">please let us know</a>!</p><h3>🛠 Behind the Scenes</h3><h4>Design</h4><p>Our design team, lead by our wonderful designer <a href="https://github.com/cowjuh">Jenny</a>, first prepared a set of refreshed branding and designs for a new website in early 2019. The design went through several iterations, we showed it off to the club, and… never got around to building it, which is unfortunately because the team did a great job with the designs and it looked <em>great</em>. You can read more about <a href="https://cowjuh.webflow.io/projects/tech/lp-rebrand">the rebranding process on Jenny’s blog</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*aklW9jnFJKCTalN1.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*t8Vem9_e2Vu5LhL1.png" /></figure><p>By the time April 2020 rolled around, we were in desperate need of an online platform aligned with the branding we were sending out to sponsors and partners to showcase this year’s projects.</p><h4>Development</h4><p>There were two main pain points of the existing website (which is over 4 years old at this point) that I wanted to tackle with a rewrite:</p><ul><li>The old website was written with the bare minimum amount of web technologies possible. While this has its advantages, it also meant that nobody really wanted to work on it — learning is a big motivator, and web development at larger firms tend to revolve around trendy web frameworks nowadays. It also meant that adding any sort of interactive required adding gnarly JavaScript and jQuery that nobody really wanted to maintain. It also meant that code reuse could be rather difficult, even though the CSS classes were reasonably well-maintained.</li><li>The website was difficult for non-technical folks (and frankly anyone not familiar with the codebase) to update. With <a href="https://github.com/ubclaunchpad/ubclaunchpad.github.io-old">everything piled up in one massive </a><a href="https://github.com/ubclaunchpad/ubclaunchpad.github.io-old">index.html and a handful of JavaScript files</a>, the website quickly lagged behind in content, and there were times when we didn&#39;t even add club signup links on the website until well into a recruitment season.</li><li>We’d made a few attempts at starting development on the website before, but unfortunately since it was always treated as more of a club “side project” or an off-season project, it was quite difficult to get the ball rolling and development would quickly fizzle out.</li></ul><p>In hopes of remedying these issues, I made two major decisions right as I started:</p><ul><li>I chose an approachable web framework, in this case <a href="https://vuejs.org/">Vue.js</a>. Its template-based approach seemed well-suited to the mostly-static website that we were going to build, while being reasonably trendy and flexible enough to accommodate new integrations in the future (for example, with our <a href="https://github.com/ubclaunchpad/rocket2">Slack bot</a>). To go with it I chose <a href="https://www.typescriptlang.org/">TypeScript</a>, a typed superset of JavaScript, which would serve as a form of self-documentation for future Launch Pad students to leverage.</li><li>I wanted as much of the website’s information configurable through a familiar yet easily validated format. Updating the projects featured on the website or our sponsors or the positions open for application should be a simple matter of editing a single file and redeploying the website. To do this, I added <a href="https://github.com/ubclaunchpad/ubclaunchpad.com/blob/master/src/data/types.ts">TypeScript types for the data we would need</a> and a <a href="https://github.com/ubclaunchpad/ubclaunchpad.com/blob/master/src/config.ts">single file, </a><a href="https://github.com/ubclaunchpad/ubclaunchpad.com/blob/master/src/config.ts">config.ts, where all the website data could be viewed and edited</a>. Accompanying this is an automatically generated <a href="https://ubclaunchpad.com/config/">configuration guidelines website</a> that provides additional instructions and presents documentation on every single field in a hopefully digestible and not-overly-intimidating matter.</li></ul><p>To get the project off the ground with some momentum, I decided I would build the initial implementation by myself. I <a href="https://github.com/ubclaunchpad/ubclaunchpad.com/commit/64e720c4bb1fd74f9aa49fd4096b10a25a5212fe">started off on my own on April 17th</a>, <a href="https://github.com/ubclaunchpad/ubclaunchpad.com/issues/16">finished implementing a first pass of the entire website just <em>two</em> days later</a>, set up what documentation I could, and opened the project up to contributions from the club!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Da4fl-ykXVi_fKmV.png" /></figure><p>Despite having a website you could scroll through that looked pretty close to the actual design, there was still a significant amount of work to be done:</p><ul><li>mobile-friendliness was pretty poor in some sections</li><li>content had to be created and collected for projects, both old and new, to feature on the website</li><li>nothing was interactive — most notably, there wasn’t even a way to see a project’s description at first</li><li>parts of the design were a bit rough around the edges once implemented</li></ul><p>…and the list went on and on, and grew as we continued to add features. Thankfully, a couple of members stepped up and did some <em>great</em> work helping bring the project to a state where we could retire the old website. I’d like to give special thanks to:</p><ul><li><a href="https://github.com/RachitMalik12">Rachit</a> for <a href="https://github.com/ubclaunchpad/ubclaunchpad.com/pull/45">wireframing and implementing the first iteration of the project modal</a>, amongst many other contributions, and for participating in discussions</li><li><a href="https://github.com/srijonsaha">Srijon</a> for improvements like <a href="https://github.com/ubclaunchpad/ubclaunchpad.com/pull/42">some awesome on-hover interactions</a> and providing tons of feedback on the design and implementation</li><li><a href="https://github.com/renehuang8822">Rene</a> and <a href="https://github.com/SophieMBerger">Sophie</a> for trying out the new configuration format to add content to the website</li><li>Everyone who gave the website trial runs and provided feedback!</li><li><a href="https://github.com/cowjuh">Jenny</a>, who lead the design of the website (and all our recent branding efforts!), as well as everyone who participated in our previous attempts at building the website</li></ul><p>All together, this entire project took us <strong>just 8 days</strong> (April 17th to April 25th) to bring to launch, which I think is not too shabby of an achievement. Thank you to everyone who participated!</p><p>Feel free to check out our work on our project repository:</p><p><a href="https://github.com/ubclaunchpad/ubclaunchpad.com">ubclaunchpad/ubclaunchpad.com</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/120/1*lJ-HSdInvyYVvUc6QQS0rA.png" /><figcaption><a href="https://www.ubclaunchpad.com/"><strong>ubclaunchpad.com</strong></a><strong> </strong>— UBC’s leading software engineering club.<br>Stay in touch: <a href="https://www.facebook.com/ubclaunchpad"><strong>Facebook</strong></a><strong> | </strong><a href="https://www.instagram.com/ubclaunchpad/"><strong>Instagram</strong></a><strong> | </strong><a href="https://www.linkedin.com/company/ubc-launch-pad/"><strong>LinkedIn</strong></a></figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=42175181d644" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ubc-launch-pad-software-engineering-blog/introducing-the-new-launch-pad-website-42175181d644">Introducing the New UBC Launch Pad Website</a> was originally published in <a href="https://medium.com/ubc-launch-pad-software-engineering-blog">UBC Launch Pad Software Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[UBC Launch Pad Year in Review (2018-2019)]]></title>
            <link>https://medium.com/ubc-launch-pad-software-engineering-blog/ubc-launch-pad-year-in-review-2018-2019-6a7444f02c46?source=rss-d9eaded8f572------2</link>
            <guid isPermaLink="false">https://medium.com/p/6a7444f02c46</guid>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[university]]></category>
            <category><![CDATA[students]]></category>
            <category><![CDATA[clubs]]></category>
            <dc:creator><![CDATA[Robert Lin]]></dc:creator>
            <pubDate>Fri, 10 May 2019 07:41:44 GMT</pubDate>
            <atom:updated>2019-05-11T06:58:07.422Z</atom:updated>
            <content:encoded><![CDATA[<h4>🐒 the story of two semesters of student hackery</h4><p>Launch Pad is a student-run software engineering club where students form team to develop a project from ideation to (hopefully) completion over the course of several semesters. 🤖</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9f_0Md7GxFDzISTM" /></figure><p>When working on projects like this, it’s easy to forget how far you’ve come. Unlike a hackathon, where you spend 24 to 48 hours to hack a small app together, Launch Pad projects are the product of months and months of continued iteration by teams of 4 to 8 developers and designers (and sometimes more!), and during this process, it’s easy to feel like you aren’t making much progress, especially if after a semester your project still feels like a barely functioning, buggy application. 😢</p><p>However, juggling full university course-loads, friends, procrastination, job searches, and development of a Launch Pad project is no mean feat, especially when many of our members join us with very little experience. Now that the school year is wrapping up, I think it’s a great time to take a moment and celebrate everyone’s accomplishments! Making things is hard, and doing it with a team is harder — it takes time, you make a lot of mistakes along the way, and there is a <em>lot</em> to learn. It’s awesome to see how far everyone has come in this brief span of time, and I’m grateful to have had the opportunity to meet and work with so many enthusiastic and talented peers, especially those in our graduating class of 2019.</p><p>So here is a quick UBC Launch Pad year in review! 🤗 Each section will be pretty light on the specifics of what each project aims to do, but if you’re interested check out the linked project repositories!</p><p>(Unfortunately some of these summaries are a bit brief if I didn’t get to work very closely with the team, and also because I got a bit lazy 😓)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A32rCB9VCh6JGshbtYhCuA.png" /><figcaption>Almost 500 pull requests merged across all Launch Pad repos in the past 6 months! 💪Graph generated by <a href="https://pullreminders.com/">Pull Reminders</a>, which unfortunately doesn’t provide data spanning the full 8 months of the past 2 semesters. 😢</figcaption></figure><h3>Pinpoint</h3><blockquote>📊 Versatile applicant management for any organization</blockquote><p>Pinpoint is a tricky project. We opted for a stack none of the team were familiar with, and our choice of database — DynamoDB — was something we all struggled to get a grasp on. We also unfortunately faced issues with members disappearing as the semester went on. As a tech lead I also failed a little here I think, by setting up the project in a way that encouraged people to work on small components of the codebase (we didn’t end up working fast enough to justify this), and being a little too loose with our project specifications, which lead to more confusion than the productive brainstorming I had imagined 😅</p><p>That said, the team at Pinpoint put together 44 pull requests without me, spanning 9 contributors and an average of 31 commits each. We didn’t get a fully functioning project in the end, but we got pretty close — most of the pieces are there thanks to the hard work on the project’s most active members, and I’m confident we can get it to a usable state. Everyone also got the chance participate in designing the user experience with our designers.</p><p>A member of Pinpoint (Srijon!) also produced a fantastic piece of artwork the night before our last demo that reflected a problem we had quite nicely:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*RfPvJC_AG6UimYaPnlnvjg.jpeg" /><figcaption>Thanks guys 😢</figcaption></figure><h3>Inertia</h3><blockquote>✈️ Effortless, self-hosted continuous deployment for small teams and projects</blockquote><p>Inertia is UBC Launch Pad’s largest codebase by far, spanning over a year of work by over 15 contributors before this semester’s team even got their hands on the project. A lot of it was written by me, and by that I mean a good chunk of the codebase was less than stellar.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2imdFOzIe_4RidGABTY9_g.png" /><figcaption>A git diff burndown of <a href="http://git@github.com:ubclaunchpad/inertia.git">Inertia</a> over its 15+ months of development. Each coloured band represents code added in each time interval — you can see that lots of code ends up getting replaced, signs that we were continuously iterating and improving on existing code as we learned. This semester’s team’s work is denoted by the blue bands, and indicates a significant amount of work on the existing codebase, so woo! This graph was generated using <a href="https://github.com/src-d/hercules">src-d/hercules</a>.</figcaption></figure><p>Getting a pull request in for Inertia can be a bit of a daunting task — with over 13,000 lines of code across 36 “packages”, the project’s scope is very difficult for inexperienced members to manage. Inertia also depends on pretty intimate knowledge of Golang and Docker, and the problems it aims to solve don’t have particularly straight-forward solutions. The project is also surrounded by a lot of intimidating tooling, leveraging custom test environments, some code generation tools, and more.</p><p>So I’m super proud that most of this semester’s team managed to learn a bit about the technologies that Inertia leverages, stay engaged throughout the development process, and contribute pull requests of their own that will allow us to build more features for Inertia in the future! As a lead I’ve always struggled with onboarding members for this project, but I hope that everyone in the team got something out of their work.</p><ul><li><a href="https://inertia.ubclaunchpad.com/">Inertia Usage Guide</a></li><li><a href="https://github.com/ubclaunchpad/inertia">ubclaunchpad/inertia</a></li></ul><h3>Rocket 2</h3><blockquote>🚀 Slack bot, team management, and onboarding system for UBC Launch Pad</blockquote><p>Internally at UBC Launch Pad, team creation, management, and onboarding is managed by a bot we call Rocket. The <a href="https://github.com/ubclaunchpad/rocket">initial iteration of the bot</a> has proved a bit difficult to build on, and quite buggy, so this semester a team set out to rebuild it from scratch using a new tech stack, best practices, well-defined documentation, and a better architecture.</p><p>The Rocket 2 team has proven to be one of this year’s most active teams, accumulating almost a thousand commits and making significant progress laying the foundation for the future of Launch Pad’s beloved Slack bot.</p><p><a href="https://github.com/ubclaunchpad/rocket2">ubclaunchpad/rocket2</a></p><h3>Bounce</h3><blockquote>🏀 Bringing people with common interests together</blockquote><p>Over the course of the year the “Bounce” team has certainly come a long way. Most of the team started with limited knowledge of web development and the languages, tools, and frameworks we were using to develop our application (Python, React, Postgres, and Docker).</p><blockquote>As is often the case, the idea was simple, so we figured the implementation shouldn’t be that difficult. Of course, we were mostly wrong about that.</blockquote><blockquote>— Bruno, Co-President and “Bounce” Tech Lead</blockquote><p>In an attempt to flatten the learning curve, Bruno (the team’s lead) tried an to get each member to start working exclusively on one part of our project — either the frontend or the backend. However, as time went on he realized that developers would often design their features without a true understanding of how they would be used by other components of the project simply because they’d never worked on other components of the project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J-y8V3OEitennZxRSAfpTg.png" /><figcaption>The “Bounce” web app looking crisp, despite the team’s hurdles! 💇‍♂</figcaption></figure><p>Although they didn’t achieve all of their end goals, they still wrapped up the semester with an application that was at least partially complete, and made two impressive demos during the semester that demonstrated their progress. And at the end of the day, what matters is most is what you <em>learn</em>, as Bruno puts quite aptly:</p><blockquote>Most importantly, however, I am confident that each member of the team acquired valuable high-level web development knowledge and gained familiarity with industry standard tools and languages that they’ll likely use in the future.</blockquote><p><a href="https://github.com/ubclaunchpad/bounce">ubclaunchpad/bounce</a></p><h3>Room8</h3><blockquote>🏠 A roommate organization mobile app</blockquote><p>Room8 is a roommate organization platform on Android. The app will allow roommates to organize themselves into a group and assign tasks to each other. The app itself will assist them in creating a schedule and rotating tasks for each roommate.</p><blockquote>Being a team thats mostly made up of first years, it’s pretty good that people came and taught themselves a new platform and also helped each other grow.</blockquote><blockquote>— Sam, “Room8” Tech Lead</blockquote><p>Check out the project and some screenshots in more detail on their GitHub repository!</p><p><a href="https://github.com/ubclaunchpad/Room8">ubclaunchpad/Room8</a></p><h3>Soil TopARgraphy</h3><blockquote>🌱 Android app that teaches soil science students in APBI 200 through augmented reality (AR)</blockquote><p>Soil TopARgraphy is an app that allows users to view topographical distribution of different soil types through an Augmented Reality (AR) terrain. It was developed to help students in the UBC’s APBI 200 — Introduction to Soil Science course and other soil-related courses, learn about the effects of topography on the formation of different soil types in an immersive and visual manner.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UGtwybH3sRiYX4tk6KanJA.png" /></figure><p>Using augmented reality, different soil orders are shown within one real-life terrain across different parts of topography. We chose an area just north of Kamloops, British Columbia as an example of the terrain model since the region is characterized by a great diversity of soil types.</p><p>More details about the app is available on the <a href="http://eml.ubc.ca/projects/soil-topargraphy">project website</a>. Soil TopARgraphy is also available on the iOS App Store and the Google Play Store — links below!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vkMKSdft7cXCMLhH2PiNDQ.jpeg" /><figcaption>Members of the Soil TopARgraphy Team showing off their work at the Multidisciplinary Undergraduate Research Conference (MURC) 📚</figcaption></figure><ul><li><a href="https://itunes.apple.com/ca/app/soil-topargraphy/id1456185352?mt=8">‎Soil TopARgraphy</a></li><li><a href="https://play.google.com/store/apps/details?id=ca.ubc.eml.topargraphy">Soil TopARgraphy - Apps on Google Play</a></li><li><a href="https://github.com/ubclaunchpad/soil-topARgraphy">ubclaunchpad/soil-topARgraphy</a></li></ul><h3>Internado</h3><blockquote>🌪 Find Internship Opportunities</blockquote><p>Internado (arguably) had a bit of a head start on the other teams, with 10 relatively experienced student web developers. They were one of the first teams to deploy a website you could actually visit, so getting started clearly wasn’t an issue: <a href="https://internado.ubclaunchpad.com/">https://internado.ubclaunchpad.com/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1I3AZX8fUbG2Lfe85K5UTw.png" /></figure><p>That being said, several parts of our tech stack were new to the team. Everyone had very little experience with PostgreSQL, Semantic UI, and Docker, so related development took some time. They also faced issues with some of their decisions:</p><blockquote>There are a few parts of our process we could’ve improved. First, the eternal problem of feature creep. There are still a few features we haven’t managed to implement. We also chose to go with a microservices architecture, dividing search and auth into separate services because we thought we’d add even more additional services later. It turned out to be unnecessary — we didn’t need any more services — and made deployment harder.</blockquote><blockquote>— Sherry, Co-President and “Internado” Tech Lead</blockquote><p>However, the team was great about sharing learning resources and working together and they were able to build the project relatively quickly while still allowing everyone to learn new skills, which was very impressive! Great job everyone! 👏</p><p>(though as Sherry pointed out to me, y’all could use a few more tests 😉)</p><p><a href="https://github.com/ubclaunchpad/Internado">ubclaunchpad/Internado</a></p><h3>Mimic</h3><blockquote>💬 Mimicking text for great fun and delight</blockquote><p>Mimic was this year’s only machine learning project. The team aimed to build a project that was a mix of experimenting with machine learning techniques, data wrangling, and developing a service. Mimic mimics the style of a given corpus to generate text.</p><p>They ended the semester with a neat demo that demonstrated how Mimic could generate text based on a corpus of Shakespeare plays or Trump tweets, which was pretty neat! Check out their repository for more details.</p><p><a href="https://github.com/ubclaunchpad/mimic">ubclaunchpad/mimic</a></p><h3>Mikado</h3><blockquote>🧳 Organize your next adventure</blockquote><p>Mikado is this year’s only iOS team. Unfortunately, delays in our interview process, bad timing with various holidays, and Apple’s WWDC sponsorship applications meant that the team did not get very far with the project. There’s a bit of code and concepts in the repository, however, and hopefully the team will be back next semester to tackle the idea again!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fxDnqKVk2FMDBw_GaMn1vg.png" /><figcaption>They have a nifty website showing off the app’s concept: <a href="https://ubclaunchpad.github.io/mikado/">https://ubclaunchpad.github.io/mikado/</a></figcaption></figure><p><a href="https://github.com/ubclaunchpad/mikado">ubclaunchpad/mikado</a></p><h3>Design</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EkzyWr4TuduVeHp6W2ZdCw.png" /><figcaption>Updated Launch Pad branding and colour scheme for 2018–2019</figcaption></figure><p>This year, we decided to recruit a larger team of designers who could work together and help each other out (since in the past, designers have simply been embedded in the developer teams and left on their own 😢). Many members of the team joined us without a strong background in UI/UX, and most have never worked in design as a team before.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tNaEKr3TG4_YfRFWZ1RWOw.jpeg" /><figcaption>some of the designers came up with this new UBC Launch Pad gang sign, which you’ll see in many of our group photos 🔺🤑</figcaption></figure><p>Despite the hurdles, the new design team did some awesome work this year, ranging from learning to use the design tool <a href="https://www.figma.com/">Figma</a>, branding updates (see above), marketing material and banners for events like <a href="https://www.facebook.com/events/753797034986865/">Project Hub</a>, designs and assets for projects with a user-facing interface, an amazing new <a href="https://www.ubclaunchpad.com/sponsorship.pdf">sponsorship package</a> (our previous one was a simple Word document…), a new gang sign, and more! 🎉</p><p>A huge part of this is thanks to Jenny, the super-talented design lead and incoming co-president of UBC Launch Pad! 💪</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BOhyCYcBWYhNSmeaeo5ccA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8jfBy1xwBNMMiKthHtpmHg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JdBpz42oMbtuCgvDYYLFcg.png" /><figcaption>Many, many iterations of the upcoming new <a href="https://www.ubclaunchpad.com/">ubclaunchpad.com</a> 😅</figcaption></figure><h3>Strategy</h3><p>Strategy at UBC Launch Pad has always been a tricky role — as a club, we are a bit of a tough sell for potential sponsors, since we focus on providing a long-term and supportive learning environment that doesn’t draw the same sorts of numbers and audiences that (for example) a hackathon does. Given what they had to work with, this year’s strategy team did a stellar job, streamlining their workflow, documenting their progress, and reaching out to potential partners. They also did a lot of great work in gathering statistics and potential selling points for the design team when creating the new <a href="https://www.ubclaunchpad.com/sponsorship.pdf">sponsorship package</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1NSSF2ETjDillHlTlOMVPQ.png" /><figcaption>An impressive spreadsheet strategy member Max put together from <a href="https://github.com/bobheadxi/GreenSquares.jl">a script I wrote</a> in preparation for this year’s <a href="https://www.ubclaunchpad.com/sponsorship.pdf">sponsorship package</a> 😲📈</figcaption></figure><p>Thanks to their work, we were able to push for a number of new initiatives this semester, such as sponsored team lunches and events like <a href="https://www.facebook.com/events/753797034986865/">Project Hub</a>!</p><h3>Other Shenanigans</h3><p>We do lots of other stuff too! Check out our <a href="https://www.instagram.com/ubclaunchpad/">Instagram</a>, where we post some of the other fun activities we do together, such as competing in Storm the Wall and the Vancouver Sun Run, going to the CSSS cruise, board game nights, and more!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mEKa5IltB1x-fUO9LhAwcg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uh9_D9zxVWekrzdy1oJAhw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AfAuZSntszs2iWTpDs76Ow.jpeg" /><figcaption>the Launch Pad team out and about! 👋</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BK1-usY9pOJfI6OUeJFDkg.jpeg" /><figcaption>❤️🚀</figcaption></figure><p>We do a round of recruiting at the start of most semesters — keep an eye out on our social media if you are interested in joining us! Also feel free to get in touch by coming to our events or shooting a message on our Instagram and Facebook profiles. 📬</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/120/1*lJ-HSdInvyYVvUc6QQS0rA.png" /><figcaption><a href="https://www.ubclaunchpad.com/"><strong>ubclaunchpad.com</strong></a><strong> </strong>— UBC’s leading software engineering club.<br>Stay in touch: <a href="https://www.facebook.com/ubclaunchpad"><strong>Facebook</strong></a><strong> | </strong><a href="https://www.instagram.com/ubclaunchpad/"><strong>Instagram</strong></a><strong> | </strong><a href="https://www.linkedin.com/company/ubc-launch-pad/"><strong>LinkedIn</strong></a></figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6a7444f02c46" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ubc-launch-pad-software-engineering-blog/ubc-launch-pad-year-in-review-2018-2019-6a7444f02c46">UBC Launch Pad Year in Review (2018-2019)</a> was originally published in <a href="https://medium.com/ubc-launch-pad-software-engineering-blog">UBC Launch Pad Software Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Turning Slate into a proper documentation builder]]></title>
            <link>https://medium.com/@bobheadxi/turning-slate-into-a-proper-documentation-builder-d0cf31abf459?source=rss-d9eaded8f572------2</link>
            <guid isPermaLink="false">https://medium.com/p/d0cf31abf459</guid>
            <category><![CDATA[documentation]]></category>
            <category><![CDATA[bash]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[script]]></category>
            <category><![CDATA[hacks]]></category>
            <dc:creator><![CDATA[Robert Lin]]></dc:creator>
            <pubDate>Sat, 09 Feb 2019 04:29:50 GMT</pubDate>
            <atom:updated>2019-02-09T04:43:33.852Z</atom:updated>
            <content:encoded><![CDATA[<h4>No thanks I don’t want to fork your repository. 😶</h4><p>I’m currently working with <a href="https://medium.com/u/36f641e4dfc2">RTrade Technologies, Ltd.</a> and <a href="https://gateway.temporal.cloud/ipfs/Qma4DNFSRR9eGqwm93zMUtqywLFpTRQji4Nnu37MTmNntM/account.html#account-api">a documentation website</a> was recently set up for one of our APIs. I thought it looked great, and slick, and super nice.</p><p>I was told the documentation was generated using a project called <a href="https://github.com/lord/slate">Slate</a>, and after taking a look I knew I had to try it out. It’s very pretty.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NMCPwETJJL7-pIy4XCitYA.png" /><figcaption><a href="https://raw.githubusercontent.com/lord/img/master/screenshot-slate.png">Wow!</a></figcaption></figure><p><a href="https://github.com/lord/slate">lord/slate</a></p><p>First step: read some docs. “<a href="https://github.com/lord/slate#getting-started-with-slate">Getting Started with Slate</a>” seemed like a good place to get started.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Kbh0N4Y-zei5FugpvJBIlA.png" /></figure><p>Mhm, looking good so far. I’ve got all those things.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ADt1iYcAHB3PKLu2iRf9PA.png" /></figure><p>Hold up. What? Is this telling me that I can’t just “use” this thing to build documentation as a tool? I need to fork it and change it?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Lo46Pmh9O0Eln5bMnqHLEg.png" /><figcaption>…uh</figcaption></figure><p>Okay great. Well, I don’t want to do that. I want my documentation to be part of my repository, so it can be versioned alongside our code, and I don’t want to carry around the baggage of an entire repository alongside my documentation. So let’s not do that, and try to hack Slate into a proper doc builder.</p><h3>Making the Script</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FKFLru5OFtMI%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DKFLru5OFtMI&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FKFLru5OFtMI%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/5452f4756702e97cc87bc44a57f4591a/href">https://medium.com/media/5452f4756702e97cc87bc44a57f4591a/href</a></iframe><pre>mkdir -p docs_build<br>cd docs_build<br>if [ ! -d slate ]; then<br>  git clone <a href="https://github.com/lord/slate.git">https://github.com/lord/slate.git</a><br>fi</pre><p>To start off, I want my script to grab the repo (I’ll need it one way or another) and chuck it into a temporary directory. I called it docs_build and chucked it into my .gitignore where it belongs.</p><p>Next, I’ll go ahead and symlink everything that I’m <em>supposed </em>to change in my “fork” from where I want my <strong>actual </strong>documentation to be — I decided to call it docs_src — into the cloned Slate repo.</p><pre># in /docs_build</pre><pre># documentation<br>ln -fs &quot;$(dirname &quot;$(pwd)&quot;)&quot;/docs_src/index.html.md \<br>  slate/source/index.html.md</pre><pre># CSS variables (colours, etc.)<br>ln -fs &quot;$(dirname &quot;$(pwd)&quot;)&quot;/docs_src/stylesheets/_variables.scss \<br>  slate/source/stylesheets/_variables.scss</pre><pre># cute logo!<br>ln -fs &quot;$(dirname &quot;$(pwd)&quot;)&quot;/.static/inertia.png \<br>  slate/source/images/logo.png</pre><p>Note that when creating a symlink with ln -s , you should use the full directory path as your source, or the link could point to something nonexistent. In this case, I opted to use pwd and join it to the file I’m trying to link from.</p><p>Next, I’ll need to install Slate’s dependencies:</p><pre># in /docs_build</pre><pre>cd slate<br>bundle install</pre><p>And hypothetically I should be good to go!</p><pre># in /docs_build/slate</pre><pre># build docs into the /docs directory<br>bundle exec middleman build --clean --build-dir=../../docs</pre><p>The build works, and all seems well. Let’s check out live reload:</p><pre># in /docs_build/slate</pre><pre>bundle exec middleman server --verbose</pre><p>If you’re following along, you’ll probably notice that this step tragically does not work properly — editing a file in my /docs_src directory does not trigger a reload.</p><p>This probably happens because a symlink doesn’t usually play well with file watchers, and poking around the Middleman repository issues reveals a few (such as <a href="https://github.com/middleman/middleman/issues/1690">this one</a>) that reveals this is likely the problem. Some more digging surfaces a <a href="https://github.com/middleman/middleman/issues/2054#issuecomment-280082417">files.watch feature</a> that seems to do what I want: add my symlink source directories as a trigger for rebuilds.</p><p>The problem is, I need to add this to config.rb , which is in the Slate repository, and I want to maintain my Slate-as-a-doc-builder feature, which means any configuration changes I make must be scripted and perfectly reproducible.</p><pre>TEMPLATE_FILES_WATCH= \<br>  &quot;files.watch :source, path: File.join(root, &#39;../../docs_src&#39;)&quot;</pre><pre>if ! grep -q &quot;$TEMPLATE_FILES_WATCH&quot; slate/config.rb ; then<br>  echo &quot;$TEMPLATE_FILES_WATCH&quot; \<br>    &gt;&gt; slate/config.rb<br>fi</pre><p>Nice! This script checks for if my custom files.watch directive is already in Slate’s config.rb , and if not, append it to the end. Now running the Middleman server successfully live-reloads my changes to <a href="http://localhost:4567/">http://localhost:4567</a> !</p><p>I’m not quite done though — I also want my site to have a favicon. I figured this might be a configuration option in index.html.md , but <a href="https://github.com/lord/slate/wiki/Adding-a-favicon">it’s not</a>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FZ74gSKGsxTeZHzZUvVREg.png" /><figcaption>Hey, I just realized the author’s name is Robert as well!</figcaption></figure><p>Well that’s just great. Time to whip out some sed :</p><pre>LAYOUT=&quot;slate/source/layouts/layout.erb&quot;</pre><pre>if ! grep -q &quot;&lt;%= favicon_tag &#39;favicon.ico&#39; %&gt;&quot; &quot;$LAYOUT&quot; ; then<br>  sed -i &#39;&#39; &#39;/&lt;head&gt;/a\<br>  &lt;%= favicon_tag &#39;\&#39;&#39;favicon\.ico&#39;\&#39;&#39; %&gt;<br>  &#39; slate/source/layouts/layout.erb<br>fi</pre><p>This checks the layout for the favicon tag, and if it’s not there, insert it right after the &lt;head&gt; tag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IWlraMnz3mC4t9u_UW6-xQ.png" /><figcaption>There it is!</figcaption></figure><p>Then I had to add the favicon to my list of things to symlink:</p><pre>ln -fs &quot;$(dirname &quot;$(pwd)&quot;)&quot;/.static/favicon.ico \<br>  slate/source/images/favicon.ico</pre><p>And it worked! bundle exec middleman server kindly updated my local deployment to show my shiny new favicon:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*Z78Fb9yTztRALIwgThmaFw.png" /><figcaption>Marvellous.</figcaption></figure><h3>Finishing Touches</h3><ul><li>I tied everything up together into a <a href="https://github.com/ubclaunchpad/inertia/blob/master/.scripts/build_docs.sh">tidy (I hope), documented (I think) script</a>.</li><li>I also added a some Makefile targets to run the build script and the live-reload server.</li><li>Of course, <a href="https://github.com/ubclaunchpad/inertia/blob/master/CONTRIBUTING.md#documentation">writing and building documentation needs documentation as well</a>.</li><li>I <a href="https://github.com/bobheadxi/slate">forked Slate</a> (and <a href="https://github.com/lord/slate/pull/1059">opened a PR upstream</a>) to add some more customization features (mostly in the CSS variables), and am currently using this fork in my script.</li><li>I deployed the documentation to <a href="https://inertia.ubclaunchpad.com/">https://inertia.ubclaunchpad.com/</a></li></ul><p>Here’s what the documentation site looks like now:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fSQLmcXU6XELwEw65nlJSQ.png" /><figcaption>wheeeee</figcaption></figure><p>Feel free to check out the <a href="https://github.com/ubclaunchpad/inertia/commit/40bfc25c78e5110c690b379b96476f258d3d897b">commit</a> or <a href="https://github.com/ubclaunchpad/inertia/pull/536">pull request</a> that added all this stuff to <a href="https://github.com/ubclaunchpad/inertia">Inertia</a>, a <a href="https://www.ubclaunchpad.com/">UBC Launch Pad</a> project!</p><ul><li><a href="https://github.com/ubclaunchpad/inertia">ubclaunchpad/inertia</a></li><li><a href="https://medium.com/ubc-launch-pad-software-engineering-blog/building-continuous-deployment-87a2bd8eedbe">Inertia — Building a Simple, Self-Hosted Continuous Deployment Solution</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d0cf31abf459" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Optimizing Travis CI Pipelines]]></title>
            <link>https://medium.com/ubc-launch-pad-software-engineering-blog/optimizing-travis-ci-pipelines-36973aea3758?source=rss-d9eaded8f572------2</link>
            <guid isPermaLink="false">https://medium.com/p/36973aea3758</guid>
            <category><![CDATA[travis-ci]]></category>
            <category><![CDATA[optimization]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[continuous-integration]]></category>
            <dc:creator><![CDATA[Robert Lin]]></dc:creator>
            <pubDate>Sun, 10 Jun 2018 22:52:26 GMT</pubDate>
            <atom:updated>2018-12-15T06:19:01.711Z</atom:updated>
            <content:encoded><![CDATA[<h4>Reducing Inertia’s continuous integration build time by over 75% using build stages, caching, and job concurrency</h4><p>Travis CI is the continuous integration tool most of the teams at <a href="https://www.ubclaunchpad.com/">UBC Launch Pad</a> — UBC’s student-run software engineering club — use to handle their projects’ CI needs. We currently have <a href="https://travis-ci.org/ubclaunchpad">14 Travis-enabled projects</a>, 8 of which have been active in the last month.</p><p><a href="https://travis-ci.com/">Travis CI - Test and Deploy with Confidence</a></p><p>At Launch Pad, I have mostly been working on <a href="https://github.com/ubclaunchpad/inertia">Inertia</a>, our in-house continuous deployment tool. Ever since we first set up a Travis CI pipeline, Inertia has always had rather long build times — there’s a number of integration tests in the codebase, and the build process involves several Docker image builds that can take quite a while.</p><p>Yesterday, however, Launch Pad’s new <a href="https://github.com/ubclaunchpad/durian">Programming Language Team</a> came over and asked if we could cancel a few of our builds, since it seemed to be holding up their pull request builds. That’s when I realized just how long Inertia builds were taking — upwards of 90 minutes total. Yikes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E-nB-EwBDq-n29-SySAFbw.png" /></figure><p>This post will go over the steps I took to remedy this situation and talk about how to take advantage of Travis’s caching, build stages, and job concurrency features.</p><h4>Contents</h4><ul><li><em>Inertia’s CI Pipeline</em></li><li><em>Getting Rid of Jobs</em></li><li><em>Caching Assets via Build Stages</em></li><li><em>Taking Advantage of Job Concurrency</em></li><li><em>Results</em></li></ul><h3>🚚 Inertia’s CI Pipeline</h3><p>For some context, our old build procedure went something like this:</p><ol><li>Install dependencies and utilities like a coverage reporter and set of binaries used for linting</li><li>Build and start a Docker image for a “mock virtual private server” for e2e testing of our bootstrap process</li><li>Build a Inertia daemon Docker, also for testing our bootstrap process</li><li>Execute tests — this includes unit tests, bootstrap tests, and build simulations, all of which takes about 7 minutes</li></ol><p>This procedure is repeated for a matrix of environment variables, each representing a VPS platform we wanted to support, defined in our .travis.yml configuration:</p><pre>env:<br>   matrix:<br>    - VPS_OS=ubuntu VERSION=16.04<br>    - VPS_OS=debian VERSION=9.3<br>    - VPS_OS=centos VERSION=7<br>    - VPS_OS=amazon VERSION=latest<br>    - VPS_OS=ubuntu VERSION=latest<br>    - VPS_OS=debian VERSION=latest<br>    - VPS_OS=centos VERSION=latest<br>   allow_failures:<br>    - env: VPS_OS=ubuntu VERSION=latest<br>    - env: VPS_OS=debian VERSION=latest<br>    - env: VPS_OS=centos VERSION=latest</pre><p>Each of these entries generates a “job”, each of which runs concurrently (up to a limit) and does the same thing. The allow_failures entry represents jobs that will run, but are allowed to fail without marking the entire build as failed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wlRWWNNIfHjG6MDI0nV0WA.png" /></figure><p>This means that for each of these entries, Travis runs through our <em>entire</em> pipeline, even though the only difference is in a single bootstrap test. It also runs our linter and builds an Inertia daemon Docker image once for each job, even if they are identical across each job. We also realized the allowed_failures jobs were a bit useless — they never really failed for any legitimate reason, and most VPS services did not offer such bleeding edge operating systems anyway. This gave me a good place to start.</p><h3>🏃 Reducing Travis Build Runtime</h3><h4>1. Getting Rid of Jobs 😱</h4><p>This first step was pretty straight forward — removing the allowed_failures jobs from our build matrix. This easily shaved more than 10 minutes off a typical build’s runtime and lopped off a whopping 36 or so minutes from each build’s total runtime. 🔪 While these builds were nice to have, they weren’t really contributing any real development value, so away they go.</p><h4>2. Caching Assets via Build Stages 📦</h4><p>This step requires taking advantage of Travis’s <a href="https://docs.travis-ci.com/user/caching/">caching</a> and <a href="https://docs.travis-ci.com/user/build-stages/">build stage</a> features. The latter is currently been beta (though it has been for a while), but I’ve found that it works pretty well.</p><p>Caching is typically used to persist data across sequential builds to skip lengthy steps that do not often change, such as installing Ruby dependencies. I’m not sure how I feel about that, however — I prefer each build to go through the same steps as every other build.</p><p>Instead, I opted to use it in combination with Travis’s build stages instead — while <em>jobs</em> run concurrently, <em>stages</em> run sequentially, and it seemed a good place as any to prepare and cache <em>all </em>the shared dependencies of each test job before starting Inertia’s test scripts.</p><p>To do this, first set up the directories you want cached:</p><pre>cache:<br>  directories:<br>    - vendor<br>    - images<br>    - daemon/web/node_modules</pre><p>Then, set up a job and stage that will handle populating these caches:</p><pre>jobs:<br>  include:<br>    - stage: precache<br>      script: true<br>      install:<br>        - go get github.com/golang/dep/cmd/dep<br>        - dep ensure              # cache vendor<br>        - make testdaemon-image   # cache images<br>        - make web-deps           # cache node_modules</pre><p>To use this cache, make sure:</p><ul><li>all jobs that require these dependencies run in stages after the precache stage</li><li>all jobs that require these dependencies have the exact same env and language setup — any deviations will result in Travis attempting to look for a cache with the same properties</li><li>make sure that you don’t repeat any of the installation handled in the precache stage</li></ul><p>When you run your next Travis build, you should see something like the following in your build logs:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q3OvwBvy2hIzWLGXbUgboQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dSziFdGCWC7pU973TiljXw.png" /><figcaption>The precache stage is followed by all your other stages — note how each job’s setup (language and environment) is identical.</figcaption></figure><p>And that’s it! You now have a build stage dedicated to setting up your build dependencies — installation no longer needs to be repeated for each job, since each will pull the required assets from the cache. For Inertia, this took 3 to 4 minutes off each build, which saves more than 12 minutes of total runtime per build. 🙈 Since a test build occurs in this stage as well, any compilation error will immediately fail and stop the entire build before any tests start, which could potentially save quite a lot of time as well.</p><h4>3. Taking Advantage of Job Concurrency 🚆</h4><p>While build stages run sequentially, all jobs within a build stage will run at the same time. It’s pretty common practice to take advantage of this by not just paralellizing different environment setups, but entirely different tasks as well.</p><p>In Inertia’s case, our tests have 3 main components:</p><ul><li>the bulk of the test suite (unit and integration)</li><li>one test that runs throught Inertia’s bootstrap process</li><li>linting and static analysis</li></ul><p>Only the second component requires a different environment setup, and the last component is entirely separate from the rest — each can be run in parallel, and the first component only needs to be run once. So I decided on the following setup:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W3RkZy6uGE-vVQOaZ6eHFw.png" /><figcaption>Travis cache is populated by the precache stage, and each job of the test stage will run concurrently.</figcaption></figure><p>To set this up in our Travis configuration:</p><pre>jobs:<br>  include:</pre><pre>    # ...</pre><pre>    - &amp;test<br>      stage: tests and static analysis<br>      install:<br>        - make testenv VPS_OS=ubuntu VPS_VERSION=16.04<br>        - bash test/docker_deps.sh<br>      before_script: make testdaemon-scp<br>      script:<br>        - go test -race -coverprofile=coverage.out ./...<br>      after_success:<br>        - go get github.com/mattn/goveralls<br>        - goveralls -coverprofile=coverage.out</pre><pre>    # Make sure bootstrap works on various other VPS platforms<br>    - &amp;bootstraptest<br>       &lt;&lt;: *test<br>      install: make testenv VPS_OS=debian VPS_VERSION=9.3<br>      script: go test ./... -v -run &#39;TestBootstrapIntegration&#39;<br>      after_success: true<br>    - &lt;&lt;: *bootstraptest<br>      install: make testenv VPS_OS=centos VPS_VERSION=7<br>    - &lt;&lt;: *bootstraptest<br>      install: make testenv VPS_OS=amazon VPS_VERSION=latest</pre><pre>    - &amp;bootstraptest<br>       &lt;&lt;: *test<br>      install: make testenv VPS_OS=debian VPS_VERSION=9.3<br>      script: go test ./... -v -run &#39;TestBootstrapIntegration&#39;<br>      after_success: true<br>    - &lt;&lt;: *bootstraptest<br>      install: make testenv VPS_OS=centos VPS_VERSION=7<br>    - &lt;&lt;: *bootstraptest<br>      install: make testenv VPS_OS=amazon VPS_VERSION=latest</pre><pre>    # Run linter and static analysis<br>    - install: bash test/lint_deps.sh<br>      script: make lint</pre><p>Note how the bootstraptest inherits the &amp;test stage name and before_script, but not its script or after_script — instead of running the entire test suite like the first test does, they just run one test. The last job manages linting and static analysis, and runs within the same stage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xolK4zBr5UlvIe-wwbA-yw.png" /><figcaption>In order: precache, all tests, bootstrap tests (737.3 ~ 737.5), and the linter.</figcaption></figure><h3>🛌 Results</h3><p>With these changes I got some pretty sizeable improvements — granted, a lot of these improvements were only possible thanks to some poor decisions I made regarding the old Travis configuration, but oh well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lJdVcj7-AnvfXtIGU7WFFA.png" /></figure><p>A Travis build is triggered <em>each time</em> a commit is pushed, and if a pull request is open for that branch, <em>two buids </em>are triggered (a PR build and a branch build), so these improvements are really going to add up.</p><p>The new configuration should also give much better feedback — based on which job failed, we will quickly be able to tell what went wrong, whether it was the linter or one of the bootstrap tests. Since the precache stage runs the daemon image build, in the event of a compilation error the whole build will quickly fail and stop as well.</p><p>Hopefully this will mean we won’t be holding up everyone else’s builds as much anymore 😛</p><p><a href="https://github.com/ubclaunchpad/inertia">ubclaunchpad/inertia</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/120/1*lJ-HSdInvyYVvUc6QQS0rA.png" /><figcaption><a href="https://www.ubclaunchpad.com/"><strong>ubclaunchpad.com</strong></a><strong> </strong>— UBC’s leading software engineering club.<br>Stay in touch: <a href="https://www.facebook.com/ubclaunchpad"><strong>Facebook</strong></a><strong> | </strong><a href="https://www.instagram.com/ubclaunchpad/"><strong>Instagram</strong></a><strong> | </strong><a href="https://www.linkedin.com/company/ubc-launch-pad/"><strong>LinkedIn</strong></a></figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=36973aea3758" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ubc-launch-pad-software-engineering-blog/optimizing-travis-ci-pipelines-36973aea3758">Optimizing Travis CI Pipelines</a> was originally published in <a href="https://medium.com/ubc-launch-pad-software-engineering-blog">UBC Launch Pad Software Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[One Year of Writing Bad Code]]></title>
            <link>https://medium.com/@bobheadxi/one-year-of-writing-bad-code-d712f725f1e8?source=rss-d9eaded8f572------2</link>
            <guid isPermaLink="false">https://medium.com/p/d712f725f1e8</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[learning-to-code]]></category>
            <category><![CDATA[self-improvement]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[humorous-life-lessons]]></category>
            <dc:creator><![CDATA[Robert Lin]]></dc:creator>
            <pubDate>Fri, 25 May 2018 05:03:54 GMT</pubDate>
            <atom:updated>2018-05-25T17:16:42.792Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Kqi7sFQz2HH-KTVk1OouHg.png" /></figure><h4>From zero to… zero?</h4><p>A little over a year ago, in the far-away days of 2017, I fell gracefully off my skateboard in an incident that ended with my face intimately embracing the warm tarmac near UBC’s bus loop. I broke two teeth and decorated my hands, knees, and face with an assortment of new holes. Thankfully, some kind strangers at the scene offered me some band-aid, and a friend of mine caught me bleeding out on the curb and helped me to the nearby emergency room, where I finally had a legitimate reason to flash my shiny MSP card.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2uVMvY48Sc-fwurK." /><figcaption>For y’all non-Canadians, <strong>MSP</strong> = <strong>M</strong>edical <strong>S</strong>ervices <strong>P</strong>lan <strong>T</strong>hat <strong>I</strong> <strong>K</strong>eep <strong>F</strong>orgetting <strong>T</strong>o <strong>P</strong>ay <strong>F</strong>or</figcaption></figure><p>The next day, I dropped by a dentist to get my teeth fixed up before heading to work as usual. The storeowner took one look at my face and promptly told me to go home.</p><p>I was rather upset, mostly from the fact that I could only eat soft foods instead of my usual fare of dill pickles and rice. After a day or two of moping about my new diet, lost wages, and updated dental features, I looked up “git guide” and created my first ever GitHub repository. Then I spent days and days looking up “facebook messenger bot” and “node js” and “spotify api” and countless different “how to…” guides. Then I wrote a whole lot of truly terrible code.</p><p>This was something I had told myself I would do over a year prior, when I first set foot on the blessed torn-up grounds near UBC’s construction sites. If I wasn’t so bored of sitting in my dorm avoiding mirrors, I probably never would have started, and I’d still be a second-rate Silver-league player in the game League of Legends. To be fair, I am still in Silver, but at least I don’t play the game anymore, and I get to be a second-rate programmer instead.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FeCqFYAVjjDksg%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FeCqFYAVjjDksg%2Fgiphy.gif&amp;image=https%3A%2F%2Fmedia3.giphy.com%2Fmedia%2Fv1.Y2lkPTc5MGI3NjExNm50eHFuOWZ2d3I0YmxrcGZ1ZzV3Y2l2Z3ZtaGFwMGs3YXRwZDEzbCZlcD12MV9naWZzX2dpZklkJmN0PWc%2FeCqFYAVjjDksg%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="246" frameborder="0" scrolling="no"><a href="https://medium.com/media/ca81bb8530c6943c41e47dcb2625026b/href">https://medium.com/media/ca81bb8530c6943c41e47dcb2625026b/href</a></iframe><p>The whole programming thing quickly became rather addicting. Soon after I started, I made my first ever contribution to an open source app (a pretty popular one too, currently sitting at around 80,000 downloads). Over the course of that summer, I actually brought my first project to a reasonable state of completion and made a bunch of contributions to the previously mentioned open source project… one of which was to accidentally do a rebase merge during a release, create a bunch of “revert” commits via panicked abuse of GitHub’s “revert” button, and effectively ruining the previously tidy commit log of a project that enforced squashing pull requests.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XAKvAaG1gU6mi5hVce7hUg.png" /><figcaption>DON’T CLICK IT BOB! IT DOESN’T WORK THE WAY YOU EXPECT IT TO!</figcaption></figure><p>It’s been 1 year, 2 failed attempts to get into my school’s Computer Science major, 1 internship, 7 programming languages, 141 pull requests, 2 hackathons, a lightning talk at a conference, and over 1,600 GitHub contributions since that fateful day. This is the part where you might expect this post to spiral into a rambling list of my glorious accomplishments, of lessons learned, and of inspirational section titles. All that fluff would be complete with stock photos of sunsets and skateboarders on well-paved roads (not falling, of course) to emphasize its inspirational nature. Perhaps even both at once.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3PrrG4gGO4xG52dK." /><figcaption>“Man skateboarding on asphalt next to forest during sunset” by <a href="https://unsplash.com/@sandishelvigs?utm_source=medium&amp;utm_medium=referral">Sandis Helvigs</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>However, I was hunting down a bug in one of my projects the other day when I found this great piece of code I wrote just last week:</p><pre>// NewClient sets up a client to communicate to the daemon at<br>// the given named remote.<br>func NewClient(remoteName string, config *Config) (*Client, bool) {<br>   remote, found := config.GetRemote(remoteName)<br>   if !found {<br>      return nil, false <br>   }<br>   return &amp;Client{  <br>      RemoteVPS: remote,<br>      version:   config.Version,  <br>      project:   config.Project,  <br>      buildType: config.BuildType,<br>      sshRunner: NewSSHRunner(remote),<br>   }, false<br>}</pre><p>Here, I awkwardly return a false upon successfully creating a client, causing a wide range of naughty behaviours. Of course, I had also forgotten to write a unit test for this function. How embarrassing.</p><p>Oh well... so much for all that coding. 🙈</p><h3>tl;dr - just do it mate</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FGcSqyYa2aF8dy%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FGcSqyYa2aF8dy%2Fgiphy.gif&amp;image=https%3A%2F%2Fmedia4.giphy.com%2Fmedia%2Fv1.Y2lkPTc5MGI3NjExcnFvaDBudjgxNWtnNTd1OG90dW56MXNmMTFzM3B4eGYwb3F3eDV1eiZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw%2FGcSqyYa2aF8dy%2Fgiphy.gif&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="326" frameborder="0" scrolling="no"><a href="https://medium.com/media/3c9df09dbc578e244bfa07694c331225/href">https://medium.com/media/3c9df09dbc578e244bfa07694c331225/href</a></iframe><p><a href="https://github.com/bobheadxi">bobheadxi (Robert Lin)</a></p><p><em>Thanks </em><a href="https://medium.com/u/bf18e08d8b45"><em>Seung Won [Tom] Lee</em></a><em> for the proofread.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d712f725f1e8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Crawling the Web for a Search Engine]]></title>
            <link>https://medium.com/ubc-launch-pad-software-engineering-blog/crawling-the-web-for-a-search-engine-a7988ee2e6e9?source=rss-d9eaded8f572------2</link>
            <guid isPermaLink="false">https://medium.com/p/a7988ee2e6e9</guid>
            <category><![CDATA[search-engines]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[web-crawler]]></category>
            <category><![CDATA[scraping]]></category>
            <category><![CDATA[scrapy]]></category>
            <dc:creator><![CDATA[Robert Lin]]></dc:creator>
            <pubDate>Thu, 10 May 2018 03:50:16 GMT</pubDate>
            <atom:updated>2018-12-15T06:19:22.149Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q2XNdlxNi5mINFo2AOUC-w.png" /><figcaption>Network of UBC-related websites, as displayed by <a href="https://github.com/ubclaunchpad/sleuth">Sleuth</a>, UBC Launch Pad’s domain-specific search engine 🔍</figcaption></figure><h4>an introduction to sleuthing the web with Scrapy</h4><p>A while back, I worked in a two-man team with <a href="https://medium.com/u/cef1450da5e2">Bruno Bachmann</a> on <a href="https://github.com/ubclaunchpad/sleuth">Sleuth</a>, a <a href="https://medium.com/u/35dbf66452b5">UBC Launch Pad</a> project to build a domain-specific search engine. This project included building everything from the website and server to a scraper that would handle populating our database with websites to search. The goal was to be able to search for detailed UBC-related content, particularly those on obscure course sites and the like, that have a hard time getting surfaced by search engines like Google. This post will go over how we implemented our crawlers and scrapers that curated content for this search engine.</p><p>To do this, I decided to use Scrapy which, from what I gathered, is more or less the go-to tool for all your web scraping needs.</p><p><a href="https://github.com/scrapy/scrapy">GitHub - scrapy/scrapy: Scrapy, a fast high-level web crawling &amp; scraping framework for Python.</a></p><p>However, most of the common use cases for Scrapy involved working with specific websites and predictable page structures, which wasn’t really all that helpful for this particular use case. Sleuth was also my first “real” software project, and my first time using Python, and my first time doing any sort of scraping… so I had to sort of had to stab about in the dark for a solution.</p><p>The thing I struggled with the most at first was how to gather data that accurately summarizes each web page a crawler would have to traverse. These web pages could take a nearly infinite number of forms, making them rather difficult to describe. For example, a Wikipedia page might easily be described by its title and first few paragraphs, both of which are easily recognizable elements of an HTML document. Those two pieces of information will usually provide a reasonably accurate summary of a page, making it easy to surface this result in relevant contexts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5hPocJ53U0ocfqeEUpBXBQ.png" /><figcaption>A typical post on the UBC subreddit 🎒</figcaption></figure><p>But what about a Reddit post? Is that best described by the post content, the post title, the comments, the subreddit name, the sidebar, or a combination of the above? Should karma play a role in how to prioritize this post in results? Do we want searches for “procrastinating” to return this page just because it is in the sidebar?</p><p>For more UBC-specific pages, it gets even tricker:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9MJugUaCGL_YKVQfIk5t6A.png" /><figcaption>A course as displayed in UBC’s course selector</figcaption></figure><p>The above screenshot is from UBC’s course selector. When would Sleuth want to display this page in a search result? The title and description works fairly well, but in this case they are both pretty non-standard HTML elements, so we can’t just grab it the same way we grab content from a Wikipedia page. What about section data? Do we want this clumped as one result, or have 100 results, with each “BIOL 200” section as its own result? Link traversal is frustrating too — the easy solution is to simply visit every link on every page, but “Save To Worklist” here is a link too… one the crawler probably won’t want to visit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*VHGoRBN9C68AY80KUg766g.png" /><figcaption>Rich results 🤔</figcaption></figure><p>Google itself seems to cheat a bit around some of these problems by offering the <a href="https://www.google.com/webmasters/tools/dashboard">Google Search Console</a>, where you can request hits from Google crawlers and learn how to have “<a href="https://developers.google.com/search/docs/guides/search-gallery">rich results</a>” show up when someone makes a search that includes your website. You do this by using metadata tags in specific ways that Google’s crawlers can look for and retrieve, which seems to be how we get these nice, neatly formatted search results.</p><p>So I built my solution along those lines by defining a fixed number of categories. At the top level, I set up two crawlers: a broad_crawler that would traverse <strong>all </strong>the links in the pages it visits, and a custom_crawler that would decide on an appropriate parser module to handle web pages that conform to an expected format. Along the way, each page’s child links will also be tracked to allow us to form “links” between results, regardless of their type. These crawlers can then identify pages based on their content and detect the best parser to use to collect data. This approach has the advantage of modular, and new types can be added at any time — although it is pretty manual.</p><p>The data flow looks a bit like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wpIUzwxDi_2ktRr73qNEsQ.png" /><figcaption>A rough outline of our crawlers’ data flow.</figcaption></figure><h3>🕷 Crawlers</h3><p>I made the distinction between the broad_crawler and thecustom_crawler because UBC course data had to be crawled in a very specific manner from the UBC course site, and we wanted to be able to retrieve very specific information (such as rows of tables on the page for course section data). The idea was that custom_crawle would be an easily extendable module that could be used to target specific sites. Because of this, the course_crawler itself was pretty simple, and to start it up I could just attach the appropriate parser and let it run free:</p><pre>process.crawl(<br>   &#39;custom_crawler&#39;,<br>   start_urls=CUSTOM_URLS[&#39;courseItem&#39;],<br>   parser=parse_subjects<br>)</pre><p>The broad_crawler is where the modularised parser design really shined, I think, allowing me to dynamically assign parsers after processing each request. I also set up some very rudimentary filtering when retrieving a page’s links:</p><pre>def process_request(self, req):<br>   if &#39;reddit.com&#39; in req.url:<br>      req = req.replace(priority=100)</pre><pre>      if &#39;comments&#39; in req.url:<br>         req = req.replace(callback=self.parse_reddit_post)<br>      else:<br>         req = req.replace(callback=self.no_parse)</pre><pre>   return req</pre><h3>👓 Parsers</h3><p>Different parsers were built for different page types in a folder and placed together in /scraper/spiders/parsers (<a href="https://github.com/ubclaunchpad/sleuth/tree/master/sleuth_crawler/scraper/scraper/spiders/parsers">source</a>). I relied heavily on <a href="https://en.wikipedia.org/wiki/XPath">xpath</a> to query for elements I wanted.</p><p>We also set up a few “datatypes” that would represent our web pages and what kind of data we wanted to retrieve:</p><pre>class ScrapyGenericPage(scrapy.Item):<br>   url = scrapy.Field()<br>   title = scrapy.Field()<br>   # ...</pre><p>There are a wide variety of tags to rely on for most pages. For our “generic” pages, I didn’t need to get too in depth — some simple descriptive metadata would be sufficient. Some examples:</p><pre># normal title<br>response.xpath(&quot;//title/text()&quot;)[0]</pre><pre># OpenGraph title<br>response.xpath(&#39;//meta[<a href="http://twitter.com/property">@property</a>=&quot;og:site_name&quot;]&#39;)[0]</pre><pre># OpenGraph description<br>response.xpath(&#39;//meta[<a href="http://twitter.com/property">@property</a>=&quot;og:description&quot;]&#39;)[0]</pre><p>I think there are probably a few other metadata systems besides OpenGraph that can be leveraged for interesting metadata, though I only got around to implementing one. Again, xpath was my friend here — I used Chrome’s inspector to quickly pick out xpath elements I needed.</p><p>I could get a bit more in-depth with some of the more specific sites. For example, for Reddit posts, I could make post parsing dependent on karma, and retrieve comments above a certain karma threshold as well.</p><pre>post_section = response.xpath(&#39;//*[<a href="http://twitter.com/id">@id</a>=&quot;siteTable&quot;]&#39;)</pre><pre>karma = post_section.xpath(<br>   &#39;//div/div/div[<a href="http://twitter.com/class">@class</a>=&quot;score unvoted&quot;]/text()&#39;<br>)[0]</pre><pre>if karma == &quot;&quot; or int(karma) &lt; POST_KARMA_THRESHOLD:<br>   return</pre><p>Each parser creates a Scrapy item (in this case, a ScrapyRedditPost) and populates its fields with the data retrieved from crawled page. Perhaps the Reddit API would have have been easier, but I felt that parsing Reddit as standard web pages would be the most organic way to gather “interesting” links, for example any links that might be in a post or comment. More importantly, the Reddit API is likely rate-limited.</p><h3>🏇 Performance</h3><p>Performance is pretty important when it comes to web crawling for a search engine. The more data you have on store, the higher the chances that you will have good, interesting results. For us, more data also meant more links, which was the foundation of how we wanted our data to be displayed on the Sleuth frontend.</p><p>In the interest of that, I made a few tweaks to the Scrapy settings and pipelines (which I won’t go over in this post). These two areas were more or less the only places I could realistically make optimizations — we didn’t have the time, skill, or resources to set up systems like distributed crawling, so we stuck with the basics.</p><p>The first thing I wanted to change was depth priority. Because we start with a few seed URLs (scroll back up to the flowchart for a reminder), I didn’t want Scrapy to spend all our system resources chasing links from the first seed URL, so I reduced the depth priority so that the crawlers would be able to get a greater “breadth” or results from a wider range of sources.</p><pre># Process lower depth requests first<br>DEPTH_PRIORITY = 50</pre><p>I also allowed Scrapy to abuse my laptop for resources:</p><pre># Configure maximum concurrent requests performed by Scrapy (default: 16)<br>CONCURRENT_REQUESTS = 100</pre><pre># Increase max thread pool size for DNS queries<br>REACTOR_THREADPOOL_MAXSIZE = 20</pre><p>And I changed a few other things that might slow down crawling:</p><pre># Disobey robots.txt rules - sorry!<br>ROBOTSTXT_OBEY = False</pre><pre># Reduce download timeout to quickly discard stuck requests<br>DOWNLOAD_TIMEOUT = 15</pre><pre># Reduce logging verbosity (&#39;DEBUG&#39; for details)<br>LOG_LEVEL = &#39;INFO&#39;</pre><pre># Disable cookies (enabled by default)<br>COOKIES_ENABLED = False</pre><p>As far as crawling manners go (yes, there seems to be crawling manners! Scrapy includes a “crawl responsibly” message on its default settings), this is pretty rude. Sorry, site admins. 😛</p><h3>🔍 Further Reading</h3><p>I have also written about this in a bit more depth about the crawlers mentioned before <a href="https://bobheadxi.github.io/sleuthing-the-web/#crawlers">here</a>, and you can read a quick rundown of how the pipeline works <a href="https://bobheadxi.github.io/sleuthing-the-web/#pipeline">here</a>. The <a href="https://doc.scrapy.org/en/latest/">Scapy documentation</a> is a must-read as well.</p><p>You can also check out the Sleuth repositories to learn more about this particular project! Development has ceased, but it was a pretty fun learning experience, and we got some pretty nice code coverage in the end. 🔥 🎉</p><ul><li><a href="https://github.com/ubclaunchpad/sleuth">ubclaunchpad/sleuth</a></li><li><a href="https://github.com/ubclaunchpad/sleuth-frontend">ubclaunchpad/sleuth-frontend</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/120/1*lJ-HSdInvyYVvUc6QQS0rA.png" /><figcaption><a href="https://www.ubclaunchpad.com/"><strong>ubclaunchpad.com</strong></a><strong> </strong>— UBC’s leading software engineering club.<br>Stay in touch: <a href="https://www.facebook.com/ubclaunchpad"><strong>Facebook</strong></a><strong> | </strong><a href="https://www.instagram.com/ubclaunchpad/"><strong>Instagram</strong></a><strong> | </strong><a href="https://www.linkedin.com/company/ubc-launch-pad/"><strong>LinkedIn</strong></a></figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a7988ee2e6e9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ubc-launch-pad-software-engineering-blog/crawling-the-web-for-a-search-engine-a7988ee2e6e9">Crawling the Web for a Search Engine</a> was originally published in <a href="https://medium.com/ubc-launch-pad-software-engineering-blog">UBC Launch Pad Software Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Inertia — Building a Simple, Self-Hosted Continuous Deployment Solution]]></title>
            <link>https://medium.com/ubc-launch-pad-software-engineering-blog/building-continuous-deployment-87a2bd8eedbe?source=rss-d9eaded8f572------2</link>
            <guid isPermaLink="false">https://medium.com/p/87a2bd8eedbe</guid>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[continuous-deployment]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[deployment]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Robert Lin]]></dc:creator>
            <pubDate>Sun, 29 Apr 2018 00:34:57 GMT</pubDate>
            <atom:updated>2018-12-15T06:19:40.768Z</atom:updated>
            <content:encoded><![CDATA[<h4>How a team of students designed and created a flexible, Docker-based Heroku alternative</h4><p>Here at <a href="https://medium.com/u/35dbf66452b5">UBC Launch Pad</a>, many of our teams’ projects are web applications. A pretty awesome step in any web application’s development process is when you deploy it for everyone to try out.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2ZbiAAu-Hmt5KTQljfXeaA.png" /><figcaption>Hurray for <a href="https://github.com/ubclaunchpad/bumper">Bumper</a>, an fun work-in-progress arcade game by a team at Launch Pad! 🎉</figcaption></figure><p>Unfortunately, deployment can be a frustrating task, especially for students with little to no experience setting up applications on remote hosts. Some of these students might also be learning a new framework or programming language as part of their projects, all while dealing with the stresses of a full course load. On top of that, we frequently find ourselves needing to deploy projects to new environments as funds run out or sponsorships end in order to keep projects online.</p><p>This was an unfortunate situation — seeing your hard work up and running can be a nice motivation boost, and the ability to gather feedback from fellow students is invaluable. So over the winter, we gathered a small team to develop an in-house tool that would make setting up continuously deployed applications simple and painless, regardless of the hosting provider. We decided to call it <a href="https://github.com/ubclaunchpad/inertia">Inertia</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KfTjN4Kjc3jQ4C52Ba_x_A.png" /><figcaption>What Golang application is complete without a gopher-themed mascot?</figcaption></figure><p>This post will briefly outline how Inertia works, the thinking that drove some of its design decisions, and the techniques and tools used to build it.</p><h4><strong>Contents</strong></h4><ul><li><em>Design</em></li><li><em>Cross-Platform Compatibility</em></li><li><em>Building and Deploying Projects</em></li><li><em>User Interfaces</em></li><li><em>Security</em></li><li><em>Making Sure Everything Works</em></li><li><em>The Road Forward</em></li></ul><h3>🎨 Design</h3><p>We set out with a few primary goals in mind:</p><ul><li><strong>minimize the number of steps</strong> required to set up continuous deployment</li><li>maximize <strong>cross-platform compatibility</strong> on clients and servers</li><li>offer an <strong>easy-to-learn interface</strong> to control deployments</li></ul><p>Continuous deployment just means automating the process of updating a deployed project as code changes. To accomplish this, we quickly settled on a simple two-component design: a client-side command line interface (CLI), and a server-side daemon.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gAo_SLqHkK9vjQQyG8OyQQ.png" /><figcaption>An early visualization of how Inertia’s various components interact.</figcaption></figure><p>A daemon is typically a process that runs persistently in the background— in our case, a tiny server that runs on your remote host, waiting for commands to be delivered to it. These could be HTTP requests from the CLI or <a href="https://developer.github.com/webhooks/">WebHook events from GitHub</a>. WebHooks are HTTP POST requests that are sent by “notifiers” — in this case, GitHub — to registered “listeners”, such as the Inertia daemon. This allows Inertia to automatically detect changes to your applications source code and make updates to the project in the background, without requiring manual intervention.</p><p>The CLI is a small application that the user downloads to use Inertia. It handles all local configuration and is in charge of sending commands through HTTP requests to the server-side daemon.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*26Jn7BtgXMh6GVwroEo0aw.png" /><figcaption>The Inertia CLI’s friendly greeting 🐥</figcaption></figure><h3>🐳 Cross-Platform Compatibility</h3><p>Because we change hosting providers so frequently, an important requirement of Inertia was that it should work on any major OS from any cloud provider.</p><p>This is where Docker comes in. Docker is massive open-source containerization project that has really blown up in the recent years, and the flexibility of containerization has proved incredibly useful and scalable. Netflix, for example, deploys up to <a href="https://medium.com/netflix-techblog/titus-the-netflix-container-management-platform-is-now-open-source-f868c9fb5436">half a million</a><strong> </strong>containers every day! The <a href="https://www.docker.com/what-container">Docker website</a> provides a nice introduction to the concept, emphasis mine:</p><blockquote>A container image is a lightweight, stand-alone, executable package of a piece of software that includes everything needed to run it: code, runtime, system tools, system libraries, settings. […] <strong>containerized software will always run the same, regardless of the environment.</strong></blockquote><p>Since a single Docker container can run anywhere that Docker runs we bypass the problem of cross-platform support by simply deploying the Inertia daemon from a Docker image. On top of that, through <a href="https://hub.docker.com/">DockerHub</a> — Docker’s online image repository service — we don’t need to worry about managing distribution of the daemon either.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DCti6BpjD0VOJCs7_y14ow.png" /></figure><p>On the client-side, using Golang to build the CLI meant that we could easily cross-compile and upload executables for different platforms <a href="https://github.com/ubclaunchpad/inertia/blob/master/.travis.yml#L60">straight from Travis</a>. <a href="https://medium.com/u/9f55ff6b6e8c">Kevin Yap</a> also kindly set up a <a href="https://brew.sh/">Homebrew</a> <a href="https://github.com/ubclaunchpad/homebrew-tap">tap</a> for us so that Inertia can be installed by running brew install ubclaunchpad/tap/inertia🔥</p><h3>🏗 Building and Deploying Projects</h3><p>Most importantly, having Docker means that as long as projects include a <a href="https://docs.docker.com/engine/reference/builder/">Dockerfile</a> or <a href="https://docs.docker.com/compose/">docker-compose</a> configuration, Inertia should be able to build and run them without installing any additional programs. Minimizing Inertia’s dependencies means introducing fewer points of potential incompatibility on different servers, which means fewer headaches during setup.</p><p>However, since the daemon itself is a Docker container (which is isolated from the host by design), we can’t actually start up containers on the server by default — we need to use Docker-socket mounting to allow us to do that. You can read more about how that works <a href="https://bobheadxi.github.io/dockerception/#docker-in-docker">here</a>. This does require our daemon to have sudo permissions, which has some security ramifications, but we decided it was the easiest way to pull off this functionality anyway. We are actively looking for a sudo-less way to do this though.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2214149b6d229180bef49c1f71c7b526/href">https://medium.com/media/2214149b6d229180bef49c1f71c7b526/href</a></iframe><p>The actual implementation of Dockerfile and docker-compose building was not as straight-forward as I had expected. To avoid installing more stuff Inertia uses <a href="https://github.com/moby/moby/tree/master/client#go-client-for-the-docker-engine-api">Docker’s native Golang client</a>, but the API exposed through it is pretty barebones. For example, there is no direct equivalent for even the commonly used <a href="https://docs.docker.com/engine/reference/commandline/build/">docker build command</a> — we have to manually compress the source code of a project and send it to the Docker daemon, which means we have no support (yet) for features like .dockerignore files. Yikes.</p><p>The same goes for docker-compose — the Golang client offers no such functionality. Instead, we found a way to use the <a href="https://hub.docker.com/r/docker/compose/">available </a><a href="https://hub.docker.com/r/docker/compose/">docker/compose Docker image</a> to do more or less the same thing. Programmatically, this is pretty similar to the Docker build — you can read more about it <a href="https://bobheadxi.github.io/dockerception/#docker-compose-in-docker">here</a>. Interestingly enough, this means that we use a Docker container (the daemon) to start a container (docker/compose) to start more containers (the user’s project). 😧</p><p>With this functionality, users just have to provide some minimal Docker configuration with their projects for Inertia to work. Setting a project up for Docker is flexible, well-documented, and pretty easy to do.</p><p>However, we wanted to go a little further. I’ve always found <a href="https://www.heroku.com/">Heroku’s</a> support for different languages pretty impressive: it typically requires nothing more than a one-line <a href="https://devcenter.heroku.com/articles/procfile">Procfile</a> and, given Heroku’s popularity, I figured it might be cool if Inertia could deploy Heroku-configured projects, or at least pull off something similar.</p><p>It turns out that the scripts that Heroku uses to build projects — called “<a href="https://devcenter.heroku.com/articles/buildpacks">buildpacks</a>” — are actually open source and free to use! These buildpacks turn projects into executable “slugs”, and a pretty wide variety are available, covering everything from Java and Scala to Node and Python applications. Even more awesome is that a tool that emulates Heroku’s entire build and run process using these buildpacks exists in the form of the aptly named community project <a href="https://github.com/gliderlabs/herokuish">Herokuish</a>. This tool conveniently <a href="https://hub.docker.com/r/gliderlabs/herokuish/">comes in a Docker image</a>, which Inertia uses similarly to the docker/compose image to provide Heroku-like builds and deployments using Docker.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EkuHsksJK2ti8_PJwI2aUA.png" /><figcaption>An example from <a href="https://github.com/ubclaunchpad/inertia/pull/146">my pull request</a> introducing this feature.</figcaption></figure><p>Heroku still offers a ton of extra features, however, such as multiple procs, plugins, rolling deployments… but for the time being, this is pretty handy to have, especially with Heroku’s limited free server uptime and its rather slow start up times if you don’t pay.</p><h3>🤺 User Interfaces</h3><p>All this work would be pretty pointless if the user-facing components are too hard to use. One important part of the user experience — and one of our initial design goals — is simple setup. Since Docker is our only dependency, Inertia setup just involves executing a script over SSH that <a href="https://github.com/ubclaunchpad/inertia/blob/master/client/bootstrap/docker.sh">installs Docker</a>, <a href="https://github.com/ubclaunchpad/inertia/blob/master/client/bootstrap/daemon-up.sh">pulls and runs an </a><a href="https://github.com/ubclaunchpad/inertia/blob/master/client/bootstrap/daemon-up.sh">ubclaunchpad/inertia image from DockerHub</a>, and <a href="https://github.com/ubclaunchpad/inertia/blob/master/client/bootstrap/keygen.sh">sets up an additional RSA key</a> and<a href="https://github.com/ubclaunchpad/inertia/blob/master/client/bootstrap/token.sh"> JSON Web Token for authentication</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/688/1*DLO_1y9X7UqXeR1iTTDNiw.png" /><figcaption>First two steps set up local configuration, and the last two set up the remote.</figcaption></figure><p>All this can be done with minimal fuss in just four steps, without ever leaving the user’s local shell. 😎</p><p>Well, you do have to head over to your GitHub repository to register a public key (so that Inertia can clone your project) and the daemon’s WebHook address (so the daemon can be notified of updates) — this hasn’t proven overly cumbersome yet, though we are considering OAuth support.</p><p>Recently we’ve added a web app to Inertia as well, <a href="https://github.com/ubclaunchpad/inertia/blob/master/Dockerfile#L1">packaged into the daemon’s image through a multi-staged Docker build</a>. The CLI offers commands that allows you to add your teammates as users, after which they can log in to the web app through the daemon’s port and view the deployed application’s logs from anywhere. We’re hoping to add more features to this web app soon to allow teams more flexibility.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/840/1*tVEziHCmXESCv8P5Zv1cgw.gif" /><figcaption>Super early version of Inertia Web, demonstrating authentication and log streaming.</figcaption></figure><h3>🔑 Security</h3><p>Security is pretty important for a tool like Inertia, where unauthorized access could wreak havoc on deployments. To make sure access is restricted, all communications require some sort of authentication — the CLI uses signed tokens, and a session management module tracks web interface authentication through cookies. To secure all these communications, Inertia uses HTTPS across the board through a self-signed SSL certificate. Standard measures like password encryption are also used.</p><h3>🛠 Making Sure Everything Works</h3><p>As an application that relies heavily on other things — scripts, Docker, user projects, the deployment environment, and so on — unit tests don’t really cut it. We need to make sure that:</p><ul><li>our Docker install and bootstrapping over SSH works</li><li>the daemon starts up correctly and is accessible</li><li>projects of different types build and deploy correctly</li><li>Git functionality (built on the pure Go implementation, <a href="https://github.com/src-d/go-git">go-git</a>) works as expected, such as project updating and branch switching</li></ul><p>We also needed to be able to do manual testing as we worked without constantly needing a real remote host to use, while making sure all server-side functionality worked consistently across different platforms.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/408/1*RrODdauvfZAZc7ZaghN7Zw.png" /><figcaption>🐋 Dockerfiles galore!</figcaption></figure><p>To do this, I set up a <a href="https://github.com/ubclaunchpad/inertia/tree/master/test/vps">set of Dockerfiles</a> that can emulate real servers of different platforms, complete with SSH access using a pre-generated RSA key saved in our repository.</p><p>Once started, these simulated servers can be used to locally start up an Inertia daemon and deploy a project.</p><p>The previously mentioned RSA key is <a href="https://github.com/ubclaunchpad/inertia-deploy-test">registered to a test repository</a> in order to make sure Git functionality works. There are also some <a href="https://github.com/ubclaunchpad/inertia/tree/master/test/build">test projects</a> to test the build processes of each of our three supported project types.</p><p>Travis is set up to <a href="https://github.com/ubclaunchpad/inertia/blob/master/.travis.yml#L14">run all of our unit and integration tests on each of the mock remotes</a>, effectively making sure our stuff consistently works across a range of platforms.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0u2ZqbvLEKUK8rZhd7uGAA.png" /><figcaption>Takes a while each time, but Travis has helped us catch a lot of bugs 🕷</figcaption></figure><h3>🚀 The Road Forward</h3><p>Inertia has come a long way since we first started work on it — it is already being used to continuously deploy several of UBC Launch Pad’s projects, such as the online game <a href="https://github.com/ubclaunchpad/bumper">Bumper</a>. Recently, <a href="https://medium.com/u/7f1802d6c346">Chad Lagore</a> and I made a brief <a href="https://docs.google.com/presentation/d/e/2PACX-1vRJXUnRmxpegHNVTgn_Kd8VFyeuiIwzDQl9c0oQqi1QSnIjFUIIjawsvLdu2RfHAXv_5T8kvSgSWGuq/pub?start=false&amp;loop=false&amp;delayms=15000&amp;slide=id.p">presentation</a> about the project at <a href="https://www.devopsdays.org/events/2018-vancouver/welcome/">Vancouver DevOpsDays</a> conference.</p><p>There is still much room for improvement, however, and the project remains under active development. We have a ton of ideas and features we want to implement going forward, and hope that this will not just be a useful tool but also a great entrypoint for anyone who wants to explore the world of Docker and deployment applications.</p><p>Check out the <a href="https://github.com/ubclaunchpad/inertia">Inertia repository</a> if you are interested in using Inertia or want to learn more and contribute! Any sort of feedback — ideas, bug reports, anything — would also be greatly appreciated. Keep an eye on our repository for future releases and new features! ✨</p><p><a href="https://github.com/ubclaunchpad/inertia">ubclaunchpad/inertia</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/120/1*lJ-HSdInvyYVvUc6QQS0rA.png" /><figcaption><a href="https://www.ubclaunchpad.com/"><strong>ubclaunchpad.com</strong></a><strong> </strong>— UBC’s leading software engineering club.<br>Stay in touch: <a href="https://www.facebook.com/ubclaunchpad"><strong>Facebook</strong></a><strong> | </strong><a href="https://www.instagram.com/ubclaunchpad/"><strong>Instagram</strong></a><strong> | </strong><a href="https://www.linkedin.com/company/ubc-launch-pad/"><strong>LinkedIn</strong></a></figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=87a2bd8eedbe" width="1" height="1" alt=""><hr><p><a href="https://medium.com/ubc-launch-pad-software-engineering-blog/building-continuous-deployment-87a2bd8eedbe">Inertia — Building a Simple, Self-Hosted Continuous Deployment Solution</a> was originally published in <a href="https://medium.com/ubc-launch-pad-software-engineering-blog">UBC Launch Pad Software Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>