<?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 Robin Bobbitt on Medium]]></title>
        <description><![CDATA[Stories by Robin Bobbitt on Medium]]></description>
        <link>https://medium.com/@robin.y.bobbitt?source=rss-b74a974f0a2b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*7xsZqo89J0OHKVv87DOW2g.jpeg</url>
            <title>Stories by Robin Bobbitt on Medium</title>
            <link>https://medium.com/@robin.y.bobbitt?source=rss-b74a974f0a2b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 05:19:30 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@robin.y.bobbitt/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 a multi-region IBM Watson Assistant application]]></title>
            <link>https://medium.com/@robin.y.bobbitt/building-a-multi-region-ibm-watson-assistant-application-118463df5711?source=rss-b74a974f0a2b------2</link>
            <guid isPermaLink="false">https://medium.com/p/118463df5711</guid>
            <category><![CDATA[ibm-cloud]]></category>
            <category><![CDATA[watson-conversation]]></category>
            <category><![CDATA[watson-assistant]]></category>
            <category><![CDATA[ibm-developer]]></category>
            <category><![CDATA[microservices]]></category>
            <dc:creator><![CDATA[Robin Bobbitt]]></dc:creator>
            <pubDate>Tue, 26 Nov 2019 21:51:57 GMT</pubDate>
            <atom:updated>2019-11-27T14:15:35.972Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uy3Veclmz3fYX9mG3JhtYQ.jpeg" /><figcaption>Photo by <a href="https://www.pexels.com/@souvenirpixels?utm_content=attributionCopyText&amp;utm_medium=referral&amp;utm_source=pexels">James Wheeler </a>from <a href="https://www.pexels.com/photo/photo-of-pathway-surrounded-by-fir-trees-1578750/?utm_content=attributionCopyText&amp;utm_medium=referral&amp;utm_source=pexels">Pexels</a></figcaption></figure><p>My team leverages <a href="https://www.ibm.com/cloud/watson-assistant/">IBM Watson Assistant</a> in a number of applications. While the service is <a href="https://cloud.ibm.com/docs/services/assistant?topic=assistant-recovery">highly available</a> out of the box, gracefully handling the occasional unexpected outage and planning for disaster recovery are the responsibility of the developer. Rather than asking our end users to “Please try again later…”, we have built multi-region support into our applications, and I’m sharing our approach here.</p><p>Our applications are written in Node.js and deployed to IBM Cloud in Dallas. Our primary Watson Assistant instances are therefore also deployed in Dallas, and our secondary instances are in Washington DC. Our preferred behavior is that all requests go to the Dallas instances, unless Dallas is having issues, in which case all requests go directly to Washington DC until Dallas recovers. We do not want our users to experience slow response times during a Dallas incident while we first try Dallas and then ultimately send the request to Washington DC. We are able to achieve our goal using the Circuit Breaker design pattern.</p><p>The basic premise of the pattern is that the Circuit Breaker monitors the requests to the external service, and uses its knowledge of recent failures to determine if requests should continue to be sent. In our case, when Dallas is healthy, the circuit is “closed,” and all requests automatically flow to Dallas first. If a request to Dallas fails or takes too long, the circuit breaker increments its error count and sends the request to Washington. Once too many errors occur in a specified time period, the circuit is “opened,” and all requests flow directly to Washington. After some time has passed, the circuit transitions to a “half open” state. The next request is sent to Dallas, and if successful, we assume Dallas has recovered and the circuit transitions to “closed”; otherwise, we assume it is still unhealthy and the circuit returns to “open” again.</p><p>You can see this approach in action in this <a href="https://github.com/robinbobbitt/multi-region-watson-assistant">sample app</a>. Refer to the instructions in the README to run this application with your own Watson Assistant instances. This is meant to be a simple sample, and does not cover basic things like protecting your endpoints or more complex things like using Redis to persist your error count across application instances.</p><p>Lastly, you will need an approach to keep your skills (née “workspaces”) up to date in your secondary region. In our case, we generate our workspace content from external sources and upload our skills programmatically, so it’s a simple matter of targeting two instances (in two different regions) instead of one. Similarly, you can leverage the <a href="https://cloud.ibm.com/apidocs/assistant/assistant-v1#update-workspace">Watson Assistant API</a> to download your skill JSON from your primary region and upload it to your secondary region.</p><p>This Circuit Breaker design pattern can of course be applied to any external service call, not just Watson Assistant. It not only benefits the consuming application with faster response times, but also protects the external service from being flooded with requests when it is in a bad state.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=118463df5711" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to deploy your Cloud Foundry app with (almost) zero fear using Travis CI]]></title>
            <link>https://medium.com/free-code-camp/how-to-deploy-your-cloud-foundry-app-with-almost-zero-fear-using-travis-ci-926697fff8f6?source=rss-b74a974f0a2b------2</link>
            <guid isPermaLink="false">https://medium.com/p/926697fff8f6</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[continuous-integration]]></category>
            <dc:creator><![CDATA[Robin Bobbitt]]></dc:creator>
            <pubDate>Thu, 15 Nov 2018 17:19:28 GMT</pubDate>
            <atom:updated>2019-11-18T18:43:33.610Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PXXH-HGbEP2x3LWooWGLlA.jpeg" /><figcaption>Photo by William Canady from Pexels</figcaption></figure><p>Application deployments to the cloud should be painless. We should be able to deploy new code continuously, as often as we want, without fear. The <a href="https://docs.cloudfoundry.org/devguide/deploy-apps/blue-green.html">blue-green deployment</a> model enables us to do this.</p><p>I recently joined a new team at work that was deploying node.js Cloud Foundry applications to the IBM Cloud using Travis with the <a href="https://docs.travis-ci.com/user/deployment/bluemixcloudfoundry/">Bluemix CloudFoundry deployment provider</a>. This works great for quickly and easily setting up your deployment with just a few parameters.</p><p>Unfortunately, every deployment means an outage of your application as the existing version stops and the new version starts up. Also, there is no verification that the new code is good before the old code is blown away.</p><p>With the blue-green deployment technique, your current application (Blue) continues to run and take network traffic. While your new application code (Green) is deployed on a temporary route. The new Green application can be validated on the temporary route. If there are any problems, the deployment stops. The Blue application continues to serve traffic uninterrupted. Once the Green application is vetted, the router is updated to point at the Green application. The Blue can be stopped.</p><p>In this manner, there is always a version of the application available to take traffic. Any problems in the deployment or runtime of the new code will not impact the availability of your application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*1EtKZCNFq6DTWK4QU0mzZw.gif" /><figcaption>Cloud Foundry Blue-Green Deployment</figcaption></figure><p>I immediately started looking around for a way to blue-green deploy our applications. In the interest of writing as little custom code as possible, I decided to leverage the <a href="https://github.com/bluemixgaragelondon/cf-blue-green-deploy">cf-blue-green-deploy plugin</a> for the Cloud Foundry command-line interface (CLI). I will share how I did this here.</p><p>I’m going to assume if you landed here you are probably past the point of simply <a href="https://docs.travis-ci.com/user/getting-started/">“getting started” with Travis</a>. I won’t be covering those details here.</p><p>If you’re not interested in following along and just want to get straight to the goods, you can clone my working sample from <a href="https://github.com/robinbobbitt/blue-green-cf-travis">GitHub</a>.</p><h3><strong>Installing the CF CLI and blue-green plugin</strong></h3><p>Since we’re not using the Cloud Foundry <a href="https://github.com/travis-ci/dpl">deployment provider</a>, we have to install the Cloud Foundry CLI ourselves, as well as the blue-green deploy plugin. We can do this in the before_deploy phase of the <a href="https://docs.travis-ci.com/user/customizing-the-build/">Travis build lifecycle</a>.</p><p>Note that the before_deploy phase runs before each deployment provider. If you are doing additional things in your deploy phase, you may want to move these steps into the after_success phase (which runs just once after a successful build) to avoid unnecessary extra installs. You could also move these steps into the deploy script itself, which we will be writing next.</p><p>Regardless of where you put it, here is the script:</p><pre>- echo &quot;Installing cf cli&quot;<br>- test x$TRAVIS_OS_NAME = &quot;xlinux&quot; &amp;&amp; rel=&quot;linux64-binary&quot; || rel=&quot;macosx64&quot;; wget &quot;https://cli.run.pivotal.io/stable?release=${rel}&amp;source=github&quot; -qO cf.tgz &amp;&amp; tar -zxvf cf.tgz &amp;&amp; rm cf.tgz<br>- export PATH=&quot;$PATH:.&quot;<br>- cf --version</pre><pre>- echo &quot;Installing cf blue-green deploy plugin&quot;<br>- cf add-plugin-repo CF-Community <a href="https://plugins.cloudfoundry.org/">https://plugins.cloudfoundry.org</a><br>- cf install-plugin blue-green-deploy -r CF-Community -f</pre><p>The command to install the CLI comes directly from the CloudFoundry DPL <a href="https://github.com/travis-ci/dpl/blob/master/lib/dpl/provider/cloud_foundry.rb">source</a>. The commands to install the blue-green deploy plugin come from the plugin’s <a href="https://github.com/bluemixgaragelondon/cf-blue-green-deploy">README</a>.</p><h3><strong>Invoking the blue-green deploy</strong></h3><p>To invoke the blue-green deploy, we will use the <a href="https://github.com/travis-ci/dpl#script">script deployment provider</a>, which executes a provided command and checks for zero status as indication of success.</p><pre>deploy:<br># on update to master branch we deploy to Cloud Foundry<br>- provider: script<br>  skip_cleanup: true<br>  script:  ./scripts/cf-blue-green-deploy.sh blue-green-cf-travis manifest.yml prod<br>  on:<br>    branch: master</pre><p>Note that skip_cleanup is set to true. Without this, the cf CLI and blue-green deploy plugin you just installed would be removed prior to the deploy running.</p><p>The <a href="https://github.com/robinbobbitt/blue-green-cf-travis/blob/master/scripts/cf-blue-green-deploy.sh">cf-blue-green-deploy.sh script</a> logs in to the Cloud Foundry API and invokes the blue-green deploy plugin. In addition to specifying an application name and manifest file, you can also pass a smoke test script to the blue-green deploy plugin. The plugin will call the smoke test script after the new application code has been deployed, but before the application route is switched to the new application. This allows you to run any number of tests against the new code before any real traffic accesses it.</p><p>The smoke test script is passed a single argument. The argument is the temporary URL of the newly deployed application. If the smoke test script exits with success, the blue-green deploy will complete by switching the route to the new application. If the smoke test script exits with a failure, traffic continues to flow to the old version of the application. The new version remains available for troubleshooting.</p><p>In my example project, the smoke test script invokes a /version API and verifies that it returns with a 200 status code.</p><p>In our real projects at work, we run a Postman collection against the newly deployed app. You want your smoke test suite to be sufficiently big enough that you feel confident in your new code, but not so big that it takes a long time to complete a deployment or flaky tests block you from completing a successful deploy.</p><p>You could optionally run a more comprehensive suite of regression tests as an after_deploy step, after your new code is live.</p><h3><strong>Side effects of a blue-green deploy in IBM Cloud</strong></h3><p>There are a few nuances of this approach to be aware of if you are deploying to IBM Cloud. Because you are creating a new CF application instance each time you blue-green deploy, your application guid will change. If you use the Availability Monitoring service, your configured tests will be lost when your guid changes.</p><p>To work around this, stand up a permanent dummy application. Write your tests for your blue-green deployed app in this dummy application’s configuration. You can specify any URL when you write your Availability Monitoring tests.</p><p>Similarly, if you use the Log Analysis service, you’ll see that when you click the “View in Kibana” link on your application dashboard’s Logs tab, you will be launched into a Kibana search on the application guid string. Any application logs from before your most recent deployment will not show up. To work around this, you can simply filter on the application name rather than the application guid.</p><p>Another service that has the same issue is Auto-Scaling. Each time a new application is stood up as part of the blue-green deploy, it needs its Auto-Scaling policy reconfigured. There is a command line interface available that you presumably could use to script this, but I have not yet had a need to try this.</p><p>If any of these issues are non-starters for you, you always have the option of writing a custom blue-green deploy script that leverages two permanent CF applications, a blue, and a green. These two apps would take turns being live and being idle. You could configure both applications with an auto-scaling policy, for example.</p><p>Of course, this approach means you can’t take advantage of the blue-green deploy plugin described in this post, and you need to maintain your own custom script.</p><h3><strong>Wrapping up</strong></h3><p>In this post, we’ve examined how we can accomplish a low risk, zero-downtime deployment using Travis and the cf blue-green deploy plugin.</p><p>In a real project, we would have even greater assurances, as we would have a suite of unit tests in place, and errors there would fail the Travis build before the deployment had a chance to run. We would also potentially have dev and staging branches configured to deploy to their own respective spaces in our Cloud Foundry organization, allowing us to validate and stabilize the application as necessary before promoting changes to production.</p><p>Thanks for reading! This is my first Medium story, and I hope you found it useful.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=926697fff8f6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/free-code-camp/how-to-deploy-your-cloud-foundry-app-with-almost-zero-fear-using-travis-ci-926697fff8f6">How to deploy your Cloud Foundry app with (almost) zero fear using Travis CI</a> was originally published in <a href="https://medium.com/free-code-camp">We’ve moved to freeCodeCamp.org/news</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>