差异包装 [英] Differential packaging

查看:94
本文介绍了差异包装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

升级应用程序时,Test-ServiceFabricApplicationPackage命令会为每个版本号未更改的代码包引发错误(这表示内容已更改,即使代码未更改).我知道有一个功能可以创建部分程序包,但是我无法使用它.我的问题是:

When upgrading an application, the Test-ServiceFabricApplicationPackage command throws errors for every code package whose version number has not changed (it's saying the content has changed, even though the code hasn't). I know there is a feature that allows creating partial packages, but I was not able to use it. My questions are:

  1. 如何检查代码包的内容以进行更改?二进制比较?
  2. 如何构造部分包(VS构建包后只需删除Code目录?编辑ServiceManifest.xml文件?)
  3. 如何运行Test-ServiceFabricApplicationPackage(什么是映像存储URL?如何将该参数传递给标准部署脚本?)
  1. How is the content of the code package checked for changes? Binary comparison?
  2. How to construct the partial package (Just remove the Code directories after VS builds the package? Edit the ServiceManifest.xml file?)
  3. How to run Test-ServiceFabricApplicationPackage (What's the image store URL? How to pass that parameter to the standard deployment script?)

我希望得到一个详尽的例子.

I'd appreciate a thorough example.

推荐答案

如果要进行部分升级,这就是我的方法:

If you want to do partial upgrades, this is how I've done it:

给予

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

您只想将Service 1更新到版本1.0.1,如下所示:

And you want to update only Service 1 to version 1.0.1 as shown below:

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

在Service1中,将ServiceManifest.xml更新为具有正确的版本号(服务本身以及要升级的其他程序包). 然后,在您的service2文件夹中,删除ServiceManifest.xml以外的所有内容.

In your Service1, update the ServiceManifest.xml to have correct version numbers (the service itself and the different packages you want to upgrade). Then, in your service2 folder, delete everything except the ServiceManifest.xml.

在ApplicationManifest.xml中,应将Service2的ServiceManifestImport保持在1.0.0版本.还要更新Service1的ServiceManifestImport的版本号.

In your ApplicationManifest.xml, you should keep the ServiceManifestImport for Service2 at version 1.0.0. Also update the versionnumber for ServiceManifestImport for Service1.

完成此操作后,您应该可以执行以下操作:

After that is done, you should be able to do a:

Test-ServiceFabricApplicationPackage $packagePath -ImageStoreConnectionString $ImageStoreConnectionString

验证软件包是否有效.据我所知,它的作用是将本地程序包与当前部署的程序包一起使用,然后将两者组合在一起就等于一个有效的完整程序包.

to validate that the package works. What this does (as far as I understand) is it uses the local package along with the currently deployed package, and those two combined should then equal a valid complete package.

因此,基本上,唯一改变的是:

So, basically, the only thing that changes is:

  • 您删除了包裹中不需要的东西(但您保留了 ServiceManifest.xml)
  • 您更新已更改的服务中的版本号
  • 您可以为应用程序和更改的服务更新应用程序清单中的版本号.
  • You remove the things you don't want in your package (but you keep the ServiceManifest.xml)
  • You update the version numbers in the services that have changed
  • You update the version numbers in the application manifest for both the application, and the changed services.

此外,请参阅此文档:

Also, see this documentation: https://azure.microsoft.com/en-us/documentation/articles/service-fabric-application-upgrade-advanced/#upgrade-with-a-diff-package

关于将映像存储区用于 Test-ServiceFabricApplicationPackage 调用(您可以通过查看默认的部署脚本来找到全部内容,但这是您需要的):

Regarding getting the image store to use for the Test-ServiceFabricApplicationPackage call (you can find it all by looking at the default deploy scripts, but here's what you need):

Open powershell
Connect to your cluster (Connect-ServiceFabricCluster ...)
Execute the following commands:

$ClusterManifestRaw = Get-ServiceFabricClusterManifest
$ClusterManifestXml = [xml]$ClusterManifestRaw
$ManagementSection = $ClusterManifestXml.ClusterManifest.FabricSettings.Section | ? { $_.Name -eq "Management" }
$ImageStoreConnectionString = $ManagementSection .ChildNodes | ? { $_.Name -eq "ImageStoreConnectionString" } | Select-Object -Expand Value

这篇关于差异包装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆