mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
Update docker file formatting
This commit is contained in:
@@ -16,21 +16,21 @@ repos:
|
||||
hooks:
|
||||
- id: isort-autogpt
|
||||
name: Lint (isort) - AutoGPT
|
||||
entry: poetry -C autogpt run isort
|
||||
entry: poetry -C classic/original_autogpt run isort
|
||||
files: ^classic/original_autogpt/
|
||||
types: [file, python]
|
||||
language: system
|
||||
|
||||
- id: isort-forge
|
||||
name: Lint (isort) - Forge
|
||||
entry: poetry -C forge run isortIts
|
||||
entry: poetry -C classic/forge run isort
|
||||
files: ^classic/forge/
|
||||
types: [file, python]
|
||||
language: system
|
||||
|
||||
- id: isort-benchmark
|
||||
name: Lint (isort) - Benchmark
|
||||
entry: poetry -C benchmark run isort
|
||||
entry: poetry -C classic/benchmark run isort
|
||||
files: ^classic/benchmark/
|
||||
types: [file, python]
|
||||
language: system
|
||||
@@ -74,7 +74,7 @@ repos:
|
||||
- id: pyright
|
||||
name: Typecheck - AutoGPT
|
||||
alias: pyright-autogpt
|
||||
entry: poetry -C autogpt run pyright
|
||||
entry: poetry -C classic/original_autogpt run pyright
|
||||
args: [-p, autogpt, autogpt]
|
||||
# include forge source (since it's a path dependency) but exclude *_test.py files:
|
||||
files: ^(classic/original_autogpt/((autogpt|scripts|tests)/|poetry\.lock$)|classic/forge/(classic/forge/.*(?<!_test)\.py|poetry\.lock)$)
|
||||
@@ -85,7 +85,7 @@ repos:
|
||||
- id: pyright
|
||||
name: Typecheck - Forge
|
||||
alias: pyright-forge
|
||||
entry: poetry -C forge run pyright
|
||||
entry: poetry -C classic/forge run pyright
|
||||
args: [-p, forge, forge]
|
||||
files: ^classic/forge/(classic/forge/|poetry\.lock$)
|
||||
types: [file]
|
||||
@@ -95,7 +95,7 @@ repos:
|
||||
- id: pyright
|
||||
name: Typecheck - Benchmark
|
||||
alias: pyright-benchmark
|
||||
entry: poetry -C benchmark run pyright
|
||||
entry: poetry -C classic/benchmark run pyright
|
||||
args: [-p, benchmark, benchmark]
|
||||
files: ^classic/benchmark/(agclassic/benchmark/|tests/|poetry\.lock$)
|
||||
types: [file]
|
||||
@@ -106,7 +106,7 @@ repos:
|
||||
hooks:
|
||||
- id: pytest-autogpt
|
||||
name: Run tests - AutoGPT (excl. slow tests)
|
||||
entry: bash -c 'cd autogpt && poetry run pytest --cov=autogpt -m "not slow" tests/unit tests/integration'
|
||||
entry: bash -c 'cd classic/original_autogpt && poetry run pytest --cov=autogpt -m "not slow" tests/unit tests/integration'
|
||||
# include forge source (since it's a path dependency) but exclude *_test.py files:
|
||||
files: ^(classic/original_autogpt/((autogpt|tests)/|poetry\.lock$)|classic/forge/(classic/forge/.*(?<!_test)\.py|poetry\.lock)$)
|
||||
language: system
|
||||
@@ -114,14 +114,14 @@ repos:
|
||||
|
||||
- id: pytest-forge
|
||||
name: Run tests - Forge (excl. slow tests)
|
||||
entry: bash -c 'cd forge && poetry run pytest --cov=forge -m "not slow"'
|
||||
entry: bash -c 'cd classic/forge && poetry run pytest --cov=forge -m "not slow"'
|
||||
files: ^classic/forge/(classic/forge/|tests/|poetry\.lock$)
|
||||
language: system
|
||||
pass_filenames: false
|
||||
|
||||
- id: pytest-benchmark
|
||||
name: Run tests - Benchmark
|
||||
entry: bash -c 'cd benchmark && poetry run pytest --cov=benchmark'
|
||||
entry: bash -c 'cd classic/benchmark && poetry run pytest --cov=benchmark'
|
||||
files: ^classic/benchmark/(agclassic/benchmark/|tests/|poetry\.lock$)
|
||||
language: system
|
||||
pass_filenames: false
|
||||
|
||||
@@ -29,13 +29,13 @@ ENV PATH="$POETRY_HOME/bin:$PATH"
|
||||
RUN poetry config installer.max-workers 10
|
||||
|
||||
WORKDIR /app/autogpt
|
||||
COPY classic/original_autogpt/pyproject.toml classic/original_autogpt/poetry.lock ./
|
||||
COPY original_autogpt/pyproject.toml original_autogpt/poetry.lock ./
|
||||
|
||||
# Include forge so it can be used AS a path dependency
|
||||
COPY classic/forge/ ../forge
|
||||
|
||||
# Include frontend
|
||||
COPY classic/frontend/ ../frontend
|
||||
COPY frontend/ ../frontend
|
||||
|
||||
# Set the entrypoint
|
||||
ENTRYPOINT ["poetry", "run", "autogpt"]
|
||||
@@ -45,16 +45,14 @@ CMD []
|
||||
FROM autogpt-base AS autogpt-dev
|
||||
RUN poetry install --no-cache --no-root \
|
||||
&& rm -rf $(poetry env info --path)/src
|
||||
ONBUILD COPY classic/original_autogpt/ ./
|
||||
ONBUILD COPY original_autogpt/ ./
|
||||
|
||||
# release build -> include bare minimum
|
||||
FROM autogpt-base AS autogpt-release
|
||||
RUN poetry install --no-cache --no-root --without dev \
|
||||
&& rm -rf $(poetry env info --path)/src
|
||||
ONBUILD COPY classic/original_autogpt/ ./autogpt
|
||||
ONBUILD COPY classic/original_autogpt/scripts/ ./scripts
|
||||
ONBUILD COPY classic/original_autogpt/plugins/ ./plugins
|
||||
ONBUILD COPY classic/original_autogpt/README.md ./README.md
|
||||
ONBUILD COPY original_autogpt/ ./autogpt
|
||||
ONBUILD COPY original_autogpt/README.md ./README.md
|
||||
ONBUILD RUN mkdir ./data
|
||||
|
||||
FROM autogpt-${BUILD_TYPE} AS autogpt
|
||||
|
||||
@@ -134,7 +134,7 @@ def start(agent_name: str, no_setup: bool):
|
||||
agent_dir = os.path.join(
|
||||
script_dir,
|
||||
f"agents/{agent_name}"
|
||||
if agent_name not in ["autogpt", "forge"]
|
||||
if agent_name not in ["original_autogpt", "forge"]
|
||||
else agent_name,
|
||||
)
|
||||
run_command = os.path.join(agent_dir, "run")
|
||||
@@ -217,8 +217,8 @@ def list():
|
||||
for d in os.listdir(agents_dir)
|
||||
if os.path.isdir(os.path.join(agents_dir, d))
|
||||
]
|
||||
if os.path.isdir("./autogpt"):
|
||||
agents_list.append("autogpt")
|
||||
if os.path.isdir("./original_autogpt"):
|
||||
agents_list.append("original_autogpt")
|
||||
if agents_list:
|
||||
click.echo(click.style("Available agents: 🤖", fg="green"))
|
||||
for agent in agents_list:
|
||||
@@ -253,7 +253,7 @@ def start(agent_name, subprocess_args):
|
||||
agent_dir = os.path.join(
|
||||
script_dir,
|
||||
f"agents/{agent_name}"
|
||||
if agent_name not in ["autogpt", "forge"]
|
||||
if agent_name not in ["original_autogpt", "forge"]
|
||||
else agent_name,
|
||||
)
|
||||
benchmark_script = os.path.join(agent_dir, "run_benchmark")
|
||||
|
||||
Reference in New Issue
Block a user