truefoundry 0.2.1__tar.gz → 0.2.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of truefoundry might be problematic. Click here for more details.
- {truefoundry-0.2.1 → truefoundry-0.2.2}/PKG-INFO +1 -1
- {truefoundry-0.2.1 → truefoundry-0.2.2}/pyproject.toml +1 -1
- {truefoundry-0.2.1 → truefoundry-0.2.2}/truefoundry/autodeploy/agents/project_identifier.py +1 -0
- {truefoundry-0.2.1 → truefoundry-0.2.2}/truefoundry/autodeploy/agents/tester.py +1 -0
- {truefoundry-0.2.1 → truefoundry-0.2.2}/truefoundry/autodeploy/cli.py +13 -7
- {truefoundry-0.2.1 → truefoundry-0.2.2}/truefoundry/autodeploy/constants.py +3 -9
- {truefoundry-0.2.1 → truefoundry-0.2.2}/truefoundry/autodeploy/tools/base.py +7 -0
- {truefoundry-0.2.1 → truefoundry-0.2.2}/truefoundry/autodeploy/tools/commit.py +1 -0
- {truefoundry-0.2.1 → truefoundry-0.2.2}/truefoundry/autodeploy/tools/docker_build.py +2 -0
- {truefoundry-0.2.1 → truefoundry-0.2.2}/truefoundry/autodeploy/tools/docker_run.py +3 -0
- {truefoundry-0.2.1 → truefoundry-0.2.2}/truefoundry/autodeploy/tools/file_type_counts.py +2 -1
- {truefoundry-0.2.1 → truefoundry-0.2.2}/truefoundry/autodeploy/tools/list_files.py +2 -0
- {truefoundry-0.2.1 → truefoundry-0.2.2}/truefoundry/autodeploy/tools/read_file.py +2 -0
- {truefoundry-0.2.1 → truefoundry-0.2.2}/truefoundry/autodeploy/tools/send_request.py +3 -1
- {truefoundry-0.2.1 → truefoundry-0.2.2}/truefoundry/deploy/cli/cli.py +3 -2
- {truefoundry-0.2.1 → truefoundry-0.2.2}/truefoundry/deploy/cli/deploy.py +0 -7
- truefoundry-0.2.2/truefoundry/deploy/cli/version.py +6 -0
- {truefoundry-0.2.1 → truefoundry-0.2.2}/README.md +0 -0
- {truefoundry-0.2.1 → truefoundry-0.2.2}/truefoundry/__init__.py +0 -0
- {truefoundry-0.2.1 → truefoundry-0.2.2}/truefoundry/autodeploy/__init__.py +0 -0
- {truefoundry-0.2.1 → truefoundry-0.2.2}/truefoundry/autodeploy/agents/__init__.py +0 -0
- {truefoundry-0.2.1 → truefoundry-0.2.2}/truefoundry/autodeploy/agents/base.py +0 -0
- {truefoundry-0.2.1 → truefoundry-0.2.2}/truefoundry/autodeploy/agents/developer.py +0 -0
- {truefoundry-0.2.1 → truefoundry-0.2.2}/truefoundry/autodeploy/exception.py +0 -0
- {truefoundry-0.2.1 → truefoundry-0.2.2}/truefoundry/autodeploy/logger.py +0 -0
- {truefoundry-0.2.1 → truefoundry-0.2.2}/truefoundry/autodeploy/tools/__init__.py +0 -0
- {truefoundry-0.2.1 → truefoundry-0.2.2}/truefoundry/autodeploy/tools/ask.py +0 -0
- {truefoundry-0.2.1 → truefoundry-0.2.2}/truefoundry/autodeploy/tools/write_file.py +0 -0
- {truefoundry-0.2.1 → truefoundry-0.2.2}/truefoundry/autodeploy/utils/client.py +0 -0
- {truefoundry-0.2.1 → truefoundry-0.2.2}/truefoundry/autodeploy/utils/diff.py +0 -0
- {truefoundry-0.2.1 → truefoundry-0.2.2}/truefoundry/autodeploy/utils/pydantic_compat.py +0 -0
- {truefoundry-0.2.1 → truefoundry-0.2.2}/truefoundry/cli/__init__.py +0 -0
- {truefoundry-0.2.1 → truefoundry-0.2.2}/truefoundry/cli/__main__.py +0 -0
- {truefoundry-0.2.1 → truefoundry-0.2.2}/truefoundry/deploy/__init__.py +0 -0
- {truefoundry-0.2.1 → truefoundry-0.2.2}/truefoundry/deploy/cli/__init__.py +0 -0
- {truefoundry-0.2.1 → truefoundry-0.2.2}/truefoundry/langchain/__init__.py +0 -0
- {truefoundry-0.2.1 → truefoundry-0.2.2}/truefoundry/ml/__init__.py +0 -0
|
@@ -92,6 +92,7 @@ pip, poetry, yarn, go.mod, cargo.toml, npm, setup.py.
|
|
|
92
92
|
)
|
|
93
93
|
|
|
94
94
|
def render(self, console: Console):
|
|
95
|
+
console.rule("[bold green]Project Identification[/]")
|
|
95
96
|
if self.primary_programming_language is not None:
|
|
96
97
|
console.print(
|
|
97
98
|
f"[bold magenta]TrueFoundry:[/] Identified a project using [bold cyan]{self.primary_programming_language}[/]."
|
|
@@ -52,6 +52,7 @@ Why was the testing a failure or successful?
|
|
|
52
52
|
logs: str
|
|
53
53
|
|
|
54
54
|
def render(self, console: Console):
|
|
55
|
+
console.rule("[bold green]Result[/]")
|
|
55
56
|
console.print(
|
|
56
57
|
f"[bold cyan]TrueFoundry:[/] The given project has been {'[bold green]successfully built[/]' if self.successful else '[bold red]failed to build[/]'}"
|
|
57
58
|
)
|
|
@@ -28,7 +28,6 @@ from truefoundry.autodeploy.agents.project_identifier import (
|
|
|
28
28
|
from truefoundry.autodeploy.agents.tester import Tester
|
|
29
29
|
from truefoundry.autodeploy.constants import (
|
|
30
30
|
ABOUT_AUTODEPLOY,
|
|
31
|
-
AUTODEPLOY_INTRO_MESSAGE,
|
|
32
31
|
AUTODEPLOY_OPENAI_API_KEY,
|
|
33
32
|
AUTODEPLOY_OPENAI_BASE_URL,
|
|
34
33
|
AUTODEPLOY_TFY_BASE_URL,
|
|
@@ -188,7 +187,7 @@ def _check_repo(project_root_path: str, console: Console):
|
|
|
188
187
|
sys.exit(1)
|
|
189
188
|
|
|
190
189
|
|
|
191
|
-
def _update_status(event, status: Status):
|
|
190
|
+
def _update_status(event, status: Status, component_type: ComponentType):
|
|
192
191
|
if isinstance(event, (AskQuestion, CommitConfirmation)):
|
|
193
192
|
status.stop()
|
|
194
193
|
|
|
@@ -210,9 +209,14 @@ def _update_status(event, status: Status):
|
|
|
210
209
|
)
|
|
211
210
|
|
|
212
211
|
if isinstance(event, DockerRunLog):
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
212
|
+
if component_type == ComponentType.SERVICE:
|
|
213
|
+
status.update(
|
|
214
|
+
"[bold cyan]Running:[/] [bold magenta]TrueFoundry[/] is running your app in a Docker container. Press ctrl+c once your app is ready for testing."
|
|
215
|
+
)
|
|
216
|
+
else:
|
|
217
|
+
status.update(
|
|
218
|
+
"[bold cyan]Running:[/] [bold magenta]TrueFoundry[/] is running your app in a Docker container and waiting for completion."
|
|
219
|
+
)
|
|
216
220
|
|
|
217
221
|
|
|
218
222
|
def _get_default_project_name(project_root_path: str):
|
|
@@ -238,7 +242,6 @@ def cli(project_root_path: str, deploy: bool, workspace_fqn: str = None):
|
|
|
238
242
|
docker_client = _get_docker(console)
|
|
239
243
|
project_root_path = os.path.abspath(project_root_path)
|
|
240
244
|
console.print(ABOUT_AUTODEPLOY)
|
|
241
|
-
console.print(AUTODEPLOY_INTRO_MESSAGE)
|
|
242
245
|
console.print(
|
|
243
246
|
"[bold reverse]You will need to have Docker and Git installed on your machine for this to work[/]"
|
|
244
247
|
)
|
|
@@ -328,13 +331,16 @@ def cli(project_root_path: str, deploy: bool, workspace_fqn: str = None):
|
|
|
328
331
|
try:
|
|
329
332
|
status.start()
|
|
330
333
|
event = developer_run.send(inp)
|
|
331
|
-
_update_status(
|
|
334
|
+
_update_status(
|
|
335
|
+
event=event, status=status, component_type=component_type
|
|
336
|
+
)
|
|
332
337
|
inp = event.render(console)
|
|
333
338
|
except StopIteration as ex:
|
|
334
339
|
response = ex.value
|
|
335
340
|
break
|
|
336
341
|
|
|
337
342
|
if deploy:
|
|
343
|
+
console.rule("[bold green]Deploying to Truefoundry[/]")
|
|
338
344
|
deploy_component(
|
|
339
345
|
workspace_fqn=workspace_fqn,
|
|
340
346
|
project_root_path=project_root_path,
|
|
@@ -10,15 +10,9 @@ AUTODEPLOY_OPENAI_API_KEY = os.environ.get("AUTODEPLOY_OPENAI_API_KEY")
|
|
|
10
10
|
AUTODEPLOY_MODEL_NAME = os.environ.get(
|
|
11
11
|
"AUTODEPLOY_MODEL_NAME", "auto-deploy-openai/gpt-4-turbo-2024-04-09"
|
|
12
12
|
)
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
If any issues are encountered during this process, Truefoundry will attempt to automatically fix them.
|
|
17
|
-
Finally, it will run the application to verify that everything is set up correctly.
|
|
18
|
-
"""
|
|
19
|
-
ABOUT_AUTODEPLOY = """To deploy your project, we will generate the deployment configuration using AI.
|
|
20
|
-
We will analyze your codebase using our AI agent and make the required changes so that we can build and deploy the code.
|
|
21
|
-
We will confirm all the changes with you.
|
|
13
|
+
ABOUT_AUTODEPLOY = """We'll use AI to build and deploy your project automatically.
|
|
14
|
+
Our AI Agent analyzes your codebase, checks for a Dockerfile, creates one if missing, builds a Docker image, fixes any issues, and runs the application to ensure we have built it correctly.
|
|
15
|
+
If you don't want to use our AI Agent to deploy automatically, create a [green]truefoundry.yaml[/] file in your project's root.
|
|
22
16
|
"""
|
|
23
17
|
# The maximum file size to read is set to 10KB.
|
|
24
18
|
# This limit is determined by the token limit of the LLM used, which is 128,000 tokens.
|
|
@@ -27,6 +27,7 @@ class CommitConfirmation(Event):
|
|
|
27
27
|
commit_message: str
|
|
28
28
|
|
|
29
29
|
def render(self, console: Console) -> Optional["Commit.Response"]:
|
|
30
|
+
console.rule("[bold green]Commit[/]")
|
|
30
31
|
console.print("[bold magenta]TrueFoundry[/] wants to make a commit,", end=" ")
|
|
31
32
|
console.print(f"with Commit Message: [green]{self.commit_message}[/]")
|
|
32
33
|
console.print("[yellow]Displaying changes to be made by the patch[/]")
|
|
@@ -16,6 +16,7 @@ from truefoundry.autodeploy.tools.base import (
|
|
|
16
16
|
Message,
|
|
17
17
|
RequestEvent,
|
|
18
18
|
ResponseEvent,
|
|
19
|
+
Rule,
|
|
19
20
|
Tool,
|
|
20
21
|
)
|
|
21
22
|
|
|
@@ -90,6 +91,7 @@ Build a docker image.
|
|
|
90
91
|
self.docker_client = docker_client
|
|
91
92
|
|
|
92
93
|
def run(self, request: DockerBuild.Request) -> Generator[Event, Any, ResponseEvent]:
|
|
94
|
+
yield Rule(message="[bold green] Docker Build[/]")
|
|
93
95
|
yield Message(message="[bold cyan]Processing:[/] Building Docker image...")
|
|
94
96
|
yield Message(message="[bold yellow]Docker build logs:[/]")
|
|
95
97
|
try:
|
|
@@ -15,6 +15,7 @@ from truefoundry.autodeploy.tools.base import (
|
|
|
15
15
|
Message,
|
|
16
16
|
RequestEvent,
|
|
17
17
|
ResponseEvent,
|
|
18
|
+
Rule,
|
|
18
19
|
Tool,
|
|
19
20
|
)
|
|
20
21
|
|
|
@@ -104,6 +105,8 @@ This will not be passed if the container is still running.
|
|
|
104
105
|
|
|
105
106
|
def run(self, request: DockerRun.Request) -> Generator[Event, Any, ResponseEvent]:
|
|
106
107
|
self._kill_running_containers()
|
|
108
|
+
|
|
109
|
+
yield Rule(message="[bold green] Docker Run[/]")
|
|
107
110
|
yield Message(message="[bold cyan]Testing:[/] Running Docker container...")
|
|
108
111
|
try:
|
|
109
112
|
container = self.docker_client.containers.run(
|
|
@@ -14,6 +14,7 @@ from truefoundry.autodeploy.tools.base import (
|
|
|
14
14
|
Message,
|
|
15
15
|
RequestEvent,
|
|
16
16
|
ResponseEvent,
|
|
17
|
+
Rule,
|
|
17
18
|
Tool,
|
|
18
19
|
)
|
|
19
20
|
|
|
@@ -53,7 +54,7 @@ Get counts of different types of file present.
|
|
|
53
54
|
self, request: FileTypeCounts.Request
|
|
54
55
|
) -> Generator[Event, Any, ResponseEvent]:
|
|
55
56
|
counter = Counter()
|
|
56
|
-
|
|
57
|
+
yield Rule(message="[bold green]File Counts[/]")
|
|
57
58
|
yield Message(
|
|
58
59
|
message="[bold cyan]Processing:[/] Scanning for various file types..."
|
|
59
60
|
)
|
|
@@ -12,6 +12,7 @@ from truefoundry.autodeploy.tools.base import (
|
|
|
12
12
|
Message,
|
|
13
13
|
RequestEvent,
|
|
14
14
|
ResponseEvent,
|
|
15
|
+
Rule,
|
|
15
16
|
Tool,
|
|
16
17
|
)
|
|
17
18
|
|
|
@@ -41,6 +42,7 @@ the subdir should be . and pattern will be *.json
|
|
|
41
42
|
self.project_root_path = project_root_path
|
|
42
43
|
|
|
43
44
|
def run(self, request: ListFiles.Request) -> Generator[Event, Any, ResponseEvent]:
|
|
45
|
+
yield Rule(message="[bold green]List Files[/]")
|
|
44
46
|
yield Message(
|
|
45
47
|
message=f"[bold cyan]Searching:[/] 🔍 Looking for files matching the pattern [magenta]{request.pattern}[/]"
|
|
46
48
|
)
|
|
@@ -11,6 +11,7 @@ from truefoundry.autodeploy.tools.base import (
|
|
|
11
11
|
Message,
|
|
12
12
|
RequestEvent,
|
|
13
13
|
ResponseEvent,
|
|
14
|
+
Rule,
|
|
14
15
|
Tool,
|
|
15
16
|
)
|
|
16
17
|
|
|
@@ -50,6 +51,7 @@ Avoid reading *.lock type files as they tend to be large
|
|
|
50
51
|
self.project_root_path = project_root_path
|
|
51
52
|
|
|
52
53
|
def run(self, request: ReadFile.Request) -> Generator[Event, Any, ResponseEvent]:
|
|
54
|
+
yield Rule(message="[bold green] Read files[/]")
|
|
53
55
|
yield Message(
|
|
54
56
|
message=f"[bold cyan]Processing:[/] Reading file at [magenta]{request.path}[/] and extracting details..."
|
|
55
57
|
)
|
|
@@ -10,6 +10,7 @@ from truefoundry.autodeploy.tools.base import (
|
|
|
10
10
|
Message,
|
|
11
11
|
RequestEvent,
|
|
12
12
|
ResponseEvent,
|
|
13
|
+
Rule,
|
|
13
14
|
Tool,
|
|
14
15
|
)
|
|
15
16
|
|
|
@@ -33,8 +34,9 @@ Send an HTTP request.
|
|
|
33
34
|
|
|
34
35
|
def run(self, request: SendRequest.Request) -> Generator[Event, Any, ResponseEvent]:
|
|
35
36
|
self.call_count += 1
|
|
37
|
+
yield Rule(message="[bold green]Endpoint Verification[/]")
|
|
36
38
|
yield Message(
|
|
37
|
-
message=f"[bold cyan]Testing:[/] Sending a [magenta]{request.method.upper()}[/] request to [magenta]{request.url}[/]
|
|
39
|
+
message=f"[bold cyan]Testing:[/] Sending a [magenta]{request.method.upper()}[/] request to [magenta]{request.url}[/]"
|
|
38
40
|
)
|
|
39
41
|
try:
|
|
40
42
|
response = requests.request(request.method.lower(), url=request.url)
|
|
@@ -5,6 +5,7 @@ import rich_click as click
|
|
|
5
5
|
from servicefoundry import logger
|
|
6
6
|
from servicefoundry.cli.commands import (
|
|
7
7
|
deploy_patch_v2_command,
|
|
8
|
+
get_delete_command,
|
|
8
9
|
get_login_command,
|
|
9
10
|
get_logout_command,
|
|
10
11
|
get_patch_command,
|
|
@@ -14,9 +15,9 @@ from servicefoundry.cli.const import GROUP_CLS
|
|
|
14
15
|
from servicefoundry.cli.util import setup_rich_click
|
|
15
16
|
from servicefoundry.lib.util import is_debug_env_set, is_experimental_env_set
|
|
16
17
|
from servicefoundry.logger import logger as servicefoundry_logger
|
|
17
|
-
from servicefoundry.version import __version__
|
|
18
18
|
|
|
19
19
|
from truefoundry.deploy.cli.deploy import deploy_v2_command
|
|
20
|
+
from truefoundry.deploy.cli.version import __version__
|
|
20
21
|
|
|
21
22
|
servicefoundry_logger.setLevel(level=logging.INFO)
|
|
22
23
|
|
|
@@ -38,7 +39,7 @@ def create_truefoundry_cli():
|
|
|
38
39
|
cli.add_command(get_login_command())
|
|
39
40
|
# cli.add_command(get_get_command())
|
|
40
41
|
# cli.add_command(get_list_command())
|
|
41
|
-
|
|
42
|
+
cli.add_command(get_delete_command())
|
|
42
43
|
# cli.add_command(get_create_command())
|
|
43
44
|
# cli.add_command(get_redeploy_command())
|
|
44
45
|
cli.add_command(get_logout_command())
|
|
@@ -89,13 +89,6 @@ def deploy_v2_command(file: str, workspace_fqn: str, wait: bool):
|
|
|
89
89
|
)
|
|
90
90
|
sys.exit(1)
|
|
91
91
|
|
|
92
|
-
click.echo(
|
|
93
|
-
click.style(
|
|
94
|
-
'We will be using TrueFoundry AI to build your project.\nIf you wish to proceed without TrueFoundry AI,\nyou need to either have a truefoundry.yaml file in your project root or\npass the path to a yaml file using the "--file file_name" option.',
|
|
95
|
-
fg="yellow",
|
|
96
|
-
),
|
|
97
|
-
)
|
|
98
|
-
|
|
99
92
|
try:
|
|
100
93
|
autodeploy_cli(project_root_path=".", deploy=True, workspace_fqn=workspace_fqn)
|
|
101
94
|
except InvalidRequirementsException as e:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|