<?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 Alexander Prooks on Medium]]></title>
        <description><![CDATA[Stories by Alexander Prooks on Medium]]></description>
        <link>https://medium.com/@alexander.prooks?source=rss-4b1b29a80cd7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*FplMqDPr1PPqt7aw.</url>
            <title>Stories by Alexander Prooks on Medium</title>
            <link>https://medium.com/@alexander.prooks?source=rss-4b1b29a80cd7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 16:58:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@alexander.prooks/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[Evaluating JS graph rendering for Jupiter F#]]></title>
            <link>https://medium.com/@alexander.prooks/evaluating-js-graph-rendering-for-jupiter-f-545a08943459?source=rss-4b1b29a80cd7------2</link>
            <guid isPermaLink="false">https://medium.com/p/545a08943459</guid>
            <category><![CDATA[graph]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[jupyter-notebook]]></category>
            <category><![CDATA[charting]]></category>
            <category><![CDATA[fsharp]]></category>
            <dc:creator><![CDATA[Alexander Prooks]]></dc:creator>
            <pubDate>Sun, 26 May 2019 16:41:59 GMT</pubDate>
            <atom:updated>2019-05-27T09:50:07.176Z</atom:updated>
            <content:encoded><![CDATA[<p>While testing IFsharp <a href="https://github.com/fsprojects/IfSharp">https://github.com/fsprojects/IfSharp</a> from Mac and docker I’ve stumbled upon usual issues which arise from using legacy F# libs: mainly graph rendering did not work. Which is sad because graphs are probably the main part of exploration story Jupyter gives you.</p><p>After a few failed attempts I’ve decided to try out rendering via JavaScript libs, but this was not as straightforward as hoped. Feature notebook <a href="https://github.com/fsprojects/IfSharp/blob/master/FSharp_Jupyter_Notebooks.ipynb">https://github.com/fsprojects/IfSharp/blob/master/FSharp_Jupyter_Notebooks.ipynb</a> has an example of working with D3. While it could solve some use cases I still think it’s too low-level (but awesome nevertheless) graph lib. I’ve started with <a href="https://github.com/shutterstock/rickshaw">https://github.com/shutterstock/rickshaw</a> lib because it’s bundled with Prometheus UI. But it never rendered. So I’ve tried a few other libs, until trying rendering via Frame, which helped. While it looked ugly, this worked and allowed me to test several other libraries like ChartJs, VisJs and graph libs. The last one turned out to work without Frame wrapper but requires to be executed twice ¯\_(ツ)_/¯</p><p>With a bit syntactic sugar it can even look like a server-side code:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gqceL5dnIVhlFw1UL8ZdTg.png" /></figure><p>Obviously, the syntax is far from being perfect, this was only a quick try.</p><p>The main advantage of this approach is that it allows interactivity without re-rendering. For example, in the above screenshot, each graph could be turned on and off. And graph in a vis.js can be rearranged by moving nodes.</p><p>And the main issues are the following:</p><ul><li>Cells contents with graphs are not saved, which might be worked around by saving a graph as a picture</li><li>This Frame-based approach is ugly. IPython suggest much better interop with javascript which allows registering code via “require” which is much more friendlier to JavaScript infrastructure: <a href="https://jupyter-notebook.readthedocs.io/en/stable/examples/Notebook/JavaScript%20Notebook%20Extensions.html">https://jupyter-notebook.readthedocs.io/en/stable/examples/Notebook/JavaScript%20Notebook%20Extensions.html</a></li></ul><p>Given above I also wonder if Fable could be of use in this scenario.</p><p>This is the code <a href="https://github.com/aprooks/ifsharp-graphs/blob/master/GraphsStarter.ipynb">https://github.com/aprooks/ifsharp-graphs/blob/master/GraphsStarter.ipynb</a>, but it requires you to run it in order to see outputs as I did not even try to figure out how to persists frame contents.</p><p>UPD. turned out there is an extension method which allows external JS code to be downloaded and properly registered, so Frame hack is not really required. An updated notebook is here: <a href="https://github.com/aprooks/ifsharp-graphs/blob/master/GraphsWithoutFrame.ipynb">https://github.com/aprooks/ifsharp-graphs/blob/master/GraphsWithoutFrame.ipynb</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=545a08943459" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Orleans with F# story]]></title>
            <link>https://medium.com/@alexander.prooks/orleans-with-f-story-6036045f1f10?source=rss-4b1b29a80cd7------2</link>
            <guid isPermaLink="false">https://medium.com/p/6036045f1f10</guid>
            <category><![CDATA[fsharp]]></category>
            <category><![CDATA[fsadvent]]></category>
            <category><![CDATA[microsoft-orleans]]></category>
            <category><![CDATA[introduction]]></category>
            <dc:creator><![CDATA[Alexander Prooks]]></dc:creator>
            <pubDate>Mon, 03 Dec 2018 22:13:00 GMT</pubDate>
            <atom:updated>2018-12-03T22:18:30.327Z</atom:updated>
            <content:encoded><![CDATA[<p>Orleans is an actor based framework and runtime aimed to make distributed OOP as easy as possible. Orleans was designed to run on several machines or containers and thus cloud-friendly is very easy to use when you have to anticipate an application with high load and/or complex interactions. Here I will describe only basics because advanced topics are better described in official docs <a href="https://dotnet.github.io/orleans/">https://dotnet.github.io/orleans/</a></p><p>In terms of Orleans, a single “actor” is an object which encapsulates in own state and can make remote calls of other grains via grain reference. If you prefer message-based protocols or frameworks (ServiceStack.net, akka, NServiceBus) then you might prefer to use such interface implemented via Orleannka <a href="https://github.com/orleanscontrib/orleankka">https://github.com/orleanscontrib/orleankka</a> project.</p><p>In Orleannka (version 2) everything a grain receives or sends is a message. Imagine we’d like to implement an account handling grain. A grain’s contract would be a set of messages which it would accept and responses. It is also safe to define exceptions as part of the contract if needed since Orleans sends them back calling code and rethrows them there.</p><pre><strong>module</strong> Account =</pre><pre>  <strong>open</strong> Orleankka.FSharp</pre><pre>  // Message with 2 commands and a query<br>  <strong>type</strong> Message =<br>  | Topup <strong>of</strong> decimal<br>  | Charge <strong>of</strong> decimal<br>  | GetBalance</pre><pre><strong>  type</strong> IAccountGrain =<br>    <strong>inherit</strong> IActorGrain&lt;Message&gt;</pre><p>This code is usually hosted in a separate project so that it can be shared with a client (web-api for example) and silo (Orleans’ backend) code</p><p>Before going to implementation details let’s also describe system message types (<a href="https://github.com/OrleansContrib/Orleankka/blob/09c1a8dd3f32abb64b16ffdea23f2576fa524d8a/Source/Orleankka.Runtime/ActorGrainMessages.cs">https://github.com/OrleansContrib/Orleankka/blob/09c1a8dd3f32abb64b16ffdea23f2576fa524d8a/Source/Orleankka.Runtime/ActorGrainMessages.cs</a>):</p><ul><li>Activate: it is being sent by the runtime when a grain is being initialized. Mainly this is a place to load state from a database.</li><li>Deactivate??: the opposite of Activate. It is being sent when the runtime cleans up memory or moves a grain from one silo to another. There is a chance grain will go offline without receiving this message (e.g. on server host crash) so it is generally suggested to persist state changes at the same operation as state change occurred.</li><li>A reminder with a name: sent when reminder triggered. Reminders are a part of scheduling part of Orleans. They are persistent, service silo restarts and are aimed to provide resilient invocation of anything happening in the future (starting from one minute). If a grain is inactive during when a reminder is triggered it will be activated starting with Activate message.</li></ul><p>Everything else sent should be part a contract published by your grain.</p><p>Grain implementations are classes of two types. The very basic is an ActorGrain class which has only a single “Task&lt;Object&gt; Receive(object message)” method which should be implemented in grain classes. It is not very convenient if you are using C#, thus there is a DispatchActorGrain class which adds some reflection goodness by treating any method with names of “On”, “Handle”, “Answer” or “Apply” to be treated like receive method of a particular message. This adds you a way of adding some DSL for handlers like the following:</p><pre><strong>type</strong> Example() =<br>    <strong>inherit</strong> DispatchActorGrain()</pre><pre>    <strong>member</strong> x.Handle(Command x) = <strong>task {<br>          return</strong> none()<br>    <strong>}<br>  <br>    member x.Answer(MyQuery qry) = 42</strong></pre><p>When you are using F# you can use the above syntax as well, but I prefer pattern matching on a raw message received, which ends up like the following:</p><pre><strong>type</strong> AccountGrain() =<br>  <strong>inherit</strong> ActorGrain()</pre><pre>  <strong>let mutable</strong> balance = 0m</pre><pre>  <strong>interface</strong> IAccountGrain<br>  <strong>override</strong> x.Receive(message:obj) = <strong>task {<br>     match</strong> message <strong>with</strong><br>     | :? Activate <strong>-&gt;</strong><br>        balance <strong>&lt;- </strong>5m // load from actual db here<br>        <strong>return</strong> none()<br>     | :? Message <strong>as</strong> msg <strong>-&gt;<br>          match</strong> msg <strong>with</strong><br>          | Topup amount <strong>-&gt;</strong><br>              balance <strong>&lt;-</strong> balance + amount<br>              <strong>return</strong> none()<br>          | Charge amount <strong>-&gt;</strong><br>              balance <strong>&lt;-</strong> balance - amount<br>              <strong>return</strong> none()<br>          | GetBalance <strong>-&gt;<br>              return</strong> some(balance)<br>  <strong>}</strong></pre><p>client to silo or mid grains interactions will like the following:</p><pre><strong>let</strong> accountRef = ActorSystem.actorOf&lt;IUserWallet&gt;(client, &quot;UserId&quot;)<br><strong>do!</strong> accountRef &lt;! Topup 100m<br><strong>let!</strong> balance = accountRef &lt;? GetBalance</pre><p>“client” is one of IActorSystem or “this.System” when called from inside actor grain.</p><p>Notice that the code of actor implementation is pretty raw and really needs some custom DSL to be provided. For example, for classic state persistence, you might have a base class requiring function implementation of “handle message -&gt; State” and a wrapper which would persist state to a database after each successful operation. Event sourcing works well since you might store a state in-memory and read events only on a grain activation.</p><p>Last but not least, Orleannka has an extensive test fake implementation which helps a lot unit testing grains. Runtime, actor interactions, reminders setup are all implemented via TestKit. While it is still possible to mock everything, I find it much more convenient to use TestKit and mock only some external actor interaction by specifying which message to be returned on which request.</p><p>Features worth looking for but not mentioned here are:</p><ul><li>state handling implementations for key/value and event sourcing (this one was not yet migrated to latest major version)</li><li>Stateless “worker” grains, which don’t have their own identity and are automatically scaled</li><li>Streams/observers for pub/sub</li></ul><p>To sum up, Orleans + Orleanka is a great pair to run a project. They helped me a lot in a couple of applications by providing a sane and clean programming model and removing some problems which arise from using “stateless” architecture. While the F# story is still worth improving it is usable and can be shaped to the needs of a project.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6036045f1f10" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[F# and Orleans meetup 10.10.18]]></title>
            <link>https://medium.com/@alexander.prooks/f-and-orleans-meetup-10-10-18-57272dc6b7f9?source=rss-4b1b29a80cd7------2</link>
            <guid isPermaLink="false">https://medium.com/p/57272dc6b7f9</guid>
            <category><![CDATA[meetup]]></category>
            <category><![CDATA[munich]]></category>
            <category><![CDATA[microsoft-orleans]]></category>
            <category><![CDATA[fsharp]]></category>
            <dc:creator><![CDATA[Alexander Prooks]]></dc:creator>
            <pubDate>Wed, 10 Oct 2018 09:49:36 GMT</pubDate>
            <atom:updated>2018-10-10T09:52:01.539Z</atom:updated>
            <content:encoded><![CDATA[<p>Links and small agenda for a meetup at Sap Hybris in Munich</p><p><strong>Intro to F# type system.</strong></p><p>I’ll concentrate on basic F# structures and patterns on how to use them.</p><p>Slides <a href="https://aprooks.github.io/F-sharp-migration/">https://aprooks.github.io/F-sharp-migration/</a></p><p>Learning material:</p><p><a href="https://swlaschin.gitbooks.io/fsharpforfunandprofit/">Introduction · F# for Fun and Profit</a></p><p><a href="https://www.amazon.co.uk/Domain-Modeling-Made-Functional-Domain-Driven/dp/1680502549">https://www.amazon.co.uk/Domain-Modeling-Made-Functional-Domain-Driven/dp/1680502549</a></p><p><strong>Orleans + F#</strong></p><p>Intro to MSFT Orleans platform and how to utilize F# via Orleankka library</p><ul><li><a href="https://aprooks.github.io/orleankka-intro/#/">Orleankka F# intro</a></li><li><a href="https://github.com/aprooks/orleankka-fsharp-intro">aprooks/orleankka-fsharp-intro</a></li></ul><p>Links:</p><ul><li><a href="https://dotnet.github.io/orleans/">Microsoft Orleans | Microsoft Orleans Documentation</a></li><li><a href="https://github.com/OrleansContrib/Orleankka">OrleansContrib/Orleankka</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=57272dc6b7f9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploying Orleans via Docker to AWS ECS]]></title>
            <link>https://medium.com/@alexander.prooks/deploying-orleans-via-docker-to-aws-ecr-b93f5517bc99?source=rss-4b1b29a80cd7------2</link>
            <guid isPermaLink="false">https://medium.com/p/b93f5517bc99</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[aws-ecs]]></category>
            <category><![CDATA[apaleo]]></category>
            <category><![CDATA[microsoft-orleans]]></category>
            <dc:creator><![CDATA[Alexander Prooks]]></dc:creator>
            <pubDate>Tue, 28 Aug 2018 16:36:44 GMT</pubDate>
            <atom:updated>2018-08-28T16:38:20.076Z</atom:updated>
            <content:encoded><![CDATA[<p>Ms Orleans (<a href="https://dotnet.github.io/orleans/">https://dotnet.github.io/orleans/</a>) was one of the latest addition to frameworks we use at <a href="https://apaleo.com/">https://apaleo.com/</a>. We use Amazon ECS to host our services and we faced a problem: Orleans siloes should communicate with each other, but by default, ECS’s network does not span across docker images deployed to different hosts.</p><p>There is a special network mode which allows joining of a docker instance to elastic network, which spans across ECS and other EC2 instances. It works out of the box, but limitations on number of instances per cluster made it unusable for development and testing deployments</p><p><a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-networking.html">https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-networking.html</a></p><p>And here are the limits:</p><p><a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html#AvailableIpPerENI">https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html#AvailableIpPerENI</a></p><p>TL;DR Use default ECS cluster’s networking, get host’s ip address and ports and send to Orleans to use for membership, but use docker’s internal ports as endpoints.</p><p>The actual workflow to make it all work would be following.</p><p>In order to get ip address call single endpoint: <a href="http://169.254.169.254/latest/meta-data/local-ipv4">http://169.254.169.254/latest/meta-data/local-ipv4</a></p><p>Ports are a bit trickier. They can be loaded by enabling ECS and loading special metadata file. Check here how to enable it <a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/container-metadata.html">https://docs.aws.amazon.com/AmazonECS/latest/developerguide/container-metadata.html</a></p><p>Most probably you will have 2 ports exposed for silo and gateway. So port info will look like:</p><pre>”PortMappings”: [ <br>{ “ContainerPort”: 30000,<br> “HostPort”: 32444, <br> “BindIp”: “”, <br> “Protocol”: “tcp” },<br>{ “ContainerPort”: 11111,<br> “HostPort”: 32456, <br> “BindIp”: “”, <br> “Protocol”: “tcp” } ],</pre><p>From here you can extract HostPort value by filtering container’s port .</p><p>Endpoint configuration will look like:</p><pre>.Configure&lt;EndpointOptions&gt;(options =&gt;<br>{<br>    // IP Address to advertise in the cluster<br>    // Must be host&#39;s port you have loaded in step 1</pre><pre>    options.AdvertisedIPAddress = IPAddress.Parse(&quot;10.0.1.1&quot;);</pre><pre>    // These 2 ports will be used by a cluster<br>    // for silo to silo communications<br>    options.SiloPort = 32456;<br>    // Port to use for the gateway (client to silo)<br>    options.GatewayPort = 32444;<br><br>    // Internal ports which you expose to docker<br>    options.GatewayListeningEndpoint = new IPEndPoint(IPAddress.Any, 30000);<br>    options.SiloListeningEndpoint = new IPEndPoint(IPAddress.Any, 11111);<br>})</pre><p>Everything else can be configured like in this example <a href="https://github.com/dotnet/orleans/tree/master/Samples/2.0/docker-aspnet-core">https://github.com/dotnet/orleans/tree/master/Samples/2.0/docker-aspnet-core</a></p><p>I still have an open question of how to properly support health checks, and clustering when ECR decides to most of the cluster but that’s another story.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b93f5517bc99" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Quick setup of Data Science machine in Azure]]></title>
            <link>https://medium.com/@alexander.prooks/quick-setup-of-data-science-machine-in-azure-73dd33edb610?source=rss-4b1b29a80cd7------2</link>
            <guid isPermaLink="false">https://medium.com/p/73dd33edb610</guid>
            <category><![CDATA[kaggle]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[ubuntu]]></category>
            <dc:creator><![CDATA[Alexander Prooks]]></dc:creator>
            <pubDate>Tue, 02 May 2017 20:05:59 GMT</pubDate>
            <atom:updated>2017-05-02T20:05:59.030Z</atom:updated>
            <cc:license>http://creativecommons.org/publicdomain/zero/1.0/</cc:license>
            <content:encoded><![CDATA[<p>This weekend I was on a local data science workshop for newbies and found out my Surface Pro was only good to run basic samples. Moreover some modules did not work or could not be installed on Windows. Since I had some credits on Azure VS subscription I rolled out one of those monster rigs. So I was more constrained to lack of knowledge but not hardware:) Had some issues setting all up so here is a super quick guide on how to run this machine for a complete *nix newbie.</p><p>Search for Data Science VM for Ubuntu in marketplace (don’t know why, but speakers were suggesting Ubuntu). And got through all generic steps. I preferred to use auth via ssh publickey. 8 to 16 cores and 28+ Gb memory should be enough for most of the tasks. I used ds5_v2 promo but it was almost an overkill. Linux machines can be up/downgraded when offline.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/363/1*i2NRfDPsvK3GZBoYhjJFOA.png" /></figure><p>Right after deployment stop machine and increase OS disk size. Some libraries will take a lot of space. 150 GB was enough for few notebooks, data sets and libs. You will be able to increase disk, but not shrink it.</p><p>Azure suggests to use attached disk for user related data, but it was too much of a burden to setup custom path for python modules.</p><p>Proceed till the end and consider saving Azure template for future use and automated setup.</p><p>Run machine, and use ssh client of choice to connect. Putty should be fine, ssh is bundled with git. This one should work from powershell:</p><pre>.”C:\Program Files\git\usr\bin\ssh.exe” {username}@{vm-ip}</pre><p>Several commands I used to tweak VM:</p><pre>#if you used ssh public key auth type<br>#this will be used as your Jupiter login as well</pre><pre>sudo passwd myusername</pre><pre># add write permissions to Anaconda folder <br># so you don&#39;t have to sudo each module install<br># <strong>super unsafe</strong> so don&#39;t use it this machine for permanent workloads<br># I also had an issue with some modules installed from sudo<br># this fixes these issues pretty fine<br># might be fine tuned to be safer but I did not care</pre><pre>sudo chmod -R ugo+rwx /anaconda</pre><pre># install kaggle cli to download/submit <br># data sets straight to/from VM<br># <a href="https://github.com/floydwch/kaggle-cli">https://github.com/floydwch/kaggle-cli</a></pre><pre>pip install kaggle-cli<br>kg config -u {kaggleUsername} -p {kagglePassword}</pre><pre># download data sets to current folder</pre><pre>kg download -c quora-question-pairs</pre><pre># this one was not visible to python<br># if installed via sudo<br>conda install spacy</pre><pre>#install other modules you might be missing</pre><pre># fancy process manager that will show your CPU load per Core<br># I&#39;d suggest to keep it running so you will see <br># if you are using all cores and when calculations stop</pre><pre>sudo apt-get install htop<br>htop</pre><p>login to your Jupyter via “https://{vm-ip}:8000/” and ignore certs warning.</p><p>Happy Kaggling :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=73dd33edb610" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Continuous deployment via YAMS and Octopus Deploy]]></title>
            <link>https://medium.com/@alexander.prooks/continuous-deployment-via-yams-and-octopus-deploy-d0251730d2e4?source=rss-4b1b29a80cd7------2</link>
            <guid isPermaLink="false">https://medium.com/p/d0251730d2e4</guid>
            <category><![CDATA[octopus]]></category>
            <category><![CDATA[may]]></category>
            <category><![CDATA[octopus-deploy]]></category>
            <category><![CDATA[continuous-deployment]]></category>
            <category><![CDATA[continuous-delivery]]></category>
            <dc:creator><![CDATA[Alexander Prooks]]></dc:creator>
            <pubDate>Mon, 19 Sep 2016 12:53:16 GMT</pubDate>
            <atom:updated>2016-09-19T12:53:16.153Z</atom:updated>
            <content:encoded><![CDATA[<p>(based on questions raised during discussions in Yams channel)</p><p>At the moment our Continuous Deployment scenario is following:</p><ol><li>VSO builds and tests every commit but on develop and master branch it also creates release packages.</li><li>GitVersion (<a href="http://gitversion.readthedocs.io/en/latest/">http://gitversion.readthedocs.io/en/latest/</a>) step generates package version number for each commit. Commits from non master branches get prerelease postfix like 0.1.0-unstable10 or 0.1.0-my-pull-request10</li><li>If build succeeds nuget packages are packed and pushed to Octopus feed; then release created via build step.</li><li>Octopus deploys packages straight to the cloud. Prerelease packages are deployed to Dev environment and releases to UAT. Later, releases from UAT can be manually promoted to production after confirmation from QA guys.</li></ol><p>Now we have several ways of how to host applications in the cloud. By application I mean several services: backend, frontend and API OWIN hosts.</p><p>We tried two ways of deploying our applications.</p><ol><li>Azure services — this is a default and most hassle free way of deploying Orleans application, but it’s main downside is way too long deployment time 20 to 40 minutes of whole cluster upgrade.</li><li>Windows services on virtual machines — we used Topshelf to host a service and simplify development by being able to run application as simple executable. Also, Octopus downloads packages to VM and does all the scripting to stop/stop service and unpack application binaries. This experience was much better but still deployment took about 5 minutes. Another downside is that we now have to manage virtual machines which is not as convenient as Azure services.</li></ol><p>YAMS as a third option excels these two. It resides on Azure Services (but can be deployed on premises), hosts simple executables and does blazing fast upgrades (10 to 50 seconds for Orleans backend) without restart of host machines. More info (<a href="https://github.com/Microsoft/Yams/blob/master/Docs/Overview.md">https://github.com/Microsoft/Yams/blob/master/Docs/Overview.md</a>). As a bonus YAMS respects Azure’s upgrade domains so there are no downtimes during upgrades.</p><p>In order to deploy application to Yams via Octopus we need to upload binaries and tell YAMS there is new version available by changing DeployConfig.json. Fortunately there is a storage API built into YAMS that encapsulates this logic. So I built this utility <a href="https://github.com/Applicita/YamsUploader">https://github.com/Applicita/YamsUploader</a> to be used from Octopus.</p><p>In order to make it work, we need several steps to be added in Process tab of octopus:</p><ol><li>Create a deploy package step to unpack utility you are going to use locally on the octopus server. Use Octopus target (we don’t need any tentacles unless you have too many releases running in parallel and want to offload your server).</li><li>For each deployable service add a deploy package step with following post-deploy powershell script:</li></ol><pre><strong>$deployRunnerPath</strong> = <strong>$OctopusParameters</strong>[‘Octopus.Action[UnpackDeployRunner].Output.Package.InstallationDirectoryPath’] #`UnpackDeployRunner` is the name of first step<br><strong>$exe</strong> = <strong>$deployRunnerPath</strong>+”\deployRunner.exe”<br>Write-Host “runner path is: <strong>$deployRunnerPath</strong>”<br><strong>$version</strong> = <strong>$OctopusParameters</strong>[‘Octopus.Release.Number’]<br><strong>$appId</strong> = “orleans-backend” #application Id of your service. Must be unique<br><strong>$yamsStorage</strong> = <strong>$YamsStorage</strong> #connection string to blob storage <br><strong>$clusterId</strong> = <strong>$YamsClusterId</strong> #deploymentId of our host azure service<br><strong>$binaries</strong> = <strong>$OctopusParameters</strong>[‘Octopus.Action[Deploy Backend].Output.Package.InstallationDirectoryPath’]<br>&amp; <strong>$exe</strong> -YamsStorage <strong>$yamsStorage</strong> -ClusterId <strong>$clusterId</strong> -BinariesPath <strong>$binaries</strong> -AppVersion “<strong>$version</strong>” -AppId <strong>$appId</strong></pre><p>That should be it.</p><p>Thing to note. Yams is following immutable release philosophy. And if redeploying same release but with changed variables might be started by Octopus, Yams won’t fetch new binaries if version is not changed.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d0251730d2e4" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>