AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
fix(agent): Unbreak docker builds after repo restructure (#7164)
Reinier van der Leer529273677971
diff --git a/.dockerignore b/.dockerignorenew file mode 100644index 0000000000..89f8a2a42a--- /dev/null+++ b/.dockerignore@@ -0,0 +1,28 @@+# Ignore everything by default, selectively add things to context+*++# AutoGPT+!autogpt/autogpt/+!autogpt/pyproject.toml+!autogpt/poetry.lock+!autogpt/README.md+!autogpt/tests/++# Benchmark+!benchmark/agbenchmark/+!benchmark/pyproject.toml+!benchmark/poetry.lock+!benchmark/README.md++# Forge+!forge/forge/+!forge/pyproject.toml+!forge/poetry.lock+!forge/README.md++# Frontend+!frontend/build/web/++# Explicitly re-ignore some folders+.*+**/__pycache__diff --git a/.github/workflows/autogpt-docker-cache-clean.yml b/.github/workflows/autogpt-docker-cache-clean.ymlindex 57ead411d4..c665b1d735 100644--- a/.github/workflows/autogpt-docker-cache-clean.yml+++ b/.github/workflows/autogpt-docker-cache-clean.yml@@ -25,7 +25,7 @@ jobs:name: Build imageuses: docker/build-push-action@v5with:- context: autogpt+ file: Dockerfile.autogptbuild-args: BUILD_TYPE=${{ matrix.build-type }}load: true # save to docker images# use GHA cache as read-onlydiff --git a/.github/workflows/autogpt-docker-ci.yml b/.github/workflows/autogpt-docker-ci.ymlindex e9948f3548..7620eed638 100644--- a/.github/workflows/autogpt-docker-ci.yml+++ b/.github/workflows/autogpt-docker-ci.yml@@ -49,7 +49,7 @@ jobs:name: Build imageuses: docker/build-push-action@v5with:- context: autogpt+ file: Dockerfile.autogptbuild-args: BUILD_TYPE=${{ matrix.build-type }}tags: ${{ env.IMAGE_NAME }}labels: GIT_REVISION=${{ github.sha }}@@ -84,7 +84,6 @@ jobs:vars_json: ${{ toJSON(vars) }}run: .github/workflows/scripts/docker-ci-summary.sh >> $GITHUB_STEP_SUMMARY- working-directory: ./continue-on-error: truetest:@@ -119,7 +118,7 @@ jobs:name: Build imageuses: docker/build-push-action@v5with:- context: autogpt+ file: Dockerfile.autogptbuild-args: BUILD_TYPE=dev # include pytesttags: >${{ env.IMAGE_NAME }},diff --git a/.github/workflows/autogpt-docker-release.yml b/.github/workflows/autogpt-docker-release.ymlindex 8610967ebb..7fd554f369 100644--- a/.github/workflows/autogpt-docker-release.yml+++ b/.github/workflows/autogpt-docker-release.yml@@ -10,10 +10,6 @@ on:type: booleandescription: 'Build from scratch, without using cached layers'-defaults:- run:- working-directory: autogpt-env:IMAGE_NAME: auto-gptDEPLOY_IMAGE_NAME: ${{ secrets.DOCKER_USER }}/auto-gpt@@ -48,7 +44,7 @@ jobs:name: Build imageuses: docker/build-push-action@v5with:- context: autogpt+ file: Dockerfile.autogptbuild-args: BUILD_TYPE=releaseload: true # save to docker images# push: true # TODO: uncomment when this issue is fixed: https://github.com/moby/buildkit/issues/1555@@ -87,5 +83,4 @@ jobs:vars_json: ${{ toJSON(vars) }}run: .github/workflows/scripts/docker-release-summary.sh >> $GITHUB_STEP_SUMMARY- working-directory: ./continue-on-error: truediff --git a/autogpt/Dockerfile b/Dockerfile.autogptsimilarity index 78%rename from autogpt/Dockerfilerename to Dockerfile.autogptindex 147debf85e..f86cee48d4 100644--- a/autogpt/Dockerfile+++ b/Dockerfile.autogpt@@ -28,8 +28,14 @@ RUN curl -sSL https://install.python-poetry.org | python3 -ENV PATH="$POETRY_HOME/bin:$PATH"RUN poetry config installer.max-workers 10-WORKDIR /app-COPY pyproject.toml poetry.lock ./+WORKDIR /app/autogpt+COPY autogpt/pyproject.toml autogpt/poetry.lock ./++# Include forge so it can be used as a path dependency+COPY forge/ ../forge++# Include frontend+COPY frontend/ ../frontend# Set the entrypointENTRYPOINT ["poetry", "run", "autogpt"]@@ -39,16 +45,16 @@ CMD []FROM autogpt-base as autogpt-devRUN poetry install --no-cache --no-root \&& rm -rf $(poetry env info --path)/src-ONBUILD COPY . ./+ONBUILD COPY autogpt/ ./# release build -> include bare minimumFROM autogpt-base as autogpt-releaseRUN poetry install --no-cache --no-root --without dev \&& rm -rf $(poetry env info --path)/src-ONBUILD COPY autogpt/ ./autogpt-ONBUILD COPY scripts/ ./scripts-ONBUILD COPY plugins/ ./plugins-ONBUILD COPY README.md ./README.md+ONBUILD COPY autogpt/autogpt/ ./autogpt+ONBUILD COPY autogpt/scripts/ ./scripts+ONBUILD COPY autogpt/plugins/ ./plugins+ONBUILD COPY autogpt/README.md ./README.mdONBUILD RUN mkdir ./dataFROM autogpt-${BUILD_TYPE} AS autogptdiff --git a/autogpt/.dockerignore b/autogpt/.dockerignoredeleted file mode 100644index a8dddfad51..0000000000--- a/autogpt/.dockerignore+++ /dev/null@@ -1,13 +0,0 @@-.*-**/.venv*-**/__pycache__-*.template-*.yaml-*.yml--data/*-logs/*-agbenchmark_config/logs/*-agbenchmark_config/reports/*--*.pngdiff --git a/autogpt/docker-compose.yml b/autogpt/docker-compose.ymlindex 281c8f6976..0782375e5c 100644--- a/autogpt/docker-compose.yml+++ b/autogpt/docker-compose.yml@@ -6,20 +6,24 @@ version: "3.9"services:auto-gpt:- build: ./+ build:+ context: ../+ dockerfile: Dockerfile.autogptenv_file:- .envports:- "8000:8000"volumes:- - ./:/app+ - ./:/app/autogpt/- ./docker-compose.yml:/app/docker-compose.yml:ro- - ./Dockerfile:/app/Dockerfile:ro+ # - ./Dockerfile:/app/Dockerfile:roprofiles: ["exclude-from-up"]# Only for TESTING purposes. Run with: docker compose run --build --rm autogpt-testautogpt-test:- build: ./+ build:+ context: ../+ dockerfile: Dockerfile.autogptenv_file:- .envenvironment:@@ -29,8 +33,8 @@ services:entrypoint: ["poetry", "run"]command: ["pytest", "-v"]volumes:- - ./autogpt:/app/autogpt- - ./tests:/app/tests+ - ./autogpt:/app/autogpt/autogpt+ - ./tests:/app/autogpt/testsdepends_on:- minioprofiles: ["exclude-from-up"]