Skip to content

Instantly share code, notes, and snippets.

@coin8086
Last active March 8, 2023 03:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save coin8086/0671260a9d9f1707f58416fe071eeb6a to your computer and use it in GitHub Desktop.
Save coin8086/0671260a9d9f1707f58416fe071eeb6a to your computer and use it in GitHub Desktop.
Service Fabric in brief

Setup Service Fabric Development Environment on Linux

The official document at https://learn.microsoft.com/en-us/azure/service-fabric/service-fabric-get-started-linux is problematic (ESPECIALLY, DO NOT follow the instruction in that document to install Docker!). Here're the correct steps.

Prerequisites

  1. Check if your Linux distro and version are supported at https://learn.microsoft.com/en-us/azure/service-fabric/service-fabric-versions#supported-linux-versions-and-support-end-date
  2. Setup Docker as instructed by https://docs.docker.com/engine/install/ubuntu

Install Service Fabric SDK

Add the dotnet repo to your sources list corresponding to your distribution.

wget -q https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb

Add the new MS Open Tech Gnu Privacy Guard (GnuPG or GPG) key to your APT keyring.

sudo curl -fsSL https://packages.microsoft.com/keys/msopentech.asc | sudo apt-key add -

Install SDK

sudo apt-get update
sudo apt-get install servicefabricsdkcommon

NOTE:

Service Fabric Dev Cluster

Setup a dev cluster by

sudo /opt/microsoft/sdk/servicefabric/common/clustersetup/devclustersetup.sh

Then you can open Service Fabric Explorer at http://localhost:19080/Explorer for it.

Remove the dev cluster when it's not needed any more by

sudo /opt/microsoft/sdk/servicefabric/common/clustersetup/devclustercleanup.sh

Create a Linux Container App

Follow this document to create a Linux container app on a dev cluster.

See sample code at https://github.com/coin8086/sf-container-sample

Service Fabric in Brief

Core Concepts

References

Programming Models

Reliable Service (ExeHost)

Code Samples

References

Container (ContainerHost)

Code Samples

References

Guest Executable (UseImplicitHost="true")

References

Service Communication

  • Naming Service
  • How to Resolve a Service
    • ServicePartitionResolver
    • Reverse Proxy
    • DNS Service (only available on Windows Host)
  • How to Publish a resolvable Service
    • Reliable Service (by ICommunicationListener::OpenAsync)
    • Container (by ServiceDnsName in ApplicationManifest.xml)

References

Cluster Health

References

Cluster Security

References

Manifest

References

Packaging & Deployment

References

Hosting Environments

Differences of Features between Linux and Windows

SF on Linux has less features than that on Windows. See https://learn.microsoft.com/en-us/azure/service-fabric/service-fabric-linux-windows-differences for more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment