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 12 forks source link

SfSbzYamlMerge uses current culture's number format when parsing yaml (but shouldn't?) #248

Closed amolenk closed 5 years ago

amolenk commented 6 years ago

The SfSbzYamlMerge tool currently uses the current culture's number format when parsing decimal numbers. For example, on my local system, I use , as the decimal separator. If I use the following input yaml:

## Service definition ##
application:
  schemaVersion: 1.0.0-preview1
  name: MyFirstMeshApp
  properties:
    services:
      - name: Web1
        properties:
          description: Web1 description.
          osType: Windows
          codePackages:
            - name: Web1
              image: web1:dev
              endpoints:
                - name: Web1Listener
                  port: 20004
              environmentVariables:
                - name: ASPNETCORE_URLS
                  value: http://+:20004
#                - name: ApplicationInsights:InstrumentationKey
#                  value: "<Place AppInsights key here, or reference it via a secret>"
              resources:
                requests:
                  cpu: 0.5
                  memoryInGB: 1
          replicaCount: 1
          networkRefs:
            - name: MyFirstMeshAppNetwork

The number of cpu cores in the output file will change from 0.5 to 5.0, because the . used in the input file is not recognized as a decimal separator. Here's the output file:

{
  "schemaVersion": "1.0.0-preview1",
  "name": "MyFirstMeshApp",
  "properties": {
    "services": [
      {
        "name": "Web1",
        "properties": {
          "description": "Web1 description.",
          "osType": "Windows",
          "codePackages": [
            {
              "name": "Web1",
              "image": "web1:dev",
              "endpoints": [
                {
                  "name": "Web1Listener",
                  "port": 20004
                }
              ],
              "environmentVariables": [
                {
                  "name": "ASPNETCORE_URLS",
                  "value": "http://+:20004"
                }
              ],
              "resources": {
                "requests": {
                  "cpu": 5.0,
                  "memoryInGB": 1.0
                }
              }
            }
          ],
          "replicaCount": 1,
          "networkRefs": [
            {
              "name": "MyFirstMeshAppNetwork"
            }
          ]
        }
      }
    ]
  }
}

I can work around this by updating the service.yaml file to cpu: 0,5, but this is obviously not an ideal solution.

I think it would be best if the SfSbzYamlMerge tool would always use a number format with a . as the decimal separator when parsing input files, no matter what the local settings are. It already does this when writing the output file.

joergjo commented 6 years ago

Same here. And even if I switch my Win10 machine's locale to en-US, it doesn't work. Deployment simply fails with a non-descriptive Deploying the application to the Service Fabric local cluster failed. See Service Fabric Explorer for additional details. message in the Service Fabric Tools pane. In SFX however there is no sign that a deployment was ever started.

bjorkstromm commented 6 years ago

Related to #131

anantshankar17 commented 5 years ago

These issues are all fixed in the latest SF Release 6.4.637 and SDK version 3.3.637. Kindly try them out and let us know.

joergjo commented 5 years ago

Works for me.