[Agent][Deploy] - update cmii frontend
This commit is contained in:
@@ -54,7 +54,7 @@ spec:
|
|||||||
memory: 500Mi
|
memory: 500Mi
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: nginx-conf
|
- name: nginx-conf
|
||||||
mountPath: /usr/local/nginx/conf/nginx.conf
|
mountPath: /etc/nginx/conf.d/nginx.conf
|
||||||
subPath: nginx.conf
|
subPath: nginx.conf
|
||||||
- name: tenant-prefix
|
- name: tenant-prefix
|
||||||
subPath: ingress-config.js
|
subPath: ingress-config.js
|
||||||
|
|||||||
@@ -34,20 +34,6 @@ metadata:
|
|||||||
cmii.type: frontend
|
cmii.type: frontend
|
||||||
data:
|
data:
|
||||||
nginx.conf: |
|
nginx.conf: |
|
||||||
user root;
|
|
||||||
worker_processes auto;
|
|
||||||
|
|
||||||
events {
|
|
||||||
worker_connections 1024;
|
|
||||||
}
|
|
||||||
http {
|
|
||||||
include mime.types;
|
|
||||||
default_type application/octet-stream;
|
|
||||||
|
|
||||||
sendfile on;
|
|
||||||
|
|
||||||
keepalive_timeout 600;
|
|
||||||
|
|
||||||
server {
|
server {
|
||||||
listen 9528;
|
listen 9528;
|
||||||
server_name localhost;
|
server_name localhost;
|
||||||
@@ -63,7 +49,6 @@ data:
|
|||||||
root html;
|
root html;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
`
|
`
|
||||||
|
|
||||||
const CmiiFrontendIngressTemplate = `
|
const CmiiFrontendIngressTemplate = `
|
||||||
|
|||||||
@@ -8,20 +8,6 @@ metadata:
|
|||||||
cmii.type: frontend
|
cmii.type: frontend
|
||||||
data:
|
data:
|
||||||
nginx.conf: |
|
nginx.conf: |
|
||||||
user root;
|
|
||||||
worker_processes auto;
|
|
||||||
|
|
||||||
events {
|
|
||||||
worker_connections 1024;
|
|
||||||
}
|
|
||||||
http {
|
|
||||||
include mime.types;
|
|
||||||
default_type application/octet-stream;
|
|
||||||
|
|
||||||
sendfile on;
|
|
||||||
|
|
||||||
keepalive_timeout 600;
|
|
||||||
|
|
||||||
server {
|
server {
|
||||||
listen 9528;
|
listen 9528;
|
||||||
server_name localhost;
|
server_name localhost;
|
||||||
@@ -37,7 +23,7 @@ data:
|
|||||||
root html;
|
root html;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
---
|
---
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
|
|||||||
@@ -63,14 +63,6 @@ type CommonEnvironmentConfig struct {
|
|||||||
ApplyFilePrefix string
|
ApplyFilePrefix string
|
||||||
}
|
}
|
||||||
|
|
||||||
//func (env *CommonEnvironmentConfig) CompactEnv() {
|
|
||||||
//
|
|
||||||
// copySameFields(env, c_app.DefaultCmiiBackendConfig)
|
|
||||||
// copySameFields(env, c_app.DefaultCmiiFrontendConfig)
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
//
|
|
||||||
|
|
||||||
func (env *CommonEnvironmentConfig) ValidateAndUniform() bool {
|
func (env *CommonEnvironmentConfig) ValidateAndUniform() bool {
|
||||||
validate := validator.New()
|
validate := validator.New()
|
||||||
err := validate.Struct(env)
|
err := validate.Struct(env)
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ diskTotal: "914.9 GB"
|
|||||||
diskUsage: "12.3 GB"
|
diskUsage: "12.3 GB"
|
||||||
archInfo: "x86_64 (64 Bit)"
|
archInfo: "x86_64 (64 Bit)"
|
||||||
osInfo: "
|
osInfo: "
|
||||||
|
|
||||||
Ubuntu 20.04.5 LTS"
|
Ubuntu 20.04.5 LTS"
|
||||||
osKernelInfo: "5.4.0-135-generic"
|
osKernelInfo: "5.4.0-135-generic"
|
||||||
tcpControl: "bbr "
|
tcpControl: "bbr "
|
||||||
|
|||||||
@@ -8,6 +8,10 @@ import (
|
|||||||
|
|
||||||
func TestCmiiEnvDeploy(t *testing.T) {
|
func TestCmiiEnvDeploy(t *testing.T) {
|
||||||
|
|
||||||
|
// dev
|
||||||
|
// devflight
|
||||||
|
// devoperation
|
||||||
|
|
||||||
deployNamespace := devFlight
|
deployNamespace := devFlight
|
||||||
|
|
||||||
// deploy to cmii environment
|
// deploy to cmii environment
|
||||||
|
|||||||
@@ -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(), 17, 35, 00, 0, now.Location())
|
targetTime := time.Date(now.Year(), now.Month(), now.Day(), 10, 05, 00, 0, now.Location())
|
||||||
|
|
||||||
duration := time.Duration(0)
|
duration := time.Duration(0)
|
||||||
|
|
||||||
@@ -277,11 +277,10 @@ func TestUpdateCmiiDeploymentImageTag(t *testing.T) {
|
|||||||
appNameTagMap := map[string]string{
|
appNameTagMap := map[string]string{
|
||||||
//"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-071501",
|
||||||
//"cmii-uav-multilink": "5.5.0",
|
//"cmii-uav-multilink": "5.5.0",
|
||||||
//"cmii-uav-developer": "5.6.0-062701",
|
//"cmii-uav-developer": "5.6.0-062701",
|
||||||
"cmii-uav-platform": "5.6.0-070401",
|
//"cmii-uav-platform": "5.6.0-0626",
|
||||||
"cmii-uav-platform-share": "5.6.0-070401",
|
|
||||||
"cmii-uav-industrial-portfolio": "5.6.0-070401",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for appName, newTag := range appNameTagMap {
|
for appName, newTag := range appNameTagMap {
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package image
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
"wdd.io/agent-common/utils"
|
"wdd.io/agent-common/utils"
|
||||||
)
|
)
|
||||||
@@ -10,10 +11,10 @@ var DefaultHarborOperator *HarborOperator
|
|||||||
|
|
||||||
func TestHarborOperator_BuildOperator(t *testing.T) {
|
func TestHarborOperator_BuildOperator(t *testing.T) {
|
||||||
harborOperator := &HarborOperator{
|
harborOperator := &HarborOperator{
|
||||||
HarborHost: "http://harbor.wdd.io",
|
HarborHost: "http://harbor.cdcyy.com.cn",
|
||||||
HarborPort: "8033",
|
HarborPort: "",
|
||||||
HarborUser: "",
|
HarborUser: "rad02_drone",
|
||||||
HarborPass: "",
|
HarborPass: "Drone@1234",
|
||||||
HarborClient: nil,
|
HarborClient: nil,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -32,7 +33,7 @@ func TestHarborOperator_RepoListAll(t *testing.T) {
|
|||||||
TestHarborOperator_BuildOperator(t)
|
TestHarborOperator_BuildOperator(t)
|
||||||
|
|
||||||
//repoListAll := DefaultHarborOperator.RepoListAll("ran")
|
//repoListAll := DefaultHarborOperator.RepoListAll("ran")
|
||||||
repoListAll := DefaultHarborOperator.RepoListAll("rancher")
|
repoListAll := DefaultHarborOperator.RepoListAll("cmii")
|
||||||
|
|
||||||
utils.BeautifulPrint(repoListAll)
|
utils.BeautifulPrint(repoListAll)
|
||||||
|
|
||||||
@@ -54,11 +55,43 @@ func TestHarborOperator_ArtifactListAll(t *testing.T) {
|
|||||||
artifactListAll := DefaultHarborOperator.ArtifactListAll("cmii", "cmii-uav-user")
|
artifactListAll := DefaultHarborOperator.ArtifactListAll("cmii", "cmii-uav-user")
|
||||||
|
|
||||||
for _, artifact := range artifactListAll {
|
for _, artifact := range artifactListAll {
|
||||||
|
//if len(artifact.Tags) == 0 {
|
||||||
|
// fmt.Println(artifact.Digest)
|
||||||
|
//}
|
||||||
for _, tag := range artifact.Tags {
|
for _, tag := range artifact.Tags {
|
||||||
fmt.Println(tag.Name)
|
fmt.Println(tag.Name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
utils.BeautifulPrint(artifactListAll)
|
//utils.BeautifulPrint(artifactListAll)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestHarborOperator_CmiiHarborCleanUp(t *testing.T) {
|
||||||
|
TestHarborOperator_BuildOperator(t)
|
||||||
|
|
||||||
|
//repoListAll := DefaultHarborOperator.RepoListAll("ran")
|
||||||
|
repoListAll := DefaultHarborOperator.RepoListAll("cmii")
|
||||||
|
|
||||||
|
for _, repo := range repoListAll {
|
||||||
|
repoName := strings.TrimPrefix(repo.Name, "cmii/")
|
||||||
|
artifactListAll := DefaultHarborOperator.ArtifactListAll("cmii", repoName)
|
||||||
|
|
||||||
|
for _, artifact := range artifactListAll {
|
||||||
|
//if len(artifact.Tags) == 0 {
|
||||||
|
// fmt.Println(artifact.Digest)
|
||||||
|
//}
|
||||||
|
for _, tag := range artifact.Tags {
|
||||||
|
if strings.Contains(tag.Name, "snapshot") || strings.Contains(tag.Name, "validation") || strings.Contains(tag.Name, "beta") || strings.Contains(tag.Name, "staging") || strings.Contains(tag.Name, "test") {
|
||||||
|
fmt.Println(tag.Name)
|
||||||
|
fmt.Println(artifact.Digest)
|
||||||
|
fmt.Println()
|
||||||
|
DefaultHarborOperator.ArtifactDeleteOne("cmii", repoName, artifact.Digest)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//utils.BeautifulPrint(artifactListAll)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -91,6 +91,17 @@
|
|||||||
2024-07-01-18-12-13 uavcloud-demo cmii-uav-platform 5.6.0-0626 5.6.0-070101
|
2024-07-01-18-12-13 uavcloud-demo cmii-uav-platform 5.6.0-0626 5.6.0-070101
|
||||||
2024-07-01-18-19-57 uavcloud-demo cmii-uav-platform 5.6.0-070101 5.6.0-0626
|
2024-07-01-18-19-57 uavcloud-demo cmii-uav-platform 5.6.0-070101 5.6.0-0626
|
||||||
2024-07-03-11-37-00 uavcloud-demo cmii-uav-industrial-portfolio 5.6.0-sense-070103 5.6.0-070301
|
2024-07-03-11-37-00 uavcloud-demo cmii-uav-industrial-portfolio 5.6.0-sense-070103 5.6.0-070301
|
||||||
|
2024-07-11-11-33-03 uavcloud-demo cmii-uav-industrial-portfolio 5.6.0-sense-071001 5.6.0-071101
|
||||||
|
2024-07-11-11-38-04 uavcloud-demo cmii-uav-industrial-portfolio 5.6.0-071101 5.6.0-sense-071001
|
||||||
|
2024-07-11-11-39-40 uavcloud-demo cmii-uav-industrial-portfolio 5.6.0-sense-071001 5.6.0-071101
|
||||||
|
2024-07-11-11-44-41 uavcloud-demo cmii-uav-industrial-portfolio 5.6.0-071101 5.6.0-sense-071001
|
||||||
|
2024-07-11-14-08-00 uavcloud-demo cmii-uav-industrial-portfolio 5.6.0-sense-071001 5.6.0-071102
|
||||||
2024-07-04-17-35-00 uavcloud-demo cmii-uav-platform-share 5.6.0-0704 5.6.0-070401
|
2024-07-04-17-35-00 uavcloud-demo cmii-uav-platform-share 5.6.0-0704 5.6.0-070401
|
||||||
2024-07-04-17-35-06 uavcloud-demo cmii-uav-industrial-portfolio 5.6.0-070301 5.6.0-070401
|
2024-07-04-17-35-06 uavcloud-demo cmii-uav-industrial-portfolio 5.6.0-070301 5.6.0-070401
|
||||||
2024-07-04-17-36-38 uavcloud-demo cmii-uav-platform 5.6.0-070203 5.6.0-070401
|
2024-07-04-17-36-38 uavcloud-demo cmii-uav-platform 5.6.0-070203 5.6.0-070401
|
||||||
|
2024-07-11-16-14-00 uavcloud-demo cmii-uav-industrial-portfolio 5.6.0-071102 5.6.0-071103
|
||||||
|
2024-07-11-16-39-40 uavcloud-demo cmii-uav-industrial-portfolio 5.6.0-071103 5.6.0-071104
|
||||||
|
2024-07-11-17-08-31 uavcloud-demo cmii-uav-industrial-portfolio 5.6.0-071104 5.6.0-071105
|
||||||
|
2024-07-12-09-14-00 uavcloud-demo cmii-uav-industrial-portfolio 5.6.0-071106 5.6.0-071201
|
||||||
|
2024-07-12-11-40-00 uavcloud-demo cmii-uav-industrial-portfolio 5.6.0-071201 5.6.0-071202
|
||||||
|
2024-07-15-10-05-51 uavcloud-demo cmii-uav-industrial-portfolio 5.6.0-071206 5.6.0-071501
|
||||||
|
|||||||
Reference in New Issue
Block a user