Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dinky
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangpeng
dinky
Commits
79107117
Unverified
Commit
79107117
authored
Jan 24, 2024
by
ZackYoung
Committed by
GitHub
Jan 24, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Feature] [Resource] Add resource hdfs ha (#3056)
parent
1400d08e
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
76 additions
and
27 deletions
+76
-27
SystemInit.java
dinky-admin/src/main/java/org/dinky/init/SystemInit.java
+2
-0
BaseResourceManager.java
.../java/org/dinky/service/resource/BaseResourceManager.java
+13
-1
BaseResourceManager.java
...main/java/org/dinky/app/resource/BaseResourceManager.java
+13
-1
Status.java
dinky-common/src/main/java/org/dinky/data/enums/Status.java
+6
-0
SystemConfiguration.java
...c/main/java/org/dinky/data/model/SystemConfiguration.java
+8
-0
messages_en_US.properties
...-common/src/main/resources/i18n/messages_en_US.properties
+4
-0
messages_zh_CN.properties
...-common/src/main/resources/i18n/messages_zh_CN.properties
+0
-0
index.tsx
dinky-web/src/pages/DevOps/JobDetail/index.tsx
+30
-25
No files found.
dinky-admin/src/main/java/org/dinky/init/SystemInit.java
View file @
79107117
...
@@ -124,6 +124,8 @@ public class SystemInit implements ApplicationRunner {
...
@@ -124,6 +124,8 @@ public class SystemInit implements ApplicationRunner {
systemConfiguration
.
getResourcesOssEndpoint
(),
systemConfiguration
.
getResourcesOssEndpoint
(),
systemConfiguration
.
getResourcesHdfsUser
(),
systemConfiguration
.
getResourcesHdfsUser
(),
systemConfiguration
.
getResourcesHdfsDefaultFS
(),
systemConfiguration
.
getResourcesHdfsDefaultFS
(),
systemConfiguration
.
getResourcesHdfsCoreSite
(),
systemConfiguration
.
getResourcesHdfsHdfsSite
(),
systemConfiguration
.
getResourcesOssAccessKey
(),
systemConfiguration
.
getResourcesOssAccessKey
(),
systemConfiguration
.
getResourcesOssRegion
(),
systemConfiguration
.
getResourcesOssRegion
(),
systemConfiguration
.
getResourcesPathStyleAccess
())
systemConfiguration
.
getResourcesPathStyleAccess
())
...
...
dinky-admin/src/main/java/org/dinky/service/resource/BaseResourceManager.java
View file @
79107117
...
@@ -31,11 +31,15 @@ import org.apache.hadoop.fs.FileSystem;
...
@@ -31,11 +31,15 @@ import org.apache.hadoop.fs.FileSystem;
import
java.io.File
;
import
java.io.File
;
import
java.io.InputStream
;
import
java.io.InputStream
;
import
java.nio.charset.Charset
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartFile
;
import
cn.hutool.core.io.FileUtil
;
import
cn.hutool.core.io.FileUtil
;
import
cn.hutool.core.io.IoUtil
;
import
cn.hutool.core.lang.Opt
;
import
cn.hutool.core.lang.Singleton
;
import
cn.hutool.core.lang.Singleton
;
import
cn.hutool.core.util.StrUtil
;
public
interface
BaseResourceManager
{
public
interface
BaseResourceManager
{
SystemConfiguration
instances
=
SystemConfiguration
.
getInstances
();
SystemConfiguration
instances
=
SystemConfiguration
.
getInstances
();
...
@@ -75,8 +79,16 @@ public interface BaseResourceManager {
...
@@ -75,8 +79,16 @@ public interface BaseResourceManager {
break
;
break
;
case
HDFS:
case
HDFS:
final
Configuration
configuration
=
new
Configuration
();
final
Configuration
configuration
=
new
Configuration
();
Charset
charset
=
Charset
.
defaultCharset
();
String
coreSite
=
instances
.
getResourcesHdfsCoreSite
().
getValue
();
Opt
.
ofBlankAble
(
coreSite
).
ifPresent
(
x
->
configuration
.
addResource
(
IoUtil
.
toStream
(
x
,
charset
),
true
));
String
hdfsSite
=
instances
.
getResourcesHdfsHdfsSite
().
getValue
();
Opt
.
ofBlankAble
(
hdfsSite
).
ifPresent
(
x
->
configuration
.
addResource
(
IoUtil
.
toStream
(
x
,
charset
),
true
));
if
(
StrUtil
.
isEmpty
(
coreSite
))
{
configuration
.
set
(
configuration
.
set
(
"fs.defaultFS"
,
instances
.
getResourcesHdfsDefaultFS
().
getValue
());
"fs.defaultFS"
,
instances
.
getResourcesHdfsDefaultFS
().
getValue
());
}
try
{
try
{
FileSystem
fileSystem
=
FileSystem
.
get
(
FileSystem
fileSystem
=
FileSystem
.
get
(
FileSystem
.
getDefaultUri
(
configuration
),
FileSystem
.
getDefaultUri
(
configuration
),
...
...
dinky-app/dinky-app-base/src/main/java/org/dinky/app/resource/BaseResourceManager.java
View file @
79107117
...
@@ -30,9 +30,13 @@ import org.apache.hadoop.conf.Configuration;
...
@@ -30,9 +30,13 @@ import org.apache.hadoop.conf.Configuration;
import
org.apache.hadoop.fs.FileSystem
;
import
org.apache.hadoop.fs.FileSystem
;
import
java.io.InputStream
;
import
java.io.InputStream
;
import
java.nio.charset.Charset
;
import
cn.hutool.core.io.FileUtil
;
import
cn.hutool.core.io.FileUtil
;
import
cn.hutool.core.io.IoUtil
;
import
cn.hutool.core.lang.Opt
;
import
cn.hutool.core.lang.Singleton
;
import
cn.hutool.core.lang.Singleton
;
import
cn.hutool.core.util.StrUtil
;
public
interface
BaseResourceManager
{
public
interface
BaseResourceManager
{
SystemConfiguration
instances
=
SystemConfiguration
.
getInstances
();
SystemConfiguration
instances
=
SystemConfiguration
.
getInstances
();
...
@@ -62,8 +66,16 @@ public interface BaseResourceManager {
...
@@ -62,8 +66,16 @@ public interface BaseResourceManager {
break
;
break
;
case
HDFS:
case
HDFS:
final
Configuration
configuration
=
new
Configuration
();
final
Configuration
configuration
=
new
Configuration
();
Charset
charset
=
Charset
.
defaultCharset
();
String
coreSite
=
instances
.
getResourcesHdfsCoreSite
().
getValue
();
Opt
.
ofBlankAble
(
coreSite
).
ifPresent
(
x
->
configuration
.
addResource
(
IoUtil
.
toStream
(
x
,
charset
),
true
));
String
hdfsSite
=
instances
.
getResourcesHdfsHdfsSite
().
getValue
();
Opt
.
ofBlankAble
(
hdfsSite
).
ifPresent
(
x
->
configuration
.
addResource
(
IoUtil
.
toStream
(
x
,
charset
),
true
));
if
(
StrUtil
.
isEmpty
(
coreSite
))
{
configuration
.
set
(
configuration
.
set
(
"fs.defaultFS"
,
instances
.
getResourcesHdfsDefaultFS
().
getValue
());
"fs.defaultFS"
,
instances
.
getResourcesHdfsDefaultFS
().
getValue
());
}
try
{
try
{
FileSystem
fileSystem
=
FileSystem
.
get
(
FileSystem
fileSystem
=
FileSystem
.
get
(
FileSystem
.
getDefaultUri
(
configuration
),
FileSystem
.
getDefaultUri
(
configuration
),
...
...
dinky-common/src/main/java/org/dinky/data/enums/Status.java
View file @
79107117
...
@@ -402,6 +402,12 @@ public enum Status {
...
@@ -402,6 +402,12 @@ public enum Status {
SYS_RESOURCE_SETTINGS_HDFS_ROOT_USER_NOTE
(
173
,
"sys.resource.settings.hdfs.root.user.note"
),
SYS_RESOURCE_SETTINGS_HDFS_ROOT_USER_NOTE
(
173
,
"sys.resource.settings.hdfs.root.user.note"
),
SYS_RESOURCE_SETTINGS_HDFS_FS_DEFAULTFS
(
174
,
"sys.resource.settings.hdfs.fs.defaultFS"
),
SYS_RESOURCE_SETTINGS_HDFS_FS_DEFAULTFS
(
174
,
"sys.resource.settings.hdfs.fs.defaultFS"
),
SYS_RESOURCE_SETTINGS_HDFS_FS_DEFAULTFS_NOTE
(
175
,
"sys.resource.settings.hdfs.fs.defaultFS.note"
),
SYS_RESOURCE_SETTINGS_HDFS_FS_DEFAULTFS_NOTE
(
175
,
"sys.resource.settings.hdfs.fs.defaultFS.note"
),
SYS_RESOURCE_SETTINGS_HDFS_CORE_SITE
(
178
,
"sys.resource.settings.hdfs.core.site"
),
SYS_RESOURCE_SETTINGS_HDFS_CORE_SITE_NOTE
(
179
,
"sys.resource.settings.hdfs.core.site.note"
),
SYS_RESOURCE_SETTINGS_HDFS_HDFS_SITE
(
380
,
"sys.resource.settings.hdfs.hdfs.site"
),
SYS_RESOURCE_SETTINGS_HDFS_HDFS_SITE_NOTE
(
381
,
"sys.resource.settings.hdfs.hdfs.site.note"
),
SYS_RESOURCE_SETTINGS_PATH_STYLE_ACCESS
(
176
,
"sys.resource.settings.oss.path.style.access"
),
SYS_RESOURCE_SETTINGS_PATH_STYLE_ACCESS
(
176
,
"sys.resource.settings.oss.path.style.access"
),
SYS_RESOURCE_SETTINGS_PATH_STYLE_ACCESS_NOTE
(
177
,
"sys.resource.settings.oss.path.style.access.note"
),
SYS_RESOURCE_SETTINGS_PATH_STYLE_ACCESS_NOTE
(
177
,
"sys.resource.settings.oss.path.style.access.note"
),
...
...
dinky-common/src/main/java/org/dinky/data/model/SystemConfiguration.java
View file @
79107117
...
@@ -265,6 +265,14 @@ public class SystemConfiguration {
...
@@ -265,6 +265,14 @@ public class SystemConfiguration {
.
stringType
()
.
stringType
()
.
defaultValue
(
"file:///"
)
.
defaultValue
(
"file:///"
)
.
note
(
Status
.
SYS_RESOURCE_SETTINGS_HDFS_FS_DEFAULTFS_NOTE
);
.
note
(
Status
.
SYS_RESOURCE_SETTINGS_HDFS_FS_DEFAULTFS_NOTE
);
private
final
Configuration
<
String
>
resourcesHdfsCoreSite
=
key
(
Status
.
SYS_RESOURCE_SETTINGS_HDFS_CORE_SITE
)
.
stringType
()
.
defaultValue
(
""
)
.
note
(
Status
.
SYS_RESOURCE_SETTINGS_HDFS_CORE_SITE_NOTE
);
private
final
Configuration
<
String
>
resourcesHdfsHdfsSite
=
key
(
Status
.
SYS_RESOURCE_SETTINGS_HDFS_HDFS_SITE
)
.
stringType
()
.
defaultValue
(
""
)
.
note
(
Status
.
SYS_RESOURCE_SETTINGS_HDFS_HDFS_SITE_NOTE
);
private
final
Configuration
<
Boolean
>
resourcesPathStyleAccess
=
key
(
Status
.
SYS_RESOURCE_SETTINGS_PATH_STYLE_ACCESS
)
private
final
Configuration
<
Boolean
>
resourcesPathStyleAccess
=
key
(
Status
.
SYS_RESOURCE_SETTINGS_PATH_STYLE_ACCESS
)
.
booleanType
()
.
booleanType
()
.
defaultValue
(
true
)
.
defaultValue
(
true
)
...
...
dinky-common/src/main/resources/i18n/messages_en_US.properties
View file @
79107117
...
@@ -260,6 +260,10 @@ sys.resource.settings.hdfs.root.user=HDFS operation user name
...
@@ -260,6 +260,10 @@ sys.resource.settings.hdfs.root.user=HDFS operation user name
sys.resource.settings.hdfs.root.user.note
=
HDFS operation user name
sys.resource.settings.hdfs.root.user.note
=
HDFS operation user name
sys.resource.settings.hdfs.fs.defaultFS
=
HDFS defaultFS
sys.resource.settings.hdfs.fs.defaultFS
=
HDFS defaultFS
sys.resource.settings.hdfs.fs.defaultFS.note
=
fs.defaultFS configuration items, such as remote: hdfs://localhost:9000, local: file:///
sys.resource.settings.hdfs.fs.defaultFS.note
=
fs.defaultFS configuration items, such as remote: hdfs://localhost:9000, local: file:///
sys.resource.settings.hdfs.core.site
=
core-site.xml
sys.resource.settings.hdfs.core.site.note
=
core-site.xml configuration file content,High availability required
sys.resource.settings.hdfs.hdfs.site
=
hdfs-site.xml
sys.resource.settings.hdfs.hdfs.site.note
=
hdfs-site.xml configuration file content
\u
FF0CHigh availability required
#Dinky Gateway
#Dinky Gateway
...
...
dinky-common/src/main/resources/i18n/messages_zh_CN.properties
View file @
79107117
This diff is collapsed.
Click to expand it.
dinky-web/src/pages/DevOps/JobDetail/index.tsx
View file @
79107117
...
@@ -28,14 +28,15 @@ import JobMetrics from '@/pages/DevOps/JobDetail/JobMetrics';
...
@@ -28,14 +28,15 @@ import JobMetrics from '@/pages/DevOps/JobDetail/JobMetrics';
import
JobOperator
from
'@/pages/DevOps/JobDetail/JobOperator/JobOperator'
;
import
JobOperator
from
'@/pages/DevOps/JobDetail/JobOperator/JobOperator'
;
import
JobConfigTab
from
'@/pages/DevOps/JobDetail/JobOverview/JobOverview'
;
import
JobConfigTab
from
'@/pages/DevOps/JobDetail/JobOverview/JobOverview'
;
import
JobVersionTab
from
'@/pages/DevOps/JobDetail/JobVersion/JobVersionTab'
;
import
JobVersionTab
from
'@/pages/DevOps/JobDetail/JobVersion/JobVersionTab'
;
import
{
refeshJobInstance
}
from
'@/pages/DevOps/JobDetail/srvice'
;
import
{
refeshJobInstance
}
from
'@/pages/DevOps/JobDetail/srvice'
;
import
{
Jobs
}
from
'@/types/DevOps/data'
;
import
{
Jobs
}
from
'@/types/DevOps/data'
;
import
{
l
}
from
'@/utils/intl'
;
import
{
l
}
from
'@/utils/intl'
;
import
{
ClusterOutlined
,
FireOutlined
,
RocketOutlined
}
from
'@ant-design/icons'
;
import
{
ClusterOutlined
,
FireOutlined
,
RocketOutlined
}
from
'@ant-design/icons'
;
import
{
PageContainer
}
from
'@ant-design/pro-components'
;
import
{
PageContainer
}
from
'@ant-design/pro-components'
;
import
{
Tag
}
from
'antd'
;
import
{
Tag
}
from
'antd'
;
import
{
useState
}
from
'react'
;
import
{
useState
}
from
'react'
;
import
{
useLocation
}
from
'umi'
;
import
{
useLocation
}
from
'umi'
;
import
{
history
}
from
"@@/core/history"
;
/**
/**
* Enum defining different operators for the JobDetail component.
* Enum defining different operators for the JobDetail component.
...
@@ -59,8 +60,11 @@ const OperatorEnum = {
...
@@ -59,8 +60,11 @@ const OperatorEnum = {
const
JobDetail
=
(
props
:
any
)
=>
{
const
JobDetail
=
(
props
:
any
)
=>
{
const
params
=
useLocation
();
const
params
=
useLocation
();
const
id
=
params
.
search
.
split
(
'='
)[
1
];
const
id
=
params
.
search
.
split
(
'='
)[
1
];
if
(
!
id
)
{
history
.
push
(
`/devops/`
);
}
const
{
data
,
run
}
=
useHookRequest
(
refeshJobInstance
,
{
const
{
data
,
run
}
=
useHookRequest
(
refeshJobInstance
,
{
defaultParams
:
[
id
,
false
],
defaultParams
:
[
id
,
false
],
pollingInterval
:
3000
pollingInterval
:
3000
});
});
...
@@ -71,13 +75,13 @@ const JobDetail = (props: any) => {
...
@@ -71,13 +75,13 @@ const JobDetail = (props: any) => {
// Define the components for each job operator
// Define the components for each job operator
const
JobOperatorItems
=
{
const
JobOperatorItems
=
{
[
OperatorEnum
.
JOB_BASE_INFO
]:
<
JobConfigTab
jobDetail
=
{
jobInfoDetail
}
/>
,
[
OperatorEnum
.
JOB_BASE_INFO
]:
<
JobConfigTab
jobDetail
=
{
jobInfoDetail
}
/>
,
[
OperatorEnum
.
JOB_LOGS
]:
<
JobLogsTab
jobDetail
=
{
jobInfoDetail
}
/>
,
[
OperatorEnum
.
JOB_LOGS
]:
<
JobLogsTab
jobDetail
=
{
jobInfoDetail
}
/>
,
[
OperatorEnum
.
JOB_VERSION
]:
<
JobVersionTab
jobDetail
=
{
jobInfoDetail
}
/>
,
[
OperatorEnum
.
JOB_VERSION
]:
<
JobVersionTab
jobDetail
=
{
jobInfoDetail
}
/>
,
[
OperatorEnum
.
JOB_CHECKPOINTS
]:
<
CheckPoints
jobDetail
=
{
jobInfoDetail
}
/>
,
[
OperatorEnum
.
JOB_CHECKPOINTS
]:
<
CheckPoints
jobDetail
=
{
jobInfoDetail
}
/>
,
[
OperatorEnum
.
JOB_METRICS
]:
<
JobMetrics
jobDetail
=
{
jobInfoDetail
}
/>
,
[
OperatorEnum
.
JOB_METRICS
]:
<
JobMetrics
jobDetail
=
{
jobInfoDetail
}
/>
,
[
OperatorEnum
.
JOB_LINEAGE
]:
<
JobLineage
jobDetail
=
{
jobInfoDetail
}
/>
,
[
OperatorEnum
.
JOB_LINEAGE
]:
<
JobLineage
jobDetail
=
{
jobInfoDetail
}
/>
,
[
OperatorEnum
.
JOB_ALERT
]:
<
AlertHistory
jobDetail
=
{
jobInfoDetail
}
/
>
[
OperatorEnum
.
JOB_ALERT
]:
<
AlertHistory
jobDetail
=
{
jobInfoDetail
}
/
>
};
};
// Define the tabs config for job operators
// Define the tabs config for job operators
...
@@ -86,7 +90,7 @@ const JobDetail = (props: any) => {
...
@@ -86,7 +90,7 @@ const JobDetail = (props: any) => {
tab
:
l
(
'devops.jobinfo.config.JobInfo'
),
tab
:
l
(
'devops.jobinfo.config.JobInfo'
),
key
:
OperatorEnum
.
JOB_BASE_INFO
key
:
OperatorEnum
.
JOB_BASE_INFO
},
},
{
tab
:
l
(
'devops.jobinfo.config.JobLogs'
),
key
:
OperatorEnum
.
JOB_LOGS
},
{
tab
:
l
(
'devops.jobinfo.config.JobLogs'
),
key
:
OperatorEnum
.
JOB_LOGS
},
{
{
tab
:
l
(
'devops.jobinfo.config.JobVersion'
),
tab
:
l
(
'devops.jobinfo.config.JobVersion'
),
key
:
OperatorEnum
.
JOB_VERSION
key
:
OperatorEnum
.
JOB_VERSION
...
@@ -103,29 +107,30 @@ const JobDetail = (props: any) => {
...
@@ -103,29 +107,30 @@ const JobDetail = (props: any) => {
tab
:
l
(
'devops.jobinfo.config.JobLineage'
),
tab
:
l
(
'devops.jobinfo.config.JobLineage'
),
key
:
OperatorEnum
.
JOB_LINEAGE
key
:
OperatorEnum
.
JOB_LINEAGE
},
},
{
tab
:
l
(
'devops.jobinfo.config.JobAlert'
),
key
:
OperatorEnum
.
JOB_ALERT
}
{
tab
:
l
(
'devops.jobinfo.config.JobAlert'
),
key
:
OperatorEnum
.
JOB_ALERT
}
];
];
console
.
log
(
!!
data
)
return
(
return
(
<
PageContainer
<
PageContainer
loading=
{
!
data
}
title=
{
jobInfoDetail
?.
instance
?.
name
}
title=
{
jobInfoDetail
?.
instance
?.
name
}
subTitle=
{
<
JobLifeCycleTag
status=
{
jobInfoDetail
?.
instance
?.
step
}
/>
}
subTitle=
{
<
JobLifeCycleTag
status=
{
jobInfoDetail
?.
instance
?.
step
}
/>
}
ghost=
{
false
}
ghost=
{
false
}
extra=
{
<
JobOperator
jobDetail=
{
jobInfoDetail
}
refesh=
{
(
isForce
)
=>
run
(
id
,
isForce
)
}
/>
}
extra=
{
<
JobOperator
jobDetail=
{
jobInfoDetail
}
refesh=
{
(
isForce
)
=>
run
(
id
,
isForce
)
}
/>
}
onBack=
{
()
=>
window
.
history
.
back
()
}
onBack=
{
()
=>
window
.
history
.
back
()
}
breadcrumb=
{
{}
}
breadcrumb=
{
{}
}
tabList=
{
JobOperatorTabs
}
tabList=
{
JobOperatorTabs
}
onTabChange=
{
(
key
)
=>
setTabKey
(
key
)
}
onTabChange=
{
(
key
)
=>
setTabKey
(
key
)
}
tags=
{
[
tags=
{
[
<
StatusTag
status=
{
jobInfoDetail
?.
instance
?.
status
}
/>,
<
StatusTag
status=
{
jobInfoDetail
?.
instance
?.
status
}
/>,
<
Tag
key=
{
'tg1'
}
color=
'blue'
>
<
Tag
key=
{
'tg1'
}
color=
'blue'
>
<
FireOutlined
/>
{
jobInfoDetail
?.
instance
?.
jid
}
<
FireOutlined
/>
{
jobInfoDetail
?.
instance
?.
jid
}
</
Tag
>,
</
Tag
>,
<
Tag
key=
{
'tg2'
}
color=
'blue'
>
<
Tag
key=
{
'tg2'
}
color=
'blue'
>
<
RocketOutlined
/>
{
jobInfoDetail
?.
history
?.
type
}
<
RocketOutlined
/>
{
jobInfoDetail
?.
history
?.
type
}
</
Tag
>,
</
Tag
>,
<
Tag
key=
{
'tg3'
}
color=
'green'
>
<
Tag
key=
{
'tg3'
}
color=
'green'
>
<
ClusterOutlined
/>
{
jobInfoDetail
?.
clusterInstance
?.
alias
}
<
ClusterOutlined
/>
{
jobInfoDetail
?.
clusterInstance
?.
alias
}
</
Tag
>
</
Tag
>
]
}
]
}
>
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment