KATIE MCLAUGHLIN: What's wrong, Martin?
Having trouble choosing?
MARTIN OMANDER: Yeah.
I just can't decide which tool I want to use.
I don't know if this new hammer will do everything I need.
And I don't want to throw away my old mallet
without being sure.
KATIE MCLAUGHLIN: Well, what if I told you
that you didn't have to choose right now and you can use both?
MARTIN OMANDER: That sounds great.
Stay tuned if you want to know more.
[MUSIC PLAYING]
KATIE MCLAUGHLIN: Liz works for StoreCraft
as a site reliability engineer, where she's on call maintaining
their custom storefront.
StoreCraft's systems are developed in-house in Python
and have been running on virtual machines for years, a set up
which evolved as StoreCraft's businesses did.
These virtual machines use slightly different versions
of Python.
This is causing extra pain and work for Liz and her team.
Liz is looking for a way to reduce this pain
by updating all the components to current Python
and also migrating away from virtual machines
onto something more scalable, like serverless.
MARTIN OMANDER: Liz knows that this upgrade will take time.
And her team needs to make sure the existing system keeps
running.
She realizes that she can best achieve this
by completing the upgrade in two steps.
First, moving to serverless, then making the language
upgrades.
KATIE MCLAUGHLIN: StoreCraft is about to launch
a new recommendation engine, which
is written using Python 3.9.
Liz sees this as the perfect candidate
to deploy a serverless first, skipping the virtual machine
altogether.
MARTIN OMANDER: Looking at the options available on Google
Cloud, Liz sees that while she could deploy
on Cloud Functions, she would be forced
to use only specific versions of Python.
However, she sees that the newest serverless
offering from Google Cloud, Cloud Run,
doesn't have this limitation.
So she chooses to deploy there instead.
KATIE MCLAUGHLIN: Creating this service on Cloud Run,
Liz has complete control over the container.
Making use of the official Python images on Docker hub,
she can pick the exact version of Python
she needs down to the patch level
by specifying the base image in the front line of the Docker
file.
As each Cloud Run service is based on its own container
image, which are each defined by their own Docker file,
Liz has complete control over the languages
used in each part of her setup.
MARTIN OMANDER: Since each Cloud Run service
has this level of isolation, Liz can move each of them
to Cloud Run one at a time.
She is also able to maintain the services running
on the original virtual machines until the team has
the availability to upgrade.
KATIE MCLAUGHLIN: However, during the refactor
of the account services component,
StoreCraft's development team finds
that it has a dependency on the sweet-ldap package, which
doesn't yet support Python 3.
Liz is able to keep the service running on
the now deprecated Python 2.7 by specifying the latest
version of Python 2.7 in the Docker file.
As soon as the sweet-ldap package has Python 3 support,
Liz can test this new version by gradually rolling out
a new revision of the service using the traffic splitting
feature of Cloud Run.
She can set the new revision of the count service
to, say, service only 5% of visitors,
that way only some of her customers
end up using the new code.
If she notices that something isn't working as intended,
she can easily roll back to the old version.
MARTIN OMANDER: By migrating each service in turn,
Liz is able to control them in isolation, allowing
for a more incremental upgrade process and a more
reliable environment.
KATIE MCLAUGHLIN: But Martin, I will have to take away
that mallet at some point.
MARTIN OMANDER: OK then.
KATIE MCLAUGHLIN: You still can have your hammer.
MARTIN OMANDER: Well, I do like this new hammer,
now that I'm used to it.
KATIE MCLAUGHLIN: Great.
[THUDDING]
Great.
[MUSIC PLAYING]