<?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 Kevin P. on Medium]]></title>
        <description><![CDATA[Stories by Kevin P. on Medium]]></description>
        <link>https://medium.com/@kevinp11?source=rss-53d54f7cfc75------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*_PWCXbPk4Y9mOXTk8ZLsWw.jpeg</url>
            <title>Stories by Kevin P. on Medium</title>
            <link>https://medium.com/@kevinp11?source=rss-53d54f7cfc75------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 00:22:10 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kevinp11/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[Cloud Resume Challenge — GCP version]]></title>
            <link>https://medium.com/@kevinp11/cloud-resume-challenge-gcp-version-c1bab65c6fbc?source=rss-53d54f7cfc75------2</link>
            <guid isPermaLink="false">https://medium.com/p/c1bab65c6fbc</guid>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[gcp]]></category>
            <category><![CDATA[cloud-resume-challenge]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <dc:creator><![CDATA[Kevin P.]]></dc:creator>
            <pubDate>Wed, 22 Jul 2020 23:37:53 GMT</pubDate>
            <atom:updated>2020-07-22T23:37:53.336Z</atom:updated>
            <content:encoded><![CDATA[<h3>Cloud Resume Challenge — GCP version</h3><p>A few weeks ago, I discovered some Tweets talking about the <a href="https://cloudresumechallenge.dev/">Cloud Resume Challenge</a> as a part of the <strong>#100DaysOfCloud</strong> challenge.</p><p>It’s a project, started by <a href="https://forrestbrazeal.com/">Forrest Brazeal</a> to help people discover and learn how to use the cloud. The idea is simple: make you build a website, fully hosted on cloud resources. If you’ve never used the cloud before, it may be hard at the beginning, but it’s a really good way to start your journey.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Uq8Am-We32dgc1P7xhDZBA.png" /><figcaption>Google Cloud</figcaption></figure><h3>0. Introduction</h3><p>The challenge was initially designed to be deployed on AWS. I’m a big fan of GCP, so I’ve decided to do it on GCP, and to convert the requirements.</p><p>For each section (if cloud related), I’ll put the code I ran to deploy the services using Google Deployment Manager.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L97orYWvGRbfJcMdRUTYug.png" /><figcaption>GCP architecture</figcaption></figure><h3>1. Certification</h3><blockquote>Your resume needs to have the <a href="https://aws.amazon.com/certification/certified-cloud-practitioner/">AWS Cloud Practitioner certification</a> on it.</blockquote><p>That’s the funny part here. I’ve been working with cloud environments (OpenStack, AWS, GCP) for 5 years now, but I don’t have any cloud certification. I’m planning to pass the GCP Professional Cloud Architect certification soon.</p><h3>2. HTML</h3><blockquote>Your resume needs to be written in <a href="https://developer.mozilla.org/en-US/docs/Web/HTML">HTML</a>. Not a Word doc, not a PDF. <a href="https://codepen.io/emzarts/pen/OXzmym">Here is an example of what I mean</a>.</blockquote><p>I’m terribly bad at web design, and everything web related in general. So to have something not that bad, I decided to find a nice HTML template, and customized it for my needs. The code is available on my <a href="https://github.com/kevinpz/cloud-resume-challenge-website/blob/master/website/index.html">Github project</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hISmBZOuQvQ17CmdUsNshg.png" /><figcaption>My website</figcaption></figure><h3>3. CSS</h3><blockquote>Your resume needs to be styled with <a href="https://www.w3schools.com/css/">CSS</a>.</blockquote><p>Same story here, you don’t want me to design something. Ever. So, like for the HTML, I just customized the template <a href="https://github.com/kevinpz/cloud-resume-challenge-website/blob/master/website/assets/css/style.css">I had found</a> to have something I like.</p><h3>4. Static S3 Website</h3><blockquote>Your HTML resume should be deployed online as an <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html">Amazon S3 static website</a>.</blockquote><p>The equivalent of S3 in GCP is <a href="https://cloud.google.com/storage">Google Cloud Storage</a>. I created a bucket, and set the appropriate rights so everyone could access it from the internet.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3ef22496b560ca6f482c3b30c07118a9/href">https://medium.com/media/3ef22496b560ca6f482c3b30c07118a9/href</a></iframe><h3>5. HTTPS</h3><blockquote>The S3 website URL should use <a href="https://www.cloudflare.com/learning/ssl/what-is-https/">HTTPS</a> for security. You will need to use <a href="https://aws.amazon.com/blogs/networking-and-content-delivery/amazon-s3-amazon-cloudfront-a-match-made-in-the-cloud/">Amazon CloudFront</a> to help with this.</blockquote><p>For GCP, I used multiple services: an <a href="https://cloud.google.com/load-balancing/docs/https">external HTTPS load balancer</a>, a <a href="https://cloud.google.com/load-balancing/docs/ssl-certificates">managed SSL certificate</a>, and <a href="https://cloud.google.com/cdn">Cloud CDN</a> to cache the website content.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/686023717049ef8a4437d74e41fa946c/href">https://medium.com/media/686023717049ef8a4437d74e41fa946c/href</a></iframe><h3>6. DNS</h3><blockquote>Point a custom DNS domain name to the CloudFront distribution, so your resume can be accessed at something like my-c00l-resume-website.com. You can use <a href="https://aws.amazon.com/route53/">Amazon Route 53</a> or any other DNS provider for this.</blockquote><p>I already have a domain registered on <a href="https://domains.google/intl/en_ca/">Google Domains</a>. I just had to create a specific subdomain for the website, and delegated it to <a href="https://cloud.google.com/dns">Cloud DNS</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MFTIp3mPewDhMNiGgDBmlw.png" /><figcaption>Google Domains entry</figcaption></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8a6131ab15821428d6b793b1101738ec/href">https://medium.com/media/8a6131ab15821428d6b793b1101738ec/href</a></iframe><h3>7. Javascript</h3><blockquote>Your resume webpage should include a visitor counter that displays how many people have accessed the site. You will need to write a bit of <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript">Javascript</a> to make this happen.</blockquote><p>For the dynamic part, I wrote a small <a href="https://github.com/kevinpz/cloud-resume-challenge-website/blob/master/website/assets/js/visitor_count.js">javascript code</a> to fetch the JSON content from the HTTPS endpoint, and update my HTML page with the visitor count.</p><h3>8. Database</h3><blockquote>The visitor counter will need to retrieve and update its count in a database somewhere. I suggest you use Amazon’s <a href="https://aws.amazon.com/dynamodb/">DynamoDB</a> for this.</blockquote><p>I used the <a href="https://cloud.google.com/firestore">GCP Firestore</a> service to store my data in a NoSQL key-value database. I don’t have any infra deployed here because the database is automatically created by the script when the first visitor reaches the website.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3d1b26587ff070bb3768f0daa75637bb/href">https://medium.com/media/3d1b26587ff070bb3768f0daa75637bb/href</a></iframe><h3>9. API</h3><blockquote>Do not communicate directly with DynamoDB from your Javascript code. Instead, you will need to create an <a href="https://medium.com/@perrysetgo/what-exactly-is-an-api-69f36968a41f">API</a> that accepts requests from your web app and communicates with the database. I suggest using AWS’s API Gateway and Lambda services for this.</blockquote><p>The communication between my Javascript code and my database is managed by a <a href="https://cloud.google.com/functions">GCP Cloud Function</a>. It’s a serverless function which answers events. In that case events are HTTPS triggers.</p><p>The function reads the visitor count from the database, increments it by one, saves it to the database, and returns the value to the client.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/063bd863b19d712dc42a25d004976c93/href">https://medium.com/media/063bd863b19d712dc42a25d004976c93/href</a></iframe><h3>10. Python</h3><blockquote>You will need to write a bit of code in the Lambda function; you could use more Javascript, but it would be better for our purposes to explore Python — a common language used in back-end programs and scripts — and its <a href="https://boto3.amazonaws.com/v1/documentation/api/latest/index.html">boto3 library for AWS</a>.</blockquote><p>I used Python 3.7 to write the Cloud Function. The communication between the code and the backend database uses the <a href="https://pypi.org/project/google-cloud-firestore/">google-cloud-firestore</a> Python library. You can check the code <a href="https://github.com/kevinpz/cloud-resume-challenge-infra/blob/master/scripts/visitor_count/main.py">here</a>.</p><h3>11. Tests</h3><blockquote>You should also include some tests for your Python code. <a href="https://realpython.com/python-testing/">Here are some resources</a> on writing good Python tests.</blockquote><p>I haven’t done a lot here. This could be greatly improved. I’m just running <a href="https://pypi.org/project/pylint/">Pylint</a> on my code, and make it fail if the score is below 10/10.</p><h3>12. Infrastructure as Code</h3><blockquote>You should not be configuring your API resources — the DynamoDB table, the API Gateway, the Lambda function — manually.</blockquote><p>All this project has been deployed using <a href="https://cloud.google.com/deployment-manager">Cloud Deployment Manager</a>. Like CloudFormation or Terraform, it’s a tool dedicated to Infrastructure as Code (IAC), but only for GCP.</p><p>This is really a great way to manage your infrastructure, replicate it, or update it easily, without having to play in the web console, or type a lot of manual commands.</p><p>All the code for the full website deployment is available on <a href="https://github.com/kevinpz/cloud-resume-challenge-infra/blob/master/deployment-manager/cloudresume.jinja">my Github</a>.</p><h3>13. Source Control</h3><blockquote>You do not want to be updating either your back-end API or your front-end website by making calls from your laptop, though. You want them to update automatically whenever you make a change to the code.</blockquote><p>I created two different repositories for this project in Github:</p><ul><li>One for the <a href="https://github.com/kevinpz/cloud-resume-challenge-infra">backend code</a>.</li><li>One for the <a href="https://github.com/kevinpz/cloud-resume-challenge-website">frontend code</a>.</li></ul><p>Then I used <a href="https://cloud.google.com/cloud-build">Cloud Build</a> to set up two triggers, one for each repository.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/895/1*AT5shrCexE2WOdWv_H5uSg.png" /><figcaption>Cloud Build triggers</figcaption></figure><h3>14. CI/CD (Back end)</h3><blockquote>Set up <a href="https://help.github.com/en/actions/getting-started-with-github-actions/about-github-actions">GitHub Actions</a> such that when you push an update to your Serverless Application Model template or Python code, your Python tests get run. If the tests pass, the SAM application should get packaged and deployed to AWS.</blockquote><p>My cloudbuild.yaml file for the backend checks the Python code using Pylint. If everything is correct, the code is packaged and pushed to a GCP bucket. Finally, the infra is deployed using Cloud Deployment Manager.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8fb0c0b63354a86b641fb5c1181c5081/href">https://medium.com/media/8fb0c0b63354a86b641fb5c1181c5081/href</a></iframe><p>A small note on the cloud function file name. In order to automatically redeploy the function when the code changes, I’ve included the md5sum of the zip in the file name itself. When the code is updated, the md5sum changes.</p><p>The deployment manager template relies on the file name, so when it changes, a function update is triggered.</p><h3>15. CI/CD (Front end)</h3><blockquote>Create a second private GitHub repository for your website code. Create GitHub Actions such that when you push new website code, the S3 bucket automatically gets updated.</blockquote><p>This step copies the website files from Github, and pushes them directly to the GCP bucket.</p><p>Once the files are pushed, the CDN cache needs to be invalidated, so the visitors will be able to fetch the new version immediately. Otherwise, the previous version will continue to be served from Cloud CDN until the expiration is reached.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c1a71a0cc802173386ea169c7783e3c7/href">https://medium.com/media/c1a71a0cc802173386ea169c7783e3c7/href</a></iframe><h3>16. Blog post</h3><blockquote>Finally, in the text of your resume, you should link a short blog post describing some things you learned while working on this project.</blockquote><p>Here we are! The final website is hosted here: <a href="https://hey.printz.dev/">https://hey.printz.dev</a>. Feel free to check it!</p><h3>A few worlds …</h3><p>If you’re totally new to the cloud, try to do it on your own, using the <a href="https://cloud.google.com/docs">GCP documentation</a> and understanding how the different components work together.</p><p>Sometimes, it may be a little bit difficult to find examples using GCP, that’s why I’ve decided to put my code here, so you won’t stay blocked too long.</p><p>If you’ve any questions, don’t hesitate to reach me, I’ll be happy to help you with your journey on GCP!</p><p>You can reach me by:</p><ul><li>Email: <a href="/service/mailto:kevin@printz.dev">kevin@printz.dev</a></li><li>Twitter: <a href="https://twitter.com/Kevin_P11">https://twitter.com/Kevin_P11</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c1bab65c6fbc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cloud Gaming : Stadia vs Nvidia GeForce Now]]></title>
            <link>https://medium.com/@kevinp11/cloud-gaming-stadia-vs-nvidia-geforce-now-2789c4575826?source=rss-53d54f7cfc75------2</link>
            <guid isPermaLink="false">https://medium.com/p/2789c4575826</guid>
            <category><![CDATA[stadia]]></category>
            <category><![CDATA[cloud-gaming]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[geforce-now]]></category>
            <category><![CDATA[gaming]]></category>
            <dc:creator><![CDATA[Kevin P.]]></dc:creator>
            <pubDate>Sat, 13 Jun 2020 19:36:44 GMT</pubDate>
            <atom:updated>2020-06-19T19:13:36.127Z</atom:updated>
            <content:encoded><![CDATA[<h3>Cloud Gaming : Stadia vs Nvidia GeForce Now</h3><p>Over the past months, I’ve read a lot of articles and tweets talking about cloud gaming, and how similar (or not) are the two main platforms in this area: Stadia and Nvidia GeForce Now.</p><p>Since I’ve spent a lot of time repeating myself again and again on this subject, I’ve decided to write an article on how similar and different both of them are.</p><p><em>All the information I used to write this post comes from publicly available sources.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RVXhHO6xVVJzDPR0un91Hw.png" /><figcaption>Stadia vs Nvidia</figcaption></figure><h3>What is cloud gaming</h3><p>Cloud gaming is the ability to play a video game with a remote hardware. This is something you could also call game streaming, because that’s what it is.</p><p>Basically, instead of owning a powerful machine to run the latest game with the highest performance, and having to renew it every few years, you’re just going to use someone else’s hardware for a cheap monthly price. The game is going to run remotely, your local controller input will be sent to the datacenter, executed on the machine, then the display will be streamed back to your home.</p><p>You only need a screen, a device capable of playing a video stream, and that’s all. Easy to set up, easy to play, nothing to worry about (except maybe your internet connection).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O6hhJKz8cyvmZF3JjBOIVg.jpeg" /><figcaption>Cloud gaming</figcaption></figure><p>There’re a lot of advantages to use cloud gaming:</p><ul><li>No need to download, install, or update a game.</li><li>No need to worry about physical storage.</li><li>No need to have a powerful computer.</li><li>Play almost everywhere: computer, phone, tablet, TV.</li></ul><p>But this also comes with some downsides:</p><ul><li>A really good internet connection is needed.</li><li>Impossible to play offline.</li><li>Input lag higher than a local PC.</li></ul><p>Cloud gaming is not something new, and it has been here for years, waiting for the good time to rise. You do not need to have a powerful device to use cloud gaming, but you do need to have an excellent and unlimited internet access to play. And that was the major issue for the past years: bad network connection, high latency, data caps.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WFYV-YD2jYMnYXHjPHszjw.jpeg" /><figcaption>Required bandwidth</figcaption></figure><p>You should have at least 10/15 Mbps of download speed for the lowest quality. For the 4K experience, plan to have a connection of at least 35 Mbps to enjoy the game.</p><p>Also, since you’re basically streaming a video, you definitely need an unlimited internet plan. For a session of one hour playing the best quality (4K), you’ll use up to 20 GB of data. For a month playing one hour a day in 4K, it could be up to 430 GB.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Tv6PMtPvGWPuz2YI4yEPMA.png" /><figcaption>Cloud gaming bandwidth usage</figcaption></figure><p>Finally, and that’s maybe the most important part, the latency. This is the major difference between streaming a video (like Netflix), and streaming a video game. When you watch a video, you don’t really care about the latency between your home and Netflix datacenter, because you don’t have any live interaction with the video itself.</p><p>For a video game, this is something totally different. If you press jump on your controller and you need to wait a full second to see it happening on the screen, this is totally unplayable. And that latency, based on the type of game you’re playing, will be perceived totally differently.</p><p>The input lag is the addition of all the latencies behind the gaming: controller latency, processing latency, display latency, … and of course for cloud gaming network latency is one of the most important parts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v8G_rJlJwaEaAJJzL39fuw.png" /><figcaption>Latency perception per game type</figcaption></figure><h3>Nvidia GeForce Now</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*Cd3I7jBXikRd_6MRAIo09g.png" /><figcaption>Nvidia how to play</figcaption></figure><p><strong>Introduction</strong></p><p>Nvidia GeForce Now is the cloud gaming service <a href="https://blogs.nvidia.com/blog/2020/02/04/geforce-now-pc-gaming/">launched</a> by Nvidia in February 2020. After more than seven years of development and beta testing, the service is now available to everyone.</p><p>Unlike Stadia, GeForce Now is not a platform on its own. It’s rather a way to stream games you already own in your personal library: Steam, Uplay, Epic, … you just have to link your account to GeForce Now, and you’ll be able to play. Not every game is available, but Nvidia GeForce Now offers hundreds of games you can already play, and they’re constantly adding new games to their list.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/920/1*H1eS5t0hQ1MK2YuA498z9A.jpeg" /><figcaption>Nvidia datacenters</figcaption></figure><p>Nvidia uses a mix between their own datacenters, and some partners’ datacenters. They have a total of nine datacenters in North America, six in Western Europe, two in Russia, one in Japan and one in South Korea for a total of <a href="https://status.geforcenow.com/">19 datacenters</a>.</p><p><strong>Pricing</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/672/1*hSRYbbliLb-0IWyCfM5cTw.png" /><figcaption>Nvidia GeForce Now pricing</figcaption></figure><p>Nvidia Geforce Now comes with two offers: a free one, and a paid one.</p><p>With the free membership you get the standard access. Depending on when and where you play, you’ll be queued with other free players until a server becomes available. Also, you’ll be limited to session of one hour max. After that you’ll have to save your game and re-enter in the queue system to play for another one hour.</p><p>The Founders membership is a paid subscription of $4.99/month. It gives you priority access (no waiting time) to the servers, and the ability to play up to six hours per session. You’ll also be able to experience the best quality with the Nvidia ray tracing technology.</p><p>Keep in mind that the Founders subscription is a limited time offer, and there is no guarantee that the price won’t go up at some point.</p><p><strong>Requirements</strong></p><p>To use GeForce Now, you’ll need one of the following device to stream the video:</p><ul><li>A Windows computer.</li><li>A Mac computer.</li><li>A Nvidia Shield TV.</li><li>An Android phone or tablet.</li></ul><p>On the connection side, you’ll need at least:</p><ul><li>15 Mbps for the 720p at 60 fps.</li><li>25 Mbps for the 1080p at 60 fps.</li></ul><p><strong>How does it work</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*KIqqqNhwqM0aLEijtBf6Xg.png" /><figcaption>Nvidia GeForce Now architecture</figcaption></figure><p>Nvidia GeForce Now is able to stream games you already own. For that, they have a number of pre-installed Windows servers with launchers (Steam, Uplay, Epic, …) and games already deployed. So when you want to play Assassin’s Creed Odyssey, Nvidia will use a Windows server with Uplay installed and the game ACO already downloaded, so you don’t have to wait before playing.</p><p>It’s exactly as if you were launching the game on your computer, but this time the computer is not in your home, and you just get the video stream.</p><p>When you press the jump button on your controller, it’ll be sent to your computer, which will forward it to the server in the Nvidia datacenter. The action will be executed on the remote game, and then the display will be streamed back to your screen.</p><h3>Stadia</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ody2QT0iiyJvace4AGhuTQ.png" /><figcaption>Stadia description</figcaption></figure><p><strong>Introduction</strong></p><p>Stadia is a new gaming platform announced by Google in 2018.</p><p>Unlike Nvidia GeForce Now which is only streaming PC games, Stadia is really a new platform, with games designed and developed for cloud gaming. Stadia has its own catalog of games, and as you would have to rebuy a game you already own on PC to play it on a Xbox/PS, you’ll also have to rebuy games if you want to play them on Stadia.</p><p>The good news is you’re playing games designed to be streamed. The publishers and the developers need to integrate the game for Stadia, and make sure everything works perfectly on the platform. For that purpose, Stadia is designed with dev tooling (latency, packets lost, …) to simulate multiple internet connection types, and see how the game runs in each condition.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dFKzpc_SEkCEYcuTvnJj3A.png" /><figcaption>Google Edge Nodes</figcaption></figure><p>There’s no precise list of Stadia datacenters, but the idea is to be as close as possible from the players to minimize the latency and the number of hops. For that, Google has more than 7500 edge nodes around the world already used to cache contents for other services like Youtube or Google Play. These locations are also used by Stadia to put the <a href="https://spectrum.ieee.org/tech-talk/telecom/internet/how-the-youtube-era-made-cloud-gaming-possible">gaming hardware</a> as well.</p><p><strong>Pricing</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*F5PiiVNefenWT4p2OSy-HA.png" /><figcaption>Stadia pricing</figcaption></figure><p>Like Nvidia, Stadia also has two different ways of playing: the base and the pro access.</p><p>The base access allows you to access the platform for free. Once connected, you need to buy games as you would do for any other platform. There’re also some restrictions regarding the maximum quality: you can only play with content up to 1080p and stereo sound.</p><p>If you want more, you can subscribe to Stadia pro for $9.99/month, and unlock more features: streaming up to 4K with 5.1 surround sound. With the pro subscription, you also have regular discounts on games, and free games every month.</p><p>If you buy a game with a pro discount and then you switch back to Stadia base, you’ll still be able to play that game. If you claim a free pro game and then you switch back to Stadia base, you won’t be able to play that game unless you reactivate your pro subscription again.</p><p><strong>How does it work</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*40SVQuWdlBBRTfLKx2O_mw.png" /><figcaption>Stadia architecture</figcaption></figure><p>As Stadia is a new platform, the infrastructure is totally different from Nvidia. Games are running on Linux servers, and are specifically developed to run on Stadia. When you start a game, you get a Linux instance with the build already available on it and up to date.</p><p>When you press a button on the Stadia controller, the input is directly sent to the wifi router, removing one additional hop. The action will be executed on the Stadia server, then the video will be streamed back to your computer.</p><p>If you want more information on how it works behind the scenes, the <a href="https://www.youtube.com/watch?v=9Htdhz6Op1I">Stadia Streaming Tech</a> from the Google I/O’19 is really interesting.</p><p><strong>Requirements</strong></p><p>To play on Stadia, you’ll need one of the following device to stream the video:</p><ul><li>A computer with Google Chrome installed.</li><li>An Android phone or tablet.</li><li>A Chromecast Ultra.</li></ul><p>On the connection side, you’ll need at least:</p><ul><li>10 Mbps for the 720p at 60 fps.</li><li>35 Mbps for the 4K at 60 fps.</li></ul><h3>Cloud gaming benchmark</h3><p><strong>Environment</strong></p><p>For this benchmark, I’ve used the following hardware:</p><ul><li>Computer: MacBook Pro (13-inch, 2016, basic config).</li><li>Network: Google Wifi in 5Ghz, and priority device given to the MBP.</li><li>Internet speedtest (on <a href="https://fast.com/">fast.com</a>): 400 Mbps download, 30 Mbps upload, latency 6 ms.</li></ul><p>For Nvidia GeForce Now, I’ve the following setup:</p><ul><li>Nvidia Shield controller in Bluetooth.</li><li>Nvidia Founders access.</li></ul><p>And for Stadia:</p><ul><li>Stadia controller in Wifi.</li><li>Stadia Pro access.</li></ul><p><strong>Startup time</strong></p><p>First test, let’s check how much time the game needs to start on both platforms. I’ve recorded my screen, and started the stopwatch at the moment when I released the click on my mouse.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FaJoEf7wzr3Q&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DaJoEf7wzr3Q&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/b2f07548f7580b7ca262e182c10b6537/href">https://medium.com/media/b2f07548f7580b7ca262e182c10b6537/href</a></iframe><p>Stadia is a clear winner here with only 21 seconds to be ready. Nvidia is far behind and needs 3x more time to start with 1min03.</p><p>The explanation is quite simple, GeForce Now is just a streaming wrapper around Steam: it uses a Windows server, has to start Steam and then launches the game. On Stadia, the game directly starts on a Linux server, and that’s all.</p><p><strong>Input lag</strong></p><p>The input lag is one of the most important things in cloud gaming. It could make your game totally unplayable if it’s too high. When running a game remotely, the network latency will be a huge part of the input lag.</p><p>On both platforms, we have a server running the video game binary, let’s try to see if we can find “how far” this server is.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/866/1*4H2OyqgPZ0zDA6odIHgkIw.png" /><figcaption>Nvidia Whireshark dump</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*cEchzgFX-SVBCANUx0PX7w.png" /><figcaption>Stadia Wireshark dump</figcaption></figure><p>Wireshark is a tool to listen and capture traffic going through the network card. While playing the game, I was able to sniff my network packets to find the remote server’s IP address. Cloud gaming has a huge bandwidth consumption. It’s not too hard to find the server address in the packet list, looking for a UDP connection.</p><p>For Nvidia, the remote server IP address is 24.51.19.228, and its remote port used to send the video stream is 18671.</p><p>For Stadia the remote IP address is 136.112.42.157, and the remote port is 44700.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/841/1*Jz3gYrVXye-rSx_E-X4twA.png" /><figcaption>Nvidia Traceroute command</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/622/1*mc-lsel3x6owokgMVo08Xw.png" /><figcaption>Stadia Traceroute command</figcaption></figure><p>Knowing both the IP addresses and the remote ports, I can now check what is the latency between my computer and the remote server. To do that, I’ve used the traceroute command with UDP packets.</p><p>As the output shows, there are 10 hops between my computer and the Nvidia server. The time for a packet to start from my computer, reach the server, and return to my computer is 30 ms.</p><p>For Stadia, the server is closer, only 8 hops, and a round trip time of 15 ms.</p><p>Again, Stadia wins here with 2 less hops. The Nvidia latency is 2x higher than the Stadia one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C_1U9ka1o3-GeL-kBVUZAQ.png" /><figcaption>Nvidia routing distance</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*E81p9j8lvOb4ZT75XH6t6Q.png" /><figcaption>Stadia routing distance</figcaption></figure><p>But how does this latency affect the game? To check it in game, I’ve recorded two small gameplay sequences making my character jump. In order to know when I pressed the controller button, I also recorded my room sound.</p><p>When I had to press the jump button, I pressed it very loudly. The point was to have a “reference” in my video to start the stopwatch.</p><p>Keep in mind this is not the more accurate method, and my screen was recorded at 60 fps (16.67 ms per frame). But since the same method is used for both platforms, it should show some interesting results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1dsI78idr9phC1HPKj1Wbw.png" /><figcaption>Video sync between Stadia and Nvidia</figcaption></figure><p>I was able to sync both sequences using the sound spike: the first spike indicates the button is pressed and the second one is when the button is released. Since the action starts when the controller button is pressed, I just had to start the stopwatch at that moment.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fc4DjqIlI4F8%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dc4DjqIlI4F8&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fc4DjqIlI4F8%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/cf8906eacf616844ad6be1d8b14deb16/href">https://medium.com/media/cf8906eacf616844ad6be1d8b14deb16/href</a></iframe><p>And once more, Stadia wins. Only 119 ms between the time I pressed the button and when the character started to move. For Nvidia, this is 50% more with 182 ms.</p><p>Once again, it’s quite easy to understand why: I’m closer to the Stadia server as we saw with the latency. Also, I’m playing like I would play on my TV: with a wireless controller. For Stadia, the controller is connected to the router in Wifi. For Nvidia, the controller is connected to my computer in Bluetooth, that’s one more hop.</p><h3><strong>Summary</strong></h3><p>So now, what’s the best cloud gaming solution? Which one should you pick, and why? First, let’s review each aspect of the two solutions.</p><p><strong>Games availability</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/673/1*merunKjCJRnhRjSWhQtsCg.png" /><figcaption>Number of available games</figcaption></figure><p>That’s a major win for Nvidia GeForce Now. The service has been here in beta for years, and since it’s a wrapper around launchers like Steam, Uplay, Epic, … it has a huge number of available games, almost 600.</p><p>Stadia as a totally new platform is far behind Nvidia, and only has 50 games available for now.</p><p><strong>Game quality</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/763/1*Co2Tt5ef3Yso2OJVZThyCg.png" /><figcaption>Supported game quality</figcaption></figure><p>Both platforms support 720p and 1080p. But Stadia wins with the 4K resolution.</p><p><strong>Startup time</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/725/1*fQy9dl4SP1YfE5ECCDzI1A.png" /><figcaption>Startup time</figcaption></figure><p>Stadia is way faster than Nvidia in the startup period. Even if it’s something you just do once when you start playing the game, Stadia is 3x faster for opening your game.</p><p><strong>Input lag</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/705/1*Kw3nAAQLpZx4jsdn8Mh3hw.png" /><figcaption>Latency and Input Lag</figcaption></figure><p>On the input lag, Stadia is also faster. The way the solution is designed with the controller directly connected to the router in Wifi, and the Google worldwide infrastructure make Stadia 30% quicker than Nvidia.</p><h3>Conclusion</h3><p>In my opinion, on the tech side, Stadia is way better than Nvidia GeForce Now and is the winner of the cloud gaming solution.</p><p>On one hand, the fact it’s a new platform allows games to be developed for cloud gaming purposes, and gives it way better performance than GeForce Now.</p><p>On the other hand, as it’s a new platform, you can’t play games you already own on your PC library as you would be able to do with GeForce Now. And the catalog is reduced because developers need to integrate Stadia.</p><p>So, which solution to pick? I would say it depends on how you play.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ENxj5HtU9h6nsxh8HOViFQ.jpeg" /><figcaption>Nvidia GeForce Now</figcaption></figure><p><strong>Nvidia GeForce Now</strong></p><p>If you have a huge Steam, Uplay, Epic, … game library and you love to replay them all the time, Nvidia GeForce Now is the solution to go. It allows you to play your games, the library is huge, and you don’t have to rebuy them.</p><p><strong>Pros</strong></p><ul><li>No need to rebuy games you already own on PC.</li><li>Huge library: you can play games from Steam, Uplay, Epic … even if they were not designed for cloud gaming.</li></ul><p><strong>Cons</strong></p><ul><li>It’s more game streaming than cloud gaming.</li><li>Need to login to the other platforms (Steam, Uplay, …).</li><li>Impossible to buy the game directly from GeForce.</li><li>Huge startup time.</li><li>Biggest latency and input lag.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MMzE9LC23JN0dKyzgio0Pg.jpeg" /><figcaption>Stadia</figcaption></figure><p><strong>Stadia</strong></p><p>If you’re more like me, you buy a game, you play it, then you switch to a new one, Stadia is the solution for you. It has the best tech features, and will likely give you the best performance.</p><p><strong>Pros</strong></p><ul><li>Real cloud gaming solution.</li><li>Small latency and input lag.</li><li>Game developed to be played with cloud gaming: integrated, tested, and validated with the Stadia infrastructure before the release.</li><li>Buy and be already playing the game in ~30 seconds.</li></ul><p><strong>Cons</strong></p><ul><li>Not a huge list of games for now.</li><li>Need to rebuy games you already own on PC.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2789c4575826" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to have HTTP(S) redirect with GCP Cloud DNS]]></title>
            <link>https://medium.com/@kevinp11/how-to-have-http-s-redirect-with-gcp-cloud-dns-bef4e9b58388?source=rss-53d54f7cfc75------2</link>
            <guid isPermaLink="false">https://medium.com/p/bef4e9b58388</guid>
            <category><![CDATA[redirect]]></category>
            <category><![CDATA[google-cloud-dns]]></category>
            <category><![CDATA[dns]]></category>
            <category><![CDATA[firebase]]></category>
            <category><![CDATA[gcp]]></category>
            <dc:creator><![CDATA[Kevin P.]]></dc:creator>
            <pubDate>Fri, 08 May 2020 23:40:40 GMT</pubDate>
            <atom:updated>2020-05-12T00:45:37.646Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to use GCP Cloud DNS and HTTPS redirects</h3><p>Unlike Google Domains where you can easily create a HTTP(S) redirection in the console, there’s no basic way to do it on GCP. There has been a <a href="https://issuetracker.google.com/issues/70980380">feature request</a> opened for the last 2 years, but it is still in the same state.</p><p>Let’s see how we can achieve the same result in GCP.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*I1XlhDFQEIesZ7qPQ5L3nQ.png" /><figcaption>GCP logo</figcaption></figure><h3>Solution choice</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/755/1*bUIM2j488n8mNAifM61J9g.png" /></figure><p>The easiest way to do it in GCP is to use the Firebase solution. There’s a built-in function that allows to connect a custom domain, and to redirect it to another domain directly, including HTTPS support out-of-the-box.</p><p>This solution only works if you want to redirect to another domain (medium.com for example). If you need to redirect to a full URL like (https://medium.com/@printz.kevin/my_story), this solution won’t work.</p><p>They’re other ways to achieve the same result using GCP only, but they’re less easy (using a GCS bucket for HTTP redirection, and adding a load balancer if HTTPS redirection is needed)</p><h3>Before starting…</h3><p>Before jumping to the configuration, here are the requirements:</p><ul><li>An existing GCP and Firebase accounts linked to a billing account</li><li>A domain name managed in Cloud DNS</li></ul><h3>Configuration</h3><h4>Firebase</h4><p>Just go to the <a href="https://console.firebase.google.com/">Firebase console</a>, click on the “Hosting section”, and select “Add custom domain”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5vYM9CPTCSMr11fTUeD_0A.png" /><figcaption>Firebase console</figcaption></figure><p>Then, enter the domain you wish to redirect, check the box and add the destination url. It’ll work for both HTTP and HTTPS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k4hEj0sl_018u7H4cvLVYg.png" /><figcaption>Create the redirection</figcaption></figure><p>If this is the first time you’re using this domain with Google, you’ll have to verify your ownership by adding a TXT record to the domain.</p><p>And finally, if everything goes well, you’ll have 2 A records to create to finalize the configuration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8MIvkV4sAPWEiRjqNd3_Hw.png" /><figcaption>Redirection summary</figcaption></figure><h4>GCP</h4><p>Now, you need to go to the <a href="https://console.cloud.google.com/">GCP console</a>, and select the Cloud DNS service. Open your zone, and click on “Add record set”. Finally, enter the DNS name, and the 2 IPv4 destinations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/788/1*sYvHh5vNN5gupxY90cWXyA.png" /><figcaption>Create Cloud DNS entries</figcaption></figure><h3>Verification</h3><p>The HTTP redirection should work directly, and redirect to HTTPS. The HTTPS one will take more time because it needs to create a certificate with Let’s Encrypt.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bTXgo8RYxOOKDi_nouWOew.png" /><figcaption>Redirect chain</figcaption></figure><p>After a few minutes (could take up to 1 hour), everything should be working!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/767/1*1s4q7clfJJ3QiMt4xm4euw.gif" /><figcaption>Redirect from Safari</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/713/1*Br_eIedvIpXVlv01Q8HTJg.png" /><figcaption>Redirect with curl</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bef4e9b58388" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setup a static website (CDN) with Terraform on GCP]]></title>
            <link>https://medium.com/swlh/setup-a-static-website-cdn-with-terraform-on-gcp-23c6937382c6?source=rss-53d54f7cfc75------2</link>
            <guid isPermaLink="false">https://medium.com/p/23c6937382c6</guid>
            <category><![CDATA[load-balancer]]></category>
            <category><![CDATA[cdn]]></category>
            <category><![CDATA[gcp]]></category>
            <category><![CDATA[website]]></category>
            <category><![CDATA[terraform]]></category>
            <dc:creator><![CDATA[Kevin P.]]></dc:creator>
            <pubDate>Fri, 08 May 2020 02:56:25 GMT</pubDate>
            <atom:updated>2020-05-22T06:07:07.009Z</atom:updated>
            <content:encoded><![CDATA[<p>Let’s say you need to quickly deploy a static website, or put some files behind a CDN on GCP. But you also want to do it as code, so you can easily replicate the infrastructure somewhere else if needed.</p><p>That’s where you’re going to use Terraform to automate the deployment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZR6-XaIHQ6wD9P6zjsj3Ig.png" /><figcaption>Google Cloud and Terraform logo</figcaption></figure><h3>What do you need?</h3><p>Before starting you’ll need some pre-existing configurations:</p><ul><li>An existing GCP account linked to a billing account</li><li>A service account with a key</li><li>Terraform (≥0.12) installed and configured on your machine</li><li>A domain name managed in Cloud DNS</li><li>The gcloud command configured</li><li>Some files to publish to the CDN</li></ul><p>You can find all the terraform files in my <a href="https://github.com/kevinpz/terraform-gcp-examples/tree/master/code/static-website">Github project</a>.</p><h3>Architecture</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wEoND1zo9KtbjUbgEh3F8Q.png" /><figcaption>Project architecture</figcaption></figure><p>The following ressources will be created in the project:</p><ul><li>An external IP address</li><li>An entry in Cloud DNS to map the IP address to the domain name</li><li>A GCS bucket</li><li>A load balancer with CDN</li><li>A managed certificate for HTTPS (in beta)</li></ul><h3>Let’s deploy</h3><h4>Prepare Terraform</h4><p>You need to configure your Terraform to use the GCP and GCP beta provider first (needed for the managed certificate). Don’t forget to change your variables in the terraform.tfvars file.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f61cbc574e357070d4d41624d8eed19e/href">https://medium.com/media/f61cbc574e357070d4d41624d8eed19e/href</a></iframe><h4>Bucket configuration</h4><p>We need then to create a GCS bucket to host our static files.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9dc708909dafac49b58f23838dbf0acb/href">https://medium.com/media/9dc708909dafac49b58f23838dbf0acb/href</a></iframe><h4>Network configuration</h4><p>We also need to create a new IP address, and add it in our DNS, so we’ll be able to get HTTPS certificates later.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0266ef298ba5ef1969b788d733cac9f7/href">https://medium.com/media/0266ef298ba5ef1969b788d733cac9f7/href</a></iframe><h4>LoadBalancer and CDN creation</h4><p>Finally, we can create our LoadBalancer, the CDN, and map them to serve the bucket content.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ed7d4847f28464c9a5758551f7cf4687/href">https://medium.com/media/ed7d4847f28464c9a5758551f7cf4687/href</a></iframe><p>And here’s a schema explaining how the traffic is handle from the internet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ffhqpvdc-zOtDvkbv74H0g.png" /><figcaption>Load balancer components</figcaption></figure><h4>Deployment</h4><p>Now that everything is ready, it’s time to start the deployment. Just run the Terraform commands, and after a few minutes everything will be deployed.</p><pre>terraform init<br>terraform plan<br>terraform apply</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xVesvGvs-VgTXrH8s-seZA.png" /><figcaption>The loadbalancer in GCP</figcaption></figure><h3>Publish the website</h3><p>Let’s try to send a simple hello world page to check if everything works.</p><pre>gsutil cp hello.html gs://coffeetime-website/</pre><h3>Test the website</h3><p>Now let’s check if everything is working as it should. Let’s open the URL : <a href="https://website.gcp.coffeetime.dev/index.html">https://website.gcp.coffeetime.dev/hello.html</a></p><p>If everything works, you should be able to load the site with a valid HTTPS certificate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*elFuoVxOHaNCxYJxvyLCfA.png" /><figcaption>Website from Safari</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YPUaEk4kNW4iUUvQvYsLsQ.png" /><figcaption>Website from curl</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=23c6937382c6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/setup-a-static-website-cdn-with-terraform-on-gcp-23c6937382c6">Setup a static website (CDN) with Terraform on GCP</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>