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

Volumes: Format of the 'destinationPath' '<value>' in volumes/volumeRefs is invalid. #314

Closed alecor191 closed 5 years ago

alecor191 commented 5 years ago

Issue description

I'm trying to attach a volume to a Linux service following instructions in Store state with Azure Files volume. Here the service description:

application:
  schemaVersion: 1.0.0-preview2
  name: SFMeshSandbox
  properties:
    services:
      - name: Seq
        properties:
          osType: Linux
          codePackages:
            - name: Seq
              image: datalust/seq:latest
              volumeRefs:
                - name: "seqVolume"
                  destinationPath: "/app/data"
[...]

I'm getting the following error when running az mesh deployment create --input-yaml-files ...:

Request is invalid. Reason 'SFMeshSandbox.Seq.Seq.seqVolume': Format of the 'destinationPath' '/app/data' in volumes/volumeRefs is invalid.."

I tried several values (e.g. /app/data, /data, data, ...) all with the same result.

And here the volume.yaml file:

volume:
  schemaVersion: 1.0.0-preview2
  name: seqVolume
  properties:
    description: Azure Files storage volume for Seq
    provider: SFAzureFile
    azureFileParameters:
      shareName: seqshare
      accountName: "<name>"
      accountKey: "<key>"

I found a doc in the MS Docs repo that uses /app/data in the YAML sample, however, it doesn't seem to work for me.

Any thoughts on what I'm missing?

Potentially related issue working with volumes - documentation issue?

BTW when following Store state with Azure Files volume to set the name field of volumeRefs to

volumeRefs:
  - name: "[resourceId('Microsoft.ServiceFabricMesh/volumes', 'testVolume')]"
    ...

the deployment failed with the following error (note how resourceId('Microsoft.ServiceFabricMesh/volumes' is listed twice):

[...] 
Unable to parse language expression 'resourceId('Microsoft.ServiceFabricMesh/volumes','[resourceId('Microsoft.ServiceFabricMesh/volumes', 'seqVolume')]')': 
expected token 'RightParenthesis' and actual 'Identifier'. 
[...]

Changing the YAML file to the following "worked" (i.e. I didn't get that error anymore, however, I can't confirm that it actually works, as I'm blocked on the issue mentioned at the top).

volumeRefs:
  - name: "testVolume"
    ...

So not sure if the docs need to be updated as we only need to provide the volume name and not the ARM syntax pointing to the resourceId, or if there is another issue with my YAML file.

ashishnegi commented 5 years ago

/cc @wangcai0124 / @athinanthny

anantshankar17 commented 5 years ago

You do not need to use the Arm resource format name in the yamls. Can you share all your yamls ? I was able to deploy a service using the same definition:

application: schemaVersion: 1.0.0-preview2 name: counterApp-az properties: description: Azure Service Fabric Mesh Counter Application. services:

alecor191 commented 5 years ago

Thanks @anantshankar17 for looking into this.

Could it be that it is related to the fact that I'm deploying both Windows and Linux services as part of the same deployment? Currently it consists of one Linux service (that's the one with the volume) and two stateless Windows services (no volume definitions).

If I remove the two Windows services from the deployment and only deploy the Linux service, I don't get that error message anymore. However, the overall deployment times out for me (but that could be related to my service).

raunakpandya commented 5 years ago

Yes, at the moment you cannot combine Windows and Linux services as part of the same application/ deployment. However, I would expect the alone Linux deployment to go through. Let us know if you continue to face trouble there.