fix: entrypoint do not display in edit

This commit is contained in:
jialin
2025-12-19 15:00:10 +08:00
parent ad048a92ed
commit bb793a41fc
8 changed files with 48 additions and 11 deletions
+16 -11
View File
@@ -51,6 +51,13 @@ const AddModal: React.FC<AddModalProps> = (props) => {
const [yamlContent, setYamlContent] = useState<string>('');
const [formContent, setFormContent] = useState<FormData>({} as FormData);
const versionFields = [
'image_name',
'run_command',
'custom_framework',
'entrypoint'
];
// remove '-custom' suffix from version_no in currentData, when action is EDIT
const genertateCurrentVersionData = (values: ListItem): ListItem => {
const data = { ...values };
@@ -82,10 +89,7 @@ const AddModal: React.FC<AddModalProps> = (props) => {
(acc: Record<string, any>, curr) => {
if (curr.version_no) {
acc[curr.version_no] = {
custom_framework: curr.custom_framework,
image_name: curr.image_name,
run_command: curr.run_command,
entrypoint: curr.entrypoint
..._.pick(curr, versionFields)
};
}
return acc;
@@ -111,10 +115,8 @@ const AddModal: React.FC<AddModalProps> = (props) => {
const versionConfigs = Object.keys(values.version_configs || {}).map(
(key: string) => ({
version_no: key,
image_name: values.version_configs?.[key]?.image_name,
run_command: values.version_configs?.[key]?.run_command,
custom_framework: values.version_configs?.[key]?.custom_framework,
is_default: key === values.default_version
is_default: key === values.default_version,
..._.pick(values.version_configs?.[key], versionFields)
})
);
@@ -123,12 +125,15 @@ const AddModal: React.FC<AddModalProps> = (props) => {
values.built_in_version_configs || {}
).map((key) => ({
version_no: key,
image_name: values.built_in_version_configs?.[key]?.image_name,
run_command: values.built_in_version_configs?.[key]?.run_command,
is_default: key === values.default_version,
built_in_frameworks:
values.built_in_version_configs?.[key]?.built_in_frameworks || [],
is_built_in: true
is_built_in: true,
..._.pick(values.built_in_version_configs?.[key], [
'image_name',
'run_command',
'entrypoint'
])
}));
return {
@@ -43,6 +43,7 @@ const VersionInfoModal: React.FC<VersionInfoModalProps> = ({
version_no: key,
image_name: value.image_name,
run_command: value.run_command,
entrypoint: value.entrypoint,
is_default: key === currentData.default_version,
availableFrameworks: [
...(value.built_in_frameworks || []),
+3
View File
@@ -199,6 +199,7 @@ export const yamlTemplate = `# ----------------------------------------
# version_configs:
# - image_name: required
# - run_command: optional
# - entrypoint: optional
# - custom_framework:
# - optional
# - choose from: ${Object.values(GPUDriverMap).join(', ')}, CPU
@@ -214,9 +215,11 @@ version_configs:
v0.11.0:
image_name: lm/vllm:latest
run_command: vllm serve {{model_path}} --port {{port}} --host {{worker_ip}} --served-model-name {{model_name}}
entrypoint: "/bin/sh -c"
custom_framework: cuda
v0.10.0:
image_name: lm/vllm:test
entrypoint:
run_command:
custom_framework:
`;
@@ -48,6 +48,10 @@
"type": ["string", "null"],
"description": "start command"
},
"entrypoint": {
"type": "string",
"description": "Override the default ENTRYPOINT of the image"
},
"custom_framework": {
"type": ["string", "null"],
"description": "custom framework"
@@ -74,6 +78,10 @@
"type": ["string", "null"],
"description": "start command"
},
"entrypoint": {
"type": "string",
"description": "Override the default ENTRYPOINT of the image"
},
"custom_framework": {
"type": ["string", "null"],
"description": "custom framework"
@@ -34,6 +34,10 @@
"type": ["string", "null"],
"description": "start command"
},
"entrypoint": {
"type": "string",
"description": "Override the default ENTRYPOINT of the image"
},
"custom_framework": {
"type": ["string", "null"],
"description": "custom framework"
@@ -38,6 +38,10 @@
"type": ["string", "null"],
"description": "start command"
},
"entrypoint": {
"type": "string",
"description": "Override the default ENTRYPOINT of the image"
},
"custom_framework": {
"type": ["string", "null"],
"description": "custom framework"
+10
View File
@@ -112,6 +112,16 @@ export const VersionItem: React.FC<VersionItemProps> = ({ data }) => {
</AutoTooltip>
</InfoItem>
)}
{data.entrypoint && (
<InfoItem>
<span className="label">
{intl.formatMessage({ id: 'backend.replaceEntrypoint' })}:
</span>
<AutoTooltip ghost minWidth={20}>
{data.entrypoint}
</AutoTooltip>
</InfoItem>
)}
{data.run_command && (
<InfoItem>
<span className="label">
@@ -73,6 +73,7 @@ const VersionsForm: React.FC<AddModalProps> = ({
version_no: '',
image_name: '',
run_command: '',
entrypoint: '',
isBuiltin: false,
is_default: false
}
@@ -99,6 +100,7 @@ const VersionsForm: React.FC<AddModalProps> = ({
version_no: '',
image_name: '',
run_command: '',
entrypoint: '',
isBuiltin: false,
is_default: false
};