Irreverent Demystifiers

Your simplified data science workflows have arrived!

The new feature on Google Cloud that data scientists and their team leaders will love

Cassie Kozyrkov
Towards Data Science
6 min readMar 26, 2020

--

Image: SOURCE.

Hey, data scientists using Google Cloud: why aren’t you using machine images yet? Because they’re only two weeks new, that’s why…

Summary

Technical

Machine images on Google Cloud make it easy to create, back up, restore, and share virtual machines you’ve customized. They’re what you’d get if disk images and snapshots and instance templates combined to have a baby. (Er, okay, that’s not how having a baby works.)

Machine images make it easy to create, back up, restore, and share virtual machines.

Oh, and if you’re on a tight budget, you’ll love them in a way you’d never love a VM copy.

Nontechnical

Ever lost your smartphone and then used a one-button solution to restore all your favorite apps, contacts, etc. onto a replacement phone? Machine images are like that, but for virtual machines on Google Cloud.

Painfully nontechnical

Imagine that the virtual computer you’ve rented from Google Cloud is a character in a video game. Before machine images, that video game had no save option — you had to restart the game from scratch every time you did something you regret. Now it’s super-easy to save and load all those items and experience points you worked so hard to get.

Click, click, done!

A demo GIF

To use a machine image to create a virtual machine: Click on the options next to your machine image, click Create VM, (naming your little best is optional), and Create! Ta-da, a no-fuss copy of your beautiful virtual machine. (Bottom right is an eye-friendly zoom in.)

Why you should care if you’re a…

Data scientist / researcher

If you’re like most data scientists, you can’t find it in your heart to love virtual machine (VM) setup and other computing chores. These things take time away from working with your data, which is the part you’re actually passionate about. Sure, you’re discerning enough to want your own special customized setup — just the way you like it — so you’re able to restrain your grumbling the first time through.

Weeks go by. You occasionally install shiny new packages, adjust settings, run scripts, and then one day… boom! You broke it.

Ideally, you’d rewind the clock to your perfect machine exactly as it was last week, but… you can’t remember what you clicked on to get there. Even if you did, starting from scratch would take hours (if you’re lucky).

Sadness.

BEFORE: Restoring last week’s setup meant starting from scratch.

AFTER: Click, click, done. Less time on chores, more time for data.

Machine images to the rescue! A machine image is a single resource that contains all the information — machine type, network tags, labels, etc. — needed to backup, copy, restore, and share an instance (virtual machine).

That means you’re able to save copies of configurations you like so that you can restore old versions of your instance easily. It’s as simple as it sounds. Click, click, done.

Hang on, why not just save copies of the virtual machine itself? Because you’d probably like to save money while you save backups.

Using machine images costs much less than saving multiple copies of a VM.

If you make a copy of your VM, you’ll have doubled the billable disk space. If you create a machine image instead, you’ll only be billed for the difference in disk contents, so even if you picked a flashy beast of a VM, every additional machine image might only cost you a few cents.

Team leader / manager

Imagine you’re a leader with new team members to onboard.

You already have the perfect setup for your team’s needs, but it lives in a nasty doc detailing which scripts each new hire has to run and which buttons they need to click.

Getting new teammates up and running takes forever.

BEFORE: Getting new teammates up and running takes forever.

AFTER: Much faster onboarding and a team that can keep up with the cutting edge.

Duplication of effort doesn’t serve your business well but luckily machine images let skip it. They let you customize once to create a golden image for your team and share it with the whole group. That moves the starting line forward for everyone and speeds up your onboarding.

“A machine image is more than just a save backup. It’s a way to accelerate your whole team.” — Ari Liberman, Product Manager, Google Compute Engine

As a bonus, you’ll want to keep updating the golden image to keep everyone’s configuration on the cutting edge. No more keeping track of which updates your group’s stragglers forgot to make.

Lecturer / TA

Grading that coding homework you gave your students — image recognition in TensorFlow, perhaps?—quickly becomes a nightmare if you have deal with debugging all the different ways your students might have messed up their machine setup. (Dare you trust them with figuring out how to get hold of GPUs, for example?)

Sure, you could tell them to get a ready-made solution on Marketplace Solutions — not a bad idea! — but what if you’re itching to customize that solution? Are you going to waste a week of class time shepherding your 100 students’ teething pains as they try to twiddle the right knobs in the right sequence? Will you give up on a customized starting point?

There’s a better way.

BEFORE: You wasted valuable teaching time on walking your students through pressing the right setup buttons in the right sequence.

AFTER: After you complete your own customization, your students can instantly start (and stay) on the same page.

Start wherever you like (from scratch, from the Marketplace, from the previous prof’s machine image) and customize to your heart’s content, then share the final machine image with your students. Skip the in-class clickfest and rest assured that if their code doesn’t work, it’s not because they forgot to check a firewall settings box in week 1.

As a bonus, if you have regrets about your students’ setup by the time midterm exams roll around, it’s easy to replace.

How to

Create a machine image

Option 1 is to create a machine image right from your VM instance in Compute Engine as the first GIF shows.

Yes, I named them “beastling” and “littlebeast.” No, that’s not how you name things when you’re doing professional data science work in collaboration with other grownups. It seems demos bring out the worst habits in me! But in my defense, a VM *can* start out as something little and you always have the option to scale it up to be quite the beast if you need to.

Option 2 is head straight to the machine images section itself and create a new one, indicating the VM instance source in the form, as the next GIF shows.

This gets you to the same form we saw in the GIF above, proceed the same way…

Use a machine image

You already saw one way to create a VM from your machine image (first GIF in the article), but here’s another:

Almost too easy, right? Almost. As far as we data scientists are concerned, no matter how easy it is, anything that doesn’t involve playing with data should always be easier. But until the telepathic interface comes around, I’m happy to have this one.

Learn more about machine images on the Google Cloud Blog.

Thanks for reading! How about an AI course?

If you had fun here and you’re looking for an applied AI course designed to be fun for beginners and experts alike, here’s one I made for your amusement:

Enjoy the entire course playlist here: bit.ly/machinefriend

Connect with Cassie Kozyrkov

Let’s be friends! You can find me on Twitter, YouTube, and LinkedIn. Interested in having me speak at your event? Use this form to get in touch.

--

--

Chief Decision Scientist, Google. ❤️ Stats, ML/AI, data, puns, art, theatre, decision science. All views are my own. twitter.com/quaesita