Azure / service-fabric-mesh-preview

Service Fabric Mesh is the Service Fabric's serverless offering to enable developers to deploy containerized applications without managing infrastructure. Service Fabric Mesh , aka project “SeaBreeze” is currently available in private preview. This repository will be used for tracking bugs/feature requests as GitHub issues and for maintaining the latest documentation.
MIT License
82 stars 13 forks source link

Deploying the application to the Service Fabric local cluster failed #246

Closed amolenk closed 6 years ago

amolenk commented 6 years ago

I can't get the simple quick start to deploy to my local cluster. I'm creating a new Service Fabric Mesh solution with a single ASP.NET Core service. If I try to debug or run it on my local cluster, I get a Deploying the application to the Service Fabric local cluster failed. See Service Fabric Explorer for additional details error.

Service Fabric Explorer does not show any information, there are no applications running on the local cluster. Are there any other places I can look for additional logging?

This is the output from the Service Fabric Tools window:

========== Checking for Container Prerequisites ==========
Verifying that Docker for Windows is installed...
Docker for Windows is installed.
Verifying that Docker for Windows is running...
Docker for Windows is running.
Verifying that the Service Fabric SDK is installed...
The Service Fabric SDK is installed.
Finding required service projects...
Service projects found.
========== Pulling Required Images ==========
Checking for missing Docker images...
Docker images are ready.
========== Warming up Service Fabric application ==========
Verifying that Docker for Windows' operating system mode matches the project's target operating system...
Docker for Windows' operating system mode matches the project's mode.
Preparing Docker images for service projects...
The Dockerfile 'C:\Users\sander\source\repos\MeshTest2\Web1\Dockerfile' will be used to build image web1:dev needed by Service Web1, CodePackage Web1.
No cached built image information was found while building project Web1. Required images will be built.
docker build -f "C:\Users\sander\source\repos\MeshTest2\Web1\Dockerfile" -t web1:dev --target base "C:\Users\sander\source\repos\MeshTest2" 

Sending build context to Docker daemon  2.142MB
Step 1/3 : FROM microsoft/aspnetcore:2.0-nanoserver-1709 AS base
Step 2/3 : WORKDIR /app
 ---> cffed522c301
 ---> 2facdcbd35bc
Step 3/3 : EXPOSE 20006
 ---> Using cache
 ---> Running in a309614c88ea
Removing intermediate container a309614c88ea
 ---> 39d1ca288b45
Successfully built 39d1ca288b45
Successfully tagged web1:dev
Docker images are ready.
Preparing the debugger...
Debugger is ready.
The container runtime settings for Service Web1, CodePackage Web1 have changed. The application must be deployed.
Preparing Service Fabric application in local Service Fabric cluster...
C:\Program Files\Microsoft SDKs\Service Fabric\Tools\Mesh\SfSbzYamlMerge\SfSbzYamlMerge.exe  /i:"C:\Users\sander\source\repos\MeshTest2\Web1\Service Resources\service.yaml" /i:"C:\Users\sander\source\repos\MeshTest2\MeshTest2\App Resources\app.yaml" /i:"C:\Users\sander\source\repos\MeshTest2\MeshTest2\obj\SFApp\App.debug.yaml" /o:"C:\Users\sander\source\repos\MeshTest2\MeshTest2\obj\SFApp" /of:"SF_SBZ_JSON"
{
  "schemaVersion": "1.0.0-preview1",
        "properties": {
          "description": "Web1 description.",
          "osType": "Windows",
  "properties": {
    "services": [
        "name": "Web1",
            {
          "codePackages": [
              "name": "Web1",
  "name": "MeshTest2",
      {
              "image": "web1:dev",
              "endpoints": [
            }
                {
                }
              ],
          "networkRefs": [
              "environmentVariables": [
            }
                {
                  "name": "ASPNETCORE_URLS",
                  "value": "http://+:20006"
          ]
                }
        }
              ],
    "description": "MeshTest2 description.",
              "resources": {
                  "cpu": 5.0,
                  "memoryInGB": 1.0
                }
              }
          "replicaCount": 1,
    ],
  }
}
      }
                "requests": {
          ],
                  "name": "Web1Listener",
    "debugParams": "[\n  {\n    \"ServiceManifestName\": \"Web1Pkg\",\n    \"CodePackageName\": \"Web1\",\n    \"ContainerDebugParams\":\n    {\n      \"Entrypoint\": [\"C:\\\\remote_debugger\\\\x64\\\\msvsmon.exe\", \"/noauth\", \"/anyuser\", \"/silent\", \"/nostatus\", \"/noclrwarn\", \"/nosecuritywarn\", \"/nofirewallwarn\", \"/nowowwarn\", \"/fallbackloadremotemanagedpdbs\", \"/timeout:2147483646\"],\n      \"EnvVars\": [\"ASPNETCORE_ENVIRONMENT=Development\", \"SERVICE_PROJECT_VOLUME_PATH=C:\\\\app\", \"NUGET_PACKAGES=C:\\\\nuget1\", \"NUGET_FALLBACK_PACKAGES=C:\\\\nuget2\"],\n      \"Volumes\": [\"C:\\\\Users\\\\sander\\\\onecoremsvsmon\\\\15.0.27428.1:C:\\\\remote_debugger\", \"C:\\\\Users\\\\sander\\\\source\\\\repos\\\\MeshTest2\\\\Web1:C:\\\\app\", \"C:\\\\Users\\\\sander\\\\.nuget\\\\packages:C:\\\\nuget1\", \"C:\\\\Program Files\\\\dotnet\\\\sdk\\\\NuGetFallbackFolder:C:\\\\nuget2\"]\n    }\n  }\n]\n"
                  "port": 20006
              "name": "MeshTest2Network"
            {

Ensuring previously deployed application is removed...
Deploying application to local Service Fabric cluster...
C:\WINDOWS\sysnative\WindowsPowerShell\v1.0\powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "import-module 'C:\Program Files\Microsoft SDKs\Service Fabric\Tools\Mesh\Scripts\PSModule\ServiceFabricHttpPSModule.dll'; Connect-SFCluster -Endpoint http://localhost:19080; .'C:\Program Files\Microsoft SDKs\Service Fabric\Tools\Mesh\Scripts\Deploy-ServiceFabricApplicationResource.ps1' -ApplicationResourcename MeshTest2 -ResourceDescriptionFile 'C:\Users\sander\source\repos\MeshTest2\MeshTest2\obj\SFApp\merged-application-MeshTest2.json'"
Deploying the application to the Service Fabric local cluster failed. See Service Fabric Explorer for additional details.
Deployment of Service Fabric application to local Service Fabric cluster failed.
========== Finished ==========
fauxcoding commented 6 years ago

I was getting this issue as well.

This is the workaround I used...

I hope this helps.

amolenk commented 6 years ago

Thanks, just tried it but didn't help. Then I did some more spelunking in the event log and discovered that the deployment failed due to insufficient resources. I have to change cpu: 0.5 to cpu: 0.003 for the application to run succesfully. This has probably something to do with the fact that I'm trying to run this in a Parallels VM.

The error message in VS is pretty unclear though, so I opened a new work-item (#247) to improve it.

amolenk commented 6 years ago

After setting my Parallels VM to allow full usage of the CPU (4 core i7), I can set the the cpu resource request in service.yaml to 0.3 maximum, which still seems a bit low.

How is the maximum CPU resource request determined in SFM?

amolenk commented 6 years ago

I'm closing this issue because the cpu: 0.3 in my previous comment is actually interpreted as cpu: 3.0 on my machine due to a localization issue ( #248 ). If I take that into account it is clear why the application wouldn't deploy.