<?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 Nik Canvin on Medium]]></title>
        <description><![CDATA[Stories by Nik Canvin on Medium]]></description>
        <link>https://medium.com/@Nik_D_C?source=rss-5429d3844a0c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*Dqlbv9hKAVqENDcw.jpg</url>
            <title>Stories by Nik Canvin on Medium</title>
            <link>https://medium.com/@Nik_D_C?source=rss-5429d3844a0c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 05:56:41 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@Nik_D_C/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[Using cloud-native microservices to automate a common business problem (gather/report metrics in…]]></title>
            <link>https://medium.com/nikcanvin/using-cloud-native-microservices-to-automate-a-common-business-problem-gather-report-metrics-in-72f7ac5b8aa0?source=rss-5429d3844a0c------2</link>
            <guid isPermaLink="false">https://medium.com/p/72f7ac5b8aa0</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[vscode]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Nik Canvin]]></dc:creator>
            <pubDate>Tue, 23 Jun 2020 15:52:02 GMT</pubDate>
            <atom:updated>2020-06-23T15:52:02.965Z</atom:updated>
            <content:encoded><![CDATA[<h3>Using cloud-native microservices to automate a common business problem (gather/report metrics in my case)</h3><p>This blog focuses on why and how (easy) cloud-native microservices where used to solve business automation needs. If you’re more interested in the actual open source solution I built in this case, you might like to skip to: <a href="https://medium.com/@Nik_D_C/consolidating-and-reporting-metrics-from-github-twitter-youtube-and-others-4d6ef1be0fd1">Consolidating and reporting metrics from Github, Twitter, YouTube and others</a>.</p><p>Across my organisation many different offering teams needed very similar business metrics and being the innovative Tech company that we are, we had several localised ‘partial’ solutions. I say ‘partial’ merely because nobody had automated most of what they needed, instead they had just done the parts of highest priority to them.</p><p>The existing solutions were implemented in almost every conceivable way, most of them run locally manually on request, but some found a server to live on in some form.</p><p>Attempts to collaborate across the organisation kept breaking down, because</p><ol><li>who ever implemented their bit usually had hardcoded very localised requirements.</li><li>they had already done what they needed and did not see any pay-off changing anything.</li></ol><p>When I started my work to automate business metrics for my project, I wanted to end this localised sub-optimal approach and believed a microservices solution, running on Cloud was both ideal and pretty easy to do.’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*94OUgHOl4oQI_uO9zQXW8Q.png" /></figure><h3>Why use a the microservices approach?</h3><p>for several reasons, actually:</p><ol><li>breaking automation workflows down into atomic parts, I was able to implement the most reusable possible microservice per part and iterate on it in isolation until it was efficient and effective enough.</li><li>by making the microservices completely stateless, they were instantly reusable for anyone else needing it (for example, I coded any inputs required as parameters to the microservice endpoint, so for a service that return a JSON document containing all the Tweets from a specific TwitterUser, the ‘get-data’ microservice endpoint could be hit providing any Twitter users screen name).</li><li>once deployed to a Cloud (OpenShift in my case), these microservices were of immediate reusable value to anyone with my access to my Cloud</li><li>The cloud handled resillience totally transparently for me, so when infrastructure outtagesd occur, the microservices any automatically instantly restarted. Also should the load driven through the microservices grow, additional resources would scale it up, seamlessly.</li></ol><h3>.. and, why in practice was this so easy to do?</h3><h4>firstly, developing microservices:</h4><p>In a nutshell, it was because Eclipse Codewind (an open source plugin) automated the whole cloud-native application creation and containerised iterative development, for me.</p><p>All I needed to do using Codewind, was:</p><ol><li>to create the application from a template (several containerised express Node.js apps, in my case), then</li><li>iteratively add/save the minimal code needed and instantly play with the running results locally.</li></ol><p>..every saved code change automatically rebuilt the containerized application build and container restart (thanks to Codewind).</p><p>See or even ‘try it’, for yourself in this BLOG: <a href="https://medium.com/nikcanvin/how-to-develop-update-a-docker-microservice-in-a-git-repo-a6118da2d92f">How to develop/update a docker microservice in a Git repo</a></p><h4>and secondly, deploying microservices:</h4><p>it takes me just a minute, to build and deploy code changes into production as a microservice, see for yourself in this BLOG: <a href="https://medium.com/nikcanvin/how-to-build-a-docker-microservice-application-and-deploy-to-openshift-fdb0769f1b9f">How to build a docker microservice application and deploy to Openshift</a></p><h3>The business metrics solution I called ‘Smarter Advocacy’</h3><p>I work on the Codewind project itself and was asked to automate reporting metrics around the number of installs that were taking place, as well as other metrics which were needed to understand the results of our advocacy efforts. We were driving awareness amongst developers out there and help funnel them to our web pages via social media posts and web searches.</p><p>You can read all about Smarter Advocacy and find links to the open source code, in this follow on BLOG: <a href="https://medium.com/@Nik_D_C/consolidating-and-reporting-metrics-from-github-twitter-youtube-and-others-4d6ef1be0fd1">Consolidating and reporting metrics from Github, Twitter, YouTube and others</a>.</p><p>Thanks for reading and please share similar experiences with microservices or interest specifically in Smart Advocacy in comment below.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=72f7ac5b8aa0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/nikcanvin/using-cloud-native-microservices-to-automate-a-common-business-problem-gather-report-metrics-in-72f7ac5b8aa0">Using cloud-native microservices to automate a common business problem (gather/report metrics in…</a> was originally published in <a href="https://medium.com/nikcanvin">NikCanvin</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Consolidating and reporting  metrics from Github, Twitter, YouTube and others]]></title>
            <link>https://medium.com/nikcanvin/consolidating-and-reporting-metrics-from-github-twitter-youtube-and-others-4d6ef1be0fd1?source=rss-5429d3844a0c------2</link>
            <guid isPermaLink="false">https://medium.com/p/4d6ef1be0fd1</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[business-metrics]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Nik Canvin]]></dc:creator>
            <pubDate>Tue, 23 Jun 2020 15:44:02 GMT</pubDate>
            <atom:updated>2020-06-23T15:52:37.011Z</atom:updated>
            <content:encoded><![CDATA[<h3>Consolidating and reporting metrics from Github, Twitter, YouTube and others</h3><p><em>Ever wanted to collect, combine, analyse and report metrics form Twitter / YouTube / Github and figure out if your efforts to advocate your project is paying dividends, well I did using cloud-native microservices, which I’ve now contributed to open source.</em></p><p>I work to help advocate on an open source project (Eclispe Codewind) and was asked to collect various metrics to help the project understand how much advocacy was being done (conferences, meetups, blogs, tweets, videos etc), what the effect of the advocacy was (how many participants, views, likes, retweets) and ultimately how that correlated with drive up ‘install’ numbers for the project.</p><p>Asking around, I quickly found many people already automating aspects of this, seemingly in every conceivable technology and because they were pretty tightly coupled to local needs, all very hard to elegantly reuse or collaborate with. This seemed solvable and so it proved to be, with microservices.</p><h4>Why use cloud-native microservices?</h4><p>here’s a quick summary:</p><ul><li>easy to build up an end-end workflow comprising many microservices (which I did my ‘SmarterAdvocacy’ solution).</li><li>once deployed maximise reuse, as each microservice elegantly automates a small part so well, that is easy to reuse and no value to reinvent/re-implement over and over again</li></ul><p>for a fuller explanation as to ‘why microservices’ were picked in my case, see this separate BLOG: <a href="https://medium.com/@Nik_D_C/using-cloud-native-microservices-to-automate-a-common-business-problem-gather-report-metrics-in-72f7ac5b8aa0">Using cloud-native microservices to automate a common business problem</a></p><p><strong>To build and deploy the microservices yourself, that’s easier than you might think:</strong></p><ul><li>see this <a href="https://medium.com/nikcanvin/how-to-develop-update-a-docker-microservice-in-a-git-repo-a6118da2d92f">separate BLOG</a>, for how to develop changes to this cloud-native express/node.js microservice in 4 simple steps.</li><li>see this <a href="https://medium.com/nikcanvin/how-to-build-a-docker-microservice-application-and-deploy-to-openshift-fdb0769f1b9f">separate BLOG</a>, for how to deploy the latest microservice into production (an OpenShift Kubernetes cluster).</li></ul><h3>The 5 microservices in Smarter Advocacy</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J_woGDBuXEIEFZ13h8_8iQ.png" /><figcaption>overview</figcaption></figure><p>Sample report, viewed by ‘display-report’:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/729/1*1dCbokf6pJUmrDLj92iVcw.png" /><figcaption>sample report output (purely Twitter metrics in this case)</figcaption></figure><ol><li><strong>‘get-data’, </strong>which gets data from various social media/github places (endpoint parameters, enable anyone to hit the endpoint with their specific ‘twitter screen name’, ‘youTube channel/video’ or ‘git project’ to collect the data for). Here’s the code: <a href="https://github.com/IBM/smarteradvocacy-get-data">https://github.com/IBM/smarteradvocacy-get-data</a></li><li><strong>‘couchdb’, </strong>to store the data from ‘get-data’ above and ‘build-report’ below. Here’s the code: <a href="https://github.com/IBM/smarteradvocacy-couchdb">https://github.com/IBM/smarteradvocacy-couchdb</a></li><li><strong>‘build-report’, </strong>which crunches the data from ‘get-data into a meaning ful report, aggregates metrics for hourly, daily and monthly totals and metrics, as when as extending it if reqiured (such as comparing actual metrics to targets etc). Here’s the code: <a href="https://github.com/IBM/smarteradvocacy-build-report">https://github.com/IBM/smarteradvocacy-build-report</a></li><li><strong>‘display-report’, </strong>which simply gets the JSON reports built above and displays it as HTML to a user in a browser. Here’s the code: <a href="https://github.com/IBM/smarteradvocacy-display-report">https://github.com/IBM/smarteradvocacy-display-report</a></li><li><strong>‘controller’, </strong>which merely drives the ‘get-data’ and ‘build-report’ with endpoints+parameters above, on a hard coded schedule (typically ‘hourly’). Here’s the code: <a href="https://github.com/IBM/smarteradvocacy-controller">https://github.com/IBM/smarteradvocacy-controller</a></li></ol><p>Done.</p><h3>Noteworthy problems tackled along the way</h3><ol><li>security; many data sources (such as the Twitter APIs) need some kind of access token, but I did not want to hard code my personal access details for all to see in github. Also I wanted to enable any developer of my microservices to be able to use their own tokens. I share my solution in this BLOG: <a href="https://medium.com/nikcanvin/how-to-securely-use-passwords-tokens-to-access-other-services-in-cloud-native-applications-f35b7f7611ce">How to securely use passwords/tokens to access other services in cloud-native applications</a></li><li>data backup; as not long after I started using ‘Smarter Advocacy’ in production, my Cloud Cluster was restarted and I inevitably lost data (I had planned to do back-ups but got carried away before I needed them)! The ideal solution would be to set-up persistent storage for my Couch DB microservice, or to ‘replicate’ the Couch DB instance to another server. However, as a quick tactical solution, I opted to backup the latest ‘build-report’ instance in the ‘build-report/public’ folder on github. Should my Cluster restart at any time, the ‘build-report’ microservice was coded to automatically retrieve the last report data from Github.</li></ol><p>Thanks for reading and please share similar experiences with microservices or interest specifically in Smart Advocacy in comment below.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4d6ef1be0fd1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/nikcanvin/consolidating-and-reporting-metrics-from-github-twitter-youtube-and-others-4d6ef1be0fd1">Consolidating and reporting  metrics from Github, Twitter, YouTube and others</a> was originally published in <a href="https://medium.com/nikcanvin">NikCanvin</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to develop/update a docker microservice in a Git repo]]></title>
            <link>https://medium.com/nikcanvin/how-to-develop-update-a-docker-microservice-in-a-git-repo-a6118da2d92f?source=rss-5429d3844a0c------2</link>
            <guid isPermaLink="false">https://medium.com/p/a6118da2d92f</guid>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Nik Canvin]]></dc:creator>
            <pubDate>Fri, 12 Jun 2020 16:09:53 GMT</pubDate>
            <atom:updated>2020-06-16T13:25:15.442Z</atom:updated>
            <content:encoded><![CDATA[<p>Using a pre-existing ‘get-data’ microservice stored in a Git repo, to show an easy way to make a change, run/test it locally and push it back to Git.</p><p><em>Note: The microservice used as an example for this blog is ‘get-data’, which can get metrics data from sources like Git, Twitter and YouTube and return it as a JSON document: </em><a href="https://github.com/IBM/smarteradvocacy-get-data"><em>https://github.com/IBM/smarteradvocacy-get-data</em></a><em> . It is used as part of a SmarterAdvocacy microservices solution, which periodically aggregates data from multiple sources, anlyses and reports the results — to help measure and improve efforts made to advocate various bits of software, enabling greater success for that software. A BLOG about SmarterAdvocacy itself, will folllow soon.</em></p><p>meanwhile, here are the 4 simple steps to follow:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3JH21vVqSJ5bshZm4KbrZw.png" /><figcaption>the 4 simple steps to develop/update a microservice in a github repo</figcaption></figure><h3>step1: get the code</h3><p>If you’re a commiter to the Git repo then:</p><ul><li>CD to the local directory to work in</li><li>git clone <a href="https://github.com/IBM/smarteradvocacy-get-data.git">https://github.com/IBM/smarteradvocacy-get-data.git</a></li></ul><p>else if you’re not a commiter, you’ll first have to ‘fork’ the repo</p><ul><li>Fork the repo in Git</li><li>CD to the local directory to work in</li><li>git clone &lt;your-git-fork&gt;</li></ul><h3>step2: get the microservice running locally in docker and ready to accept code changes</h3><ul><li><a href="https://www.eclipse.org/codewind/gettingstarted.html">install for Codewind is simple</a> (as a plugin in your VSCode, Eclipse or Intellij IDE)</li><li>then in your IDE (VSCode in my case) under Codewind/local, click the icon to ‘Add Existing Project’:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/756/1*6FgIMx0oOdNXn3AgxpffZA.png" /><figcaption>Codewind panel showing existing projects imported into Codewind and buttons to create a new blank project from a template, or add existing project (as we’re doiong in this blog)</figcaption></figure><ul><li>select the cloned project on your machine, from step1 above:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pl-z2wQAmIi4X47KgW3uYA.png" /></figure><ul><li>check that Codewind has determined the correct Type and Language, then click ‘Yes’:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/838/1*OwD5RmFNj95UbIH-_R-3Yg.png" /></figure><p>then simply WAIT, while Codewind automatically does the rest:</p><p>1…auto docker builds the microservice (docker build logs are a click away):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/1*W11S5vFvIPpLD-bgfCJ38Q.png" /><figcaption>Codewind panel showing Docker build success</figcaption></figure><p>2…auto docker runs the microservice locally:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/696/1*hspSG27Vx5RtsGtOKdBNmQ.png" /><figcaption>Codewind panel showing Application Endpoint clickable url link</figcaption></figure><p>All DONE .. to check, you can then click the ‘Application Endpoint’ link, to see it running (here’s the index.html of my ‘get-data’ microservice):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*dd11OUzsAUB5e8dCxbCF-w.png" /><figcaption>demo microservice running in a local Docker container</figcaption></figure><p>..so far, pretty easy stuff!</p><h3>step3: make a code change, respin the docker build/run/test:</h3><p>Codewind does this magically for you. All you need to do is save a code change and Codewind will automatically spot the change rebuild the docker container/application as required and restart the new modified microservice.</p><p>Simple example, changing some text in ‘index.html’ (and making it ‘red’ to help you spot it below) and SAVE:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_NOUga-U2Kv62GKjLCHZKA.png" /><figcaption>demo code update to ‘index.html’ in my VSCode IDE</figcaption></figure><p>and simply click the application endpoint again:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/724/1*AMCVLWw6IpBkr5QbBu2KZg.png" /><figcaption>demo changes shown in index.html, automatically running in a local Docker container</figcaption></figure><p>Once you’re happy with all your code changes, you’ll be ready to get them merged into the original Git repo for everyone else on the project to get:</p><h3>step4: push your code back to the original Git repo</h3><p>If you’re a commiter to the Git repo then:</p><ul><li>git commit -am “example modification to html”</li><li>git push origin master</li></ul><p>else if you’re not a commiter, you’ll first have to ‘fork’ the repo</p><ul><li>git commit -am “example modification to html”</li><li>git push origin master</li><li>raise a Pull Request from your fork, into the target Git repo.</li></ul><p><strong>and we’re DONE, thanks for reading.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a6118da2d92f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/nikcanvin/how-to-develop-update-a-docker-microservice-in-a-git-repo-a6118da2d92f">How to develop/update a docker microservice in a Git repo</a> was originally published in <a href="https://medium.com/nikcanvin">NikCanvin</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to securely use passwords/tokens to access other services in cloud-native applications]]></title>
            <link>https://medium.com/nikcanvin/how-to-securely-use-passwords-tokens-to-access-other-services-in-cloud-native-applications-f35b7f7611ce?source=rss-5429d3844a0c------2</link>
            <guid isPermaLink="false">https://medium.com/p/f35b7f7611ce</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[openshift]]></category>
            <category><![CDATA[nodejs]]></category>
            <dc:creator><![CDATA[Nik Canvin]]></dc:creator>
            <pubDate>Mon, 27 Apr 2020 09:02:21 GMT</pubDate>
            <atom:updated>2020-04-27T09:31:47.460Z</atom:updated>
            <content:encoded><![CDATA[<p>I needed my docker app to read/write data to other services using their access authentication. Here’s how I did it securely without giving away the OAuth token, username or password (I wanted nothing hardcoded in github code).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/701/1*WZAqMtfD-kE4fT1MKhbl-A.png" /></figure><p>My particular application reads several documents from CouchDB, anylyses and enriches it, then writes a single report document back to CouchDB. It also stores a copy of the latest report (removing any preivous ones) in github as a backup.</p><h4>For the production environment</h4><p>It did not take long to find out a best practice here was to:</p><ol><li>Use Secrets in Kubernetes to store the sensitive passwords/tokens.</li><li>Set environment variables in the application container from the secrets.</li><li>Assign and use variables in the application from the container environment variables.</li></ol><h4>For the local development environment</h4><p>I also needed a solution for my local development containers. Having no access to production kubernetes secrets, and also no access to my local environment (laptop) variables as I run/test in an isolated docker container locally, so I opted to:</p><ul><li>pass access credentials to the express Node.js application as optional parameters at on the application endpoint, for example: /applicaiton-end-point?GitToken=xxx&amp;CouchDbUsername=xxx … etc</li></ul><h3>Here were the steps taken</h3><h4>Setup the secrets in my production Openshift instance</h4><p><em>For non-Openshift Kubernetes user, simple alternative instructions are linked below[1]</em></p><ol><li>Create a Key/Value secret, under Openshift Workloads/Secrets:</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/638/1*YNzLFy0O2TXg0VQTJsct7A.png" /><figcaption>Create a Key/Value secret, under Openshift Workloads/Secrets</figcaption></figure><p>and enter details and click ‘Create’:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/558/1*1p1y8RFcAliPx1dw9B9wXA.png" /><figcaption>enter details and click ‘Create’ … (fake token data shown in illustration)</figcaption></figure><p>2. The secret was created, next click ‘Add Secret to Workload’:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/1*yN34eAzXK0mZLKtzZS89Bw.png" /><figcaption>secret was created, next click ‘Add Secret to Workload’</figcaption></figure><p>then select the workload (pod) to add the secret as an environment variable too and click ‘Save’:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/784/1*efHPnZZ38eyeBsS93CUgsg.png" /><figcaption>select the workload (pod) to add the secret as an environment variable too and click ‘Save’</figcaption></figure><h4>A quick test</h4><p>Test the results, by opening the workload pod (selected above), clicking on ‘terminal’ and typing ‘printenv’ to print all environment key/values set, or name the specific key you want to query, as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/888/1*31jaUQc-qgbxR1pl2CRlOQ.png" /><figcaption>confirmation the environment is set, from the secret</figcaption></figure><h4>Write the application code to set variables to the access credentials</h4><p>Assumes if the production environment variable exists, then use it. If not then use the request query parameter if it’s set (local development vase), else report an error:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*83ZJmIZOHIZaJcbkQsVu-w.png" /><figcaption>code extract</figcaption></figure><p>To make things quicker for manual tests (especially in future when I’ve forgotten where the find the ‘secrets’ on Openshift), I added instructions/links to secrets, on the application index.html page:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/559/1*EjcvPbRCuf-Ub0xRSOkb9A.png" /><figcaption>instructions/links to secrets, on the application index.html page</figcaption></figure><p>All done.</p><h4>reference links:</h4><ul><li>[1] creating secrets in Kubernetes: <a href="https://kubernetesbyexample.com/secrets/">https://kubernetesbyexample.com/secrets/</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f35b7f7611ce" width="1" height="1" alt=""><hr><p><a href="https://medium.com/nikcanvin/how-to-securely-use-passwords-tokens-to-access-other-services-in-cloud-native-applications-f35b7f7611ce">How to securely use passwords/tokens to access other services in cloud-native applications</a> was originally published in <a href="https://medium.com/nikcanvin">NikCanvin</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Testing my applications on the next Node.js version (right now, it’s v14)]]></title>
            <link>https://medium.com/codewind/testing-my-applications-on-the-next-node-js-version-right-now-its-v14-3fb853f87e2a?source=rss-5429d3844a0c------2</link>
            <guid isPermaLink="false">https://medium.com/p/3fb853f87e2a</guid>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Nik Canvin]]></dc:creator>
            <pubDate>Tue, 21 Apr 2020 07:41:12 GMT</pubDate>
            <atom:updated>2020-04-21T07:41:12.098Z</atom:updated>
            <content:encoded><![CDATA[<p>As another new Node.js LTS version comes out (v14 this time), I wanted to test my Node.js investments against it, ultimately aiming to upgrade them as efficiently and effectively as possible. Using <a href="http://ibm.biz/20200417-blog-codewind">Codewind</a> (an open source plugin for your IDE) I swapped the Node.js versions over and tested them, here’s how easy it was.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v4TLE4n8PfwB8u1kLj10UQ.png" /><figcaption>instant application ‘response time‘ results when repeatedly under load, demonstrated v14 would run and performance had not regressed</figcaption></figure><p>Well, it was easy after I jumped the ‘updating my Node.js version to a pre-release nightly build’ hurdle, which I’ll explain at the bottom for anyone interested in doing the same.</p><p>I have many Node.js applications and microservices in production, covering release time legals process automation and more recently gathering, analysing and report various business metrics. Continuously keeping them on the latest software stack protects them from accruing deprecated API technical debt.</p><p>Thankfully due to all the benfits of ‘twelve-factor apps’[1], I previously choose to run all my Node.js workloads as cloud-native microservices. This meant all the dependencies (including software stack layers) were already ‘explicitly declared and isolated’. You can read how I easy I found doing this in: ‘My first cloud-native Node.js microservice, from nothing to running, immediately’[2].</p><p>Rebuilding and testing my applications on Node.js v14 was as simple as a small change in the Dockerfile, which was made easier still using Codewind as it automatically spotted the file change, rebuild, restarted the containerized application and provided five great time saving tools for me to have a poke about and have confidence in the Node.js version change.</p><h3>Top 5 time saving Codewind features, that helped with this ‘upgrade stack test’ scenario</h3><h4>1. Performance testing, fully integrated in Codewind</h4><p>Checking your continuous code updates for any unintended performance regressions is a powerful capability provided ‘out-the-box’ in Codewind. The sooner you spot any issues, especially complex performance ones, the better.</p><p>In this scenario, the only code change was the Node.js version declaration and I was able to instantly check the performance between Node.js v14 and v12.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/404/1*36QuDf2n4yUfXq1n3_cGDA.png" /><figcaption>click:</figcaption></figure><p>A simple configuration panel enabled me to inflict the workload challenge for my application. I wanted to test just enough load to have confidence in the Node version upgrade but without causing any ‘rate-limiting’ algorithm to kick in on a live web page my application was hitting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1014/1*OHoLSOHObfDcorm9kje-Qw.png" /><figcaption>configure testing runs, I hit the ‘get-data’ endpoint with several parameters, 30 times a second (10 at a time), for 20 seconds … I was sensitive not to hammer harder, as the microservice was hit a live web page elsewhere</figcaption></figure><p>Results in, everthing was clean:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J43ORMtayTl3SF7GpVE3Lw.png" /><figcaption>graphed results of 10 runs, 5 with Node v14, then 5 more with Node v12.. response time looked pretty consistent to me (only outlier was the middle v12 (the 8th) run, probably an insignificant network blip)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yAaOsricER2xd_9DooALjA.png" /><figcaption>results also tabularised, where any individual runs can be selected/deleted from the data if desirable (such as removing the noisy 8th run)</figcaption></figure><h4>2. Application health metrics constantly collected and displayed</h4><p>During playtime with the application above, I was able to watch the http response time, as well as impact on CPU and memory use, to look for any irregularities.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/388/1*19t5fuuq5tEz6ggY-Z-WQw.png" /><figcaption>click:</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*srIDBIiYlVjHUdvtk0GlvA.png" /><figcaption>snap-shot was taken after the first 5 performance runs, from the next cool feature below:</figcaption></figure><h4>3. Quick launch application for a manual sniff test</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/346/1*koVbLpGqCBdiWMs5LZp9QA.png" /><figcaption>click:</figcaption></figure><p>The microservice served a web page, providing links that enable me to quickly test it with many different parameters:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*4yYTYXZL1kkbBlfmv557qg.png" /><figcaption>clicking a link ran the microservice, which got some business metrics and returned JSON</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OsGidaujkvTzYHdTQ_801Q.png" /><figcaption>application results, demonstraing ‘business as usual’ on new Node.js version</figcaption></figure><h4>4. Simple ‘click to open a shell’ inside the running container.</h4><p>OK, it’s easy to ‘docker run …’ if you know how, but you need to remember the command and some lightweight docker images I use don’t have ‘bash’ so starting a container and keeping it running long enough can be a pain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/442/1*FjIkV5QGBommkTswhbE7Ww.png" /><figcaption>click:</figcaption></figure><p>I used this to double check the run container running the application actually had Node.js v14 running in it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/703/1*f3LueHE0oI1roA0IQDXhNg.png" /><figcaption>able to quickly check ‘node -v’ running in the actual container, v14 nightly build was present</figcaption></figure><h4>5. Keep an eye on the build logs tick past</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/366/1*fbVtjgyca9k7scjvdPqBGA.png" /><figcaption>click:</figcaption></figure><p>First the Docker build then the Application build log, helped me debug my issue when ‘updating the Node.js version to pre-release nightly build’, which I cover at the bottom of this blog</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/701/1*EqV38FWvormcQ8fMqoBOSA.png" /><figcaption>Docker build log firing up….</figcaption></figure><h3>In Summary</h3><p>The combination of modernising business workloads using ‘twelve factor’[1] application implementations with <a href="http://ibm.biz/20200417-blog-codewind">Codewind</a> for rapid iterative development of cloud-native applications, enabled me to simply and quickly maintain software stack currency.</p><p><strong><em>and finally, as promised above: Updating my Node.js version to a pre-release nightly build’</em></strong></p><p>I hoped it would be as simple as changing the Dockerfile ‘from’ declaration from ‘node:12-stretch’ to ‘node:14-stretch’, causing the software stack to base off Node.js v14 as the first step of the build process. However, as v14 was not released until the following week, there were no Node.js v14 images on Dockerhub ready for use.</p><p>Instead I retained the ‘node:12-stretch’ declaration and opted to download/update the Node.js version during the Docker build process. I added a couple of ‘node -version’ queries too, before and after the upgrade to check the results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/988/1*yu0wglmdGAhnR5gIaumlpA.png" /><figcaption>Dockerfile updates made (pre-release node v14 nightly builds shown) .. for example only as I commented them out, I’ve also shown what post-release node builds would look like for v13</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/703/1*NeUIp1hR2dBgkRJutU5JKQ.png" /><figcaption>docker.build.log (shows node version used before and after update)</figcaption></figure><h4>Reference links:</h4><ul><li><a href="http://ibm.biz/20200417-blog-codewind">Codewind landing page</a> (for news, blogs, github repos, twitter, etc)</li><li>[1] <a href="https://12factor.net/dependencies">twelve-factor apps/dependencies</a></li><li>[2] <a href="https://medium.com/codewind/my-first-cloud-native-node-js-microservice-from-nothing-to-running-immediately-13a49be74ba8">My first cloud-native Node.js microservice, from nothing to running, immediately</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3fb853f87e2a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/codewind/testing-my-applications-on-the-next-node-js-version-right-now-its-v14-3fb853f87e2a">Testing my applications on the next Node.js version (right now, it’s v14)</a> was originally published in <a href="https://medium.com/codewind">codewind</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[JDK 14 is coming, but will my Java application run on it?]]></title>
            <link>https://medium.com/codewind/jdk-14-is-coming-but-will-my-java-application-run-on-it-49bac9ee145b?source=rss-5429d3844a0c------2</link>
            <guid isPermaLink="false">https://medium.com/p/49bac9ee145b</guid>
            <category><![CDATA[jdk]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[containers]]></category>
            <dc:creator><![CDATA[Nik Canvin]]></dc:creator>
            <pubDate>Wed, 18 Mar 2020 09:46:15 GMT</pubDate>
            <atom:updated>2020-03-19T08:00:46.299Z</atom:updated>
            <content:encoded><![CDATA[<h3>JDK 14 is now here, but will my Java application run on it?</h3><p>well, … NO… as it turns out… for my specific application at least, here’s how I tested against JDK14, then found, debugged and fixed an issue in minutes!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/1*oRhLFDLPEuhZL8lBHipCZQ.gif" /><figcaption>JDK 14 tested clean, after an issue was identified/fixed</figcaption></figure><p>New versions of the layers in your application software stack are continuously released and often contain API breaking changes, especially as security fixes strive to lock down every possible risky code path. In the latest JDK14 release[1] for example, the ‘JEP367 to Remove the Pack200 Tools and API’[2] could bring your application or build process to a grinding halt and if it does, what can you do about it!</p><p>Staying current on the latest software stack has never been more critical to ensure your application gets the latest security features and fixes, as well as minimizing business agile development blocking technical debt!</p><p>The best way to stay current is to continuously test your application on latest stack levels, so here I’ve shared a great quick, easy and cheap way to achieve it. However, before I share my favourite method, it’s worth pointing out support can mean two things, which I’ll touch on later on:</p><ol><li>Toleration — simply put, will the application still run at all!</li><li>Exploitation- will the application run better in some way, such as faster due to performance improvements, more resilient due to enhanced fault toleration, or maybe easier to debug issues thanks to new diagnostic features.</li></ol><h3>Containerize your application and simply interchange software stack levels as required</h3><p>Running a Java application in a container, using an implementation such as OCI or Docker, enables it to easily run in a controlled environment. Then in this JDK 14 case, I simply switched the Java Runtime used, re-built the container and tested it.</p><p>Simple in theory but the investment and maintenance of containerization skills and devops pipelines pain point, adds yet more pressure on stretched technology teams. This is where <a href="http://ibm.biz/20200312-codewind">Eclipse Codewind</a> had the answer, as it’s designed specifically to automate this pain point. Developing in your favorite IDE (Intellij, Eclipse and VS Code all currently supported), Codewind handles the Containerization and Kubernetes part automatically. To switch the JDK version to 14 (I was previously running on JDK8), I saved a simple update to the Dockerfile and Codewind did the rest.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/1*8RGuiLyScP9RlmwiEp2eXQ.png" /><figcaption>Switched the build process to JDK14, in the Dockerfile</figcaption></figure><p>The update was automatically spotted and new container instantly built and …oh, a BUILD FAILURE .. not what I was expecting. A ‘maven-war-plugin’ hit an API incompatibility issue:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/707/1*GrPFMxeMVmxix3_v8zEDcg.png" /><figcaption>Docker build log extract, (using Codewind plugin in VS Code)</figcaption></figure><p>Toggling back to JDK13 the application built and ran, providing instant confirmation that this breaking change was introduced in JDK14.</p><p>Using Codewind to search the project for ‘maven-war-plugin’ I found it declared in the ‘pom.xml’ file, using version ‘2.6’. A quick web search steered me to the MvnRepository page, where I saw ‘2.6’ was released in 2015 (might security vulnerabilities lurk in that) and the latest version is now ‘3.2.3&#39;, so a quick edit to the pom.xml was made:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/456/1*4kLZ3kB6WdfaDMxX8-aAfA.png" /><figcaption>Bumping the version from 2.6 up to the latest 3.2.3 ( update made/saved in Codewind)</figcaption></figure><p>Codewind automatically spotted the ‘pom.xml’ file save, rebuilt the application (fully successful that time) and ran it. Issue resolved!</p><h3>Just to recap</h3><p>A build process pre-requisite did not support JDK14. However, without personally having installed Kubernetes or having containerization skills, using Codewind I was able use containerization to test, find and fix an issue, in a matter of minutes.</p><h4>Here are a few extra tips to consider:</h4><ol><li>Regarding testing for ‘exploitation’ mentioned above, Codewind has built-in performance monitoring and testing tools, that enable measurement of any improvements achieved by switching software stack layers.</li><li>It may be worth fully automation the currency testing activity. You could automate systematic changes to the Dockerfile, changing each software stack layer to the latest versions/releases and running your test suite against it. This could provide you with the earliest possible feedback that some technical debt had been incurred, helping you to plan to most cost effective response.</li><li>Of course the larger the application, the more APIs that are used in pre-requisite software, the more likely it is that stack currency testing hit issues. Here’s a great approach breaking application down into bite size microservices, see Modernize existing apps and build new cloud-native apps[4], offered by IBM.</li><li>Here’s one final tip regarding consolidating management and patching of software levels in the application stack of multiple microservices in one go (for example, bumping up the JDK level of many microserivces). Using the architectural stack features in Kabanero.io[5], a single JDK level change can instantly feed into scoped future development and deployment of new or updated microservices.</li></ol><p><strong><em>References mentioned above:</em></strong></p><ol><li><em>JDK 14 release contents: </em><a href="https://openjdk.java.net/projects/jdk/14/"><em>https://openjdk.java.net/projects/jdk/14/</em></a></li><li><em>JEP367 to Remove the Pack200 Tools and API: </em><a href="https://openjdk.java.net/jeps/367"><em>https://openjdk.java.net/jeps/367</em></a></li><li><em>Eclipse Codewind (plug-in for VS Code, Eclipse and Intellij) to automate application containerization develop/build/run iterations: </em><a href="https://www.eclipse.org/codewind/"><em>https://www.eclipse.org/codewind/</em></a></li><li><em>Modernize existing apps and build new cloud-native apps, offered by IBM: </em><a href="https://www.ibm.com/cloud/cloud-pak-for-applications"><em>https://www.ibm.com/cloud/cloud-pak-for-applications</em></a></li><li><em>Kabanero, an open source project focused on bringing together foundational open source technologies into a modern microservices-based framework: </em><a href="https://kabanero.io/"><em>https://kabanero.io/</em></a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=49bac9ee145b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/codewind/jdk-14-is-coming-but-will-my-java-application-run-on-it-49bac9ee145b">JDK 14 is coming, but will my Java application run on it?</a> was originally published in <a href="https://medium.com/codewind">codewind</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Legal work required to release a complicated Eclipse project like Codewind]]></title>
            <link>https://medium.com/nikcanvin/legal-work-required-to-release-a-complicated-eclipse-project-like-codewind-7f777ff4ffd6?source=rss-5429d3844a0c------2</link>
            <guid isPermaLink="false">https://medium.com/p/7f777ff4ffd6</guid>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[copyright]]></category>
            <category><![CDATA[software-licensing]]></category>
            <dc:creator><![CDATA[Nik Canvin]]></dc:creator>
            <pubDate>Mon, 20 Jan 2020 12:34:37 GMT</pubDate>
            <atom:updated>2020-01-20T12:34:37.588Z</atom:updated>
            <content:encoded><![CDATA[<p>For each four weekly release of Eclipse Codewind, the project must clear usage of every new open source dependency with the Eclipse IP legal team and then update the project ‘Notices’ file, sounds easy right — lets find out!</p><p><em>Note: before the release is functionally complete and dependencies unlikely to change (the release DCUT milestone), the process described below may be followed to derisk salient issues at DCUT causing release delays.</em></p><h3>In a nut-shell:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GyEkP6VQHczfbjUU4Dtwfw.png" /></figure><ol><li>Run a bash script to clone the release source code, install all production sub-dependencies and scan everything, then generate several outputs required for the steps below.</li><li>Using SOS tooling, import the scan results and resolve any unknown package name, version and/or license issues.</li><li>Check no blocking legal risks exist, then raise Eclipse IP CQs exist for all new/updated open source packages (special bulk CQ’s used for Node.js and Go-Lang packages)</li><li>Create the NOTICE.md file and raise the Git pull requests to add it back into the source code</li></ol><h3>The gory details:</h3><h4>setup</h4><ul><li><strong>install pre-requisties before beginning</strong>. Scroll to the bottom of this BLOG to see the list of stuff to install, before embarking on this journey!</li><li><strong>get latest list of git repositories containing source:</strong> to catch any changes, the globally distributed development team update a single collaborative BOX note (<a href="https://ibm.ent.box.com/notes/533512510928?s=nwm4j29xp7uuaumrljyz7fd8b1f9xid7">Codewind Resources</a>), listing all the project git reposititories containing project source. We’re currently up to 9 repositories with source in scope of the <a href="https://www.eclipse.org/projects/dev_process/ip-process-in-cartoons.php">Eclipse IP process</a> (and 7 repositories that are not in scope, that contain website source and documentaiton etc). We also list all project <a href="https://hub.docker.com/search?q=eclipse%2Fcodewind&amp;type=image">Eclipse/Codewind Docker containers</a>, hosted on dockerhub, for futher consideration of legal impacts.</li><li><strong>set-up for automation below:</strong> the git source repositories (in scope) list is then updated, along with the release numbers of both the previous release and this release, in this single <a href="https://ibm.box.com/s/7s6gmxu96gakffxvostkease7mmajoe8">bash script</a> which is run to automate many steps below.</li></ul><h4>step 1 — run a bash script which — clones release source code, installs production dependencies and generates several outputs</h4><p><em>the following sub steps are fully automated within a single </em><a href="https://ibm.box.com/s/7s6gmxu96gakffxvostkease7mmajoe8"><em>bash script</em></a><em> but I’ve </em><strong><em>outlined the script internals below, just for your information:</em></strong></p><ol><li><strong><em>get the source code: </em></strong><em>clone the git repositories locally (ensuring the ‘branched release version’ of the code is used post release DCUT, instead of ‘latest’). I then make a copy of the source, which is used to avoid excessive duplicate git downloads if the following steps need to be rerun for any reason (this copy/recovery practice is duplicated in each step below, to save time if used).</em></li><li><strong><em>remove some legals noise:</em></strong><em> we then remove all instances of our own Eclipse Codewind license and the Notices file provided with Codewind in each repository, to prevent lots of false positive legal hits for the remainder of the process below.</em></li><li><strong><em>install Node.js sub-dependencies: </em></strong><em>all Node.js package ‘production’ sub-dependencies are then install locally by finding and ‘npm ci’ all the ‘package-lock.json’ files (currently up to 16). At this point, a copy of the node.js dependency trees is created as a text file, for future reference if needed (currently 1880 dependencies are listed).</em></li><li><strong><em>produce a single ‘package-lock.json’ and ‘node_modules.zip’ file containing only Node.js dependencies not seen in any previous Codewind release: </em></strong><em>it is an Eclipse IP team requirement to handle all Node.js dependencies clearence in a single bulk CQ, but they probably assume the release only contains a single Node.js package-lock.json. As Codewind contains 16 files, some magic is required to process all the Node.js dependencies and end up with the minimal artifacts the Eclipse IP bulk process dictates. To avoid potential false positive issue duplication, I go further and also exclude all dependencies previously cleared for use in any previous Codewind Eclispe IP CQ. So for each production dependency listed in each ‘package-lock.json’ files, check if it previously exists in the packageInventory.txt. If it does not, then add it, also add it to a ‘tempory file’ listing all new dependencies and copy the dependency source to a ‘deltaNodeModulesSource’ local directory. Then post process the ‘tempory file’ to reformat it into well formed package-lock.json file</em></li><li><strong><em>install GO-lang sub-dependencies:</em></strong><em> next is to install all the Go-lang sub-dependencies in Eclipse Codewind. For each ‘Gopkg.lock’ file found in the source, the sub-dependencies are installed using ‘dep ensure -v’ and the output is saved in ‘go-subpackages-dep-ensure.log’ for use later, as this is only way I’ve found to get ‘version’ data for GO packages. In total GO source code from parts of 57 git repositories are pulled into Eclipse Codewind.</em></li><li><strong><em>install Java sub-dependencies</em></strong><em>:</em></li><li><strong><em>produce a file containing all the ‘Copyright’ statements:</em></strong><em> A secondary ‘grep’ script is called and scans through all the source code in the release and generates a ‘Copyrights.txt’ file containing ‘filepath : copyright’.</em></li><li><strong><em>remove all previously seen files, prior to the next ‘main legals scanning’ step: </em></strong><em>as the ‘main legals scanning’ step can create a large output containing many noisy false positive hits and take hours to run, I’ve developed this purging algorithm to minimise the pain: Starting at the release source root directory, sym-link and image files are removed, using ‘Diff’ each Package.json file is removed if ever previously seen (‘MD5sum’ will always be different for Package.json files even if their contents are identicle, due to the way NPM works, so ‘Diff’ is used only for this file type), using ‘MD5sum’ each archive file (zip, gz, war, tar) is removed if ever previous seen. If not previous seen, then the archive is decompressed then this algorithm is recursively called on the decompressed results,using ‘MD5sum’, each remaining file is removed if ever previously seen,finally for each sub-directory this algorithm is recursively called on each node within it.</em></li><li><strong><em>produce a .csv file, listing all the open source packages in the release:</em></strong><em> I run the Wicked tool, which produces a Scan-Report.csv. file, listing every detected open source package name, version and various software license hits. As Wicked is unable to identify ‘version’ numbers for GO packages, I then get the ‘version’data from the ‘go-subpackages-dep-ensure.log’ file (from sub-step 5 above) and merge it into ‘Scan-Report-Go-versions-added.csv’ file, in the ‘WickedScans/wholerelease/src_scan-results/’ directory.</em></li></ol><p><em>the ‘sos-eclipseScan.sh script ends, the salient outputs produced are:</em></p><ol><li><strong><em>node_modules.zip </em></strong><em>— contains only Node.js packages source that have never been seen in any previous Eclipse Codewind release.</em></li><li><strong><em>package-lock.json</em></strong><em> — contains only Node.js package name/versions that have never been seen in any previous Eclipse Codewind release.</em></li><li><strong><em>scanner-0.xml </em></strong><em>— contains a legal risky keywords CSAR scan of the delta Node.js packages in the release.</em></li><li><strong><em>ScanReport-Go-versions-added.csv</em></strong><em> — contains a detected list of all polyglot open source package names, versions, licenses found in the release.</em></li><li><strong>src-copyrights.txt — </strong>contains a detected list of ‘copright statements : filepaths’</li></ol><h4>step 2 Using SOS tooling, import the scan results and resolve any unknown package name, version and/or license issues.</h4><ol><li>To import the scan results, copy the text from ‘Scan-Report-Go-versions-added.csv’, then ‘paste special (keep value and number formating)’ into the SOS tool ‘import’ tab, then click ‘perpare merge’ and eyeball impact metrics before proceeding, then click ‘merge’.</li><li>On the SOS tool ‘actions’ tab, investigate and resolve any package name, version and/or license issues. You may click the ‘google URL’ links to expedite any web research that may be required. Some issues may be ‘out-of-scope’ of further legals processing (such as any direct Codewind code itself), so these should be marked as such.</li></ol><h4>step 3 Check no blocking legal risks exist, then raise Eclipse IP CQs exist for all new/updated open source packages</h4><ol><li>for Node.js packages, check that the ‘delta’ dependencies don’t contain any risks likely to block Eclipse IP approval, by reviewing the csar/scanner-o.xml file in CSAR. Assuming we’re clear to proceed, I usually go this <a href="https://dev.eclipse.org/ipzilla/buglist.cgi?query_format=advanced&amp;short_desc_type=allwordssubstr&amp;short_desc=&amp;product=ecd&amp;component=ecd.codewind">all the Codewind CQs</a> query, find the bulk NOde.js CQ for the previously release and quickly copy the fields over to a new CQ and attach the ‘package-lock.json’ and ‘node_modules.zip’ produced above. It literally takes only two minutes. Once the CQ is raised, add the CQ url link/number to the SOS tool.</li><li>for Go-lang packages, filter in the SOS tool to find remaining new/updated GO-lang packages requiring Eclipse CQs (they will have been found in this release, require Eclipse CQ urls to be added and sit under the ‘vendor’ directory in the source code). Then either raise individual Eclipse IP CQs for each of them, or to save time if there are many, use the Go-Tool.xlsx to copy all the new/updated GO-lang package into a single directory, zip it upand raise a single bulk GO-lang CQ. Ensure the GO-lang CQ urls to SOS.</li><li>filter to find remaining new/updated packages requiring Eclipse CQs, raise individual Eclipse IP CQs for each of them and add the CQ urls to SOS.</li></ol><h4>step 8 create the NOTICE.md file and raise the Git Pull Requests to add the file to the release</h4><ol><li>Copy the text from the ‘coprights.txt’ file, then paste it into the SOS-GrepCopyrights ‘pasteGrepCopyrights’ tab. Then do a ‘blank’ merge in SOS (clear the import tab, then click prepareMerge, then click Merge), to ensure all manually entered data on the ‘action’ tab is copied to the ‘inventory’ tab. Then copy all the content on the ‘inventory’ tab, to the SOS-GrepCopyrights ‘pasteInventoryIn-fromSOS’ tab. Then on the ‘MERGE’ tab, click ‘GO’. The copyright data is then merged with the SOS inventory data and a new inventory data set produced on the ‘copyInventoryOut-toSOS’ tab. Copy the content from that tab. On the SOS ‘inventory’ tab, paste special (keep value and number formating) the content back into SOS.</li><li>From the ‘LICR’ tab, click to reapply filters, then copy the content to the clipboard, then paste it into a new Excel spreadsheet. Save that new sheet as a ‘Notices.csv’ file. Then use the microservice here <a href="http://eclipsenoticetextgenerator.fulfils1.fyre.ibm.com/process-notices">http://eclipsenoticetextgenerator.fulfils1.fyre.ibm.com/process-notices</a>, browse to find the Notices.csv file and click ‘go’. A ZIP file containing the ECLP-2.0 license and a Notices file, is downloaded to your workstation.</li><li>Update the NOTICE.md file, to include the project home URL ‘https://www.eclipse.org/codewind/’ and list of source repositories in the ‘## Soure Code’ section.</li><li>For each Codewind source repository (for example: <a href="https://github.com/eclipse/codewind">https://github.com/eclipse/codewind</a>) remove any previous redundant fork and create a new one. In the new fork, delete the NOTICE.md file in the master branch root directory, then update the new NOTICE.md file. Then raise a Git Pull Request (PR) to promote the change to the Git origin. Change the ‘branch’ to the ‘release numbered branch’ (as is a Codewind team practice), then repeat this flow to delete/upload the NOTICE.md file and riase a second PR on the release branch.</li></ol><h4><em>* pre-requistes to install before beginning:</em></h4><ul><li><em>install ‘</em><a href="https://golang.github.io/dep/docs/installation.html"><em>dep</em></a><em>’ on your system</em></li><li><em>install ‘</em><a href="https://w3-connections.ibm.com/wikis/home?lang=en-gb#!/wiki/W7c33090f777f_4d05_bda9_b9d8b79b0c7c/page/Download%20CSAR"><em>CSAR</em></a><em>’ on your system</em></li><li><em>install ‘</em><a href="https://wicked-help.w3ibm.mybluemix.net/#!/doc/cli"><em>wicked cli</em></a><em>’ on your system</em></li><li><em>download ‘csar.sh’ and put it in a ‘~/sh’ directory</em></li><li><em>download ‘</em><a href="https://ibm.box.com/s/7s6gmxu96gakffxvostkease7mmajoe8"><em>sos-eclipseScan&lt;n&gt;.sh</em></a><em>’ and put it in the home ‘~/’ directory, then chmod 777 sos-eclipseScan&lt;n&gt;.sh</em></li><li><em>download the latest ‘</em><a href="https://ibm.ent.box.com/file/322675273316"><em>sos.xlsm</em></a><em>’ from the previous release</em></li><li><em>download the latest </em><a href="https://ibm.box.com/s/ieiwnvulpr4dplkbm6xg74856c2ctps3"><em>packageInventory-after&lt;release&gt;.txt</em></a><em> containing a list of Node.js packages fully automated in all preivous releases, sits in my local ‘Codewind’ directory.</em></li><li><em>download the ‘</em><a href="https://ibm.ent.box.com/file/328418893108"><em>sos-grepCopyrights.xlsm</em></a><em>’</em></li><li>optional if <em>doing a BULK Go-lang eclipse CQ (instructions to follow, on request): download ‘</em><a href="https://ibm.box.com/s/i3j01pwn5yrwn7smljb1df25mow5gls2"><em>go-tool.xlsx</em></a><em>’</em></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7f777ff4ffd6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/nikcanvin/legal-work-required-to-release-a-complicated-eclipse-project-like-codewind-7f777ff4ffd6">Legal work required to release a complicated Eclipse project like Codewind</a> was originally published in <a href="https://medium.com/nikcanvin">NikCanvin</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to build a docker microservice application and deploy to Openshift]]></title>
            <link>https://medium.com/nikcanvin/how-to-build-a-docker-microservice-application-and-deploy-to-openshift-fdb0769f1b9f?source=rss-5429d3844a0c------2</link>
            <guid isPermaLink="false">https://medium.com/p/fdb0769f1b9f</guid>
            <dc:creator><![CDATA[Nik Canvin]]></dc:creator>
            <pubDate>Fri, 17 Jan 2020 14:49:10 GMT</pubDate>
            <atom:updated>2020-04-27T07:56:15.981Z</atom:updated>
            <content:encoded><![CDATA[<p>A simple way to build and deploy a dockerised application to Openshift.</p><h3>Docker containerized application developed using Codewind</h3><p>To initially create a docker containerized microservice application, I used Eclipse/Codewind .. see ‘<a href="https://medium.com/codewind/my-first-cloud-native-node-js-microservice-from-nothing-to-running-immediately-13a49be74ba8">My first cloud-native Node.js microservice, from nothing to running, immediately</a>’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y3k5U1G9lGmn8OgsX9nMjg.png" /></figure><h3>Docker build the microservice</h3><p>git clone &lt;reponame&gt;</p><p>cd &lt;reponame&gt;</p><p>docker build -t nikcanvin/&lt;imagename&gt;:latest .</p><h3>Push the docker image to Dockerhub</h3><p>docker login</p><p>docker push nikcanvin/&lt;imagename&gt;</p><h3>Deploy to OpenShift 4.2</h3><p>login into OpenShift console: (exmaple is private link): <a href="https://console-openshift-console.apps.devadvocacy.os.fyre.ibm.com/">https://console-openshift-console.apps.devadvocacy.os.fyre.ibm.com</a></p><h4>Navigate to Workloads/Deployments [Create Deployment]</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/474/1*SFNU6JucsSc8V8vdwIkxMg.png" /><figcaption>example for Express Node application (hence port=3000)</figcaption></figure><h4>Navigate to Networking/Services [Create Service]</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/379/1*Lrk4YZ2VYpyXVbC3WtaAZg.png" /><figcaption>example for Express Node application (hence port=3000)</figcaption></figure><h4>Navigate to Networking/Routes [Create Route]</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/414/1*v0Z6d8FMiIwmLvSpRaSf3w.png" /><figcaption>example for Express Node application (hence port=3000)</figcaption></figure><h4>Then test the URL:</h4><p>click the link provided in the OPenshift RouteDetails tab and the application should launch in the browser, for example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/906/1*EZFvJNegWb9iYBT9qqOJhw.png" /><figcaption>my demo application is now running on OpenShift</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fdb0769f1b9f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/nikcanvin/how-to-build-a-docker-microservice-application-and-deploy-to-openshift-fdb0769f1b9f">How to build a docker microservice application and deploy to Openshift</a> was originally published in <a href="https://medium.com/nikcanvin">NikCanvin</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Node.js sub-dependencies licenses pain points and some invaluable relief ..]]></title>
            <link>https://medium.com/nikcanvin/node-js-sub-dependencies-licenses-pain-points-and-some-invaluable-relief-de039b3c796?source=rss-5429d3844a0c------2</link>
            <guid isPermaLink="false">https://medium.com/p/de039b3c796</guid>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Nik Canvin]]></dc:creator>
            <pubDate>Tue, 12 Nov 2019 15:06:54 GMT</pubDate>
            <atom:updated>2019-11-12T15:06:54.782Z</atom:updated>
            <content:encoded><![CDATA[<h3>Node.js sub-dependencies licenses pain points and some invaluable relief ..</h3><p>Working as a software project manager for the last 2 years on an offering which uses 1000s of open source packages and releases every four weeks, I’ve spent considerable time discovering, understanding and manually working through several pain points regarding open source (OS) sub-dependency identification and licensing challenges.</p><p>I then went on to automate the process with a new Node.js microservice that I deployed on my company proviate Cloud.</p><p>If you suffer from similar Node.js dependencies pain or you’re interested in the microservice function and/or implementation, then you might like the experiences I shared in these three BLOGs:</p><p><a href="https://medium.com/codewind/checking-node-js-sub-dependencies-licenses-for-usage-and-redistribution-58fe70a77847">1. Checking Node.js sub-dependencies licenses for usage and redistribution</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/283/1*1l_ho6DtWdtCLfzkZ-qHxQ.png" /></figure><p><a href="https://medium.com/codewind/a-new-microservice-to-provide-node-js-sub-dependency-license-insights-7576c6535f2f">2. A new microservice to provide ‘Node.js sub-dependency license insights’</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/672/1*c4KBKXs4a7mXMss4Y0v5sw.png" /></figure><p><a href="https://medium.com/codewind/a-technical-autopsy-of-a-containerized-node-js-dependency-insights-microservice-application-1bbd686d721d">3. A technical autopsy of a containerized ‘Node.js dependency insights’ microservice application</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*BrYfPeHTkeql3EulYrfiwA.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=de039b3c796" width="1" height="1" alt=""><hr><p><a href="https://medium.com/nikcanvin/node-js-sub-dependencies-licenses-pain-points-and-some-invaluable-relief-de039b3c796">Node.js sub-dependencies licenses pain points and some invaluable relief ..</a> was originally published in <a href="https://medium.com/nikcanvin">NikCanvin</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A simple way to check the health of your Node.js application]]></title>
            <link>https://medium.com/@Nik_D_C/a-simple-way-to-check-the-health-of-your-node-js-application-9aba8d2f638d?source=rss-5429d3844a0c------2</link>
            <guid isPermaLink="false">https://medium.com/p/9aba8d2f638d</guid>
            <category><![CDATA[nodejs]]></category>
            <dc:creator><![CDATA[Nik Canvin]]></dc:creator>
            <pubDate>Fri, 01 Nov 2019 09:32:31 GMT</pubDate>
            <atom:updated>2019-11-02T11:10:58.109Z</atom:updated>
            <content:encoded><![CDATA[<p>You can get the vital statistics of a Node.js application instantly, such as CPU, memory use, http throughput/response times INSTANTLY, using an <a href="http://bit.ly/2WA9aWV">appmetrics-dash</a> module from NPM.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*Zn9UV0ddVZhLJVhwsU1uig.gif" /></figure><p>The full data available on the dashboard is as follows:</p><ul><li>CPU Profiling (via a separate tab), helping you find the HOT code</li><li>HTTP Incoming Requests</li><li>HTTP Throughput</li><li>Average Reponse Times (top 5)</li><li>CPU</li><li>Memory</li><li>Heap</li><li>Event Loop Times</li><li>Environment</li><li>Other Requests</li><li>HTTP Outbound Requests</li></ul><p>As well as displaying data, it also provides the ability to generate both <a href="https://www.npmjs.com/package/node-report/">Node Report</a> and Heap Snapshots directly from the dashboard. The Node Report will display in a new tab in the browser whilst the Heap Snapshot will be written to disk for loading into the Chrome DevTools for analysis. These can both be triggered from the options menu in the top left of the screen. The dashboard uses <a href="https://developer.ibm.com/open/node-application-metrics/">Node Application Metrics</a> to monitor the application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GK1gGpyEFf87E0Ra1zToiQ.png" /></figure><p>If all that is not good enough already, this capability is now built into <a href="http://bit.ly/33bRweK">Eclipse Codewind</a> enabling you to create cloud-native containerised microservices (without needing complex Kubernetes and Dockers skills).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9aba8d2f638d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>