diff --git a/.gitignore b/.gitignore index 126bc7a..5ce1bb8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ node_modules -.env +.env* .vscode -yarn-error.log -/data +/data* +*.log diff --git a/examples/constants.js b/examples/constants.js deleted file mode 100644 index 7816501..0000000 --- a/examples/constants.js +++ /dev/null @@ -1,474 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -/* eslint-disable no-template-curly-in-string */ - -const MARKET_ITEM_LIST = [ - { - id: '0b41d10e-36e5-4e97-95c2-27726dd94f33', - name: 'COVID-19 Chest X-ray Dataset', - author: 'ieee8023', - type: 'data', - dataType: 'github', - dataUrl: - 'https://github.com/ieee8023/covid-chestxray-dataset/archive/master.zip', - categories: 'COVID-19', - tags: ['open source dataset'], - summary: 'Dataset of COVID-19 X-ray and CT images on GitHub', - protocol: 'covid_chestxray_dataset.yaml', - useNumber: 0, - starNumber: 0, - status: 'approved', - createdAt: '2020-09-20T04:52:48.289Z', - updatedAt: '2020-09-20T04:52:48.289Z', - }, - { - id: 'e284b120-fdaf-11ea-adc1-0242ac120002', - name: 'COVID-19 Chest X-ray Diagnosis Training Job Template', - author: 'mlmed', - type: 'template', - categories: 'COVID-19', - tags: ['official example'], - summary: 'Covid chestxray model training job', - protocol: 'covid_chestxray_training.yaml', - useNumber: 0, - starNumber: 0, - status: 'approved', - createdAt: '2020-09-20T04:52:48.289Z', - updatedAt: '2020-09-20T04:52:48.289Z', - }, - { - id: '1', - name: 'Couplet Dataset', - author: 'OpenPAI', - type: 'data', - dataType: 'blob', - dataUrl: - 'https://openpaimarketplace.blob.core.windows.net/marketplace/Couplet_data/couplet_data.tgz', - categories: 'AI couplet', - tags: ['official example'], - summary: 'Dataset of couplet', - protocol: 'couplet_dataset.yaml', - useNumber: 0, - starNumber: 0, - status: 'approved', - createdAt: '2020-08-15T04:52:48.289Z', - updatedAt: '2020-08-15T04:52:48.289Z', - }, - { - id: '2', - name: 'Couplet Training Job Template', - author: 'OpenPAI', - type: 'template', - categories: 'AI couplet', - tags: ['official example'], - summary: 'Couplet model training job', - protocol: 'couplet_training.yaml', - useNumber: 0, - starNumber: 0, - status: 'approved', - createdAt: '2020-08-15T04:52:48.289Z', - updatedAt: '2020-08-15T04:52:48.289Z', - }, - { - id: '3', - name: 'Couplet Inference Job Template', - author: 'OpenPAI', - type: 'template', - categories: 'AI couplet', - tags: ['official example'], - summary: 'Couplet inference service with trained model', - protocol: 'couplet_inference.yaml', - useNumber: 0, - starNumber: 0, - status: 'approved', - createdAt: '2020-08-15T04:52:48.289Z', - updatedAt: '2020-08-15T04:52:48.289Z', - }, - { - id: '4', - name: 'Covid19 Outbreak Statistics Dataset', - author: 'OpenPAI', - type: 'data', - dataType: 'blob', - dataUrl: - 'https://openpaimarketplace.blob.core.windows.net/marketplace/Covid19_data/covid-19_data.json', - categories: 'AI couplet', - tags: ['official example'], - summary: - 'Provides up-to-date data about Coronavirus outbreak, including numbers about confirmed cases, deaths and recovered', - protocol: 'covid_dataset.yaml', - useNumber: 0, - starNumber: 0, - status: 'approved', - createdAt: '2020-08-15T04:52:48.289Z', - updatedAt: '2020-08-15T04:52:48.289Z', - }, - { - id: '5', - name: 'Covid19 Prediction Model', - author: 'OpenPAI', - type: 'template', - categories: 'AI couplet', - tags: ['official example'], - summary: - 'This model predicts the confirmed and death number of population of different dates', - protocol: 'covid_training.yaml', - useNumber: 0, - starNumber: 0, - status: 'approved', - createdAt: '2020-08-15T04:52:48.289Z', - updatedAt: '2020-08-15T04:52:48.289Z', - }, - { - id: '6', - name: 'Covid19 Inference Service', - author: 'OpenPAI', - type: 'template', - categories: 'AI couplet', - tags: ['official example'], - summary: - 'This is the inference service to visualize the prediction number of confirmed and death population in different countries', - protocol: 'covid_inference.yaml', - useNumber: 0, - starNumber: 0, - status: 'approved', - createdAt: '2020-08-15T04:52:48.289Z', - updatedAt: '2020-08-15T04:52:48.289Z', - }, - { - id: '7', - name: 'Grammar Check Dataset', - author: 'OpenPAI', - type: 'data', - dataType: 'blob', - dataUrl: - 'https://openpaimarketplace.blob.core.windows.net/marketplace/GrammarCheck/gramarCheck_data.tgz', - categories: 'AI couplet', - tags: ['official example'], - summary: 'Dataset for grammar check task', - protocol: 'grammar_check_dataset.yaml', - useNumber: 0, - starNumber: 0, - status: 'approved', - createdAt: '2020-08-15T04:52:48.289Z', - updatedAt: '2020-08-15T04:52:48.289Z', - }, - { - id: '8', - name: 'Grammar Check Model Training', - author: 'OpenPAI', - type: 'template', - categories: 'AI couplet', - tags: ['official example'], - summary: 'A grammar check model training process', - protocol: 'grammar_check_training.yaml', - useNumber: 0, - starNumber: 0, - status: 'approved', - createdAt: '2020-08-15T04:52:48.289Z', - updatedAt: '2020-08-15T04:52:48.289Z', - }, - { - id: '9', - name: 'Grammar Check Inference Job', - author: 'OpenPAI', - type: 'template', - categories: 'AI couplet', - tags: ['official example'], - summary: 'Grammar check inference job with trained model', - protocol: 'grammar_check_inference.yaml', - useNumber: 0, - starNumber: 0, - status: 'approved', - createdAt: '2020-08-15T04:52:48.289Z', - updatedAt: '2020-08-15T04:52:48.289Z', - }, - { - id: '10', - name: 'GPU Sharing Example', - author: 'OpenPAI', - type: 'template', - categories: 'gpu sharing', - tags: ['official example'], - summary: 'GPU sharing example: two tasks share one GPU', - protocol: 'gpu_sharing.yaml', - useNumber: 0, - starNumber: 0, - status: 'approved', - createdAt: '2020-09-22T04:52:48.289Z', - updatedAt: '2020-09-22T04:52:48.289Z', - }, - { - id: '69ff3c37-1405-49a7-b9de-47e640ba490c', - name: 'Caffe2 Minist Example', - author: 'OpenPAI', - type: 'old', - categories: ['official example'], - tags: ['official example'], - summary: 'A caffe minist example', - protocol: 'caffe-mnist.yaml', - useNumber: 0, - starNumber: 0, - status: 'approved', - createdAt: '2020-07-28T04:52:48.289Z', - updatedAt: '2020-07-28T04:52:48.289Z', - }, - { - id: '9d3fbdad-dd82-429c-a368-f3d7b41717b5', - name: 'Caffe2 ResNet50 Example', - author: 'OpenPAI', - type: 'old', - categories: ['official example'], - tags: ['official example'], - summary: 'A caffe resnet50 example', - protocol: 'caffe2-resnet50.yaml', - useNumber: 0, - starNumber: 0, - status: 'approved', - createdAt: '2020-07-28T04:52:48.289Z', - updatedAt: '2020-07-28T04:52:48.289Z', - }, - { - id: '5fa59045-c3f8-4243-88ff-89a1034681d8', - name: 'Chainer Example', - author: 'OpenPAI', - type: 'old', - categories: ['official example'], - tags: ['official example'], - summary: 'A chainer example', - protocol: 'chainer-cifar.yaml', - useNumber: 0, - starNumber: 0, - status: 'approved', - createdAt: '2020-07-28T04:52:48.289Z', - updatedAt: '2020-07-28T04:52:48.289Z', - }, - { - id: 'd5f357d0-70cc-435c-92f2-21d63c7a1513', - name: 'Horovod Pytorch', - author: 'OpenPAI', - type: 'old', - categories: ['official example'], - tags: ['official example'], - summary: 'A horovod pytorch example', - protocol: 'horovod-pytorch-synthetic-benchmark.yaml', - useNumber: 0, - starNumber: 0, - status: 'approved', - createdAt: '2020-07-28T04:52:48.289Z', - updatedAt: '2020-07-28T04:52:48.289Z', - }, - { - id: '55a21b76-abbe-4f75-9b09-ed0ee3accc16', - name: 'Keras Tensorflow Mnist Example', - author: 'OpenPAI', - type: 'old', - categories: ['official example'], - tags: ['official example'], - summary: 'A keras tensorflow minist example', - protocol: 'keras-tensorflow-mnist.yaml', - useNumber: 0, - starNumber: 0, - status: 'approved', - createdAt: '2020-07-28T04:52:48.289Z', - updatedAt: '2020-07-28T04:52:48.289Z', - }, - { - id: '56a0d871-fe2d-43ce-b26c-b89b9c0646fd', - name: 'Mxnet Autoencoder Example', - author: 'OpenPAI', - type: 'old', - categories: ['official example'], - tags: ['official example'], - summary: 'A Mxnet Autoencoder Example', - protocol: 'mxnet-autoencoder.yaml', - useNumber: 0, - starNumber: 0, - status: 'approved', - createdAt: '2020-07-28T04:52:48.289Z', - updatedAt: '2020-07-28T04:52:48.289Z', - }, - { - id: 'cc42d399-06d8-4b93-9e84-e5f609ef0c73', - name: 'Pytorch Mnist Example', - author: 'OpenPAI', - type: 'old', - categories: ['official example'], - tags: ['official example'], - summary: 'A Pytorch Mnist Example', - protocol: 'pytorch-mnist.yaml', - useNumber: 0, - starNumber: 0, - status: 'approved', - createdAt: '2020-07-28T04:52:48.289Z', - updatedAt: '2020-07-28T04:52:48.289Z', - }, - { - id: '1c7efdef-40da-46d0-bdea-16c25e560380', - name: 'Pytorch Regression Example', - author: 'OpenPAI', - type: 'old', - categories: ['official example'], - tags: ['official example'], - summary: 'A Pytorch Regression Example', - protocol: 'pytorch-regression.yaml', - useNumber: 0, - starNumber: 0, - status: 'approved', - createdAt: '2020-07-28T04:52:48.289Z', - updatedAt: '2020-07-28T04:52:48.289Z', - }, - { - id: '80cf9714-de4e-480b-8e26-66f529dbff6d', - name: 'Rocm Pytorch Mnist', - author: 'OpenPAI', - type: 'old', - categories: ['official example'], - tags: ['official example'], - summary: 'A Rocm Pytorch Example', - protocol: 'rocm-pytorch-mnist.yaml', - useNumber: 0, - starNumber: 0, - status: 'approved', - createdAt: '2020-07-28T04:52:48.289Z', - updatedAt: '2020-07-28T04:52:48.289Z', - }, - { - id: '44cbad87-c2d5-4433-9890-0883f07e3912', - name: 'rocm_tensorflow2', - author: 'OpenPAI', - type: 'old', - categories: ['official example'], - tags: ['official example'], - summary: 'A Rocm Tensorflow2 Example', - protocol: 'rocm-tensorflow2.yaml', - useNumber: 0, - starNumber: 0, - status: 'approved', - createdAt: '2020-07-28T04:52:48.289Z', - updatedAt: '2020-07-28T04:52:48.289Z', - }, - { - id: '17c2500d-94ed-4e2d-af74-e1ace47987af', - name: 'sklearn_text_vectorizers', - author: 'OpenPAI', - type: 'old', - categories: ['official example'], - tags: ['official example'], - summary: 'A Scikit-learn Example', - protocol: 'sklearn-text-vectorizers.yaml', - useNumber: 0, - starNumber: 0, - status: 'approved', - createdAt: '2020-07-28T04:52:48.289Z', - updatedAt: '2020-07-28T04:52:48.289Z', - }, - { - id: '4fb02608-3769-475c-a0c2-c2155fb03c4f', - name: 'tensorflow_cifar10', - author: 'OpenPAI', - type: 'old', - categories: ['official example'], - tags: ['official example'], - summary: 'A Tensorflow Distributed Example', - protocol: 'tensorflow-cifar10.yaml', - useNumber: 0, - starNumber: 0, - status: 'approved', - createdAt: '2020-07-28T04:52:48.289Z', - updatedAt: '2020-07-28T04:52:48.289Z', - }, - { - id: '74c8ab09-6225-4982-8145-5be0b5c55a28', - name: 'tensorflow_serving_mnist', - author: 'OpenPAI', - type: 'old', - categories: ['official example'], - tags: ['official example'], - summary: 'A Tensorflow Mnist Model Example', - protocol: 'tensorflow-serving-mnist.yaml', - useNumber: 0, - starNumber: 0, - status: 'approved', - createdAt: '2020-08-15T04:52:48.289Z', - updatedAt: '2020-08-15T04:52:48.289Z', - }, - { - id: '11', - name: 'cifar10-single-mul-DDP-gloo', - author: 'OpenPAI', - type: 'template', - categories: ['distributed example'], - tags: ['official example'], - summary: 'Pytorch Cifar10 Example', - protocol: 'cifar10-single-mul-DDP-gloo.yaml', - useNumber: 0, - starNumber: 0, - status: 'approved', - createdAt: '2020-09-23T14:52:48.289Z', - updatedAt: '2020-09-23T14:52:48.289Z', - }, - { - id: '12', - name: 'cifar10-single-mul-DDP-gloo-Apex-mixed', - author: 'OpenPAI', - type: 'template', - categories: ['distributed example'], - tags: ['official example'], - summary: 'Pytorch Cifar10 Example', - protocol: 'cifar10-single-mul-DDP-gloo-Apex-mixed.yaml', - useNumber: 0, - starNumber: 0, - status: 'approved', - createdAt: '2020-09-23T14:52:48.289Z', - updatedAt: '2020-09-23T14:52:48.289Z', - }, - { - id: '13', - name: 'cifar10-single-mul-DDP-nccl', - author: 'OpenPAI', - type: 'template', - categories: ['distributed example'], - tags: ['official example'], - summary: 'Pytorch Cifar10 Example', - protocol: 'cifar10-single-mul-DDP-nccl.yaml', - useNumber: 0, - starNumber: 0, - status: 'approved', - createdAt: '2020-09-23T14:52:48.289Z', - updatedAt: '2020-09-23T14:52:48.289Z', - }, - { - id: '14', - name: 'cifar10-single-mul-DDP-nccl-Apex-mixed', - author: 'OpenPAI', - type: 'template', - categories: ['distributed example'], - tags: ['official example'], - summary: 'Pytorch Cifar10 Example', - protocol: 'cifar10-single-mul-DDP-nccl-Apex-mixed.yaml', - useNumber: 0, - starNumber: 0, - status: 'approved', - createdAt: '2020-09-23T14:52:48.289Z', - updatedAt: '2020-09-23T14:52:48.289Z', - }, - { - id: '15', - name: 'cifar10-single-node-gpus-cpu-DP', - author: 'OpenPAI', - type: 'template', - categories: ['distributed example'], - tags: ['official example'], - summary: 'Pytorch Cifar10 Example', - protocol: 'cifar10-single-node-gpus-cpu-DP.yaml', - useNumber: 0, - starNumber: 0, - status: 'approved', - createdAt: '2020-09-23T14:52:48.289Z', - updatedAt: '2020-09-23T14:52:48.289Z', - }, -]; - -module.exports = { MARKET_ITEM_LIST }; diff --git a/examples/examples.js b/examples/examples.js new file mode 100644 index 0000000..4cc73a3 --- /dev/null +++ b/examples/examples.js @@ -0,0 +1,502 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const EXAMPLE_LIST = [ + { + id: "0b41d10e-36e5-4e97-95c2-27726dd94f33", + name: "COVID-19 Chest X-ray Dataset", + author: "ieee8023", + type: "data", + dataType: "github", + dataUrl: + "https://github.com/ieee8023/covid-chestxray-dataset/archive/master.zip", + categories: "COVID-19", + tags: ["open source dataset"], + summary: "Dataset of COVID-19 X-ray and CT images on GitHub", + protocol: "covid_chestxray_dataset.yaml", + description: "covid_chestxray_dataset.md", + useNumber: 0, + starNumber: 0, + status: "approved", + createdAt: "2020-09-20T04:52:48.289Z", + updatedAt: "2020-09-20T04:52:48.289Z", + }, + { + id: "e284b120-fdaf-11ea-adc1-0242ac120002", + name: "COVID-19 Chest X-ray Diagnosis Training Job Template", + author: "mlmed", + type: "template", + categories: "COVID-19", + tags: ["official example"], + summary: "Covid chestxray model training job", + protocol: "covid_chestxray_training.yaml", + description: "covid_chestxray_training.md", + useNumber: 0, + starNumber: 0, + status: "approved", + createdAt: "2020-09-20T04:52:48.289Z", + updatedAt: "2020-09-20T04:52:48.289Z", + }, + { + id: "1", + name: "Couplet Dataset", + author: "OpenPAI", + type: "data", + dataType: "blob", + dataUrl: + "https://openpaimarketplace.blob.core.windows.net/marketplace/Couplet_data/couplet_data.tgz", + categories: "AI couplet", + tags: ["official example"], + summary: "Dataset of couplet", + protocol: "couplet_dataset.yaml", + description: "couplet_dataset.md", + useNumber: 0, + starNumber: 0, + status: "approved", + createdAt: "2020-08-15T04:52:48.289Z", + updatedAt: "2020-08-15T04:52:48.289Z", + }, + { + id: "2", + name: "Couplet Training Job Template", + author: "OpenPAI", + type: "template", + categories: "AI couplet", + tags: ["official example"], + summary: "Couplet model training job", + protocol: "couplet_training.yaml", + description: "couplet_training.md", + useNumber: 0, + starNumber: 0, + status: "approved", + createdAt: "2020-08-15T04:52:48.289Z", + updatedAt: "2020-08-15T04:52:48.289Z", + }, + { + id: "3", + name: "Couplet Inference Job Template", + author: "OpenPAI", + type: "template", + categories: "AI couplet", + tags: ["official example"], + summary: "Couplet inference service with trained model", + protocol: "couplet_inference.yaml", + description: "couplet_inference.md", + useNumber: 0, + starNumber: 0, + status: "approved", + createdAt: "2020-08-15T04:52:48.289Z", + updatedAt: "2020-08-15T04:52:48.289Z", + }, + { + id: "4", + name: "Covid19 Outbreak Statistics Dataset", + author: "OpenPAI", + type: "data", + dataType: "blob", + dataUrl: + "https://openpaimarketplace.blob.core.windows.net/marketplace/Covid19_data/covid-19_data.json", + categories: "AI couplet", + tags: ["official example"], + summary: + "Provides up-to-date data about Coronavirus outbreak, including numbers about confirmed cases, deaths and recovered", + protocol: "covid_dataset.yaml", + description: "covid_dataset.md", + useNumber: 0, + starNumber: 0, + status: "approved", + createdAt: "2020-08-15T04:52:48.289Z", + updatedAt: "2020-08-15T04:52:48.289Z", + }, + { + id: "5", + name: "Covid19 Prediction Model", + author: "OpenPAI", + type: "template", + categories: "AI couplet", + tags: ["official example"], + summary: + "This model predicts the confirmed and death number of population of different dates", + protocol: "covid_training.yaml", + description: "covid_training.md", + useNumber: 0, + starNumber: 0, + status: "approved", + createdAt: "2020-08-15T04:52:48.289Z", + updatedAt: "2020-08-15T04:52:48.289Z", + }, + { + id: "6", + name: "Covid19 Inference Service", + author: "OpenPAI", + type: "template", + categories: "AI couplet", + tags: ["official example"], + summary: + "This is the inference service to visualize the prediction number of confirmed and death population in different countries", + protocol: "covid_inference.yaml", + description: "covid_inference.md", + useNumber: 0, + starNumber: 0, + status: "approved", + createdAt: "2020-08-15T04:52:48.289Z", + updatedAt: "2020-08-15T04:52:48.289Z", + }, + { + id: "7", + name: "Grammar Check Dataset", + author: "OpenPAI", + type: "data", + dataType: "blob", + dataUrl: + "https://openpaimarketplace.blob.core.windows.net/marketplace/GrammarCheck/gramarCheck_data.tgz", + categories: "AI couplet", + tags: ["official example"], + summary: "Dataset for grammar check task", + protocol: "grammar_check_dataset.yaml", + description: "grammar_check_dataset.md", + useNumber: 0, + starNumber: 0, + status: "approved", + createdAt: "2020-08-15T04:52:48.289Z", + updatedAt: "2020-08-15T04:52:48.289Z", + }, + { + id: "8", + name: "Grammar Check Model Training", + author: "OpenPAI", + type: "template", + categories: "AI couplet", + tags: ["official example"], + summary: "A grammar check model training process", + protocol: "grammar_check_training.yaml", + description: "grammar_check_training.md", + useNumber: 0, + starNumber: 0, + status: "approved", + createdAt: "2020-08-15T04:52:48.289Z", + updatedAt: "2020-08-15T04:52:48.289Z", + }, + { + id: "9", + name: "Grammar Check Inference Job", + author: "OpenPAI", + type: "template", + categories: "AI couplet", + tags: ["official example"], + summary: "Grammar check inference job with trained model", + protocol: "grammar_check_inference.yaml", + description: "grammar_check_inference.md", + useNumber: 0, + starNumber: 0, + status: "approved", + createdAt: "2020-08-15T04:52:48.289Z", + updatedAt: "2020-08-15T04:52:48.289Z", + }, + { + id: "10", + name: "GPU Sharing Example", + author: "OpenPAI", + type: "template", + categories: "gpu sharing", + tags: ["official example"], + summary: "GPU sharing example: two tasks share one GPU", + protocol: "gpu_sharing.yaml", + description: "gpu_sharing.md", + useNumber: 0, + starNumber: 0, + status: "approved", + createdAt: "2020-09-22T04:52:48.289Z", + updatedAt: "2020-09-22T04:52:48.289Z", + }, + { + id: "69ff3c37-1405-49a7-b9de-47e640ba490c", + name: "Caffe2 Minist Example", + author: "OpenPAI", + type: "old", + categories: ["official example"], + tags: ["official example"], + summary: "A caffe minist example", + protocol: "caffe-mnist.yaml", + description: "caffe-mnist.md", + useNumber: 0, + starNumber: 0, + status: "approved", + createdAt: "2020-07-28T04:52:48.289Z", + updatedAt: "2020-07-28T04:52:48.289Z", + }, + { + id: "9d3fbdad-dd82-429c-a368-f3d7b41717b5", + name: "Caffe2 ResNet50 Example", + author: "OpenPAI", + type: "old", + categories: ["official example"], + tags: ["official example"], + summary: "A caffe resnet50 example", + protocol: "caffe2-resnet50.yaml", + description: "caffe2-resnet50.md", + useNumber: 0, + starNumber: 0, + status: "approved", + createdAt: "2020-07-28T04:52:48.289Z", + updatedAt: "2020-07-28T04:52:48.289Z", + }, + { + id: "5fa59045-c3f8-4243-88ff-89a1034681d8", + name: "Chainer Example", + author: "OpenPAI", + type: "old", + categories: ["official example"], + tags: ["official example"], + summary: "A chainer example", + protocol: "chainer-cifar.yaml", + description: "chainer-cifar.md", + useNumber: 0, + starNumber: 0, + status: "approved", + createdAt: "2020-07-28T04:52:48.289Z", + updatedAt: "2020-07-28T04:52:48.289Z", + }, + { + id: "d5f357d0-70cc-435c-92f2-21d63c7a1513", + name: "Horovod Pytorch", + author: "OpenPAI", + type: "old", + categories: ["official example"], + tags: ["official example"], + summary: "A horovod pytorch example", + protocol: "horovod-pytorch-synthetic-benchmark.yaml", + description: "horovod-pytorch-synthetic-benchmark.md", + useNumber: 0, + starNumber: 0, + status: "approved", + createdAt: "2020-07-28T04:52:48.289Z", + updatedAt: "2020-07-28T04:52:48.289Z", + }, + { + id: "55a21b76-abbe-4f75-9b09-ed0ee3accc16", + name: "Keras Tensorflow Mnist Example", + author: "OpenPAI", + type: "old", + categories: ["official example"], + tags: ["official example"], + summary: "A keras tensorflow minist example", + protocol: "keras-tensorflow-mnist.yaml", + description: "keras-tensorflow-mnist.md", + useNumber: 0, + starNumber: 0, + status: "approved", + createdAt: "2020-07-28T04:52:48.289Z", + updatedAt: "2020-07-28T04:52:48.289Z", + }, + { + id: "56a0d871-fe2d-43ce-b26c-b89b9c0646fd", + name: "Mxnet Autoencoder Example", + author: "OpenPAI", + type: "old", + categories: ["official example"], + tags: ["official example"], + summary: "A Mxnet Autoencoder Example", + protocol: "mxnet-autoencoder.yaml", + description: "mxnet-autoencoder.md", + useNumber: 0, + starNumber: 0, + status: "approved", + createdAt: "2020-07-28T04:52:48.289Z", + updatedAt: "2020-07-28T04:52:48.289Z", + }, + { + id: "cc42d399-06d8-4b93-9e84-e5f609ef0c73", + name: "Pytorch Mnist Example", + author: "OpenPAI", + type: "old", + categories: ["official example"], + tags: ["official example"], + summary: "A Pytorch Mnist Example", + protocol: "pytorch-mnist.yaml", + description: "pytorch-mnist.md", + useNumber: 0, + starNumber: 0, + status: "approved", + createdAt: "2020-07-28T04:52:48.289Z", + updatedAt: "2020-07-28T04:52:48.289Z", + }, + { + id: "1c7efdef-40da-46d0-bdea-16c25e560380", + name: "Pytorch Regression Example", + author: "OpenPAI", + type: "old", + categories: ["official example"], + tags: ["official example"], + summary: "A Pytorch Regression Example", + protocol: "pytorch-regression.yaml", + description: "pytorch-regression.md", + useNumber: 0, + starNumber: 0, + status: "approved", + createdAt: "2020-07-28T04:52:48.289Z", + updatedAt: "2020-07-28T04:52:48.289Z", + }, + { + id: "80cf9714-de4e-480b-8e26-66f529dbff6d", + name: "Rocm Pytorch Mnist", + author: "OpenPAI", + type: "old", + categories: ["official example"], + tags: ["official example"], + summary: "A Rocm Pytorch Example", + protocol: "rocm-pytorch-mnist.yaml", + description: "rocm-pytorch-mnist.md", + useNumber: 0, + starNumber: 0, + status: "approved", + createdAt: "2020-07-28T04:52:48.289Z", + updatedAt: "2020-07-28T04:52:48.289Z", + }, + { + id: "44cbad87-c2d5-4433-9890-0883f07e3912", + name: "rocm_tensorflow2", + author: "OpenPAI", + type: "old", + categories: ["official example"], + tags: ["official example"], + summary: "A Rocm Tensorflow2 Example", + protocol: "rocm-tensorflow2.yaml", + description: "rocm-tensorflow2.md", + useNumber: 0, + starNumber: 0, + status: "approved", + createdAt: "2020-07-28T04:52:48.289Z", + updatedAt: "2020-07-28T04:52:48.289Z", + }, + { + id: "17c2500d-94ed-4e2d-af74-e1ace47987af", + name: "sklearn_text_vectorizers", + author: "OpenPAI", + type: "old", + categories: ["official example"], + tags: ["official example"], + summary: "A Scikit-learn Example", + protocol: "sklearn-text-vectorizers.yaml", + description: "sklearn-text-vectorizers.md", + useNumber: 0, + starNumber: 0, + status: "approved", + createdAt: "2020-07-28T04:52:48.289Z", + updatedAt: "2020-07-28T04:52:48.289Z", + }, + { + id: "4fb02608-3769-475c-a0c2-c2155fb03c4f", + name: "tensorflow_cifar10", + author: "OpenPAI", + type: "old", + categories: ["official example"], + tags: ["official example"], + summary: "A Tensorflow Distributed Example", + protocol: "tensorflow-cifar10.yaml", + description: "tensorflow-cifar10.md", + useNumber: 0, + starNumber: 0, + status: "approved", + createdAt: "2020-07-28T04:52:48.289Z", + updatedAt: "2020-07-28T04:52:48.289Z", + }, + { + id: "74c8ab09-6225-4982-8145-5be0b5c55a28", + name: "tensorflow_serving_mnist", + author: "OpenPAI", + type: "old", + categories: ["official example"], + tags: ["official example"], + summary: "A Tensorflow Mnist Model Example", + protocol: "tensorflow-serving-mnist.yaml", + description: "tensorflow-serving-mnist.md", + useNumber: 0, + starNumber: 0, + status: "approved", + createdAt: "2020-08-15T04:52:48.289Z", + updatedAt: "2020-08-15T04:52:48.289Z", + }, + { + id: "11", + name: "cifar10-single-mul-DDP-gloo", + author: "OpenPAI", + type: "template", + categories: ["distributed example"], + tags: ["official example"], + summary: "Pytorch Cifar10 Example", + protocol: "cifar10-single-mul-DDP-gloo.yaml", + description: "cifar10-single-mul-DDP-gloo.md", + useNumber: 0, + starNumber: 0, + status: "approved", + createdAt: "2020-09-23T14:52:48.289Z", + updatedAt: "2020-09-23T14:52:48.289Z", + }, + { + id: "12", + name: "cifar10-single-mul-DDP-gloo-Apex-mixed", + author: "OpenPAI", + type: "template", + categories: ["distributed example"], + tags: ["official example"], + summary: "Pytorch Cifar10 Example", + protocol: "cifar10-single-mul-DDP-gloo-Apex-mixed.yaml", + description: "cifar10-single-mul-DDP-gloo-Apex-mixed.md", + useNumber: 0, + starNumber: 0, + status: "approved", + createdAt: "2020-09-23T14:52:48.289Z", + updatedAt: "2020-09-23T14:52:48.289Z", + }, + { + id: "13", + name: "cifar10-single-mul-DDP-nccl", + author: "OpenPAI", + type: "template", + categories: ["distributed example"], + tags: ["official example"], + summary: "Pytorch Cifar10 Example", + protocol: "cifar10-single-mul-DDP-nccl.yaml", + description: "cifar10-single-mul-DDP-nccl.md", + useNumber: 0, + starNumber: 0, + status: "approved", + createdAt: "2020-09-23T14:52:48.289Z", + updatedAt: "2020-09-23T14:52:48.289Z", + }, + { + id: "14", + name: "cifar10-single-mul-DDP-nccl-Apex-mixed", + author: "OpenPAI", + type: "template", + categories: ["distributed example"], + tags: ["official example"], + summary: "Pytorch Cifar10 Example", + protocol: "cifar10-single-mul-DDP-nccl-Apex-mixed.yaml", + description: "cifar10-single-mul-DDP-nccl-Apex-mixed.md", + useNumber: 0, + starNumber: 0, + status: "approved", + createdAt: "2020-09-23T14:52:48.289Z", + updatedAt: "2020-09-23T14:52:48.289Z", + }, + { + id: "15", + name: "cifar10-single-node-gpus-cpu-DP", + author: "OpenPAI", + type: "template", + categories: ["distributed example"], + tags: ["official example"], + summary: "Pytorch Cifar10 Example", + protocol: "cifar10-single-node-gpus-cpu-DP.yaml", + description: "cifar10-single-node-gpus-cpu-DP.md", + useNumber: 0, + starNumber: 0, + status: "approved", + createdAt: "2020-09-23T14:52:48.289Z", + updatedAt: "2020-09-23T14:52:48.289Z", + }, +]; + +module.exports = { EXAMPLE_LIST }; diff --git a/rest_server/src/models/marketplace_item.js b/rest_server/src/models/marketplace_item.js index 5442c22..15806d6 100644 --- a/rest_server/src/models/marketplace_item.js +++ b/rest_server/src/models/marketplace_item.js @@ -19,7 +19,11 @@ class MarketplaceItem { categories: DataTypes.ARRAY(DataTypes.STRING), tags: DataTypes.ARRAY(DataTypes.STRING), summary: DataTypes.STRING, - protocol: DataTypes.TEXT, + description: DataTypes.TEXT, + protocol: { + type: DataTypes.TEXT, + allowNull: false, + }, useNumber: { type: DataTypes.INTEGER, allowNull: false, diff --git a/rest_server/src/models/model_init_handler.js b/rest_server/src/models/model_init_handler.js index 32f066f..a44fc6f 100644 --- a/rest_server/src/models/model_init_handler.js +++ b/rest_server/src/models/model_init_handler.js @@ -2,28 +2,38 @@ // Licensed under the MIT License. const { get } = require('lodash'); const fs = require('fs-extra'); -const yaml = require('js-yaml'); const path = require('path'); -const { MARKET_ITEM_LIST } = require('../../../examples/constants'); +const { EXAMPLE_LIST } = require('../../../examples/examples'); -const EXAMPLE_DIR1 = path.join(__dirname, '../../../examples/yaml_templates'); -const EXAMPLE_DIR2 = path.join(__dirname, '../../../examples/item_protocols'); +const protocolDir = path.join(__dirname, '../../../examples/item_protocols'); +const descriptionDir = path.join( + __dirname, + '../../../examples/item_descriptions', +); const createTemplates = async models => { - const templates = []; await Promise.all( - MARKET_ITEM_LIST.map(async item => { - const filePath = path.join( - item.type === 'old' ? EXAMPLE_DIR1 : EXAMPLE_DIR2, - item.protocol, - ); + EXAMPLE_LIST.map(async item => { try { - const text = await fs.readFile(filePath, 'utf8'); - const template = yaml.safeLoad(text); - templates.push(template); + const protocolFilePath = path.join( + item.type === 'old' + ? path.join(protocolDir, 'old_templates') + : protocolDir, + item.protocol, + ); + const descriptionFilePath = + item.type === 'old' + ? null + : path.join(descriptionDir, item.description); + const protocolText = await fs.readFile(protocolFilePath, 'utf8'); + let descriptionText = `# ${item.name}`; + if (await fs.pathExists(descriptionFilePath)) { + descriptionText = await fs.readFile(descriptionFilePath, 'utf8'); + } const newItem = { ...item, - ...{ protocol: text }, + protocol: protocolText, + description: descriptionText, ...{ categories: Array.isArray(item.categories) ? item.categories @@ -36,8 +46,6 @@ const createTemplates = async models => { } }), ); - - return templates; }; const init = async models => { diff --git a/webportal/src/app/market_detail/components/pivot_card.jsx b/webportal/src/app/market_detail/components/pivot_card.jsx index 297301b..819f291 100644 --- a/webportal/src/app/market_detail/components/pivot_card.jsx +++ b/webportal/src/app/market_detail/components/pivot_card.jsx @@ -35,7 +35,7 @@ const PivotCard = props => {