My summer internship at Sandtable

Over the course of this summer I spent 11 weeks as a Software Engineer intern at Sandtable. I had a wonderful time here and learned a lot from some very knowledgeable and friendly Engineers.

We worked with Trello, which I am very fond of, to organize our tasks and had daily morning chats about what everyone is up to. My team was always very helpful, whether it was Samuel helping me fix my own attempt to git revert, or Celine helping me set up to deploy my app, or our CTO Thomas telling me about a cool helpful feature I didn’t know about.

There was a lot of flexibility around what I would be working on, which I decided along with Thomas, considering my interests along with the company’s.

Sandtable is using AWS’s Elastic Cloud Computing instances for their work and my aim was to improve the process of using them. We wanted a way of finding out which instance types fit best for a particular task.

I spent the first few days learning more about EC2 instances (and Flask, and Slack’s and Amazon’s API) and discussing with the team the application’s design and functionality.

And so I started building a Slack application in Python that would work as a recommendation system for deciding which spot instances to use.

By the end of the first week, I had my first version of Sandinstance: a Slack app with 3 slash commands: /types would show all the available instance families, /detail would show more detailed information regarding a particular instance family, and /suggest would list all the instance types that had the required vCPU and memory, that would be specified by the user.

This first version only considered demand instance prices which my program read from a json file provided by AWS, so the next step was to get the spot pricing, which we were mainly interested in. This was done through AWS’s SDK for Python, boto3. Next, I worked on improving suggest’s recommendation system until we were happy with the way it worked.

After having a full, functioning version, I spent time throughly testing my code. With Sam’s guidance, I learned about mocking an API, and about coverage – ensuring that as much as possible of my code is tested.

Next came the 4th slash command, that would plot the instance prices for a given period. As great as an idea as it was, there was one issue: Slack has a limit of 3 seconds for responses, and calling AWS’s API and plotting the data proved to take too long. We also noted Amazon only stored data for the past 3 months, so in plotting it, we were limited to this period. We therefore started storing it with MongoDB right away, for the instance types we were interested in.

At this point, we realized how much we don’t know about the way AWS’s EC2 spot pricing works. We had a lot of questions with no answer regarding periods of abnormally high prices, which we called surges, price differences for the same instances between different zones, and many other questions. We were particularly concerned by the surges since they caused our instances to be terminated: this meant losing the instances we were using at the time. I therefore spent a good 3 weeks peforming data analysis on the instance prices using Jupyter Notebooks, which culminated with a presentation of my findings to the rest of the dev team and the Data Scientists. The knowledge gained through this research showed us we can not only save on instance purchasing, but also ensure a termination may not occur.

The data analysis was very powerful but the plots would soon lose their value as the data used would become old. And so the new idea appeared: the 4th slash command was turned into a Dash app by Plotly. I enjoyed learning about Dash and building a web app with it that would show highly customizable plots. The plots would take several minutes to appear since there was a lot of querying and computation involved so I moved from MongoDB to postgreSQL for storing the data. I also built an endpoint which would update the spot data, and another endpoint for demand. As a last touch, I added the option for the user to add and remove instance types from the database.

I’d like to thank everyone at Sandtable for the amazing experience I had as an intern. It also goes without mentioning I’m now an avid fan of board games, which we played almost every lunch break.

Leave a comment

Please prove that you are human: