SlideShare a Scribd company logo
1 of 26
Microsoft Orleans
The Easy Way
JOHN S AZARIAH
PRINCIPAL SDE, MICROSOFT CORP
@JOHNAZARIAH
Introduction
Getting Started Is (mostly) Simple
• https://dotnet.github.io/orleans/
• https://gitter.im/dotnet/orleans
• https://devblogs.microsoft.com/dotnet/orleans-3-0/
• Blogs,Videos, ConferenceTalks
The first hurdles
• Concept of Virtual Actors
• Idiosyncratic Code Layout (Grain Interfaces, Grains, …)
• Declarative persistence
• State management
• Query patterns, Fan-out, Fan-in and performance implications
• Silos, Clients, Configuration
• Failure modes - split-brain scenarios, concurrency
• Advanced Concepts (Reentrancy, Timers, Reminders,
Streaming, …)
My own n00b path
• Writing a simple dummy app which runs locally based on
samples
• Preparing the application to run in the cloud - configuration,
secrets and so on
• Preparing the application to run in clustered mode
• Provisioning and deploying to Azure
• CI/CD considerations - stability, repeatability
Orleans
Application
Code Structure
Silo Client
Interface
Implementation
Interface
Client Code
Orleans
Application
Code Structure
Orleans
Runtime
Components
Client
Silo
Client
Silo
Client
Silo
Load Balancer
Persistence (Grain Storage)
Clustering
Orleans Universal Silo
Introducing Orleans Universal Silo
• https://github.com/johnazariah/orleans-contrib-universalsilo
• https://www.nuget.org/packages/Orleans.Contrib.UniversalSilo/
• https://www.nuget.org/packages/Orleans.Contrib.UniversalSilo.Te
mplates/
• https://github.com/johnazariah/orleans-contrib-
universalsilo/blob/main/docs/index.md
Setting up your work environment
• https://github.com/johnazariah/orleans-contrib-
universalsilo/blob/main/docs/setup-environment-setup.md
Getting Started
• Install template library with
dotnet new --install
Orleans.Contrib.UniversalSilo.Templates
• List installed templates
dotnet new --list
• Ensure OrleansWebAPI template is present
Getting Started
• Create newWebAPI Direct Client Project
dotnet new orleans-webapi –name Cornflake
• Initialize Git
make init
• Inspect code withVisual Studio
start Cornflake.sln
Testing
• All tests are IntegrationTests
• Test Clusters are set up with Host Clustering and In-Memory Storage
• Use Property BasedTesting whenever possible
Running
• .NET Generic HostApplication
• Hit http://localhost:5000/swagger/index.html with browser to see
app
• Hit http://localhost:8080/ with browser to see Orleans Dashboard
Running
• .NET Generic HostApplication
• Hit http://localhost:5000/swagger/index.html with browser to see
app
• Hit http://localhost:8080/ with browser to see Orleans Dashboard
Development Workflow
.net CLI targets
• Clean the project with make dotnet-clean.This removes build
artefacts and restores
• Restore, Build andTest the project with make dotnet-test.
• Publish the project to an output folder with make dotnet-publish.
• Run the artefacts in the output folder with make dotnet-run.
• make dotnet-all is an alias target which does dotnet-clean dotnet-
test dotnet-publish dotnet-run.This will implicitly rebuild, test,
republish and run the project as you make changes in your code
and re-run it.
Docker targets
• Build the docker image with make docker-build
• Run the image with HostLocal clustering mode with make docker-
run.
• Run with Azure clustering mode against local Azure Storage
Emulator with make docker-run-local-ase
• Stop all running containers with make docker-stop
• List the docker images you have built with make docker-list
Local Kubernetes Deployment
• Ensure you are running with the correct context (docker-desktop)
• make dotnet-all to build, test and run your project until
satisfactory.
• git commit (to update the hash of the HEAD commit)
• make docker-build to build a docker image with these changes,
tagged with the current branch and commit hash
• make k8s-deploy or make k8s-upgrade to deploy 3 copies of the
latest image into the current k8s context.
• make k8s-status is an alias for kubectl get all
Manual AKS deployment
• You can install Azure CLI tools, or just use the docker container.
• Recommend using two shells for this – one for Azure and one for
the Project
Manual AKS deployment : Azure Shell
• make az-start fires up an interactive shell inside the officialAzure CLI Docker
image
• make az-login will allow you to use your browser to authenticate againstAzure.
Find the id of the subscription you want.
• make az-sub-set sub=<id you selected above> will set the shell to use the
selected subscription by default.
• Put the org-name and project-name, and the subscription id in Setup.cfg
• make az-new-org should only be run once per organization name.
• make az-new-proj should only be run once per project.
• Put emitted values for paks_storage_connection_string and
oaks_acr_login_token into Setup.cfg
Manual AKS deployment : Project Shell
• make aks-prepare to set up the k8s context to the remote AKS
cluster
• make docker-push to push the latest built image to the remote
Azure Container Registry
• make k8s-deploy to deploy the remote AKS cluster
CI/CD AKS deployment : WIP
• This is the next feature I’m working on
Next Steps
• Try these templates and improve them. Pull Requests welcome.
• Get the CI/CD stage completed.This is work-in-progress.
• Use this approach for non-Orleans .NET core generic hosts to
support deployment onAKS
• Work out an integration story with ProjectTye
• Community suggestions
Thank you!

More Related Content

What's hot

Continuous Delivery in Enterprise Environments using Docker, Ansible and Jenkins
Continuous Delivery in Enterprise Environments using Docker, Ansible and JenkinsContinuous Delivery in Enterprise Environments using Docker, Ansible and Jenkins
Continuous Delivery in Enterprise Environments using Docker, Ansible and Jenkins
Marcel Birkner
 

What's hot (20)

SEP DevOps Ignite Talk - Packer
SEP DevOps Ignite Talk - PackerSEP DevOps Ignite Talk - Packer
SEP DevOps Ignite Talk - Packer
 
Django via Docker
Django via DockerDjango via Docker
Django via Docker
 
Azure workshop
Azure workshopAzure workshop
Azure workshop
 
Containerize All the (Multi-Platform) Things! by Phil Estes
Containerize All the (Multi-Platform) Things! by Phil EstesContainerize All the (Multi-Platform) Things! by Phil Estes
Containerize All the (Multi-Platform) Things! by Phil Estes
 
Docker get started
Docker get startedDocker get started
Docker get started
 
Things I've learned working with Docker Support
Things I've learned working with Docker SupportThings I've learned working with Docker Support
Things I've learned working with Docker Support
 
Opscode Webinar: Cooking with Chef on Microsoft Windows
Opscode Webinar: Cooking with Chef on Microsoft WindowsOpscode Webinar: Cooking with Chef on Microsoft Windows
Opscode Webinar: Cooking with Chef on Microsoft Windows
 
Docker on azure
Docker on azureDocker on azure
Docker on azure
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
Automated Deployment with Capistrano
Automated Deployment with CapistranoAutomated Deployment with Capistrano
Automated Deployment with Capistrano
 
Containerization using docker
Containerization using dockerContainerization using docker
Containerization using docker
 
Continuous Delivery in Enterprise Environments using Docker, Ansible and Jenkins
Continuous Delivery in Enterprise Environments using Docker, Ansible and JenkinsContinuous Delivery in Enterprise Environments using Docker, Ansible and Jenkins
Continuous Delivery in Enterprise Environments using Docker, Ansible and Jenkins
 
Automation in the Small: Code to Cloud
Automation in the Small: Code to CloudAutomation in the Small: Code to Cloud
Automation in the Small: Code to Cloud
 
Sitecore Docker XM&XP 9.2.0/9.3.0 SXA+JSS+PS
Sitecore Docker XM&XP 9.2.0/9.3.0 SXA+JSS+PSSitecore Docker XM&XP 9.2.0/9.3.0 SXA+JSS+PS
Sitecore Docker XM&XP 9.2.0/9.3.0 SXA+JSS+PS
 
Docker Security Deep Dive by Ying Li and David Lawrence
Docker Security Deep Dive by Ying Li and David LawrenceDocker Security Deep Dive by Ying Li and David Lawrence
Docker Security Deep Dive by Ying Li and David Lawrence
 
Boosting Sitecore Development With Sitecore Docker
Boosting Sitecore Development With Sitecore DockerBoosting Sitecore Development With Sitecore Docker
Boosting Sitecore Development With Sitecore Docker
 
Installing WordPress on AWS
Installing WordPress on AWSInstalling WordPress on AWS
Installing WordPress on AWS
 
Container Days Boston - Kubernetes in production
Container Days Boston - Kubernetes in productionContainer Days Boston - Kubernetes in production
Container Days Boston - Kubernetes in production
 
Docker slides
Docker slidesDocker slides
Docker slides
 
Using Docker with Puppet - PuppetConf 2014
Using Docker with Puppet - PuppetConf 2014Using Docker with Puppet - PuppetConf 2014
Using Docker with Puppet - PuppetConf 2014
 

Similar to Reactive summit 2020 microsoft orleans the easy way

PDXPortland - Dockerize Django
PDXPortland - Dockerize DjangoPDXPortland - Dockerize Django
PDXPortland - Dockerize Django
Hannes Hapke
 

Similar to Reactive summit 2020 microsoft orleans the easy way (20)

Power of Azure Devops
Power of Azure DevopsPower of Azure Devops
Power of Azure Devops
 
[NYC Meetup] Docker at Nuxeo
[NYC Meetup] Docker at Nuxeo[NYC Meetup] Docker at Nuxeo
[NYC Meetup] Docker at Nuxeo
 
Experts Live Europe 2017 - Why you should care about Docker - an introduction
Experts Live Europe 2017 - Why you should care about Docker - an introductionExperts Live Europe 2017 - Why you should care about Docker - an introduction
Experts Live Europe 2017 - Why you should care about Docker - an introduction
 
DevOps Fusion 2019: Docker - Why the future takes place in containers
DevOps Fusion 2019: Docker - Why the future takes place in containersDevOps Fusion 2019: Docker - Why the future takes place in containers
DevOps Fusion 2019: Docker - Why the future takes place in containers
 
Container Native Development Tools - Talk by Mickey Boxell
Container Native Development Tools - Talk by Mickey BoxellContainer Native Development Tools - Talk by Mickey Boxell
Container Native Development Tools - Talk by Mickey Boxell
 
Docker and Microservice
Docker and MicroserviceDocker and Microservice
Docker and Microservice
 
Docker - A curtain raiser to the Container world
Docker - A curtain raiser to the Container worldDocker - A curtain raiser to the Container world
Docker - A curtain raiser to the Container world
 
Containers docker-docker hub-azureacr-azure aci
Containers docker-docker hub-azureacr-azure aciContainers docker-docker hub-azureacr-azure aci
Containers docker-docker hub-azureacr-azure aci
 
Package your Java EE Application using Docker and Kubernetes
Package your Java EE Application using Docker and KubernetesPackage your Java EE Application using Docker and Kubernetes
Package your Java EE Application using Docker and Kubernetes
 
Docker Seattle Meetup April 2015 - The Docker Orchestration Ecosystem on Azure
Docker Seattle Meetup April 2015 - The Docker Orchestration Ecosystem on AzureDocker Seattle Meetup April 2015 - The Docker Orchestration Ecosystem on Azure
Docker Seattle Meetup April 2015 - The Docker Orchestration Ecosystem on Azure
 
Kolla talk at OpenStack Summit 2017 in Sydney
Kolla talk at OpenStack Summit 2017 in SydneyKolla talk at OpenStack Summit 2017 in Sydney
Kolla talk at OpenStack Summit 2017 in Sydney
 
PDXPortland - Dockerize Django
PDXPortland - Dockerize DjangoPDXPortland - Dockerize Django
PDXPortland - Dockerize Django
 
A curtain-raiser to the container world Docker & Kubernetes
A curtain-raiser to the container world Docker & KubernetesA curtain-raiser to the container world Docker & Kubernetes
A curtain-raiser to the container world Docker & Kubernetes
 
DCEU 18: Building Your Development Pipeline
DCEU 18: Building Your Development PipelineDCEU 18: Building Your Development Pipeline
DCEU 18: Building Your Development Pipeline
 
Oracle database on Docker Container
Oracle database on Docker ContainerOracle database on Docker Container
Oracle database on Docker Container
 
Docker for Developers
Docker for DevelopersDocker for Developers
Docker for Developers
 
Docker New York Meetup May 2015 - The Docker Orchestration Ecosystem on Azure
Docker New York Meetup May 2015 - The Docker Orchestration Ecosystem on Azure Docker New York Meetup May 2015 - The Docker Orchestration Ecosystem on Azure
Docker New York Meetup May 2015 - The Docker Orchestration Ecosystem on Azure
 
Dockerization of Azure Platform
Dockerization of Azure PlatformDockerization of Azure Platform
Dockerization of Azure Platform
 
You, and Me, and Docker Makes Three
You, and Me, and Docker Makes ThreeYou, and Me, and Docker Makes Three
You, and Me, and Docker Makes Three
 
Moving to Containers: Building with Docker and Amazon ECS - CON310 - re:Inven...
Moving to Containers: Building with Docker and Amazon ECS - CON310 - re:Inven...Moving to Containers: Building with Docker and Amazon ECS - CON310 - re:Inven...
Moving to Containers: Building with Docker and Amazon ECS - CON310 - re:Inven...
 

Recently uploaded

VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
MsecMca
 

Recently uploaded (20)

Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
 
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 

Reactive summit 2020 microsoft orleans the easy way

  • 1. Microsoft Orleans The Easy Way JOHN S AZARIAH PRINCIPAL SDE, MICROSOFT CORP @JOHNAZARIAH
  • 3. Getting Started Is (mostly) Simple • https://dotnet.github.io/orleans/ • https://gitter.im/dotnet/orleans • https://devblogs.microsoft.com/dotnet/orleans-3-0/ • Blogs,Videos, ConferenceTalks
  • 4. The first hurdles • Concept of Virtual Actors • Idiosyncratic Code Layout (Grain Interfaces, Grains, …) • Declarative persistence • State management • Query patterns, Fan-out, Fan-in and performance implications • Silos, Clients, Configuration • Failure modes - split-brain scenarios, concurrency • Advanced Concepts (Reentrancy, Timers, Reminders, Streaming, …)
  • 5. My own n00b path • Writing a simple dummy app which runs locally based on samples • Preparing the application to run in the cloud - configuration, secrets and so on • Preparing the application to run in clustered mode • Provisioning and deploying to Azure • CI/CD considerations - stability, repeatability
  • 10. Introducing Orleans Universal Silo • https://github.com/johnazariah/orleans-contrib-universalsilo • https://www.nuget.org/packages/Orleans.Contrib.UniversalSilo/ • https://www.nuget.org/packages/Orleans.Contrib.UniversalSilo.Te mplates/ • https://github.com/johnazariah/orleans-contrib- universalsilo/blob/main/docs/index.md
  • 11. Setting up your work environment • https://github.com/johnazariah/orleans-contrib- universalsilo/blob/main/docs/setup-environment-setup.md
  • 12. Getting Started • Install template library with dotnet new --install Orleans.Contrib.UniversalSilo.Templates • List installed templates dotnet new --list • Ensure OrleansWebAPI template is present
  • 13. Getting Started • Create newWebAPI Direct Client Project dotnet new orleans-webapi –name Cornflake • Initialize Git make init • Inspect code withVisual Studio start Cornflake.sln
  • 14. Testing • All tests are IntegrationTests • Test Clusters are set up with Host Clustering and In-Memory Storage • Use Property BasedTesting whenever possible
  • 15. Running • .NET Generic HostApplication • Hit http://localhost:5000/swagger/index.html with browser to see app • Hit http://localhost:8080/ with browser to see Orleans Dashboard
  • 16. Running • .NET Generic HostApplication • Hit http://localhost:5000/swagger/index.html with browser to see app • Hit http://localhost:8080/ with browser to see Orleans Dashboard
  • 18. .net CLI targets • Clean the project with make dotnet-clean.This removes build artefacts and restores • Restore, Build andTest the project with make dotnet-test. • Publish the project to an output folder with make dotnet-publish. • Run the artefacts in the output folder with make dotnet-run. • make dotnet-all is an alias target which does dotnet-clean dotnet- test dotnet-publish dotnet-run.This will implicitly rebuild, test, republish and run the project as you make changes in your code and re-run it.
  • 19. Docker targets • Build the docker image with make docker-build • Run the image with HostLocal clustering mode with make docker- run. • Run with Azure clustering mode against local Azure Storage Emulator with make docker-run-local-ase • Stop all running containers with make docker-stop • List the docker images you have built with make docker-list
  • 20. Local Kubernetes Deployment • Ensure you are running with the correct context (docker-desktop) • make dotnet-all to build, test and run your project until satisfactory. • git commit (to update the hash of the HEAD commit) • make docker-build to build a docker image with these changes, tagged with the current branch and commit hash • make k8s-deploy or make k8s-upgrade to deploy 3 copies of the latest image into the current k8s context. • make k8s-status is an alias for kubectl get all
  • 21. Manual AKS deployment • You can install Azure CLI tools, or just use the docker container. • Recommend using two shells for this – one for Azure and one for the Project
  • 22. Manual AKS deployment : Azure Shell • make az-start fires up an interactive shell inside the officialAzure CLI Docker image • make az-login will allow you to use your browser to authenticate againstAzure. Find the id of the subscription you want. • make az-sub-set sub=<id you selected above> will set the shell to use the selected subscription by default. • Put the org-name and project-name, and the subscription id in Setup.cfg • make az-new-org should only be run once per organization name. • make az-new-proj should only be run once per project. • Put emitted values for paks_storage_connection_string and oaks_acr_login_token into Setup.cfg
  • 23. Manual AKS deployment : Project Shell • make aks-prepare to set up the k8s context to the remote AKS cluster • make docker-push to push the latest built image to the remote Azure Container Registry • make k8s-deploy to deploy the remote AKS cluster
  • 24. CI/CD AKS deployment : WIP • This is the next feature I’m working on
  • 25. Next Steps • Try these templates and improve them. Pull Requests welcome. • Get the CI/CD stage completed.This is work-in-progress. • Use this approach for non-Orleans .NET core generic hosts to support deployment onAKS • Work out an integration story with ProjectTye • Community suggestions