Merge branch 'refs/heads/local-ss'
This commit is contained in:
@@ -263,24 +263,8 @@ func (op *AgentOsOperator) modifyHostnameExec(args []string) (bool, []string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (op *AgentOsOperator) modifySystemConfigExec() (bool, []string) {
|
func (op *AgentOsOperator) modifySystemConfigExec() (bool, []string) {
|
||||||
sysctlConfigFile := "/etc/sysctl.d/wdd-k8s.conf"
|
|
||||||
|
|
||||||
// ssh config
|
return op.ModifySysConfigBastion()
|
||||||
// system redirection
|
|
||||||
if !BasicFileExistAndNotNull(sysctlConfigFile) {
|
|
||||||
ok, resultLog := BasicDownloadFile(op.OssOfflinePrefix+"systemctl-config-template.txt", "", "", "", sysctlConfigFile)
|
|
||||||
if !ok {
|
|
||||||
return false, resultLog
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
AllCommandExecutor([]string{
|
|
||||||
"sysctl",
|
|
||||||
"-p",
|
|
||||||
sysctlConfigFile,
|
|
||||||
})
|
|
||||||
|
|
||||||
return true, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (op *AgentOsOperator) ModifySysConfigBastion() (bool, []string) {
|
func (op *AgentOsOperator) ModifySysConfigBastion() (bool, []string) {
|
||||||
@@ -2345,8 +2329,7 @@ func (op *AgentOsOperator) installChronyByDockerExec(funcArgs []string) (bool, [
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// run docker command
|
chronyCommand := []string{
|
||||||
ok, resultLog := AllCommandExecutor([]string{
|
|
||||||
"docker",
|
"docker",
|
||||||
"run",
|
"run",
|
||||||
"--name=chrony",
|
"--name=chrony",
|
||||||
@@ -2354,12 +2337,20 @@ func (op *AgentOsOperator) installChronyByDockerExec(funcArgs []string) (bool, [
|
|||||||
"--detach",
|
"--detach",
|
||||||
"--cap-add=SYS_TIME",
|
"--cap-add=SYS_TIME",
|
||||||
"--publish=123:123/udp",
|
"--publish=123:123/udp",
|
||||||
"--env=NTP_SERVERS=\"ntp1.aliyun.com,ntp2.aliyun.com,ntp3.aliyun.com,ntp4.aliyun.com\"",
|
|
||||||
"--env=LOG_LEVEL=0",
|
"--env=LOG_LEVEL=0",
|
||||||
"--env=TZ=Asia/Shanghai",
|
"--env=TZ=Asia/Shanghai",
|
||||||
"--env=ENABLE_SYSCLK=true",
|
"--env=ENABLE_SYSCLK=true",
|
||||||
funcArgs[0] + ":8033/cmii/chronyd:0.4.3",
|
}
|
||||||
})
|
if op.CanAccessInternet {
|
||||||
|
chronyCommand = append(chronyCommand, "--env=NTP_SERVERS=\"ntp1.aliyun.com,ntp2.aliyun.com,ntp3.aliyun.com,ntp4.aliyun.com\"")
|
||||||
|
} else {
|
||||||
|
chronyCommand = append(chronyCommand, "--env=NTP_SERVERS=127.127.1.1")
|
||||||
|
}
|
||||||
|
|
||||||
|
chronyCommand = append(chronyCommand, funcArgs[0]+":8033/cmii/chronyd:0.4.3")
|
||||||
|
|
||||||
|
// run docker command
|
||||||
|
ok, resultLog := AllCommandExecutor(chronyCommand)
|
||||||
if !ok {
|
if !ok {
|
||||||
return false, append(resultLog, "[installChronyByDockerExec] - docker chrony run error !")
|
return false, append(resultLog, "[installChronyByDockerExec] - docker chrony run error !")
|
||||||
}
|
}
|
||||||
@@ -2472,6 +2463,8 @@ func (op *AgentOsOperator) chronyToMasterExec(args []string) (bool, []string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ubuntu
|
||||||
|
|
||||||
// modify the systemd-timesync.service
|
// modify the systemd-timesync.service
|
||||||
ntpFile := "/etc/systemd/timesyncd.conf"
|
ntpFile := "/etc/systemd/timesyncd.conf"
|
||||||
AllCommandExecutor([]string{
|
AllCommandExecutor([]string{
|
||||||
|
|||||||
@@ -253,7 +253,7 @@ func TestUpdateCmiiDeploymentImageTag(t *testing.T) {
|
|||||||
// 计算20:00的时间
|
// 计算20:00的时间
|
||||||
now := time.Now()
|
now := time.Now()
|
||||||
|
|
||||||
targetTime := time.Date(now.Year(), now.Month(), now.Day(), 12, 50, 00, 0, now.Location())
|
targetTime := time.Date(now.Year(), now.Month(), now.Day(), 17, 35, 00, 0, now.Location())
|
||||||
|
|
||||||
duration := time.Duration(0)
|
duration := time.Duration(0)
|
||||||
|
|
||||||
@@ -278,7 +278,7 @@ func TestUpdateCmiiDeploymentImageTag(t *testing.T) {
|
|||||||
//"cmii-uav-platform-dispatchh5": "5.6.0-062401",
|
//"cmii-uav-platform-dispatchh5": "5.6.0-062401",
|
||||||
//"cmii-uav-data-post-process": "5.6.0-062401",
|
//"cmii-uav-data-post-process": "5.6.0-062401",
|
||||||
//"cmii-uav-industrial-portfolio": "5.6.0-071801",
|
//"cmii-uav-industrial-portfolio": "5.6.0-071801",
|
||||||
"cmii-uav-industrial-portfolio": "5.7.0-31369-yunnan-082102",
|
"cmii-uav-industrial-portfolio": "5.7.0-31369-yunnan-082104",
|
||||||
//"cmii-uav-brain": "5.5.0",
|
//"cmii-uav-brain": "5.5.0",
|
||||||
//"cmii-uav-platform": "5.6.0-071702",
|
//"cmii-uav-platform": "5.6.0-071702",
|
||||||
//"cmii-uas-lifecycle": "5.6.0-30403-071802",
|
//"cmii-uas-lifecycle": "5.6.0-30403-071802",
|
||||||
|
|||||||
@@ -3,8 +3,9 @@
|
|||||||
all_image_list_txt="all-cmii-image-list.txt" # 需要修改版本
|
all_image_list_txt="all-cmii-image-list.txt" # 需要修改版本
|
||||||
gzip_image_list_txt="all-gzip-image-list.txt" # 一般不需要修改
|
gzip_image_list_txt="all-gzip-image-list.txt" # 一般不需要修改
|
||||||
oss_prefix_url="https://oss.demo.uavcmlc.com/cmlc-installation"
|
oss_prefix_url="https://oss.demo.uavcmlc.com/cmlc-installation"
|
||||||
local_gzip_path="/root/wdd/octopus_image_tmp"
|
local_gzip_path="/root/wdd/octopus_image"
|
||||||
DockerRegisterDomain="10.250.0.100:8033" # 需要根据实际修改
|
|
||||||
|
DockerRegisterDomain="10.40.51.5:8033" # 需要根据实际修改
|
||||||
HarborAdminPass=V2ryStr@ngPss # 需要跟第一脚本中的密码保持一致
|
HarborAdminPass=V2ryStr@ngPss # 需要跟第一脚本中的密码保持一致
|
||||||
|
|
||||||
print_green() {
|
print_green() {
|
||||||
@@ -48,7 +49,6 @@ Download_Load_Tag_Upload() {
|
|||||||
print_red "bad arguments"
|
print_red "bad arguments"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
shift # past argument or value
|
|
||||||
done
|
done
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -56,6 +56,10 @@ Download_Load_Tag_Upload() {
|
|||||||
dltu() {
|
dltu() {
|
||||||
print_green "download all image name list and gzip file list!"
|
print_green "download all image name list and gzip file list!"
|
||||||
cd $local_gzip_path || exit
|
cd $local_gzip_path || exit
|
||||||
|
|
||||||
|
rm $all_image_list_txt
|
||||||
|
rm $gzip_image_list_txt
|
||||||
|
|
||||||
wget "$oss_prefix_url$all_image_list_txt"
|
wget "$oss_prefix_url$all_image_list_txt"
|
||||||
wget "$oss_prefix_url$gzip_image_list_txt"
|
wget "$oss_prefix_url$gzip_image_list_txt"
|
||||||
|
|
||||||
@@ -66,7 +70,7 @@ dltu() {
|
|||||||
echo "download gzip file =>: $oss_prefix_url${i}"
|
echo "download gzip file =>: $oss_prefix_url${i}"
|
||||||
if wget "$oss_prefix_url${i}" >/dev/null 2>&1; then
|
if wget "$oss_prefix_url${i}" >/dev/null 2>&1; then
|
||||||
echo "Gzip file download success : ${i}"
|
echo "Gzip file download success : ${i}"
|
||||||
image_full_name=$(docker load -i ${i} | awk -F': ' '{print $2}')
|
image_full_name=$(docker load -i ${i} | head -n1 |awk -F': ' '{print $2}')
|
||||||
|
|
||||||
app_name=$(echo "$image_full_name" | sed 's|.*/||g')
|
app_name=$(echo "$image_full_name" | sed 's|.*/||g')
|
||||||
echo "extract short name is $app_name"
|
echo "extract short name is $app_name"
|
||||||
@@ -77,7 +81,9 @@ dltu() {
|
|||||||
docker tag ${image_full_name} $DockerRegisterDomain/rancher/$app_name
|
docker tag ${image_full_name} $DockerRegisterDomain/rancher/$app_name
|
||||||
docker push $DockerRegisterDomain/rancher/$app_name
|
docker push $DockerRegisterDomain/rancher/$app_name
|
||||||
else
|
else
|
||||||
echo ""
|
print_green "tag image to => $DockerRegisterDomain/cmii/$app_name"
|
||||||
|
docker tag ${image_full_name} $DockerRegisterDomain/cmii/$app_name
|
||||||
|
docker push $DockerRegisterDomain/cmii/$app_name
|
||||||
fi
|
fi
|
||||||
|
|
||||||
else
|
else
|
||||||
@@ -89,10 +95,57 @@ dltu() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Load_Tag_Upload(){
|
||||||
|
print_green "[LTU] - start to load image from offline !"
|
||||||
|
|
||||||
|
while [[ $# -gt 0 ]]; do
|
||||||
|
case "$1" in
|
||||||
|
rke)
|
||||||
|
# print_green "download rke "
|
||||||
|
local_gzip_path="$local_gzip_path/rke"
|
||||||
|
mkdir -p ${local_gzip_path}
|
||||||
|
oss_prefix_url="$oss_prefix_url/rke/"
|
||||||
|
ltu
|
||||||
|
shift # past argument
|
||||||
|
;;
|
||||||
|
middle)
|
||||||
|
local_gzip_path="$local_gzip_path/middle"
|
||||||
|
mkdir -p $local_gzip_path
|
||||||
|
oss_prefix_url="$oss_prefix_url/middle/"
|
||||||
|
ltu
|
||||||
|
shift # past argument
|
||||||
|
;;
|
||||||
|
cmii)
|
||||||
|
local_gzip_path="$local_gzip_path/cmii"
|
||||||
|
mkdir -p $local_gzip_path
|
||||||
|
oss_prefix_url="$oss_prefix_url/cmii/"
|
||||||
|
ltu
|
||||||
|
shift # past argument
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
# unknown option
|
||||||
|
print_red "bad arguments"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
shift # past argument or value
|
||||||
|
done
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
ltu(){
|
||||||
|
while IFS= read -r file; do
|
||||||
|
[ -z "${file}" ] && continue
|
||||||
|
echo "read gzip file full name is $file"
|
||||||
|
done < "$(find $local_gzip_path -type f -name "*.tar.gz")"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
test(){
|
test(){
|
||||||
app_name=$(echo "nginx:latest" | sed 's|.*/||g')
|
app_name=$(echo "nginx:latest" | sed 's|.*/||g')
|
||||||
echo "extract short name is $app_name"
|
echo "extract short name is $app_name"
|
||||||
}
|
}
|
||||||
|
|
||||||
# test
|
# test
|
||||||
Download_Load_Tag_Upload "rke"
|
#Download_Load_Tag_Upload "rke" "middle" "cmii"
|
||||||
|
|
||||||
|
Load_Tag_Upload "rke"
|
||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
|
|
||||||
func TestFetchDependencyRepos_Middle(t *testing.T) {
|
func TestFetchDependencyRepos_Middle(t *testing.T) {
|
||||||
|
|
||||||
errorPullImageList, errorGzipImageList, realCmiiImageName, allGzipFileNameList := C_DownloadCompressUploadDependency(true, false, false)
|
errorPullImageList, errorGzipImageList, realCmiiImageName, allGzipFileNameList := C_DownloadCompressUploadDependency(true, true, false)
|
||||||
|
|
||||||
utils.BeautifulPrintListWithTitle(errorPullImageList, "errorPullImageList")
|
utils.BeautifulPrintListWithTitle(errorPullImageList, "errorPullImageList")
|
||||||
utils.BeautifulPrintListWithTitle(errorGzipImageList, "errorGzipImageList")
|
utils.BeautifulPrintListWithTitle(errorGzipImageList, "errorGzipImageList")
|
||||||
@@ -22,7 +22,7 @@ func TestFetchDependencyRepos_Middle(t *testing.T) {
|
|||||||
|
|
||||||
func TestFetchDependencyRepos_RKE(t *testing.T) {
|
func TestFetchDependencyRepos_RKE(t *testing.T) {
|
||||||
|
|
||||||
errorPullImageList, errorGzipImageList, realCmiiImageName, allGzipFileNameList := C_DownloadCompressUploadDependency(true, true, false)
|
errorPullImageList, errorGzipImageList, realCmiiImageName, allGzipFileNameList := C_DownloadCompressUploadDependency(true, true, true)
|
||||||
|
|
||||||
utils.BeautifulPrintListWithTitle(errorPullImageList, "errorPullImageList")
|
utils.BeautifulPrintListWithTitle(errorPullImageList, "errorPullImageList")
|
||||||
utils.BeautifulPrintListWithTitle(errorGzipImageList, "errorGzipImageList")
|
utils.BeautifulPrintListWithTitle(errorGzipImageList, "errorGzipImageList")
|
||||||
|
|||||||
@@ -215,3 +215,5 @@
|
|||||||
2024-08-21-11-03-00 uavcloud-demo cmii-uav-industrial-portfolio 5.7.0-31369-yunnan-082001 5.7.0-31369-yunnan-082101
|
2024-08-21-11-03-00 uavcloud-demo cmii-uav-industrial-portfolio 5.7.0-31369-yunnan-082001 5.7.0-31369-yunnan-082101
|
||||||
2024-08-21-14-50-50 uavcloud-demo cmii-uav-industrial-portfolio 5.7.0-31369-yunnan-082101 5.7.0-31369-yunnan-082201
|
2024-08-21-14-50-50 uavcloud-demo cmii-uav-industrial-portfolio 5.7.0-31369-yunnan-082101 5.7.0-31369-yunnan-082201
|
||||||
2024-08-21-14-55-15 uavcloud-demo cmii-uav-industrial-portfolio 5.7.0-31369-yunnan-082201 5.7.0-31369-yunnan-082102
|
2024-08-21-14-55-15 uavcloud-demo cmii-uav-industrial-portfolio 5.7.0-31369-yunnan-082201 5.7.0-31369-yunnan-082102
|
||||||
|
2024-08-21-17-07-00 uavcloud-demo cmii-uav-industrial-portfolio 5.7.0-31369-yunnan-082102 5.7.0-31369-yunnan-082103
|
||||||
|
2024-08-21-17-35-40 uavcloud-demo cmii-uav-industrial-portfolio 5.7.0-31369-yunnan-082103 5.7.0-31369-yunnan-082104
|
||||||
|
|||||||
@@ -68,7 +68,9 @@ public class AcceptAgentInitInfo {
|
|||||||
put("Local",
|
put("Local",
|
||||||
15);
|
15);
|
||||||
put("Guangzhou",
|
put("Guangzhou",
|
||||||
13);
|
16);
|
||||||
|
put("Jinrongjie",
|
||||||
|
17);
|
||||||
|
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ spring:
|
|||||||
allow-circular-references: true
|
allow-circular-references: true
|
||||||
allow-bean-definition-overriding: true
|
allow-bean-definition-overriding: true
|
||||||
rabbitmq:
|
rabbitmq:
|
||||||
host: 10.250.0.100
|
host: 42.192.52.227
|
||||||
port: 20672
|
port: 20672
|
||||||
username: boge
|
username: boge
|
||||||
password: boge8tingH
|
password: boge8tingH
|
||||||
@@ -24,7 +24,7 @@ spring:
|
|||||||
max-interval: 65000
|
max-interval: 65000
|
||||||
initial-interval: 2000
|
initial-interval: 2000
|
||||||
redis:
|
redis:
|
||||||
host: 10.250.0.100
|
host: 42.192.52.227
|
||||||
port: 21370
|
port: 21370
|
||||||
database: 0
|
database: 0
|
||||||
password: boge8tingH
|
password: boge8tingH
|
||||||
@@ -46,7 +46,7 @@ spring:
|
|||||||
|
|
||||||
datasource:
|
datasource:
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
url: jdbc:mysql://10.250.0.100:21306/octopus_server?autoReconnect=true&useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8
|
url: jdbc:mysql://42.192.52.227:21306/octopus_server?autoReconnect=true&useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8
|
||||||
username: boge
|
username: boge
|
||||||
password: boge8tingH
|
password: boge8tingH
|
||||||
type: com.zaxxer.hikari.HikariDataSource
|
type: com.zaxxer.hikari.HikariDataSource
|
||||||
|
|||||||
@@ -53,7 +53,8 @@ public class TestBaseFuncScheduler {
|
|||||||
// Long projectServerId = 1778681124701483009L;// 北京通感
|
// Long projectServerId = 1778681124701483009L;// 北京通感
|
||||||
// Long projectServerId = 1788026824445317122L;// 新疆移动
|
// Long projectServerId = 1788026824445317122L;// 新疆移动
|
||||||
// Long projectServerId = 1791639665955184642L;// 深圳公安
|
// Long projectServerId = 1791639665955184642L;// 深圳公安
|
||||||
Long projectServerId = 1795703135172485122L;// 北京通感
|
// Long projectServerId = 1795703135172485122L;// 北京通感
|
||||||
|
Long projectServerId = 1826162388894871554L; // 江苏南通二级平台 8-21
|
||||||
// Long projectServerId = 1773619219367120898L; // 内网35-71项目
|
// Long projectServerId = 1773619219367120898L; // 内网35-71项目
|
||||||
|
|
||||||
|
|
||||||
@@ -66,7 +67,8 @@ public class TestBaseFuncScheduler {
|
|||||||
// String masterNodeServerName = "Chengdu-amd64-10"; // 北京通感
|
// String masterNodeServerName = "Chengdu-amd64-10"; // 北京通感
|
||||||
// String masterNodeServerName = "Chengdu-amd64-14"; // 新疆移动
|
// String masterNodeServerName = "Chengdu-amd64-14"; // 新疆移动
|
||||||
// String masterNodeServerName = "Local-amd64-251"; // 新疆移动
|
// String masterNodeServerName = "Local-amd64-251"; // 新疆移动
|
||||||
String masterNodeServerName = "Chengdu-amd64-200"; // 北京通感
|
// String masterNodeServerName = "Chengdu-amd64-200"; // 北京通感
|
||||||
|
String masterNodeServerName = "Jinrongjie-amd64-056"; // 江苏南通二级平台
|
||||||
// String masterNodeServerName = "Ziyang-amd64-61"; // 资阳公安
|
// String masterNodeServerName = "Ziyang-amd64-61"; // 资阳公安
|
||||||
|
|
||||||
ProjectServerVO projectServerVO = coreProjectServerService.projectServerOne(projectServerId);
|
ProjectServerVO projectServerVO = coreProjectServerService.projectServerOne(projectServerId);
|
||||||
@@ -87,9 +89,9 @@ public class TestBaseFuncScheduler {
|
|||||||
|
|
||||||
|
|
||||||
List<BaseFunctionEnum> masterNodeProcedure = List.of(
|
List<BaseFunctionEnum> masterNodeProcedure = List.of(
|
||||||
BaseFunctionEnum.DISABLE_SWAP,
|
// BaseFunctionEnum.DISABLE_SWAP,
|
||||||
BaseFunctionEnum.DISABLE_SELINUX,
|
// BaseFunctionEnum.DISABLE_SELINUX,
|
||||||
BaseFunctionEnum.MODIFY_SYSCONFIG,
|
// BaseFunctionEnum.MODIFY_SYSCONFIG,
|
||||||
BaseFunctionEnum.SHUTDOWN_FIREWALL,
|
BaseFunctionEnum.SHUTDOWN_FIREWALL,
|
||||||
BaseFunctionEnum.INSTALL_DOCKER,
|
BaseFunctionEnum.INSTALL_DOCKER,
|
||||||
BaseFunctionEnum.INSTALL_DEFAULT_SSH_KEY,
|
BaseFunctionEnum.INSTALL_DEFAULT_SSH_KEY,
|
||||||
@@ -97,7 +99,7 @@ public class TestBaseFuncScheduler {
|
|||||||
BaseFunctionEnum.MODIFY_DOCKER_CONFIG,
|
BaseFunctionEnum.MODIFY_DOCKER_CONFIG,
|
||||||
BaseFunctionEnum.INSTALL_HARBOR,
|
BaseFunctionEnum.INSTALL_HARBOR,
|
||||||
BaseFunctionEnum.INSTALL_NFS_SERVER_ONLINE
|
BaseFunctionEnum.INSTALL_NFS_SERVER_ONLINE
|
||||||
);
|
);
|
||||||
|
|
||||||
List<BaseFunctionEnum> agentNodeProcedure = List.of(
|
List<BaseFunctionEnum> agentNodeProcedure = List.of(
|
||||||
BaseFunctionEnum.DISABLE_SWAP,
|
BaseFunctionEnum.DISABLE_SWAP,
|
||||||
|
|||||||
Reference in New Issue
Block a user