mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +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",
|
"name": "dockerImage",
|
||||||
"label": "Docker Image",
|
"label": "Docker Image",
|
||||||
"placeholder": "e.g. python3.7",
|
"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",
|
"type": "select",
|
||||||
"options": ["node:pre-defined", "python:pre-defined", "custom image"],
|
"options": ["node:pre-defined", "python:pre-defined", "custom image"],
|
||||||
"required": true
|
"required": true
|
||||||
@ -35,16 +35,16 @@
|
|||||||
{
|
{
|
||||||
"name": "image",
|
"name": "image",
|
||||||
"label": "Image URL",
|
"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,
|
"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
|
"required": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "version",
|
"name": "containerTag",
|
||||||
"label": "Version",
|
"label": "Docker Image Tag",
|
||||||
"placeholder": "e.g. 10",
|
"placeholder": "e.g. latest",
|
||||||
"help": "Provide the version for your image.",
|
"help": "Provide the tag for your docker image.",
|
||||||
"disabled": true,
|
"disabled": true,
|
||||||
"required": false
|
"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
|
termsAndConditions: boolean
|
||||||
// ---- optional fields ----
|
// ---- optional fields ----
|
||||||
image: string
|
image: string
|
||||||
version: string
|
containerTag: string
|
||||||
entrypoint: string
|
entrypoint: string
|
||||||
tags?: string
|
tags?: string
|
||||||
}
|
}
|
||||||
|
@ -73,7 +73,7 @@ export default function FormPublish(): ReactElement {
|
|||||||
setFieldValue('dockerImage', imageSelected)
|
setFieldValue('dockerImage', imageSelected)
|
||||||
setDisableFlag(true)
|
setDisableFlag(true)
|
||||||
setFieldValue('image', 'node')
|
setFieldValue('image', 'node')
|
||||||
setFieldValue('version', '10')
|
setFieldValue('containerTag', '10')
|
||||||
setFieldValue('entrypoint', 'node $ALGO')
|
setFieldValue('entrypoint', 'node $ALGO')
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@ -81,7 +81,7 @@ export default function FormPublish(): ReactElement {
|
|||||||
setFieldValue('dockerImage', imageSelected)
|
setFieldValue('dockerImage', imageSelected)
|
||||||
setDisableFlag(true)
|
setDisableFlag(true)
|
||||||
setFieldValue('image', 'oceanprotocol/algo_dockers')
|
setFieldValue('image', 'oceanprotocol/algo_dockers')
|
||||||
setFieldValue('version', 'python-panda')
|
setFieldValue('containerTag', 'python-panda')
|
||||||
setFieldValue('entrypoint', 'python $ALGO')
|
setFieldValue('entrypoint', 'python $ALGO')
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@ -89,7 +89,7 @@ export default function FormPublish(): ReactElement {
|
|||||||
setFieldValue('dockerImage', imageSelected)
|
setFieldValue('dockerImage', imageSelected)
|
||||||
setDisableFlag(false)
|
setDisableFlag(false)
|
||||||
setFieldValue('image', '')
|
setFieldValue('image', '')
|
||||||
setFieldValue('version', '')
|
setFieldValue('containerTag', '')
|
||||||
setFieldValue('entrypoint', '')
|
setFieldValue('entrypoint', '')
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@ export const validationSchema: Yup.SchemaOf<MetadataPublishFormAlgorithm> = Yup.
|
|||||||
})
|
})
|
||||||
.required('Required'),
|
.required('Required'),
|
||||||
image: Yup.string().required('Required'),
|
image: Yup.string().required('Required'),
|
||||||
version: Yup.string().required('Required'),
|
containerTag: Yup.string().required('Required'),
|
||||||
entrypoint: Yup.string().required('Required'),
|
entrypoint: Yup.string().required('Required'),
|
||||||
author: Yup.string().required('Required'),
|
author: Yup.string().required('Required'),
|
||||||
termsAndConditions: Yup.boolean().required('Required'),
|
termsAndConditions: Yup.boolean().required('Required'),
|
||||||
@ -30,9 +30,9 @@ export const validationSchema: Yup.SchemaOf<MetadataPublishFormAlgorithm> = Yup.
|
|||||||
export const initialValues: Partial<MetadataPublishFormAlgorithm> = {
|
export const initialValues: Partial<MetadataPublishFormAlgorithm> = {
|
||||||
name: '',
|
name: '',
|
||||||
author: '',
|
author: '',
|
||||||
dockerImage: '',
|
dockerImage: 'node:pre-defined',
|
||||||
image: '',
|
image: '',
|
||||||
version: '',
|
containerTag: '',
|
||||||
entrypoint: '',
|
entrypoint: '',
|
||||||
files: '',
|
files: '',
|
||||||
description: '',
|
description: '',
|
||||||
|
@ -72,7 +72,7 @@ export function checkIfTimeoutInPredefinedValues(
|
|||||||
|
|
||||||
function getAlgoithComponent(
|
function getAlgoithComponent(
|
||||||
image: string,
|
image: string,
|
||||||
version: string,
|
containerTag: string,
|
||||||
entrypoint: string,
|
entrypoint: string,
|
||||||
algorithmLanguace: string
|
algorithmLanguace: string
|
||||||
): MetadataAlgorithm {
|
): MetadataAlgorithm {
|
||||||
@ -83,7 +83,7 @@ function getAlgoithComponent(
|
|||||||
container: {
|
container: {
|
||||||
entrypoint: entrypoint,
|
entrypoint: entrypoint,
|
||||||
image: image,
|
image: image,
|
||||||
tag: version
|
tag: containerTag
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -136,7 +136,7 @@ export function transformPublishAlgorithmFormToMetadata(
|
|||||||
tags,
|
tags,
|
||||||
dockerImage,
|
dockerImage,
|
||||||
image,
|
image,
|
||||||
version,
|
containerTag,
|
||||||
entrypoint,
|
entrypoint,
|
||||||
termsAndConditions,
|
termsAndConditions,
|
||||||
files
|
files
|
||||||
@ -148,7 +148,7 @@ export function transformPublishAlgorithmFormToMetadata(
|
|||||||
const algorithmLanguace = getAlgoithFileExtension(fileUrl)
|
const algorithmLanguace = getAlgoithFileExtension(fileUrl)
|
||||||
const algorithm = getAlgoithComponent(
|
const algorithm = getAlgoithComponent(
|
||||||
image,
|
image,
|
||||||
version,
|
containerTag,
|
||||||
entrypoint,
|
entrypoint,
|
||||||
algorithmLanguace
|
algorithmLanguace
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user