🛠️ fix: file name (#76)

* 🛠️ fix: file name

* 🛠️ fix: file name

* 🛠️ fix: file name

* 🛠️ fix: common libs
This commit is contained in:
Florian Hönicke
2023-05-03 09:53:44 +02:00
committed by GitHub
parent db1602c269
commit 51f2e4b096
5 changed files with 9 additions and 8 deletions

View File

@@ -1,5 +1,5 @@
EXECUTOR_FILE_NAME = '__init__.py'
IMPLEMENTATION_FILE_NAME = 'implementation.py'
IMPLEMENTATION_FILE_NAME = 'microservice.py'
TEST_EXECUTOR_FILE_NAME = 'test_microservice.py'
REQUIREMENTS_FILE_NAME = 'requirements.txt'
DOCKER_FILE_NAME = 'Dockerfile'

View File

@@ -145,13 +145,13 @@ metas:
num_approach, 1)
os.makedirs(MICROSERVICE_FOLDER_v1)
with open(os.path.join(os.path.dirname(__file__), 'static_files', 'microservice', 'microservice.py'), 'r') as f:
with open(os.path.join(os.path.dirname(__file__), 'static_files', 'microservice', 'jina_wrapper.py'), 'r', encoding='utf-8') as f:
microservice_executor_boilerplate = f.read()
microservice_executor_code = microservice_executor_boilerplate.replace('class GPTDeployExecutor(Executor):',
f'class {microservice_name}(Executor):')
persist_file(microservice_executor_code, os.path.join(MICROSERVICE_FOLDER_v1, EXECUTOR_FILE_NAME))
with open(os.path.join(os.path.dirname(__file__), 'static_files', 'microservice', 'apis.py'), 'r') as f:
with open(os.path.join(os.path.dirname(__file__), 'static_files', 'microservice', 'apis.py'), 'r', encoding='utf-8') as f:
persist_file(f.read(), os.path.join(MICROSERVICE_FOLDER_v1, 'apis.py'))
microservice_content = self.generate_and_persist_file(
@@ -221,7 +221,7 @@ metas:
@staticmethod
def read_docker_template():
with open(os.path.join(os.path.dirname(__file__), 'static_files', 'microservice', 'Dockerfile'), 'r') as f:
with open(os.path.join(os.path.dirname(__file__), 'static_files', 'microservice', 'Dockerfile'), 'r', encoding='utf-8') as f:
return f.read()
def parse_result_fn_dockerfile(self, content_raw: str):

View File

@@ -2,7 +2,7 @@ FROM jinaai/jina:3.14.1-py39-standard
# update pip
RUN pip install --upgrade pip
RUN apt-get update && apt-get install --no-install-recommends -y {{apt_get_packages}} && apt-get clean && rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install --no-install-recommends -y ffmpeg build-essential pkg-config {{apt_get_packages}} && apt-get clean && rm -rf /var/lib/apt/lists/*
## install requirements for the executor
COPY requirements.txt .

View File

@@ -1,7 +1,7 @@
from jina import Executor, requests as jina_requests, DocumentArray
import json
from .implementation import func
from .microservice import func
class GPTDeployExecutor(Executor):

View File

@@ -87,7 +87,8 @@ If you listed gpt_3_5_turbo earlier, you must use it. gpt_3_5_turbo is the best
''' + template_generate_possible_packages_output_format_string)
template_code_wrapping_string = '''The code will go into {file_name_purpose}. Make sure to wrap the code into ``` marks even if you only output code:
template_code_wrapping_string = '''The code will go into {file_name_purpose}.
Note that you must obey the double asterisk and tripple backtick syntax from like this:
**{file_name}**
```{tag_name}
...code...
@@ -145,7 +146,7 @@ Start the test with an extensive comment about the test case. If gpt_3_5_turbo i
The test must start with the following import:
```
from .implementation import func
from .microservice import func
```
''' + not_allowed_function_string + '''
The test must not open local files.