mirror of
https://github.com/aljazceru/dev-gpt.git
synced 2025-12-25 01:14:24 +01:00
🧪 test: level 2
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import json
|
||||
import os
|
||||
import random
|
||||
import re
|
||||
@@ -185,16 +186,22 @@ metas:
|
||||
tag_name=REQUIREMENTS_FILE_TAG,
|
||||
)[REQUIREMENTS_FILE_NAME]
|
||||
|
||||
self.generate_and_persist_file(
|
||||
section_title='Generate Dockerfile',
|
||||
template=template_generate_apt_get_install,
|
||||
destination_folder=MICROSERVICE_FOLDER_v1,
|
||||
file_name_s=None,
|
||||
parse_result_fn=self.parse_result_fn_dockerfile,
|
||||
docker_file_wrapped=self.read_docker_template(),
|
||||
requirements_file_wrapped=self.files_to_string({
|
||||
REQUIREMENTS_FILE_NAME: requirements_content,
|
||||
})
|
||||
# self.generate_and_persist_file(
|
||||
# section_title='Generate Dockerfile',
|
||||
# template=template_generate_apt_get_install,
|
||||
# destination_folder=MICROSERVICE_FOLDER_v1,
|
||||
# file_name_s=None,
|
||||
# parse_result_fn=self.parse_result_fn_dockerfile,
|
||||
# docker_file_wrapped=self.read_docker_template(),
|
||||
# requirements_file_wrapped=self.files_to_string({
|
||||
# REQUIREMENTS_FILE_NAME: requirements_content,
|
||||
# })
|
||||
# )
|
||||
|
||||
# docker file from curdir
|
||||
shutil.copy(
|
||||
src=os.path.join(os.path.dirname(__file__), 'static_files', 'microservice', 'Dockerfile'),
|
||||
dst=MICROSERVICE_FOLDER_v1 + '/Dockerfile'
|
||||
)
|
||||
|
||||
self.write_config_yml(microservice_name, MICROSERVICE_FOLDER_v1)
|
||||
@@ -364,15 +371,15 @@ metas:
|
||||
|
||||
def get_possible_packages(self):
|
||||
print_colored('', '\n\n############# What packages to use? #############', 'blue')
|
||||
packages_csv_string = self.generate_and_persist_file(
|
||||
packages_json_string = self.generate_and_persist_file(
|
||||
section_title='Generate possible packages',
|
||||
template=template_generate_possible_packages,
|
||||
destination_folder=self.microservice_root_path,
|
||||
file_name_s=['packages.csv'],
|
||||
file_name_s=['strategies.json'],
|
||||
system_definition_examples=[],
|
||||
description=self.microservice_specification.task
|
||||
)['packages.csv']
|
||||
packages_list = [[pkg.strip().lower() for pkg in packages_string.split(',')] for packages_string in packages_csv_string.split('\n')]
|
||||
)['strategies.json']
|
||||
packages_list = [[pkg.strip().lower() for pkg in packages] for packages in json.loads(packages_json_string)]
|
||||
packages_list = [
|
||||
packages for packages in packages_list if len(set(packages).intersection(set(PROBLEMATIC_PACKAGES))) == 0
|
||||
]
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
FROM jinaai/jina:3.14.1-py39-standard
|
||||
|
||||
RUN apt-get update && apt-get install --no-install-recommends -y {apt_get_packages} && apt-get clean && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
## install requirements for the executor
|
||||
COPY requirements.txt .
|
||||
RUN pip install --compile -r requirements.txt
|
||||
|
||||
@@ -45,15 +45,21 @@ PDFParserExecutor
|
||||
)
|
||||
|
||||
|
||||
template_generate_possible_packages_output_format_string = '''You must output the package combinations as a list of lists wrapped into ``` and name it **packages.csv**. Do not use quotation marks around packages names in the output. Separate packages in a combination by comma. The output looks this:
|
||||
**{file_name}**
|
||||
template_generate_possible_packages_output_format_string = '''You must output the package combinations as a \
|
||||
list of lists wrapped into ``` and name it **strategies.json**. \
|
||||
Do not use quotation marks around packages names in the output. \
|
||||
Separate packages in a combination by comma. \
|
||||
Note that you can also leave a line empty to indicate that one of the strategies does not require any package and can be done in plain python.
|
||||
The output looks like this:
|
||||
**strategies.json**
|
||||
```
|
||||
package1a, package1b ...
|
||||
package2a, package2b, package2c
|
||||
package3a ...
|
||||
package4a ...
|
||||
package5a ...
|
||||
...
|
||||
[
|
||||
["package1", "package2", "package3"],
|
||||
["package4", "package5"],
|
||||
["package6", "package7", "package8", "package9"],
|
||||
[],
|
||||
["package10"]
|
||||
]
|
||||
```'''
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user