Differential packaging

前端 未结 2 2045
萌比男神i
萌比男神i 2020-11-27 19:18

When upgrading an application, the Test-ServiceFabricApplicationPackage command throws errors for every code package whose version number has not changed (it\'s

2条回答
  •  暖寄归人
    2020-11-27 19:43

    Service Fabric supports differential packages but upgrades with differential packages hasn't been completely integrated with Visual Studio yet. But you can do it manually.

    1. Yes it's binary comparison.
    2. So in a differential package, you increment the versions only for packages (code, config, and data) that have changed. If the binaries have changed for a package whose version has not changed - which can just be from a recompilation - then you can simply omit its files from the final application package.
    3. The image store can be an external location (like Azure blob storage) but the simplest option is the built-in image store service, which is used by default in the SDK and in Azure. To use that, simply use "fabric:ImageStore" for the image store string: Test-ServiceFabricApplicationPackage -ApplicationPackagePath /path/to/package -ImageStoreConnectionString fabric:ImageStore

    Here's an example of a diff package. Imagine you have the following:

    app1 1.0.0
      service1 1.0.0
        code 1.0.0
        config 1.0.0
      service2 1.0.0
        code 1.0.0
        config 1.0.0
    

    And you want to upgrade only the code package of service1:

    app1 2.0.0            <-- new version
      service1 2.0.0      <-- new version
        code 2.0.0        <-- new version
        config 1.0.0
      service2 1.0.0
        code 1.0.0
        config 1.0.0
    

    You update the versions in your application and service manifests, but you only include the packages that have changed in the final application package. Your application package would simply look like this:

    app1/
      service1/
        code/
    

    The packages whose version numbers haven't changed aren't included. Note that you could include those packages, but only if they are identical (binary diff) to the packages of the same version currently registered for the application in the cluster, in which case they will simply be ignored.

    A quick and easy way to generate one of these is to use the Package command in Visual Studio (right-click the application and select Package). Then go to the output directory and simply delete the directories for packages whose versions haven't changed.

提交回复
热议问题