<?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 Scott Rossillo on Medium]]></title>
        <description><![CDATA[Stories by Scott Rossillo on Medium]]></description>
        <link>https://medium.com/@srossillo?source=rss-f029f8f9d339------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*LiDhRXbfhZSBHM-etxe7RA.jpeg</url>
            <title>Stories by Scott Rossillo on Medium</title>
            <link>https://medium.com/@srossillo?source=rss-f029f8f9d339------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 14:22:17 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@srossillo/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[Building Multi-Architecture Docker Images on ARM 64]]></title>
            <link>https://tech.smartling.com/building-multi-architecture-docker-images-on-arm-64-c3e6f8d78e1c?source=rss-f029f8f9d339------2</link>
            <guid isPermaLink="false">https://medium.com/p/c3e6f8d78e1c</guid>
            <category><![CDATA[m6g]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[graviton]]></category>
            <category><![CDATA[graviton2]]></category>
            <category><![CDATA[arm]]></category>
            <dc:creator><![CDATA[Scott Rossillo]]></dc:creator>
            <pubDate>Mon, 13 Jan 2020 08:57:17 GMT</pubDate>
            <atom:updated>2020-01-14T01:14:27.856Z</atom:updated>
            <content:encoded><![CDATA[<h3>Building Multi-Architecture Docker Images on ARM 64-bit AWS Graviton2 Processors</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*qyOpVwnFh5H0rhaa-SUFJg.png" /></figure><p>AWS recently announced a preview of its new generation of Amazon EC2 M6g instances that are powered by 64 bit ARM based AWS <a href="https://aws.amazon.com/blogs/aws/coming-soon-graviton2-powered-general-purpose-compute-optimized-memory-optimized-ec2-instances/">Graviton2</a> processors. The projected performance and pricing advantages over the latest generation of AWS x86–64 instances are too impressive to ignore.</p><p>While we could simply use standard Docker on ARM to build images for these new AWS Graviton processors, there are many benefits to supporting both architectures rather than abandoning the x86–64 ship:</p><ol><li>Developers need to be able to run their CI/CD generated Docker images locally. For the foreseeable future, developer machines will continue to use x86–64 CPUs.</li><li>Share common containers across x86–64 and Graviton2 clusters.</li><li>Run staging environments on ARM and production on x86–64 until Graviton2 is out of preview.</li><li>Once Graviton2s are generally available, quickly switch back to x86–64 if a service migration to ARM causes any issues.</li></ol><p>Building multi-architecture Docker images is still an experimental feature. However, hosting multi-architecture images is already well supported by Docker’s Registry, both self hosted and on <a href="https://hub.docker.com/">hub.docker.com</a>. Your mileage may vary with 3rd party Docker registry implementations</p><p>In this post, we’ll demonstrate how to build and publish multi-architecture Docker images on an ARM Linux host for both x86–64 (AMD64) and ARM64 so you can run a Docker container from the image on either architecture.</p><p>Note: if you’re OK building your images on your macOS or Windows desktop, <a href="https://www.docker.com/products/docker-desktop">Docker Desktop</a> ships out of the box with support for building multi-architecture Docker images. However, if you run Linux, or want to build your Docker images correctly, as part of your CI/CD pipeline, read on.</p><h3>Install Docker 19.03 or Later</h3><p>To start, we’re going to need an ARM64 Linux host capable of running Docker 19.03 or later. You could use an x86–64 host as well. However, since we’re looking to benefit from the cost savings of ARM, we’ll use one as our build server with Ubuntu 19.10. Ubuntu is a popular Linux distribution supported by multiple cloud services, however, other recent distributions should work fine as well. However, you’ll need to make sure you’re running a Linux kernel 5.x or later. On AWS, you can use the <a href="https://aws.amazon.com/marketplace/pp/Canonical-Group-Limited-Ubuntu-1910-Eoan-Arm/B07Z9QVQQB">Ubuntu 19.10 AMI</a>.</p><p>On Ubuntu, install docker.io for Ubuntu’s repository. We also install binfmt-support and qemnu-user-static. QEMU enables a single host to build images for multiple architectures and binfmt-support adds multiple binary format support to the Linux kernel. Note that binfmt-support version 2.1.43 or later is required.</p><p>Add your user to the Docker group to enable commands to be run from your user account. Remember to reboot or log out and back in after running:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/faa86200ec4cb4f851215c8242892b1c/href">https://medium.com/media/faa86200ec4cb4f851215c8242892b1c/href</a></iframe><h3>Install Docker Buildx</h3><p>Next, we need to install Docker’s buildx command. <a href="https://docs.docker.com/buildx/working-with-buildx/">Buildx</a> is in technology preview and offers experimental build features such as multi-architecture builds. If you enabled docker to be run as your user, you can install this as your regular user, rather than root.</p><p>Install the buildx command line plugin for Docker. The code below will install the latest release for ARM 64-bit.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/76b74b5a8cf3c813fdf2cfc5b87d5aa6/href">https://medium.com/media/76b74b5a8cf3c813fdf2cfc5b87d5aa6/href</a></iframe><h3>Build Multi-Architecture Images</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/1*GTowKObOIgJYC5C6gqXvYA.png" /></figure><p>Building multi-architecture images (Docker’s documentation refers to these as multi-platform images) requires a builder backed by the docker-container driver and supports two strategies for building cross platform images:</p><ol><li>Using QEMU emulation support in the kernel</li><li>Building on multiple native nodes coordinated by a single builder</li></ol><p>Here we’re using the QEMU approach as it is the cheaper of the two options, since it only requires a single build host for all targeted architectures. Additionally, Docker is not using QEMU here to create fully functional virtual machine,. We’re using <a href="https://ownyourbits.com/2018/06/13/transparently-running-binaries-from-any-architecture-in-linux-with-qemu-and-binfmt_misc/">QEMU user mode</a>, so only system calls need to be emulated.</p><p>As your CI/CD needs evolve you may wish to invest in a build farm of native nodes to speed up the build process.</p><p>Let’s create a bootstrap the builder, you can give it whatever name you’d like:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f87f75dd733b230d7d1eda13e747fc8a/href">https://medium.com/media/f87f75dd733b230d7d1eda13e747fc8a/href</a></iframe><p>Perfect, we now have a builder capable of targeting linux/arm64 linux/amd64, and other architectures!</p><p>Now let’s build an image that can be run on both Linux amd64 and arm64 from a simple Dockerfile. Note that the image you are pulling from must also support the architectures you plan to target. This can be checked using:</p><pre>$ docker buildx imagetools inspect alpine</pre><p>Dockerfile:</p><pre>FROM alpine</pre><pre>RUN apk add util-linux</pre><pre>CMD [&quot;lscpu&quot;]</pre><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c71a4d888a9fed6b3cef770a07d21489/href">https://medium.com/media/c71a4d888a9fed6b3cef770a07d21489/href</a></iframe><p>There’s a lot going on here so let’s unpack it:</p><ol><li>Docker transfers the build context to our builder container</li><li>The builder builds an image for each architecture we requested with the --platform argument</li><li>The images are pushed to Docker Hub</li><li>Buildx generates a manifest JSON file pushes that to Docker Hub as the image tag.</li></ol><p>Let’s use imagetools to inspect the generated Docker image:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/83248877131fe47ba1b8e710a8b54c75/href">https://medium.com/media/83248877131fe47ba1b8e710a8b54c75/href</a></iframe><p>Here we can see that foo4u/demo-multiarch:2 is a JSON manifest pointing to the manifests for each of the platforms we targeted during the build. Although the image appears on the registry as a single image, it’s actually a manifest containing links to the platform specific images. Buildx built and a published an image per architecture and then generated a manifest linking them together.</p><p>Docker uses this information when pulling the image to download the appropriate image for the machine’s runtime architecture.</p><p>Let’s run the image on x86–64 / amd64:</p><pre>$ docker run --rm foo4u/demo-mutliarch:2<br>Unable to find image &#39;foo4u/demo-mutliarch:2&#39; locally<br>2: Pulling from foo4u/demo-mutliarch<br>e6b0cf9c0882: Already exists <br>Status: Downloaded newer image for foo4u/demo-mutliarch:2<br>Architecture:                    x86_64</pre><p>Now let’s run the image on arm64:</p><pre>$ docker run --rm foo4u/demo-mutliarch:2<br>Unable to find image &#39;foo4u/demo-mutliarch:2&#39; locally<br>2: Pulling from foo4u/demo-mutliarch<br>Status: Downloaded newer image for foo4u/demo-mutliarch:2<br>Architecture:                    aarch64</pre><p>That’s it! Now we have a fully functioning Docker image that we can run on either our existing x86–64 servers or our shiny new ARM 64 servers!</p><p>In conclusion, getting started with multi-architecture Docker images on Linux isn’t so hard. We can even use an ARM server to build the images, potentially saving us money on our CI/CD server(s) as well as our staging and production infrastructure.</p><p>Bonus: you can further optimize your Docker builds if the language you use for has good multi-architecture support (such as Java or Go). For example, you can build a Spring Boot application with a single platform compile:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6284435e2eeb171c047723a4c11b9855/href">https://medium.com/media/6284435e2eeb171c047723a4c11b9855/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c3e6f8d78e1c" width="1" height="1" alt=""><hr><p><a href="https://tech.smartling.com/building-multi-architecture-docker-images-on-arm-64-c3e6f8d78e1c">Building Multi-Architecture Docker Images on ARM 64</a> was originally published in <a href="https://tech.smartling.com/">Universal Language</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Migrate to Keycloak with Zero Downtime]]></title>
            <link>https://tech.smartling.com/migrate-to-keycloak-with-zero-downtime-8dcab9e7cb2c?source=rss-f029f8f9d339------2</link>
            <guid isPermaLink="false">https://medium.com/p/8dcab9e7cb2c</guid>
            <category><![CDATA[oauth]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[advantages-of-oauth]]></category>
            <dc:creator><![CDATA[Scott Rossillo]]></dc:creator>
            <pubDate>Thu, 14 Jan 2016 21:07:01 GMT</pubDate>
            <atom:updated>2016-08-12T03:04:57.502Z</atom:updated>
            <content:encoded><![CDATA[<h3><a href="http://keycloak.jboss.org/">Keycloak</a> / <a href="https://access.redhat.com/products/red-hat-single-sign-on"><strong>Red Hat Single Sign-O</strong></a><strong>n </strong>is an excellent Single Sign-On and identity management server, implementing both OpenID Connect 1.0 (OIDC) and SAML 2.0 specifications. It provides an Authorization Server and adapters for Java clients, including a Spring Security implementation. Since Keycloak implements the standard OIDC protocol, it works great with applications developed in other languages as well.</h3><p>Migrating your users from one identity management system to another is something that requires careful upfront planning. You’re probably focused on the new features the new software will give you to build out your product. However, it’s important to plan and test your strategy for moving your users from your legacy system to your new identity management system, since a failed user migration process will cause headaches for your users and support team.</p><p>Some questions you should ask yourself when planning your new identity management implementation include:</p><p>1. Can users be migrated to the new system without them having to reset their passwords?<br> <strong>2.</strong> Can the new login system be turned on without downtime?<br> <strong>3.</strong> If something totally unexpected goes wrong with your new system launch, can it be rolled back?</p><p>When implementing Keycloak, the answer to all three questions is yes. The solution lies in Keycloak’s User Federation SPI, an interface allowing users to be imported from a legacy system into Keycloak’s local storage the first time they log into your application using Keycloak. This is called an on demand migration.</p><p>To help Keycloak implementers with user migration, we’ve open sourced our <a href="https://github.com/Smartling/keycloak-user-migration-provider">user federation provider</a>. It can be used to perform an on demand migration to Keycloak. Below, we’ll take a dive into the code to understand how the user migration process works.</p><p>Our user federation provider will:</p><p><strong>1.</strong> Confirm on demand if a user exists in our legacy user system.<br><strong>2.</strong> Validate on demand if the password being typed into Keycloak’s login page matches their password in our legacy user system.<br><strong>3.</strong> Import the user into Keycloak’s local storage and make Keycloak the system of record for the imported user after their first successful login.</p><p>Since we’re implementing Keycloak to support a service oriented architecture, our federation provider will use a RESTful API to request information about our users from the legacy system. This approach is very flexible because it supports a legacy user service written in any language and it provides a clear separation of concerns between Keycloak and the legacy system during the migration process.</p><p>Using our custom provider, we’ll be able address two of our migration concerns with minimal effort. Since we can validate user information and passwords on demand, we can migrate user accounts without users resetting their passwords and without downtime. Additionally, because the system of record remains our legacy system until a user logs in and we haven’t forced a password change, we can migrate back to our legacy system if something unexpected happens with our Keycloak implementation. Using an on demand approach to user migration mitigates the risk of a catastrophic failure rippling out of control.</p><p>We migrate our users to Keycloak in two steps via our federation provider. During login, we confirm that the user exists in our legacy system and import the user and any metadata, such as roles and custom attributes, into Keycloak. Secondly, we confirm the password entered on the Keycloak login screen matches the password in the legacy system and break the federation link. After these steps are complete, Keycloak will become the system of record for the user.</p><p>Writing our on demand migration provider starts by implementing the UserFederationProvider and UserFederationProviderFactory interfaces. The UserFederationProviderFactory<br> tells Keycloak what properties need to be set for the UserFederationProvider to work. Since we’re using a RESTful API in our federation provider, we just need to set the base URI to our legacy identity server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/989/0*X06gAmIRxMSR_4Fj.png" /></figure><p>The actual work is done by our custom user federation provider. By implementing a few key methods:</p><pre>UserModel getUserByUsername(RealmModel realm, String username); UserModel getUserByEmail(RealmModel realm, String email); boolean isValid(RealmModel realm, UserModel local); boolean validCredentials(RealmModel realm, UserModel user, List&lt;UserCredentialModel&gt; input);</pre><p>In getUserByUsername() and getUserByEmail(), we call our legacy user system to request a JSON representation of the user to be migrated. Using this information we create a Keycloak user model, populate it with the information from our legacy system, and return the model to Keycloak for storage. Additionally, we set a federation link between the Keycloak user and our migration provider. This allows us to validate the user’s password with our legacy user system in a future API call.</p><p>Our isValid() method simply makes a request to our legacy user system to check if a user exists. Keycloak calls this method to verify that we want to proceed with credential validation.<br> A successful response means the user exists.</p><p>In our migration process, implementing a real check in isValid() may seem redundant, but it’s important. If a user has been created in Keycloak but fails to provide a correct password, the user will remain in Keycloak with a federation link to our migration provider. We need to be able to communicate to Keycloak if the user is still valid for migration if they return to login again hours or even days later.</p><p>Our validCredentials() implementation is also pretty simple. We send the username and password the user entered into the Keycloak login form over to our legacy system for validation. A successful response means the password validates; any other response means the entered password is incorrect. Upon successful validation, we save the password the user entered in the login form into Keycloak’s storage and remove the federation link between the Keycloak user and our migration provider. Keycloak is now the system of record for this user.</p><p>Our open sourced user federation provider comes with two sample applications. A sample legacy user service and a demo portal that can be used to prompt a Keycloak login and thus an on demand migration. Give it a try and hit us up in the comments below if you have any questions!</p><p><em>Originally published at </em><a href="http://tech.smartling.com/migrate-to-keycloak-with-zero-downtime/"><em>tech.smartling.com</em></a><em> on January 14, 2016.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8dcab9e7cb2c" width="1" height="1" alt=""><hr><p><a href="https://tech.smartling.com/migrate-to-keycloak-with-zero-downtime-8dcab9e7cb2c">Migrate to Keycloak with Zero Downtime</a> was originally published in <a href="https://tech.smartling.com/">Universal Language</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>