Skip to content

Commit 9e734fb

Browse files
owlet42qijianshuaiinsMilo
authored
FedLCM supports upgrading clusters (#30)
* FedLCM supports upgrading fate clusters (#11) * FedLCM supports upgrading the FATE cluster server to upgrade the detection part Signed-off-by: Chenlong Ma <chenlongm@vmware.com> * Add upgrade API Signed-off-by: Chenlong Ma <chenlongm@vmware.com> * Fix swag install Signed-off-by: Chenlong Ma <chenlongm@vmware.com> * swag fmt Signed-off-by: Chenlong Ma <chenlongm@vmware.com> * Add FATE upgrade API Signed-off-by: Chenlong Ma <chenlongm@vmware.com> * fix bug 'The upgraded FATE cannot run the job normally' Signed-off-by: Chenlong Ma <chenlongm@vmware.com> * add version Signed-off-by: Chenlong Ma <chenlongm@vmware.com> * FedLCM supports cross-version upgrade of FATE Signed-off-by: Chenlong Ma <chenlongm@vmware.com> * update swagger Signed-off-by: Chenlong Ma <chenlongm@vmware.com> * fix go test Signed-off-by: Chenlong Ma <chenlongm@vmware.com> --------- Signed-off-by: Chenlong Ma <chenlongm@vmware.com> * The front end supports the upgrade of exchange and cluster (#29) * Implement exchange and cluster version upgrades (#21) * Portal adds exchange and cluster upgrade functions Signed-off-by: qijianshuai <qjianshuai@vmware.com> * The cluster exchange interface displays the version Signed-off-by: qijianshuai <qjianshuai@vmware.com> * version text modify Signed-off-by: qijianshuai <qjianshuai@vmware.com> * Fix bugs in ui during cluster and exchange upgrade Signed-off-by: qijianshuai <qjianshuai@vmware.com> --------- Signed-off-by: qijianshuai <qjianshuai@vmware.com> Co-authored-by: qijianshuai <qjianshuai@vmware.com> Signed-off-by: qijianshuai <qjianshuai@vmware.com> * Protal adds a prompt that the version of the cluster is inconsistent with that of the exchange (#24) Signed-off-by: qijianshuai <qjianshuai@vmware.com> Co-authored-by: qijianshuai <qjianshuai@vmware.com> Signed-off-by: qijianshuai <qjianshuai@vmware.com> * portal fixed Signed-off-by: qijianshuai <qjianshuai@vmware.com> --------- Signed-off-by: qijianshuai <qjianshuai@vmware.com> Co-authored-by: qijianshuai <qjianshuai@vmware.com> Signed-off-by: qijianshuai <67683493+qijianshuai@users.noreply.github.com> * Refresh the portal fed and open detail pages, the content of Exposed Services appears repeatedly (#33) Signed-off-by: qijianshuai <qjianshuai@vmware.com> --------- Signed-off-by: Chenlong Ma <chenlongm@vmware.com> Signed-off-by: qijianshuai <67683493+qijianshuai@users.noreply.github.com> Signed-off-by: qijianshuai <qjianshuai@vmware.com> Co-authored-by: qijianshuai <67683493+qijianshuai@users.noreply.github.com> Co-authored-by: qjianshuai <1096324583@qq.com>
1 parent 9f1b556 commit 9e734fb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+3485
-2098
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ ifeq (, $(shell which swag))
7878
SWAG_BIN_TMP_DIR=$$(mktemp -d) ;\
7979
cd $$SWAG_BIN_TMP_DIR ;\
8080
go mod init tmp ;\
81-
go get -u github.com/swaggo/swag/cmd/swag ;\
81+
go install github.com/swaggo/swag/cmd/swag@v1.8.7 ;\
8282
rm -rf $$SWAG_BIN_TMP_DIR ;\
8383
}
8484
SWAG_BIN=$(GOBIN)/swag

fml-manager/server/api/job.go

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,14 @@ func (controller *JobController) Route(r *gin.RouterGroup) {
6161
}
6262

6363
// handleJobCreation process a job creation request
64-
// @Summary Process job creation
65-
// @Tags Job
66-
// @Produce json
67-
// @Param project body service.JobRemoteJobCreationRequest true "job creation request"
68-
// @Success 200 {object} GeneralResponse{} "Success"
69-
// @Failure 401 {object} GeneralResponse "Unauthorized operation"
70-
// @Failure 500 {object} GeneralResponse{code=int} "Internal server error"
71-
// @Router /job/create [post]
64+
// @Summary Process job creation
65+
// @Tags Job
66+
// @Produce json
67+
// @Param project body service.JobRemoteJobCreationRequest true "job creation request"
68+
// @Success 200 {object} GeneralResponse{} "Success"
69+
// @Failure 401 {object} GeneralResponse "Unauthorized operation"
70+
// @Failure 500 {object} GeneralResponse{code=int} "Internal server error"
71+
// @Router /job/create [post]
7272
func (controller *JobController) handleJobCreation(c *gin.Context) {
7373
if err := func() error {
7474
creationRequest := &service.JobRemoteJobCreationRequest{}
@@ -91,15 +91,15 @@ func (controller *JobController) handleJobCreation(c *gin.Context) {
9191
}
9292

9393
// handleJobResponse process a job approval response
94-
// @Summary Process job response
95-
// @Tags Job
96-
// @Produce json
97-
// @Param uuid path string true "Job UUID"
98-
// @Param project body service.JobApprovalContext true "job approval response"
99-
// @Success 200 {object} GeneralResponse{} "Success"
100-
// @Failure 401 {object} GeneralResponse "Unauthorized operation"
101-
// @Failure 500 {object} GeneralResponse{code=int} "Internal server error"
102-
// @Router /job/{uuid}/response [post]
94+
// @Summary Process job response
95+
// @Tags Job
96+
// @Produce json
97+
// @Param uuid path string true "Job UUID"
98+
// @Param project body service.JobApprovalContext true "job approval response"
99+
// @Success 200 {object} GeneralResponse{} "Success"
100+
// @Failure 401 {object} GeneralResponse "Unauthorized operation"
101+
// @Failure 500 {object} GeneralResponse{code=int} "Internal server error"
102+
// @Router /job/{uuid}/response [post]
103103
func (controller *JobController) handleJobResponse(c *gin.Context) {
104104
if err := func() error {
105105
jobUUID := c.Param("uuid")
@@ -123,15 +123,15 @@ func (controller *JobController) handleJobResponse(c *gin.Context) {
123123
}
124124

125125
// handleJobStatusUpdate process a job status update request
126-
// @Summary Process job status update
127-
// @Tags Job
128-
// @Produce json
129-
// @Param uuid path string true "Job UUID"
130-
// @Param project body service.JobStatusUpdateContext true "job status"
131-
// @Success 200 {object} GeneralResponse{} "Success"
132-
// @Failure 401 {object} GeneralResponse "Unauthorized operation"
133-
// @Failure 500 {object} GeneralResponse{code=int} "Internal server error"
134-
// @Router /job/{uuid}/status [post]
126+
// @Summary Process job status update
127+
// @Tags Job
128+
// @Produce json
129+
// @Param uuid path string true "Job UUID"
130+
// @Param project body service.JobStatusUpdateContext true "job status"
131+
// @Success 200 {object} GeneralResponse{} "Success"
132+
// @Failure 401 {object} GeneralResponse "Unauthorized operation"
133+
// @Failure 500 {object} GeneralResponse{code=int} "Internal server error"
134+
// @Router /job/{uuid}/status [post]
135135
func (controller *JobController) handleJobStatusUpdate(c *gin.Context) {
136136
if err := func() error {
137137
jobUUID := c.Param("uuid")

fml-manager/server/api/project.go

Lines changed: 116 additions & 116 deletions
Large diffs are not rendered by default.

fml-manager/server/api/site.go

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ func (controller *SiteController) Route(r *gin.RouterGroup) {
5353
}
5454

5555
// getSite returns the sites list
56-
// @Summary Return sites list
57-
// @Tags Site
58-
// @Produce json
59-
// @Success 200 {object} GeneralResponse{data=[]entity.Site} "Success"
60-
// @Failure 500 {object} GeneralResponse{code=int} "Internal server error"
61-
// @Router /site [get]
56+
// @Summary Return sites list
57+
// @Tags Site
58+
// @Produce json
59+
// @Success 200 {object} GeneralResponse{data=[]entity.Site} "Success"
60+
// @Failure 500 {object} GeneralResponse{code=int} "Internal server error"
61+
// @Router /site [get]
6262
func (controller *SiteController) getSite(c *gin.Context) {
6363
siteList, err := controller.siteAppService.GetSiteList()
6464
if err != nil {
@@ -79,13 +79,13 @@ func (controller *SiteController) getSite(c *gin.Context) {
7979
}
8080

8181
// postSite creates or updates site information
82-
// @Summary Create or update site info
83-
// @Tags Site
84-
// @Produce json
85-
// @Param site body entity.Site true "The site information"
86-
// @Success 200 {object} GeneralResponse "Success"
87-
// @Failure 500 {object} GeneralResponse{code=int} "Internal server error"
88-
// @Router /site [post]
82+
// @Summary Create or update site info
83+
// @Tags Site
84+
// @Produce json
85+
// @Param site body entity.Site true "The site information"
86+
// @Success 200 {object} GeneralResponse "Success"
87+
// @Failure 500 {object} GeneralResponse{code=int} "Internal server error"
88+
// @Router /site [post]
8989
func (controller *SiteController) postSite(c *gin.Context) {
9090
if err := func() error {
9191
updatedSiteInfo := &entity.Site{}
@@ -108,13 +108,13 @@ func (controller *SiteController) postSite(c *gin.Context) {
108108
}
109109

110110
// deleteSite removes a site
111-
// @Summary Remove a site, all related projects will be impacted
112-
// @Tags Site
113-
// @Produce json
114-
// @Param uuid path string true "The site UUID"
115-
// @Success 200 {object} GeneralResponse "Success"
116-
// @Failure 500 {object} GeneralResponse{code=int} "Internal server error"
117-
// @Router /site/{uuid} [delete]
111+
// @Summary Remove a site, all related projects will be impacted
112+
// @Tags Site
113+
// @Produce json
114+
// @Param uuid path string true "The site UUID"
115+
// @Success 200 {object} GeneralResponse "Success"
116+
// @Failure 500 {object} GeneralResponse{code=int} "Internal server error"
117+
// @Router /site/{uuid} [delete]
118118
func (controller *SiteController) deleteSite(c *gin.Context) {
119119
if err := func() error {
120120
siteUUID := c.Param("uuid")

fml-manager/server/main.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ import (
4343
)
4444

4545
// main starts the API server
46-
// @title fml manager API service
47-
// @version v1
48-
// @description backend APIs of fml manager service
49-
// @termsOfService http://swagger.io/terms/
50-
// @contact.name FedLCM team
51-
// @BasePath /api/v1
52-
// @in header
46+
// @title fml manager API service
47+
// @version v1
48+
// @description backend APIs of fml manager service
49+
// @termsOfService http://swagger.io/terms/
50+
// @contact.name FedLCM team
51+
// @BasePath /api/v1
52+
// @in header
5353
func main() {
5454
viper.AutomaticEnv()
5555
replacer := strings.NewReplacer(".", "_")

frontend/src/app/app-routing.module.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import { TimeOutServiceComponent } from './components/time-out-service/time-out-
3434
import { DirectorNewComponent } from './view/openfl/director-new/director-new.component'
3535
import { DirectorDetailComponent } from './view/openfl/director-detail/director-detail.component'
3636
import { EnvoyDetailComponent } from './view/openfl/envoy-detail/envoy-detail.component';
37+
import { ExchangeClusterUpgradeComponent } from './view/federation/exchange-cluster-upgrade/exchange-cluster-upgrade.component';
3738
import { AuthService } from './services/common/auth.service';
3839
import { RouterGuard } from './router-guard';
3940

@@ -171,6 +172,14 @@ const routes: Routes = [
171172

172173
component: ClusterDetailComponent
173174
},
175+
{
176+
path: 'federation/fate/:id/detail/:uuid/:version/:name/upgrade',
177+
data: {
178+
preload: true
179+
},
180+
181+
component: ExchangeClusterUpgradeComponent
182+
},
174183
{
175184
path: 'federation/openfl/:id/envoy/detail/:envoy_uuid',
176185
data: {

frontend/src/app/app.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
// limitations under the License.
1111

1212
import { Component } from '@angular/core';
13-
import { addTextIcon, ClarityIcons, userIcon, vmBugIcon, alignBottomIcon, barsIcon, certificateIcon, cogIcon, nodeGroupIcon, organizationIcon, usersIcon, hostGroupIcon, trashIcon, checkCircleIcon, angleIcon, plusCircleIcon, clusterIcon, routerIcon, cloudTrafficIcon, nvmeIcon, refreshIcon, worldIcon, detailsIcon, popOutIcon, timesCircleIcon, searchIcon, recycleIcon, nodesIcon, infoCircleIcon } from '@cds/core/icon';
13+
import { addTextIcon, ClarityIcons, userIcon, vmBugIcon, alignBottomIcon, barsIcon, certificateIcon, cogIcon, nodeGroupIcon, organizationIcon, usersIcon, hostGroupIcon, trashIcon, checkCircleIcon, angleIcon, plusCircleIcon, clusterIcon, routerIcon, cloudTrafficIcon, nvmeIcon, refreshIcon, worldIcon, detailsIcon, popOutIcon, timesCircleIcon, searchIcon, recycleIcon, nodesIcon, infoCircleIcon, uploadIcon, warningStandardIcon} from '@cds/core/icon';
1414
import { thinClientIcon } from '@cds/core/icon/shapes/thin-client';
1515
import { updateIcon } from '@cds/core/icon/shapes/update';
16-
ClarityIcons.addIcons(addTextIcon, vmBugIcon, userIcon, alignBottomIcon, cogIcon, certificateIcon, organizationIcon, barsIcon, nodeGroupIcon, usersIcon, hostGroupIcon, trashIcon, checkCircleIcon, angleIcon, plusCircleIcon, clusterIcon, routerIcon, cloudTrafficIcon, nvmeIcon, updateIcon, refreshIcon, worldIcon, detailsIcon, popOutIcon, timesCircleIcon, searchIcon, recycleIcon, nodesIcon, thinClientIcon,infoCircleIcon);
16+
ClarityIcons.addIcons(addTextIcon, vmBugIcon, userIcon, alignBottomIcon, cogIcon, certificateIcon, organizationIcon, barsIcon, nodeGroupIcon, usersIcon, hostGroupIcon, trashIcon, checkCircleIcon, angleIcon, plusCircleIcon, clusterIcon, routerIcon, cloudTrafficIcon, nvmeIcon, updateIcon, refreshIcon, worldIcon, detailsIcon, popOutIcon, timesCircleIcon, searchIcon, recycleIcon, nodesIcon, thinClientIcon,infoCircleIcon, uploadIcon, warningStandardIcon);
1717

1818
@Component({
1919
selector: 'app-root',

frontend/src/app/app.module.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ import { TimeOutServiceComponent } from './components/time-out-service/time-out-
5353
import { FilterComponent } from './components/filter/filter.component';
5454
import { EnvoyDetailComponent } from './view/openfl/envoy-detail/envoy-detail.component';
5555
import { CreateOpenflComponent } from './view/openfl/create-openfl-fed/create-openfl-fed.component';
56+
import { ExchangeClusterUpgradeComponent } from './view/federation/exchange-cluster-upgrade/exchange-cluster-upgrade.component';
5657

5758
@NgModule({
5859
declarations: [
@@ -85,7 +86,8 @@ import { CreateOpenflComponent } from './view/openfl/create-openfl-fed/create-op
8586
DirectorDetailComponent,
8687
FilterComponent,
8788
EnvoyDetailComponent,
88-
CreateOpenflComponent
89+
CreateOpenflComponent,
90+
ExchangeClusterUpgradeComponent
8991
],
9092
imports: [
9193
BrowserModule,

frontend/src/app/services/federation-fate/fed.service.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,4 +103,12 @@ export class FedService {
103103
createExternalCluster(fed_uuid:string, externalCluster:any): Observable<any> {
104104
return this.http.post('/federation/fate/'+ fed_uuid +'/cluster/external', externalCluster);
105105
}
106+
107+
getExchangeClusterUpgradeVersionList(fed_uuid:string, upgrade_uuid: string, type: 'cluster' | 'exchange') {
108+
return this.http.get<any>(`/federation/fate/${fed_uuid}/${type}/${upgrade_uuid}/upgrade`)
109+
}
110+
111+
upgradeExchangeCluster(fed_uuid:string, upgrade_uuid: string, type: 'cluster' | 'exchange', data: {upgradeVersion: string}) {
112+
return this.http.post(`/federation/fate/${fed_uuid}/${type}/${upgrade_uuid}/upgrade?upgradeVersion=${data.upgradeVersion}`, {});
113+
}
106114
}

frontend/src/app/view/federation/cluster-detail/cluster-detail.component.html

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div class="content-area" [ngClass]="{'hide': isShowDetailFailed && isPageLoading}">
2-
<a href="javascript:history.back()">&lt;&lt;{{'CommonlyUse.back'|translate}}</a>
2+
<a href="javascript:;" (click)="back()">&lt;&lt;{{'CommonlyUse.back'|translate}}</a>
33
<h2>{{'ClusterDetail.detail'|translate}}</h2>
44
<div *ngIf="isShowDetailFailed" class="alert alert-danger" role="alert">
55
<div class="alert-items">
@@ -30,6 +30,9 @@ <h2>{{'ClusterDetail.detail'|translate}}</h2>
3030
<button class="btn" (click)="openDeleteConfrimModal()">
3131
<cds-icon shape="trash"></cds-icon> {{'CommonlyUse.delete'|translate}}
3232
</button>
33+
<button *ngIf="clusterDetail.upgradeable" class="btn" (click)="toUpgrade(clusterDetail, 'Cluster')">
34+
<cds-icon shape="upload"></cds-icon> {{'CommonlyUse.upgrade'|translate}}
35+
</button>
3336
</div>
3437
<div class="card card1">
3538
<ul class="list">
@@ -53,13 +56,17 @@ <h2>{{'ClusterDetail.detail'|translate}}</h2>
5356
<span><b>{{'NewCluster.namespace'|translate}}:</b></span>
5457
<span>{{clusterDetail.namespace}}</span>
5558
</li>
59+
<li>
60+
<span><b>{{'CommonlyUse.version'|translate}}:</b></span>
61+
<span>{{clusterDetail.version}}</span>
62+
</li>
5663
<li>
5764
<span><b>{{'ClusterDetail.partyId'|translate}}:</b></span>
5865
<span>{{clusterDetail.party_id}}</span>
5966
</li>
6067
<li>
6168
<span><b>{{'CommonlyUse.status'|translate}}:</b></span>
62-
<span class="label statusLabel" [class.label-info]="clusterDetail.status===2"
69+
<span class="label statusLabel" [class.label-info]="clusterDetail.status===2 || clusterDetail?.status===6"
6370
[class.label-success]="clusterDetail.status===1" [class.label-danger]="clusterDetail.status===5"
6471
[class.label-warning]="clusterDetail.status===3||clusterDetail.status===4">{{constantGather('participantFATEstatus',
6572
clusterDetail.status).name | translate}}</span>

0 commit comments

Comments
 (0)