chore: default_env, env
This commit is contained in:
@@ -57,7 +57,7 @@ const AddModal: React.FC<AddModalProps> = (props) => {
|
||||
'run_command',
|
||||
'custom_framework',
|
||||
'entrypoint',
|
||||
'environment'
|
||||
'env'
|
||||
];
|
||||
|
||||
// remove '-custom' suffix from version_no in currentData, when action is EDIT
|
||||
|
||||
@@ -48,7 +48,7 @@ const VersionInfoModal: React.FC<VersionInfoModalProps> = ({
|
||||
'image_name',
|
||||
'run_command',
|
||||
'entrypoint',
|
||||
'environment',
|
||||
'env',
|
||||
'backend_source'
|
||||
]),
|
||||
is_default: key === currentData.default_version,
|
||||
|
||||
@@ -286,18 +286,18 @@ health_check_path: /v1/models
|
||||
default_backend_param:
|
||||
- --host
|
||||
default_run_command: "{{model_path}} --port {{port}} --host {{worker_ip}} --served-model-name {{model_name}}"
|
||||
default_environment:
|
||||
default_env:
|
||||
version_configs:
|
||||
v0.11.0:
|
||||
image_name: lm/vllm:latest
|
||||
run_command: "{{model_path}} --port {{port}} --host {{worker_ip}} --served-model-name {{model_name}}"
|
||||
entrypoint: "/bin/sh -c"
|
||||
custom_framework: cuda
|
||||
environment:
|
||||
env:
|
||||
v0.10.0:
|
||||
image_name: lm/vllm:test
|
||||
entrypoint:
|
||||
run_command:
|
||||
custom_framework: rocm
|
||||
environment:
|
||||
env:
|
||||
`;
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
"type": ["string", "null"],
|
||||
"description": "default start command"
|
||||
},
|
||||
"default_environment": {
|
||||
"default_env": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
@@ -63,7 +63,7 @@
|
||||
"type": ["string", "null"],
|
||||
"description": "custom framework"
|
||||
},
|
||||
"environment": {
|
||||
"env": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
"type": ["string", "null"],
|
||||
"description": "health check path"
|
||||
},
|
||||
"default_environment": {
|
||||
"default_env": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
@@ -49,7 +49,7 @@
|
||||
"type": ["string", "null"],
|
||||
"description": "custom framework"
|
||||
},
|
||||
"environment": {
|
||||
"env": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
"type": ["string", "null"],
|
||||
"description": "health check path"
|
||||
},
|
||||
"default_environment": {
|
||||
"default_env": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
@@ -53,7 +53,7 @@
|
||||
"type": ["string", "null"],
|
||||
"description": "custom framework"
|
||||
},
|
||||
"environment": {
|
||||
"env": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
|
||||
@@ -8,7 +8,7 @@ export interface VersionConfigs {
|
||||
version_no?: string;
|
||||
is_built_in?: boolean;
|
||||
backend_source?: string;
|
||||
environment: Record<string, any>;
|
||||
env: Record<string, any>;
|
||||
}
|
||||
|
||||
export interface VersionListItem extends VersionConfigs {
|
||||
@@ -27,7 +27,7 @@ export interface FormData {
|
||||
content?: string;
|
||||
enabled?: boolean;
|
||||
backend_source?: string;
|
||||
default_environment?: Record<string, any>;
|
||||
default_env?: Record<string, any>;
|
||||
}
|
||||
|
||||
export interface ListItem extends FormData {
|
||||
|
||||
@@ -16,10 +16,10 @@ const BasicForm = () => {
|
||||
const intl = useIntl();
|
||||
const { getRuleMessage } = useAppUtils();
|
||||
const { action, backendSource } = useFormContext();
|
||||
const defaultEnvs = Form.useWatch('default_environment', form);
|
||||
const defaultEnvs = Form.useWatch('default_env', form);
|
||||
|
||||
const handleEnviromentVarsChange = (labels: Record<string, any>) => {
|
||||
form.setFieldValue('env', labels);
|
||||
form.setFieldValue('default_env', labels);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
@@ -101,7 +101,7 @@ const BasicForm = () => {
|
||||
})}
|
||||
></ListInput>
|
||||
</Form.Item>
|
||||
<Form.Item<FormData> name="default_environment">
|
||||
<Form.Item<FormData> name="default_env">
|
||||
<LabelSelector
|
||||
label={intl.formatMessage({
|
||||
id: 'backend.form.defaultEnvironment'
|
||||
|
||||
@@ -79,7 +79,7 @@ const VersionsForm: React.FC<AddModalProps> = ({
|
||||
entrypoint: '',
|
||||
isBuiltin: false,
|
||||
is_default: false,
|
||||
environment: {}
|
||||
env: {}
|
||||
}
|
||||
];
|
||||
|
||||
@@ -107,7 +107,7 @@ const VersionsForm: React.FC<AddModalProps> = ({
|
||||
entrypoint: '',
|
||||
isBuiltin: false,
|
||||
is_default: false,
|
||||
environment: {}
|
||||
env: {}
|
||||
};
|
||||
form.setFieldValue('version_configs', [...versions, newVersion]);
|
||||
};
|
||||
@@ -150,7 +150,7 @@ const VersionsForm: React.FC<AddModalProps> = ({
|
||||
if (idx === name) {
|
||||
return {
|
||||
...version,
|
||||
environment: {
|
||||
env: {
|
||||
...envs
|
||||
}
|
||||
};
|
||||
@@ -400,12 +400,12 @@ const VersionsForm: React.FC<AddModalProps> = ({
|
||||
label={intl.formatMessage({ id: 'backend.runCommand' })}
|
||||
></SealTextArea>
|
||||
</Form.Item>
|
||||
<Form.Item name={[name, 'environment']}>
|
||||
<Form.Item name={[name, 'env']}>
|
||||
<LabelSelector
|
||||
label={intl.formatMessage({
|
||||
id: 'models.form.env'
|
||||
})}
|
||||
labels={versionConfigs?.[name]?.environment}
|
||||
labels={versionConfigs?.[name]?.env}
|
||||
btnText={intl.formatMessage({ id: 'common.button.vars' })}
|
||||
onChange={(envs) =>
|
||||
handleEnviromentVarsChange(envs, name)
|
||||
|
||||
Reference in New Issue
Block a user