Skip to content

Commit

Permalink
add for cloud native support
Browse files Browse the repository at this point in the history
  • Loading branch information
baisui1981 committed Mar 19, 2024
1 parent 19065ff commit 58a7b9b
Show file tree
Hide file tree
Showing 15 changed files with 234 additions and 84 deletions.
20 changes: 13 additions & 7 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 11 additions & 4 deletions src/base/base.manage-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import {SnapshotsetComponent} from "../common/snapshotset.component";
import {SchemaEditVisualizingModelComponent, SchemaXmlEditComponent} from "../corecfg/schema-xml-edit.component";
import {DataxAddComponent} from "./datax.add.component";
import {DataxWorkerComponent, PowerjobCptType} from "./datax.worker.component";
import {DataxWorkerDTO, ProcessMeta} from "../runtime/misc/RCDeployment";
import {Breadcrumb, DataxWorkerDTO, ProcessMeta} from "../runtime/misc/RCDeployment";
import {PluginManageComponent} from "./plugin.manage.component";
import {StepType} from "../common/steps.component";
import {ErrorListComponent} from "./error.list.component";
Expand Down Expand Up @@ -111,7 +111,7 @@ export const dataXWorkerCfg: { processMeta: ProcessMeta }
}
]
, step0InitDescriptorProcess: (cpt: DataxWorkerAddStep0Component, desc: Array<Descriptor>) => {
// console.log(desc);
// console.log(desc);
cpt.initPowerJobRelevantProperties(desc);
}
, step1HeteroGetter: (dto: DataxWorkerDTO) => {
Expand Down Expand Up @@ -169,7 +169,7 @@ const flinkClusterHeteroPkGetter: (dto: DataxWorkerDTO) => ItemPropVal = (dto: D
}
return null;
}

const FlinkSessionPageHeader = "添加Kubernetes Session执行器";
// @ts-ignore
export const flinkClusterCfg: { processMeta: ProcessMeta }
= {
Expand All @@ -179,6 +179,13 @@ export const flinkClusterCfg: { processMeta: ProcessMeta }
require: true,
extraParam: "dataxName_" + PowerjobCptType.FlinkCluster
},
breadcrumbGetter: (params) => {
let crumb: Breadcrumb = flinkSessionDetail.processMeta.breadcrumbGetter(params);
return {
breadcrumb: crumb.breadcrumb,
name: FlinkSessionPageHeader
}
},
successCreateNext: (step3: DataxWorkerAddStep3Component) => {
// DataxWorkerComponent.getJobWorkerMeta(this, null, step3.dto.processMeta)
// .then((dataXWorkerStatus) => {
Expand Down Expand Up @@ -211,7 +218,7 @@ export const flinkClusterCfg: { processMeta: ProcessMeta }
launchClusterMethod: "Launch_flink_cluster",
relaunchClusterMethod: "relaunch_flink_cluster",
targetName: flinkClusterCfgTargetName
, pageHeader: "Flink Kubernetes Session执行器"
, pageHeader: FlinkSessionPageHeader
// , createButtonLabel: "创建Flink Native Cluster执行器"
, notCreateTips: "还未创建Flink Kubernetes Session执行器,创建之后可以将Flink Job提交到Kubernetes Session集群,高效并行执行数据实时同步任务"
, stepsType: StepType.CreateFlinkCluster
Expand Down
10 changes: 5 additions & 5 deletions src/base/datax.worker.add.step0.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ import {NzDrawerService} from "ng-zorro-antd/drawer";
@Component({
template: `
<nz-spin [nzSpinning]="this.formDisabled" nzSize="large">
<nz-alert nzType="warning" nzMessage="告知" [nzDescription]="unableToUseK8SController"
nzShowIcon></nz-alert>
<ng-template #unableToUseK8SController>
因架构调整,基于K8S执行的分布式DataX任务执行器,和Flink任务执行器需要做新的调整,会将Zookeeper组建依赖去掉,会在<strong>4.0.0版本</strong>中重新与大家见面
</ng-template>
<!-- <nz-alert nzType="warning" nzMessage="告知" [nzDescription]="unableToUseK8SController"-->
<!-- nzShowIcon></nz-alert>-->
<!-- <ng-template #unableToUseK8SController>-->
<!-- 因架构调整,基于K8S执行的分布式DataX任务执行器,和Flink任务执行器需要做新的调整,会将Zookeeper组建依赖去掉,会在<strong>4.0.0版本</strong>中重新与大家见面-->
<!-- </ng-template>-->
<nz-empty style="height: 500px"
nzNotFoundImage="https://gw.alipayobjects.com/zos/antfincdn/ZHrcdLPrvN/empty.svg"
Expand Down
13 changes: 11 additions & 2 deletions src/base/datax.worker.running.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ export class DataxWorkerRunningComponent extends AppFormComponent implements Aft
//
// });

this.jsonPost('/coredefine/corenodemanage.ajax?action=datax_action&emethod=remove_datax_worker&targetName=' + this.dto.processMeta.targetName
this.jsonPost('/coredefine/corenodemanage.ajax?action=datax_action&emethod=remove_datax_worker&targetName=' + this.currentApp.name //this.dto.processMeta.targetName
, {})
.then((r) => {
// console.log("xxxxxxxx");
Expand Down Expand Up @@ -566,7 +566,7 @@ export class DataxWorkerRunningComponent extends AppFormComponent implements Aft
></nz-progress>
<ng-template #podProgress>
<span nz-icon *ngIf="progressStat === 'active'" [nzType]="'sync'" [nzSpin]="true"></span>
{{this.rcDeployment.pods.length}}/{{this.toPodNum.targetPodNum}} <br/>
{{this.rcDeployment.pods.length}}/{{this.toPodNum.targetPodNum}} <i class="union-pod">pod</i> <br/>
<button *ngIf="showErrorLogs" nz-button nzType="link" (click)="openError()">error</button>
</ng-template>
<nz-button-group *ngIf="this.rcDeployment.replicaScalable" style="margin-left: 5px">
Expand Down Expand Up @@ -650,6 +650,13 @@ export class DataxWorkerRunningComponent extends AppFormComponent implements Aft
</nz-page-header>
`
,
styles:[
`.union-pod {
font-size: 9px;
color: #5d5d5d;
}`
]
})
export class PodsListComponent extends BasicFormComponent implements AfterViewInit, OnInit {

Expand Down Expand Up @@ -799,6 +806,7 @@ export class PodsListComponent extends BasicFormComponent implements AfterViewIn
// console.log(data);
// this.collectionOptionList = data;
// this.isLoading = false;
this.formDisabled = true;
this._progressStat = 'active';
this.rcDeployment.rcScalaLog = undefined;
let evtSubject: EventSourceSubject = DataxWorkerAddStep3Component.createLaunchingEventSubject(
Expand Down Expand Up @@ -845,6 +853,7 @@ export class PodsListComponent extends BasicFormComponent implements AfterViewIn
case EventType.SSE_CLOSE:
if (this._progressStat === 'active') {
this._progressStat = 'success';
this.formDisabled = false;
}
case EventType.TASK_EXECUTE_STEPS:
break;
Expand Down
22 changes: 16 additions & 6 deletions src/base/error.detail.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,19 @@ import {Component, Input, OnInit} from '@angular/core';

import {NzModalService} from "ng-zorro-antd/modal";
import {BasicFormComponent, BasicSideBar} from "../common/basic.form.component";
import {TISService} from "../common/tis.service";
import {SystemError, TISService} from "../common/tis.service";
import {EditorConfiguration} from "codemirror";
import {NzDrawerRef} from "ng-zorro-antd/drawer";

// 查看操作日志
@Component({
template: `
<nz-alert class="tool-bar" *ngIf="showErrlistLink" nzType="info" [nzMessage]="msgTemplate"></nz-alert>
<ng-template #msgTemplate>
<a target="_blank" routerLink="/base/sys-errors"> <i nz-icon nzType="link" nzTheme="outline"></i> 异常列表</a>
</ng-template>
<tis-codemirror [ngModel]="content" [config]="codeMirrirOpts" [size]="{width:'100%',height:'100%'}"></tis-codemirror>
<nz-alert class="tool-bar" *ngIf="showErrlistLink" nzType="info" [nzMessage]="msgTemplate"></nz-alert>
<ng-template #msgTemplate>
<a target="_blank" routerLink="/base/sys-errors"> <i nz-icon nzType="link" nzTheme="outline"></i> 异常列表</a>
</ng-template>
<tis-codemirror [ngModel]="content" [config]="codeMirrirOpts"
[size]="{width:'100%',height:'100%'}"></tis-codemirror>
`
})
export class ErrorDetailComponent extends BasicFormComponent implements OnInit {
Expand All @@ -55,6 +56,15 @@ export class ErrorDetailComponent extends BasicFormComponent implements OnInit {
}

ngOnInit(): void {
// if (this.sysErrCode) {
// switch (this.sysErrCode) {
// case SystemError.FLINK_CLUSTER_LOSS_OF_CONTACT: {
//
// break;
// }
// default:
// }
// }

this.httpPost('/runtime/operation_detail.ajax'
, `action=operation_log_action&event_submit_do_get_error_detail=y&logfilename=${this.logFileName}`)
Expand Down
31 changes: 16 additions & 15 deletions src/base/error.list.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,22 @@ import {NzDrawerService} from "ng-zorro-antd/drawer";
@Component({
template: `
<tis-page-header title="系统异常" [showBreadcrumb]="showBreadcrumb">
</tis-page-header>
<tis-page [spinning]="formDisabled" [pager]="pager" [rows]="logs" (go-page)="goPage($event)">
<tis-col title="异常摘要" width="30">
<ng-template let-l='r'>{{l.abstractInfo}}</ng-template>
</tis-col>
<tis-col title="创建时间">
<ng-template let-l='r'>{{l.createTime | date : "yyyy/MM/dd HH:mm:ss"}}</ng-template>
</tis-col>
<tis-col title="操作">
<ng-template let-l='r'>
<button nz-button [nzType]="'link'" (click)="sysErrorDetail(l.logFileName)"><i nz-icon nzType="eye" nzTheme="outline"></i></button>
</ng-template>
</tis-col>
</tis-page>
<tis-page-header title="系统异常" [showBreadcrumb]="showBreadcrumb">
</tis-page-header>
<tis-page [spinning]="formDisabled" [pager]="pager" [rows]="logs" (go-page)="goPage($event)">
<tis-col title="异常摘要" width="30">
<ng-template let-l='r'>{{l.abstractInfo}}</ng-template>
</tis-col>
<tis-col title="创建时间">
<ng-template let-l='r'>{{l.createTime | date : "yyyy/MM/dd HH:mm:ss"}}</ng-template>
</tis-col>
<tis-col title="操作">
<ng-template let-l='r'>
<button nz-button [nzType]="'link'" (click)="sysErrorDetail(l.logFileName)"><i nz-icon nzType="eye"
nzTheme="outline"></i></button>
</ng-template>
</tis-col>
</tis-page>
`
})
export class ErrorListComponent extends BasicFormComponent implements OnInit {
Expand Down
14 changes: 8 additions & 6 deletions src/base/flink.cluster.list.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ import {DataXJobWorkerStatus} from "../runtime/misc/RCDeployment";
<tis-page [spinning]="formDisabled" [pager]="pager" [rows]="clusters" (go-page)="goPage($event)">
<tis-col title="名称" width="20">
<ng-template let-l='r'>
<dl id="cluster-desc">
<dl class="cluster-desc">
<dt>ClusterId</dt>
<dd> <a [routerLink]="'/base/flink-session-detail/'+l.clusterId">{{l.clusterId}}</a></dd>
<dt>Namespace</dt>
<dd>{{l.k8sNamespace}}</dd>
<dt>BasePath</dt>
<dd>{{l.k8sBasePath}}</dd>
<dt>管道</dt>
<dd> <a><span nz-icon nzType="link" nzTheme="outline"></span>{{l.dataXName}}</a></dd>
<!-- <dt>管道</dt>-->
<!-- <dd> <a><span nz-icon nzType="link" nzTheme="outline"></span>{{l.dataXName}}</a></dd>-->
</dl>
</ng-template>
Expand All @@ -69,11 +69,13 @@ import {DataXJobWorkerStatus} from "../runtime/misc/RCDeployment";
</tis-page>
`,
styles:[
`#cluster-desc dt{
`.cluster-desc dt {
float: left;
color: #1f8ffb;
font-weight: bold;
color: #676767;
}
#cluster-desc dd{
.cluster-desc dd {
margin: 0 0 0 80px;
}
`
Expand Down
2 changes: 1 addition & 1 deletion src/common/init.system.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export class InitSystemComponent extends BasicFormComponent implements OnInit {
this._percent += 2;
}, 500);
let url = '/runtime/applist.ajax?action=sys_initialize_action&emethod=init';
this.httpPost(url, '').then((r) => {
this.httpPost(url, 'disableTransaction=true').then((r) => {
clearInterval(timer);
if (r.success) {
this.activeModal.close(r);
Expand Down
2 changes: 1 addition & 1 deletion src/common/launch.waitting.process.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export function openWaittingProcessComponent(drawerService: NzDrawerService, sub
</div>
<div nz-col nzSpan="16" class="process-height">
<ng-terminal #term></ng-terminal>
<ng-terminal #term></ng-terminal>
</div>
</div>
Expand Down
5 changes: 4 additions & 1 deletion src/common/plugins.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -874,9 +874,12 @@ export class NotebookwrapperComponent implements OnInit {
</nz-select>
</ng-container>
<ng-container *ngSwitchCase="6">
<!--select-->
<nz-select [disabled]="disabled" [(ngModel)]="_pp.primary" [name]="_pp.key"
(ngModelChange)="inputValChange(_pp,$event)" nzAllowClear>
<nz-option *ngFor="let e of _pp.options" [nzLabel]="e.name" [nzValue]="e.name"></nz-option>
<nz-option nzCustomContent *ngFor="let e of _pp.options" [nzLabel]="e.name" [nzValue]="e.name">
<span *ngIf="e.endType" nzTheme="fill" nz-icon nz [nzType]="e.endType"></span> {{e.name}}
</nz-option>
</nz-select>
</ng-container>
<ng-container *ngSwitchCase="7">
Expand Down
2 changes: 2 additions & 0 deletions src/common/tis.plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -926,6 +926,8 @@ export interface IFieldError {
export class ValOption {
public impl: string;
public name: string;
// 端类型,mysql,docker,sqlserver
public endType:string;
}

export interface OptionEnum {
Expand Down
Loading

0 comments on commit 58a7b9b

Please sign in to comment.