在 VSTS 版本上部署 Service Fabric 服务版本升级失败 [英] Deployment for Service Fabric service version upgrade fails on VSTS Release

查看:19
本文介绍了在 VSTS 版本上部署 Service Fabric 服务版本升级失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

日志中出现以下错误.

The content in ConfigPackage Name:Config and Version:1.0.0.20180315.2 in Service Manifest 'TwoServicePkg' has changed, but the version number is the same.

我只更改了其中一项服务的代码,因此我只更改了清单中的一个版本代码.

I changed only the code of one of the services, so I changed only one version of the code in the manifest.

这种情况下,通过Visual Studio升级是没有问题的.

In this case, there is no problem with the upgrade through Visual Studio.

但是,通过 VSTS 升级会导致上述错误.

However, upgrading via VSTS will cause the above error.

我默认为 Service Fabric 创建了 VSTS CI/CD.(管道:VSTS Git Repo -> Build -> Release)

I created VSTS CI/CD for Service Fabric as default. (Pipeline: VSTS Git Repo -> Build -> Release)

首先提交 > 构建 > 发布"就可以了.

First 'Commit > Build > Release' is Okay.

Service Fabric 清单版本

Service Fabric Manifest Versions

MyAppType: 1.0.0
  OneService: Pkg 1.0.0 / Code 1.0.0 / Config 1.0.0
  TwoService: Pkg 1.0.0 / Code 1.0.0 / Config 1.0.0

现在,我只修复 OneService 代码.并编辑服务结构清单的版本.

Now, I fix OneService Code only. And Edit verisons of service fabric manifest.

Service Fabric 清单版本

Service Fabric Manifest Versions

MyAppType: 1.0.1(*)
  OneService: Pkg 1.0.1(*) / Code 1.0.1(*) / Config 1.0.0
  TwoService: Pkg 1.0.0 / Code 1.0.0 / Config 1.0.0

第二次提交 > 构建正常.但是发布失败.日志中出现以下错误.

Second Commit > Build is Okay. But Release is Failed. The following error appears at log.

The content in ConfigPackage Name:Config and Version:1.0.0.20180315.2 in Service Manifest 'TwoServicePkg' has changed, but the version number is the same.

但我没有修改 TwoService Pkg (Both Code, Config).

But I didn't modify TwoService Pkg (Both Code, Config).

此外,通过VS2017 IDE,立即发布到Azure Cloud Service Fabric Cluster"也很好.(当然,升级应用程序"选项已选中.)

Moreover, It's good to Publish To 'Azure Cloud Service Fabric Cluster' through VS2017 IDE, Immediately. (Of course, 'Upgrade the Application' option checked.)

当前的临时解决方案是将所有(所有 pkg​​/代码/配置)版本升级,如下所示.

Current temporary solution is to version up all (all pkg / code / config) like below.

Service Fabric 清单版本

Service Fabric Manifest Versions

MyAppType: 1.0.1(*)
  OneService: Pkg 1.0.1(*) / Code 1.0.1(*) / Config 1.0.1(*)
  TwoService: Pkg 1.0.1(*) / Code 1.0.1(*) / Config 1.0.1(*)

我想构建构建管道,但令人困惑.

I want to construct build pipeline, But It's Confusing.

我只使用默认的 VSTS Service Fabric 模板.

I just use default VSTS Service Fabric template.

并且只修改发布配置文件名称(Cloud.xml -> Cloud.Development.xml).

And modify only Publish Profile name (Cloud.xml -> Cloud.Development.xml).

发布任务截图

推荐答案

您收到的错误消息提示:

The error you get as the error message suggest :

'ConfigPackage 服务清单 'PackageName' 中的内容有改变了,但版本号是一样的.

'The content in ConfigPackage Service Manifest 'PackageName' has changed, but the version number is the same.

这意味着:我们在这个包中发现了一些与之前版本不匹配的东西,因为你说版本应该是相同的,它们应该匹配,所以我不知道该怎么做,会让你解决这个问题.

That means: we found something different in this package that does not match the previous version, because you've said the version should be the same, they should match, so I don't know what to do and will let you fix that.

该消息不是很有暗示性,因此乍一看您会迷路.

The message is not very suggestive, so at first glance you get lost.

我在这里回答了同样的问题 error-while-upgrading-azure-service-fabric-through-vsts-ci-cd,请检查答案是否能帮助您解决问题.

I have answered the same questions here error-while-upgrading-azure-service-fabric-through-vsts-ci-cd, please check if the answer help you solve your problem.

我再解释一下:

每当您注册应用程序时,Service Fabric 都会将注册的新版本与服务器中当前的版本进行比较,如果已经存在相同的服务版本,则会比较包、配置包、代码包等on,如果其中任何一个不匹配,则部署将失败.

Whenever you register an application, service fabric will compare the new version being registered with the versions currently in the server, if the same service version is already there, it will compare the packages, the config packages, the code package and so on, if any of them doesn't match it will fail the deployment.

对其中任何一个的每一个小的更改都应该触发版本升级,例如,如果您在 Setting.xml 中添加或删除配置设置,您必须升级配置文件的版本和服务清单中的一个.

Every small change on any of these, should trigger a version upgrade, for example, if you add or remove a config setting in the Setting.xml you have to upgrade the version of your config file and one in the service manifest.

之前:

app1 -------> 1.0.0
  service1 -> 1.0.0
    code ---> 1.0.0
    config -> 1.0.0

之后

app1 -------> 1.0.1
  service1 -> 1.0.1
    code ---> 1.0.0
    config -> 1.0.1

对于代码包也一样,如果同时升级代码和配置,则应该只升级服务清单一个版本,例如:

For the code package the same happens, and if you upgrade the code and config at same time, you should only upgrade the service manifest only one version, like:

app1 -------> 1.0.1
  service1 -> 1.0.1
    code ---> 1.0.1
    config -> 1.0.1

这里最棘手的挑战是代码更改,每当触发新构建时,构建将下载源代码并编译所有内容,您知道根据提交更改发生了什么变化,但是对于构建,一切都会生成一个程序集,所以它不关心它是否改变了,它会生成一个新的程序集,尽管代码与以前的构建相同,但大多数时候输出的二进制文件会有所不同.

The trickiest challenge here are the code changes, whenever a new build is triggered, the build will download the source and compile everything, you know what has changed based on commit changes, but for the build everything will generate an assembly, so it does not care if it changed or not, it will generate a new assembly, despite the code being the same from previous build the output binary on most of the times will be different.

通过应用程序注册,如果版本保持不变,这些二进制文件应该与现有的匹配,不会发生什么.为了解决这个问题,差异包装加入派对,我不会在这里提供太多细节,因为超出了本答案的范围,但您可以通过以下链接获得更多信息:

Going through the Application Registration, if the version keep the same, these binaries should match the existing ones, what is not gonna happen. To solve this, the differential packaging join the party, I won't give too much details here because is out of scope for this answer, but you can get more information on these links:

带有差异包的 Service Fabric 应用程序

StackOverflow 问题:差异化包装

这篇关于在 VSTS 版本上部署 Service Fabric 服务版本升级失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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