- New k8s_pod_spec form sections (image credentials, node selector, gpu vendor overrides) under k8s_options, replacing the legacy flat k8s_volume_mounts list. UI keys aligned to the backend wire shape (snake_case k8s_options + camelCase inside). - System default container registry is pre-filled into the first image credential when creating a new cluster; empty username/password are coerced to null on submit to match the Optional[str] backend schema. - Register cluster flow supports multi-runtime selection gated by the cluster's gpuVendorOverrides: non-override vendors stay single-select with an inline hint; multi-add only opens once an override vendor is picked, and non-override cards become disabled in that state. - Manifest URL emits multiple ?runtime= params; check-env step combines per-vendor commands; downstream steps are disabled when no vendor is selected. - Pre-validate gpuVendorOverrides at save time (non-empty selector, no duplicates across vendors, no key clash with base nodeSelector) so the user sees the error before hitting the manifest endpoint. - Misc: dark-mode background of the k8s_pod_spec / volume mount titles no longer clashes with the drawer; cluster Steps no longer leaks the internal showModules/showForms props to the DOM.
65 lines
1.8 KiB
TypeScript
65 lines
1.8 KiB
TypeScript
import { BulbOutlined } from '@ant-design/icons';
|
|
import { useIntl } from '@umijs/max';
|
|
import { Alert, Typography } from 'antd';
|
|
import CheckEnvCommand from '../check-env-command';
|
|
import { useAddWorkerContext } from './add-worker-context';
|
|
import { AddWorkerStepProps, StepNamesMap } from './config';
|
|
import { Title } from './constainers';
|
|
import StepCollapse from './step-collapse';
|
|
|
|
const CheckEnvironment: React.FC<AddWorkerStepProps> = ({ disabled }) => {
|
|
const { stepList, summary, provider } = useAddWorkerContext();
|
|
const intl = useIntl();
|
|
const currentGPU = summary.get('currentGPU');
|
|
const currentGPUs: string[] = summary.get('selectedGPUs') || [];
|
|
const workerCommand = summary.get('workerCommand') || {
|
|
label: '',
|
|
link: '',
|
|
notes: []
|
|
};
|
|
|
|
const stepIndex = stepList.indexOf(StepNamesMap.CheckEnv) + 1;
|
|
|
|
return (
|
|
<StepCollapse
|
|
disabled={disabled}
|
|
name={StepNamesMap.CheckEnv}
|
|
title={
|
|
<Title>
|
|
{stepIndex}.{' '}
|
|
{intl.formatMessage({ id: 'clusters.addworker.checkEnv' })}
|
|
</Title>
|
|
}
|
|
>
|
|
<Alert
|
|
type="info"
|
|
showIcon
|
|
icon={<BulbOutlined />}
|
|
style={{
|
|
marginBottom: 8
|
|
}}
|
|
title={
|
|
<span
|
|
dangerouslySetInnerHTML={{
|
|
__html: intl.formatMessage(
|
|
{ id: 'clusters.create.addworker.tips' },
|
|
{ label: workerCommand.label, link: workerCommand.link }
|
|
)
|
|
}}
|
|
></span>
|
|
}
|
|
></Alert>
|
|
<Typography.Paragraph style={{ marginBottom: 8 }}>
|
|
{intl.formatMessage({ id: 'cluster.create.checkEnv.tips' })}
|
|
</Typography.Paragraph>
|
|
<CheckEnvCommand
|
|
provider={provider}
|
|
currentGPU={currentGPU}
|
|
currentGPUs={currentGPUs}
|
|
/>
|
|
</StepCollapse>
|
|
);
|
|
};
|
|
|
|
export default CheckEnvironment;
|