mirror of
https://github.com/oceanprotocol/market.git
synced 2024-11-13 16:54:53 +01:00
set default pre-defined docker image and renamed version field to docker image tag
This commit is contained in:
parent
8f8870c829
commit
e92f759898
@ -27,7 +27,7 @@
|
||||
"name": "dockerImage",
|
||||
"label": "Docker Image",
|
||||
"placeholder": "e.g. python3.7",
|
||||
"help": "Please select a predefined image to run your algorithm.",
|
||||
"help": "Please select a image to run your algorithm.",
|
||||
"type": "select",
|
||||
"options": ["node:pre-defined", "python:pre-defined", "custom image"],
|
||||
"required": true
|
||||
@ -35,16 +35,16 @@
|
||||
{
|
||||
"name": "image",
|
||||
"label": "Image URL",
|
||||
"placeholder": "e.g. node or https://hub.docker.com/_/node",
|
||||
"placeholder": "e.g. oceanprotocol/algo_dockers or https://example.com/image_path",
|
||||
"disabled": true,
|
||||
"help": "Provide the name of a docker image or the full url if you have it hosted in a 3rd party repo",
|
||||
"help": "Provide the name of a public docker image or the full url if you have it hosted in a 3rd party repo",
|
||||
"required": false
|
||||
},
|
||||
{
|
||||
"name": "version",
|
||||
"label": "Version",
|
||||
"placeholder": "e.g. 10",
|
||||
"help": "Provide the version for your image.",
|
||||
"name": "containerTag",
|
||||
"label": "Docker Image Tag",
|
||||
"placeholder": "e.g. latest",
|
||||
"help": "Provide the tag for your docker image.",
|
||||
"disabled": true,
|
||||
"required": false
|
||||
},
|
||||
|
2
src/@types/MetaData.d.ts
vendored
2
src/@types/MetaData.d.ts
vendored
@ -50,7 +50,7 @@ export interface MetadataPublishFormAlgorithm {
|
||||
termsAndConditions: boolean
|
||||
// ---- optional fields ----
|
||||
image: string
|
||||
version: string
|
||||
containerTag: string
|
||||
entrypoint: string
|
||||
tags?: string
|
||||
}
|
||||
|
@ -73,7 +73,7 @@ export default function FormPublish(): ReactElement {
|
||||
setFieldValue('dockerImage', imageSelected)
|
||||
setDisableFlag(true)
|
||||
setFieldValue('image', 'node')
|
||||
setFieldValue('version', '10')
|
||||
setFieldValue('containerTag', '10')
|
||||
setFieldValue('entrypoint', 'node $ALGO')
|
||||
break
|
||||
}
|
||||
@ -81,7 +81,7 @@ export default function FormPublish(): ReactElement {
|
||||
setFieldValue('dockerImage', imageSelected)
|
||||
setDisableFlag(true)
|
||||
setFieldValue('image', 'oceanprotocol/algo_dockers')
|
||||
setFieldValue('version', 'python-panda')
|
||||
setFieldValue('containerTag', 'python-panda')
|
||||
setFieldValue('entrypoint', 'python $ALGO')
|
||||
break
|
||||
}
|
||||
@ -89,7 +89,7 @@ export default function FormPublish(): ReactElement {
|
||||
setFieldValue('dockerImage', imageSelected)
|
||||
setDisableFlag(false)
|
||||
setFieldValue('image', '')
|
||||
setFieldValue('version', '')
|
||||
setFieldValue('containerTag', '')
|
||||
setFieldValue('entrypoint', '')
|
||||
break
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ export const validationSchema: Yup.SchemaOf<MetadataPublishFormAlgorithm> = Yup.
|
||||
})
|
||||
.required('Required'),
|
||||
image: Yup.string().required('Required'),
|
||||
version: Yup.string().required('Required'),
|
||||
containerTag: Yup.string().required('Required'),
|
||||
entrypoint: Yup.string().required('Required'),
|
||||
author: Yup.string().required('Required'),
|
||||
termsAndConditions: Yup.boolean().required('Required'),
|
||||
@ -30,9 +30,9 @@ export const validationSchema: Yup.SchemaOf<MetadataPublishFormAlgorithm> = Yup.
|
||||
export const initialValues: Partial<MetadataPublishFormAlgorithm> = {
|
||||
name: '',
|
||||
author: '',
|
||||
dockerImage: '',
|
||||
dockerImage: 'node:pre-defined',
|
||||
image: '',
|
||||
version: '',
|
||||
containerTag: '',
|
||||
entrypoint: '',
|
||||
files: '',
|
||||
description: '',
|
||||
|
@ -72,7 +72,7 @@ export function checkIfTimeoutInPredefinedValues(
|
||||
|
||||
function getAlgoithComponent(
|
||||
image: string,
|
||||
version: string,
|
||||
containerTag: string,
|
||||
entrypoint: string,
|
||||
algorithmLanguace: string
|
||||
): MetadataAlgorithm {
|
||||
@ -83,7 +83,7 @@ function getAlgoithComponent(
|
||||
container: {
|
||||
entrypoint: entrypoint,
|
||||
image: image,
|
||||
tag: version
|
||||
tag: containerTag
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -136,7 +136,7 @@ export function transformPublishAlgorithmFormToMetadata(
|
||||
tags,
|
||||
dockerImage,
|
||||
image,
|
||||
version,
|
||||
containerTag,
|
||||
entrypoint,
|
||||
termsAndConditions,
|
||||
files
|
||||
@ -148,7 +148,7 @@ export function transformPublishAlgorithmFormToMetadata(
|
||||
const algorithmLanguace = getAlgoithFileExtension(fileUrl)
|
||||
const algorithm = getAlgoithComponent(
|
||||
image,
|
||||
version,
|
||||
containerTag,
|
||||
entrypoint,
|
||||
algorithmLanguace
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user