diff --git a/content/pages/publish/form-algorithm.json b/content/pages/publish/form-algorithm.json index fc7be3b4e..dbfc98a3b 100644 --- a/content/pages/publish/form-algorithm.json +++ b/content/pages/publish/form-algorithm.json @@ -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 }, diff --git a/src/@types/MetaData.d.ts b/src/@types/MetaData.d.ts index 6b3dc1812..9ebf613b5 100644 --- a/src/@types/MetaData.d.ts +++ b/src/@types/MetaData.d.ts @@ -50,7 +50,7 @@ export interface MetadataPublishFormAlgorithm { termsAndConditions: boolean // ---- optional fields ---- image: string - version: string + containerTag: string entrypoint: string tags?: string } diff --git a/src/components/pages/Publish/FormAlgoPublish.tsx b/src/components/pages/Publish/FormAlgoPublish.tsx index a37b5c2c0..58490e121 100644 --- a/src/components/pages/Publish/FormAlgoPublish.tsx +++ b/src/components/pages/Publish/FormAlgoPublish.tsx @@ -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 } diff --git a/src/models/FormAlgoPublish.ts b/src/models/FormAlgoPublish.ts index 8831e7d9a..d5299229f 100644 --- a/src/models/FormAlgoPublish.ts +++ b/src/models/FormAlgoPublish.ts @@ -16,7 +16,7 @@ export const validationSchema: Yup.SchemaOf = 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 = Yup. export const initialValues: Partial = { name: '', author: '', - dockerImage: '', + dockerImage: 'node:pre-defined', image: '', - version: '', + containerTag: '', entrypoint: '', files: '', description: '', diff --git a/src/utils/metadata.ts b/src/utils/metadata.ts index fb9fcaadf..014513d29 100644 --- a/src/utils/metadata.ts +++ b/src/utils/metadata.ts @@ -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 )