diff --git a/main.py b/main.py index 51d8381..a277960 100644 --- a/main.py +++ b/main.py @@ -72,7 +72,7 @@ response = openai.ChatCompletion.create( + test_description + "Finally write the Dockerfile that defines the environment with all necessary dependencies which the executor uses. " "It is important to make sure that all libs are installed that are required by the python packages. " - "The base image of the Dockerfile is jinaai/jina:3.14.2-dev18-py310-standard. " + "The base image of the Dockerfile is FROM jinaai/jina:3.14.2-dev18-py310-standard. " "The Dockerfile runs the test during the build process (wrap the code in the string $$$start_dockerfile$$$ ... $$$end_dockerfile$$$)" }, @@ -96,7 +96,7 @@ def clean_content(content): executor_name = find_between(plain_text, f'$$$start_executor_name$$$', f'$$$end_executor_name$$$').strip() -for tag, file_name in [['executor', f'{executor_name}py'], ['requirements', 'requirements.txt'], ['test_executor', 'test_executor.py'], ['ockerfile', 'Dockerfile']]: +for tag, file_name in [['executor', f'{executor_name}.py'], ['requirements', 'requirements.txt'], ['test_executor', 'test_OCRDetectorExecutor.py'], ['dockerfile', 'Dockerfile']]: content = find_between(plain_text, f'$$$start_{tag}$$$', f'$$$end_{tag}$$$') clean = clean_content(content) folder = 'executor' @@ -108,7 +108,7 @@ for tag, file_name in [['executor', f'{executor_name}py'], ['requirements', 'req config_content = f''' jtype: {executor_name} py_modules: - - executor.py + - {executor_name}.py metas: name: {executor_name} ''' diff --git a/microchain-frontend/src/Graph.js b/microchain-frontend/src/Graph.js new file mode 100644 index 0000000..40dae55 --- /dev/null +++ b/microchain-frontend/src/Graph.js @@ -0,0 +1,52 @@ +import React, { useState } from 'react'; +import Microservice from './Microservice'; +import MicroserviceModal from './MicroserviceModal'; +import { Button, Grid } from '@material-ui/core'; + +const Graph = ({ onExport }) => { + const [microservices, setMicroservices] = useState([]); + const [selectedMicroservice, setSelectedMicroservice] = useState(null); + const [showModal, setShowModal] = useState(false); + + const handleSave = (microservice) => { + if (selectedMicroservice) { + setMicroservices( + microservices.map((ms) => + ms.id === selectedMicroservice.id ? microservice : ms + ) + ); + } else { + setMicroservices([...microservices, { ...microservice, id: Date.now() }]); + } + setSelectedMicroservice(null); + }; + + const handleEdit = (microservice) => { + setSelectedMicroservice(microservice); + setShowModal(true); + }; + + return ( +