chore: cluster docker provider
This commit is contained in:
@@ -66,7 +66,7 @@ const AddWorkerStep: React.FC<AddModalProps> = ({
|
||||
const [currentProvider, setCurrentProvider] = React.useState<string>('cuda');
|
||||
const [workerCommand, setWorkerCommand] = React.useState<Record<string, any>>(
|
||||
{
|
||||
label: 'NVIDIA CUDA',
|
||||
label: 'NVIDIA',
|
||||
link: 'https://docs.gpustack.ai/latest/installation/installation-requirements/#nvidia-cuda'
|
||||
}
|
||||
);
|
||||
@@ -85,7 +85,7 @@ const AddWorkerStep: React.FC<AddModalProps> = ({
|
||||
onSelect={handleSelectProvider}
|
||||
currentProvider={currentProvider}
|
||||
/>
|
||||
{provider === ProviderValueMap.Custom && (
|
||||
{provider === ProviderValueMap.Docker && (
|
||||
<Content>
|
||||
<Line></Line>
|
||||
<Alert
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
import ScrollerModal from '@/components/scroller-modal';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import React from 'react';
|
||||
import { ProviderType } from '../config';
|
||||
import AddWorkerStep from './add-worker-step';
|
||||
|
||||
type ViewModalProps = {
|
||||
open: boolean;
|
||||
provider: ProviderType;
|
||||
registrationInfo: {
|
||||
token: string;
|
||||
image: string;
|
||||
server_url: string;
|
||||
cluster_id: number;
|
||||
};
|
||||
onCancel: () => void;
|
||||
};
|
||||
|
||||
const AddWorker: React.FC<ViewModalProps> = (props) => {
|
||||
const { open, onCancel, registrationInfo, provider } = props || {};
|
||||
const intl = useIntl();
|
||||
|
||||
return (
|
||||
<ScrollerModal
|
||||
title={intl.formatMessage({ id: 'resources.button.create' })}
|
||||
open={open}
|
||||
centered={false}
|
||||
onCancel={onCancel}
|
||||
destroyOnHidden={true}
|
||||
closeIcon={true}
|
||||
maskClosable={false}
|
||||
keyboard={false}
|
||||
width={860}
|
||||
style={{
|
||||
top: 100
|
||||
}}
|
||||
maxContentHeight={600}
|
||||
footer={null}
|
||||
>
|
||||
<AddWorkerStep registrationInfo={registrationInfo} provider={provider} />
|
||||
</ScrollerModal>
|
||||
);
|
||||
};
|
||||
|
||||
export default AddWorker;
|
||||
@@ -5,6 +5,8 @@ import styled from 'styled-components';
|
||||
const { Step } = Steps;
|
||||
|
||||
const Wrapper = styled.div`
|
||||
width: min(1200px, 100%);
|
||||
margin: 0 auto;
|
||||
padding-block: 30px;
|
||||
background-color: var(--ant-color-bg-container);
|
||||
.ant-steps-item-description {
|
||||
|
||||
@@ -5,7 +5,7 @@ import iluvatarWEBP from '@/assets/logo/Iluvatar.png';
|
||||
import metaxLogo from '@/assets/logo/metax.png';
|
||||
import moorePNG from '@/assets/logo/moore _threads.png';
|
||||
import IconFont from '@/components/icon-font';
|
||||
import styled from 'styled-components';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import ProviderCatalog from './provider-catalog';
|
||||
|
||||
const ProviderImage = ({ src, showBg }: { src: string; showBg?: boolean }) => {
|
||||
@@ -20,110 +20,6 @@ const ProviderImage = ({ src, showBg }: { src: string; showBg?: boolean }) => {
|
||||
);
|
||||
};
|
||||
|
||||
const supportedHardPlatforms = [
|
||||
{
|
||||
label: 'NVIDIA CUDA',
|
||||
value: 'cuda',
|
||||
description: '',
|
||||
key: 'cuda',
|
||||
locale: false,
|
||||
link: 'https://docs.gpustack.ai/latest/installation/installation-requirements/#nvidia-cuda',
|
||||
icon: <IconFont type="icon-nvidia2" style={{ fontSize: 32 }} />
|
||||
},
|
||||
{
|
||||
label: 'AMD ROCm',
|
||||
description: '',
|
||||
value: 'rocm',
|
||||
key: 'rocm',
|
||||
locale: false,
|
||||
link: 'https://docs.gpustack.ai/latest/installation/installation-requirements/#amd-rocm',
|
||||
icon: (
|
||||
<IconFont
|
||||
type="icon-amd"
|
||||
style={{ fontSize: 32, color: 'var(--ant-color-text)' }}
|
||||
/>
|
||||
)
|
||||
},
|
||||
{
|
||||
label: 'Ascend CANN',
|
||||
description: '',
|
||||
value: 'npu',
|
||||
key: 'npu',
|
||||
locale: false,
|
||||
link: 'https://docs.gpustack.ai/latest/installation/installation-requirements/#ascend-cann',
|
||||
icon: <ProviderImage src={ascendLogo} showBg />
|
||||
},
|
||||
{
|
||||
label: 'Hygon DTK',
|
||||
description: '',
|
||||
value: 'dcu',
|
||||
key: 'dcu',
|
||||
locale: false,
|
||||
link: 'https://docs.gpustack.ai/latest/installation/installation-requirements/#hygon-dtk',
|
||||
icon: <ProviderImage src={hyponPNG} />
|
||||
},
|
||||
{
|
||||
label: 'Moore Threads',
|
||||
description: '',
|
||||
value: 'musa',
|
||||
key: 'musa',
|
||||
locale: false,
|
||||
link: 'https://docs.gpustack.ai/latest/installation/installation-requirements/#moore-threads-musa',
|
||||
icon: <ProviderImage src={moorePNG} />
|
||||
},
|
||||
{
|
||||
label: 'Iluvatar Corex',
|
||||
description: '',
|
||||
value: 'corex',
|
||||
key: 'corex',
|
||||
locale: false,
|
||||
link: 'https://docs.gpustack.ai/latest/installation/installation-requirements/#iluvatar-corex',
|
||||
icon: <ProviderImage src={iluvatarWEBP} showBg />
|
||||
},
|
||||
{
|
||||
label: 'Cambricon',
|
||||
value: 'cambricon',
|
||||
key: 'cambricon',
|
||||
locale: false,
|
||||
link: 'https://docs.gpustack.ai/latest/installation/installation-requirements/#cambricon-mlu',
|
||||
icon: <ProviderImage src={CambriconPNG} />
|
||||
},
|
||||
{
|
||||
label: 'Metax',
|
||||
value: 'metax',
|
||||
key: 'metax',
|
||||
locale: false,
|
||||
icon: <ProviderImage src={metaxLogo} showBg />
|
||||
}
|
||||
];
|
||||
|
||||
const Header = styled.div`
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
justify-content: center;
|
||||
align-self: center;
|
||||
`;
|
||||
|
||||
const renderHeader = (item: any) => {
|
||||
return (
|
||||
<Header>
|
||||
<span className="icon">{item.icon}</span>
|
||||
<span className="label">{item.label}</span>
|
||||
</Header>
|
||||
);
|
||||
};
|
||||
|
||||
const dataList = supportedHardPlatforms.map((item) => {
|
||||
return {
|
||||
label: renderHeader(item),
|
||||
value: item.value,
|
||||
key: item.key,
|
||||
locale: item.locale
|
||||
};
|
||||
});
|
||||
|
||||
interface SupportedHardwareProps {
|
||||
onSelect?: (provider: string, item: any) => void;
|
||||
currentProvider?: string;
|
||||
@@ -133,6 +29,84 @@ const SupportedHardware: React.FC<SupportedHardwareProps> = ({
|
||||
onSelect,
|
||||
currentProvider
|
||||
}) => {
|
||||
const intl = useIntl();
|
||||
|
||||
const supportedHardPlatforms = [
|
||||
{
|
||||
label: intl.formatMessage({ id: 'vendor.nividia' }),
|
||||
value: 'cuda',
|
||||
description: '',
|
||||
key: 'cuda',
|
||||
locale: false,
|
||||
link: 'https://docs.gpustack.ai/latest/installation/installation-requirements/#nvidia-cuda',
|
||||
icon: <IconFont type="icon-nvidia2" style={{ fontSize: 32 }} />
|
||||
},
|
||||
{
|
||||
label: 'AMD',
|
||||
description: '',
|
||||
value: 'rocm',
|
||||
key: 'rocm',
|
||||
locale: false,
|
||||
link: 'https://docs.gpustack.ai/latest/installation/installation-requirements/#amd-rocm',
|
||||
icon: (
|
||||
<IconFont
|
||||
type="icon-amd"
|
||||
style={{ fontSize: 32, color: 'var(--ant-color-text)' }}
|
||||
/>
|
||||
)
|
||||
},
|
||||
{
|
||||
label: intl.formatMessage({ id: 'vendor.ascend' }),
|
||||
description: '',
|
||||
value: 'npu',
|
||||
key: 'npu',
|
||||
locale: false,
|
||||
link: 'https://docs.gpustack.ai/latest/installation/installation-requirements/#ascend-cann',
|
||||
icon: <ProviderImage src={ascendLogo} showBg />
|
||||
},
|
||||
{
|
||||
label: intl.formatMessage({ id: 'vendor.hygon' }),
|
||||
description: '',
|
||||
value: 'dcu',
|
||||
key: 'dcu',
|
||||
locale: false,
|
||||
link: 'https://docs.gpustack.ai/latest/installation/installation-requirements/#hygon-dtk',
|
||||
icon: <ProviderImage src={hyponPNG} />
|
||||
},
|
||||
{
|
||||
label: intl.formatMessage({ id: 'vendor.moorthreads' }),
|
||||
description: '',
|
||||
value: 'musa',
|
||||
key: 'musa',
|
||||
locale: false,
|
||||
link: 'https://docs.gpustack.ai/latest/installation/installation-requirements/#moore-threads-musa',
|
||||
icon: <ProviderImage src={moorePNG} />
|
||||
},
|
||||
{
|
||||
label: intl.formatMessage({ id: 'vendor.iluvatar' }),
|
||||
description: '',
|
||||
value: 'corex',
|
||||
key: 'corex',
|
||||
locale: false,
|
||||
link: 'https://docs.gpustack.ai/latest/installation/installation-requirements/#iluvatar-corex',
|
||||
icon: <ProviderImage src={iluvatarWEBP} showBg />
|
||||
},
|
||||
{
|
||||
label: intl.formatMessage({ id: 'vendor.cambricon' }),
|
||||
value: 'cambricon',
|
||||
key: 'cambricon',
|
||||
locale: false,
|
||||
link: 'https://docs.gpustack.ai/latest/installation/installation-requirements/#cambricon-mlu',
|
||||
icon: <ProviderImage src={CambriconPNG} />
|
||||
},
|
||||
{
|
||||
label: intl.formatMessage({ id: 'vendor.metax' }),
|
||||
value: 'metax',
|
||||
key: 'metax',
|
||||
locale: false,
|
||||
icon: <ProviderImage src={metaxLogo} showBg />
|
||||
}
|
||||
];
|
||||
return (
|
||||
<ProviderCatalog
|
||||
onSelect={onSelect}
|
||||
|
||||
Reference in New Issue
Block a user