microsoft / service-fabric

Service Fabric is a distributed systems platform for packaging, deploying, and managing stateless and stateful distributed applications and containers at large scale.
https://docs.microsoft.com/en-us/azure/service-fabric/
MIT License
3.03k stars 401 forks source link

Add DNSService to ClusterDeployer Docker demo containers #113

Open drnic opened 6 years ago

drnic commented 6 years ago

I have Service Fabric running within Docker via https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-get-started-mac

I followed the tutorial at https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-quickstart-containers-linux to attempt to deploy a SF app via linux containers.

The error I get is:

$ ./install.sh
[1/10] files, ApplicationManifest.xml
[2/10] files, _.dir
[3/10] files, azurevotebackPkg/ServiceManifest.xml
[4/10] files, azurevotebackPkg/_.dir
[5/10] files, azurevotebackPkg/config/Settings.xml
[6/10] files, azurevotebackPkg/config/_.dir
[7/10] files, azurevotefrontPkg/ServiceManifest.xml
[8/10] files, azurevotefrontPkg/_.dir
[9/10] files, azurevotefrontPkg/config/Settings.xml
[10/10] files, azurevotefrontPkg/config/_.dir
Complete
(FABRIC_E_DNS_SERVICE_NOT_FOUND) DnsService is not enabled on the cluster.
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/knack/cli.py", line 125, in invoke
    cmd_result = self.invocation.execute(args)
  File "/usr/local/lib/python3.6/site-packages/knack/invocation.py", line 85, in execute
    cmd_result = parsed_args.func(params)
  File "/usr/local/lib/python3.6/site-packages/knack/commands.py", line 67, in __call__
    return self.handler(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/knack/commands.py", line 123, in _command_handler
    result = op(client, **command_args) if client else op(**command_args)
  File "/usr/local/lib/python3.6/site-packages/sfctl/custom_app.py", line 251, in create
    client.create_application(app_desc, timeout)
  File "/usr/local/lib/python3.6/site-packages/azure/servicefabric/service_fabric_client_ap_is.py", line 3171, in create_application
    raise models.FabricErrorException(self._deserialize, response)
azure.servicefabric.models.fabric_error.FabricErrorException: (FABRIC_E_DNS_SERVICE_NOT_FOUND) DnsService is not enabled on the cluster.

What DNS service do I need to add into my https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-get-started-mac service fabric?

drnic commented 6 years ago

Which Dockerfile is used to create https://hub.docker.com/r/microsoft/service-fabric-onebox/ which is used for https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-get-started-mac?

Or something else?

Should/can we get the DNS service into it?

I don't think I see any example ClusterManifest.xml files that contain the DNS service. What does its inclusion/configuration look like in production Azure clusters?

drnic commented 6 years ago

I'll see if I can guess my way to success:

screen shot 2018-05-01 at 10 18 22 am

drnic commented 6 years ago

Effort #1 was:

    <Section Name="DNSService">
      <Parameter Name="IsEnabled" Value="True" />
    </Section>

screen shot 2018-05-01 at 1 04 28 pm

drnic commented 6 years ago

Ok, setting 1 instance (for the shared docker container) fixed the :53 clash:

    <Section Name="DNSService">
      <Parameter Name="IsEnabled" Value="True" />
      <Parameter Name="InstanceCount" Value="1" />
    </Section>

How do I give the DNSService a Name and a Health State?

screen shot 2018-05-01 at 1 20 50 pm

drnic commented 6 years ago

With the DNSService running (afaik) the install.sh now gets a (FABRIC_E_TIMEOUT) Operation timed out error during create_application.

$ ./install.sh
[1/10] files, ApplicationManifest.xml
[2/10] files, _.dir
[3/10] files, azurevotebackPkg/ServiceManifest.xml
[4/10] files, azurevotebackPkg/_.dir
[5/10] files, azurevotebackPkg/config/Settings.xml
[6/10] files, azurevotebackPkg/config/_.dir
[7/10] files, azurevotefrontPkg/ServiceManifest.xml
[8/10] files, azurevotefrontPkg/_.dir
[9/10] files, azurevotefrontPkg/config/Settings.xml
[10/10] files, azurevotefrontPkg/config/_.dir
Complete
(FABRIC_E_TIMEOUT) Operation timed out.
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/knack/cli.py", line 125, in invoke
    cmd_result = self.invocation.execute(args)
  File "/usr/local/lib/python3.6/site-packages/knack/invocation.py", line 85, in execute
    cmd_result = parsed_args.func(params)
  File "/usr/local/lib/python3.6/site-packages/knack/commands.py", line 67, in __call__
    return self.handler(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/knack/commands.py", line 123, in _command_handler
    result = op(client, **command_args) if client else op(**command_args)
  File "/usr/local/lib/python3.6/site-packages/sfctl/custom_app.py", line 251, in create
    client.create_application(app_desc, timeout)
  File "/usr/local/lib/python3.6/site-packages/azure/servicefabric/service_fabric_client_ap_is.py", line 3171, in create_application
    raise models.FabricErrorException(self._deserialize, response)
azure.servicefabric.models.fabric_error.FabricErrorException: (FABRIC_E_TIMEOUT) Operation timed out.
drnic commented 6 years ago

To reproduce, my XML and Dockerfile are at https://gist.github.com/drnic/9b9538966b8a087de3a9be17d1e448af. The DNSService is added at https://gist.github.com/drnic/9b9538966b8a087de3a9be17d1e448af#file-clustermanifest-singlemachine-dns-xml-L113-L116

cd /tmp
git clone https://gist.github.com/9b9538966b8a087de3a9be17d1e448af.git mysfcluster
cd mysfcluster
docker build -t mysfcluster .
docker run --name sftestcluster -d -p 19080:19080 -p 19000:19000 -p 25100-25200:25100-25200 -p 80:80 mysfcluster

Pop inside:

docker exec -ti sftestcluster bash

Wait for SF + DNS to wake up:

watch ps axwwf

Eventually DNS etc will be running:

   19 ?        S      0:00 /bin/bash ./run.sh
   20 ?        S      0:00  \_ /bin/bash ./ClusterDeployer.sh
  317 ?        Sl     0:00      \_ ./FabricHost -c -skipfabricsetup
  374 pts/1    SLsl+   0:01          \_ dotnet FabricDCA.dll
  390 pts/2    Ssl+   0:07          \_ /home/ClusterDeployer/ClusterData/Data/N0010/Fabric/Fabric.Code/Fabric
  403 pts/3    Ssl+   0:07          \_ /home/ClusterDeployer/ClusterData/Data/N0020/Fabric/Fabric.Code/Fabric
  412 pts/4    Ssl+   0:05          \_ /home/ClusterDeployer/ClusterData/Data/N0030/Fabric/Fabric.Code/Fabric
  871 pts/5    Ssl+   0:00          \_ /home/ClusterDeployer/ClusterData/Data/N0030/Fabric/Fabric.Code/FabricGateway.exe localhost:37857
 1489 pts/6    Ssl+   0:00          \_ /home/ClusterDeployer/ClusterData/Data/N0020/Fabric/Fabric.Code/FabricGateway.exe localhost:43097
 1511 pts/7    Ssl+   0:00          \_ /home/ClusterDeployer/ClusterData/Data/N0010/Fabric/Fabric.Code/FabricGateway.exe localhost:38739
 4860 pts/8    Ssl+   0:01          \_ /home/ClusterDeployer/ClusterData/Data/N0020/Fabric/work/Applications/__FabricSystem_App4294967295/FileStoreService.Cod
e.Current/FileStoreService.exe
15653 pts/9    Ssl+   0:00          \_ /home/ClusterDeployer/ClusterData/Data/N0030/Fabric/work/Applications/__FabricSystem_App4294967295/DnsService.Code.Curr
ent/FabricDnsService.exe
15783 pts/10   Ssl+   0:01          \_ /home/ClusterDeployer/ClusterData/Data/N0030/Fabric/work/Applications/__FabricSystem_App4294967295/FileStoreService.Cod
e.Current/FileStoreService.exe
15799 pts/11   Ssl+   0:01          \_ /home/ClusterDeployer/ClusterData/Data/N0010/Fabric/work/Applications/__FabricSystem_App4294967295/FileStoreService.Cod
e.Current/FileStoreService.exe

Download and attempt to deploy the Voting app:

cd /tmp
git clone https://github.com/Azure-Samples/service-fabric-containers.git
cd service-fabric-containers/Linux/container-tutorial/Voting

sfctl cluster select --endpoint http://localhost:19080
./install.sh
suhuruli commented 6 years ago

DNSService is not supported currently for the onebox scenario on a Mac. We are going to add support for it soon

drnic commented 6 years ago

Can I ask what is the nature of the “not currently supported” within Docker/Mac? That is, where else might DNSService work/not work? Many environments will already have some notion of dns/networking in existence; eg BOSH.


From: Sudhanva Huruli notifications@github.com Sent: Friday, May 4, 2018 2:45:00 AM To: Microsoft/service-fabric Cc: Dr Nic Williams; Author Subject: Re: [Microsoft/service-fabric] Add DNSService to ClusterDeployer Docker demo containers (#113)

DNSService is not supported currently for the onebox scenario on a Mac. We are going to add support for it soon

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/Microsoft/service-fabric/issues/113#issuecomment-386360049, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AAAAbMhidTZnxm_hSzkOOSic6x86owi0ks5tuzQMgaJpZM4TtXtX.

suhuruli commented 6 years ago

The DNSService does not work when turned on for Service Fabric running inside a container as it does on Mac's. The developer cluster's on Windows and Ubuntu dev machines will come up just fine with the DNSService on.

coin8086 commented 1 year ago

@suhuruli, unfortunately, I have the same error on Windows with Docker Desktop.

I'm following this https://learn.microsoft.com/en-us/azure/service-fabric/service-fabric-quickstart-containers-linux but I'm deploying to a local dev cluster of Linux instead of Azure. I followed this https://learn.microsoft.com/en-us/azure/service-fabric/service-fabric-local-linux-cluster-windows to setup my local dev cluster in Docker. This is what I did and got (in Cygwin):

robert@robert-surface ~/code/service-fabric-containers/Linux/container-tutorial/Voting master
$ sfctl cluster select --endpoint http://localhost:19080/

robert@robert-surface ~/code/service-fabric-containers/Linux/container-tutorial/Voting master
$ ./install.sh
Uploading Application Files
Uploading path: .: 100%|▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒| 2/2 [00:02<00:00,  1.34s/it]
[3/13] files, _.dir
Time left: 297 seconds
Uploading path: azurevotebackPkg: 100%|▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒| 2/2 [00:01<00:00,  1.21it/s]
[6/13] files, azurevotebackPkg\_.dir
Time left: 295 seconds
Uploading path: azurevotebackPkg\config: 100%|▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒| 1/1 [00:00<00:00,  3.46it/s]
[8/13] files, azurevotebackPkg\config\_.dir
Time left: 294 seconds
Uploading path: azurevotefrontPkg: 100%|▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒| 2/2 [00:00<00:00,  4.40it/s]
[11/13] files, azurevotefrontPkg\_.dir
Time left: 294 seconds
Uploading path: azurevotefrontPkg\config: 100%|▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒| 1/1 [00:00<00:00,  3.55it/s]
[13/13] files, azurevotefrontPkg\config\_.dir
Complete
Time left: 293 seconds
Provisioning Application Type
Creating Application
ERROR: (FABRIC_E_DNS_SERVICE_NOT_FOUND) DnsService is not enabled on the cluster.
Traceback (most recent call last):
  File "C:\Users\robert\AppData\Local\Programs\Python\Python310\lib\site-packages\knack\cli.py", line 206, in invoke
    cmd_result = self.invocation.execute(args)
  File "C:\Users\robert\AppData\Local\Programs\Python\Python310\lib\site-packages\sfctl\entry.py", line 81, in execute
    return super(SFInvoker, self).execute(args)
  File "C:\Users\robert\AppData\Local\Programs\Python\Python310\lib\site-packages\knack\invocation.py", line 208, in execute
    cmd_result = parsed_args.func(params)
  File "C:\Users\robert\AppData\Local\Programs\Python\Python310\lib\site-packages\knack\commands.py", line 139, in __call__
    return self.handler(*args, **kwargs)
  File "C:\Users\robert\AppData\Local\Programs\Python\Python310\lib\site-packages\knack\commands.py", line 246, in _command_handler
    result = op(client, **command_args) if client else op(**command_args)
  File "C:\Users\robert\AppData\Local\Programs\Python\Python310\lib\site-packages\sfctl\custom_app.py", line 707, in create
    client.create_application(app_desc, timeout)
  File "C:\Users\robert\AppData\Local\Programs\Python\Python310\lib\site-packages\azure\servicefabric\operations\_service_fabric_client_ap_is_operations.py", line 3729, in create_application
    raise models.FabricErrorException(self._deserialize, response)
azure.servicefabric.models._models_py3.FabricErrorException: (FABRIC_E_DNS_SERVICE_NOT_FOUND) DnsService is not enabled on the cluster.

And, this is the container image I use for the SF Linux cluter:

PS C:\Users\robert> docker images
REPOSITORY                                TAG       IMAGE ID       CREATED         SIZE
mcr.microsoft.com/service-fabric/onebox   u18       dffdac13e6ad   16 months ago   2.14GB
suhuruli commented 1 year ago

Adding @peterpogorski who can help with this now!

coin8086 commented 1 year ago

Hi @peterpogorski , any idea on this?

BTW, I'm also trying to use the Ubuntu 20 image as the document says but it's not found at all!

PS C:\Users\robert> docker run --name sftestcluster -d -v /var/run/docker.sock:/var/run/docker.sock -p 19080:19080 -p 19000:19000 -p 25100-25200:25100-25200 mcr.microsoft.com/service-fabric/onebox:u20
Unable to find image 'mcr.microsoft.com/service-fabric/onebox:u20' locally
docker: Error response from daemon: manifest for mcr.microsoft.com/service-fabric/onebox:u20 not found: manifest unknown: manifest tagged by "u20" is not found.
bmd-syd commented 1 year ago

Hi @suhuruli, I have just been following the Linux container voting tutorial here: https://learn.microsoft.com/en-us/azure/service-fabric/service-fabric-quickstart-containers-linux

After running ./install.sh to deploy to my SF cluster in Azure I see the same error message in the terminal. And no services show within the Explorer view. I am using Ubuntu 18 on the VM.

Creating Application
/opt/homebrew/lib/python3.11/site-packages/urllib3/connectionpool.py:1056: InsecureRequestWarning: Unverified HTTPS request is being made to host 'XXXX.XXXX.cloudapp.azure.com'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#ssl-warnings
  warnings.warn(
**(FABRIC_E_DNS_SERVICE_NOT_FOUND) DnsService is not enabled on the cluster.**
Traceback (most recent call last):
  File "/opt/homebrew/lib/python3.11/site-packages/knack/cli.py", line 206, in invoke
    cmd_result = self.invocation.execute(args)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/sfctl/entry.py", line 81, in execute
    return super(SFInvoker, self).execute(args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/knack/invocation.py", line 208, in execute
    cmd_result = parsed_args.func(params)
                 ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/knack/commands.py", line 139, in __call__
    return self.handler(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/knack/commands.py", line 246, in _command_handler
    result = op(client, **command_args) if client else op(**command_args)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/sfctl/custom_app.py", line 707, in create
    client.create_application(app_desc, timeout)
  File "/opt/homebrew/lib/python3.11/site-packages/azure/servicefabric/operations/_service_fabric_client_ap_is_operations.py", line 3729, in create_application
    raise models.FabricErrorException(self._deserialize, response)
**azure.servicefabric.models._models_py3.FabricErrorException: (FABRIC_E_DNS_SERVICE_NOT_FOUND) DnsService is not enabled on the cluster.**

Are there any other avenues for support?

UPDATE 22/10

I have just seen this when creating a Linux cluster. So, DNS can not be enabled on any Linux cluster. Which seems to go against an earlier comment in this in thread, unless I have read it incorrectly i.e. "The developer cluster's on Windows and Ubuntu dev machines will come up just fine with the DNSService on."

Screenshot 2023-10-22 at 10 58 55

Should this have any impact of Service Fabric Quick Start Tutorial, as I still encountered issues (see original post).