Skip to content

Commit

Permalink
resolve issue 416 (#417)
Browse files Browse the repository at this point in the history
Co-authored-by: 李鹏 <lipeng@cgt.com.cn>
  • Loading branch information
lipeng186 and 李鹏 authored Oct 13, 2023
1 parent 2841f98 commit d7616ee
Showing 1 changed file with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,22 +65,25 @@ public ExecResult handlerRequest(ServiceRoleInfo serviceRoleInfo) throws Excepti
installServiceRoleCommand.setServiceName(serviceRoleInfo.getParentName());
installServiceRoleCommand.setServiceRoleName(serviceRoleInfo.getName());
installServiceRoleCommand.setServiceRoleType(serviceRoleInfo.getRoleType());
installServiceRoleCommand.setPackageName(serviceRoleInfo.getPackageName());
installServiceRoleCommand.setDecompressPackageName(serviceRoleInfo.getDecompressPackageName());
installServiceRoleCommand.setRunAs(serviceRoleInfo.getRunAs());
installServiceRoleCommand.setServiceRoleType(serviceRoleInfo.getRoleType());
String md5 = FileUtil.readString(
Constants.MASTER_MANAGE_PACKAGE_PATH + Constants.SLASH + serviceRoleInfo.getPackageName() + ".md5",
Charset.defaultCharset());
installServiceRoleCommand.setPackageMd5(md5);

String md5 ;
if ("aarch64".equals(hostEntity.getCpuArchitecture()) && FileUtil.exist(Constants.MASTER_MANAGE_PACKAGE_PATH
+ Constants.SLASH + serviceRoleInfo.getDecompressPackageName() + "-arm.tar.gz")) {
installServiceRoleCommand.setPackageName(serviceRoleInfo.getDecompressPackageName() + "-arm.tar.gz");
logger.info("find arm package {}", installServiceRoleCommand.getPackageName());
String armMd5 = FileUtil.readString(Constants.MASTER_MANAGE_PACKAGE_PATH + Constants.SLASH
md5 = FileUtil.readString(Constants.MASTER_MANAGE_PACKAGE_PATH + Constants.SLASH
+ serviceRoleInfo.getDecompressPackageName() + "-arm.tar.gz.md5", Charset.defaultCharset());
installServiceRoleCommand.setPackageMd5(armMd5);
}else {
installServiceRoleCommand.setPackageName(serviceRoleInfo.getPackageName());
md5 = FileUtil.readString(
Constants.MASTER_MANAGE_PACKAGE_PATH + Constants.SLASH + serviceRoleInfo.getPackageName() + ".md5",
Charset.defaultCharset());
}
installServiceRoleCommand.setPackageMd5(md5);

ActorSelection actorSelection = ActorUtils.actorSystem.actorSelection(
"akka.tcp://datasophon@" + serviceRoleInfo.getHostname() + ":2552/user/worker/installServiceActor");
Timeout timeout = new Timeout(Duration.create(180, TimeUnit.SECONDS));
Expand Down

0 comments on commit d7616ee

Please sign in to comment.