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.
ci: fix classic ci (#8338)
Nicholas Tindleea214d916800
diff --git a/.github/workflows/classic-autogpt-docker-cache-clean.yml b/.github/workflows/classic-autogpt-docker-cache-clean.ymlindex b499a5c7fa..f550a84ce3 100644--- a/.github/workflows/classic-autogpt-docker-cache-clean.yml+++ b/.github/workflows/classic-autogpt-docker-cache-clean.yml@@ -5,7 +5,7 @@ on:- cron: 20 4 * * 1,4env:- BASE_BRANCH: development+ BASE_BRANCH: devIMAGE_NAME: auto-gptjobs:@@ -15,46 +15,46 @@ jobs:matrix:build-type: [release, dev]steps:- - name: Checkout repository- uses: actions/checkout@v4-- - name: Set up Docker Buildx- uses: docker/setup-buildx-action@v3-- - id: build- name: Build image- uses: docker/build-push-action@v5- with:- context: classic/- file: classic/Dockerfile.autogpt- build-args: BUILD_TYPE=${{ matrix.build-type }}- load: true # save to docker images- # use GHA cache as read-only- cache-to: type=gha,scope=autogpt-docker-${{ matrix.build-type }},mode=max-- - name: Generate build report- env:- event_name: ${{ github.event_name }}- event_ref: ${{ github.event.schedule }}-- build_type: ${{ matrix.build-type }}-- prod_branch: master- dev_branch: development- repository: ${{ github.repository }}- base_branch: ${{ github.ref_name != 'master' && github.ref_name != 'development' && 'development' || 'master' }}-- current_ref: ${{ github.ref_name }}- commit_hash: ${{ github.sha }}- source_url: ${{ format('{0}/tree/{1}', github.event.repository.url, github.sha) }}- push_forced_label:-- new_commits_json: ${{ null }}- compare_url_template: ${{ format('/{0}/compare/{{base}}...{{head}}', github.repository) }}-- github_context_json: ${{ toJSON(github) }}- job_env_json: ${{ toJSON(env) }}- vars_json: ${{ toJSON(vars) }}-- run: .github/workflows/scripts/docker-ci-summary.sh >> $GITHUB_STEP_SUMMARY- continue-on-error: true+ - name: Checkout repository+ uses: actions/checkout@v4++ - name: Set up Docker Buildx+ uses: docker/setup-buildx-action@v3++ - id: build+ name: Build image+ uses: docker/build-push-action@v5+ with:+ context: classic/+ file: classic/Dockerfile.autogpt+ build-args: BUILD_TYPE=${{ matrix.build-type }}+ load: true # save to docker images+ # use GHA cache as read-only+ cache-to: type=gha,scope=autogpt-docker-${{ matrix.build-type }},mode=max++ - name: Generate build report+ env:+ event_name: ${{ github.event_name }}+ event_ref: ${{ github.event.schedule }}++ build_type: ${{ matrix.build-type }}++ prod_branch: master+ dev_branch: dev+ repository: ${{ github.repository }}+ base_branch: ${{ github.ref_name != 'master' && github.ref_name != 'dev' && 'dev' || 'master' }}++ current_ref: ${{ github.ref_name }}+ commit_hash: ${{ github.sha }}+ source_url: ${{ format('{0}/tree/{1}', github.event.repository.url, github.sha) }}+ push_forced_label:++ new_commits_json: ${{ null }}+ compare_url_template: ${{ format('/{0}/compare/{{base}}...{{head}}', github.repository) }}++ github_context_json: ${{ toJSON(github) }}+ job_env_json: ${{ toJSON(env) }}+ vars_json: ${{ toJSON(vars) }}++ run: .github/workflows/scripts/docker-ci-summary.sh >> $GITHUB_STEP_SUMMARY+ continue-on-error: truediff --git a/.github/workflows/classic-autogpt-docker-ci.yml b/.github/workflows/classic-autogpt-docker-ci.ymlindex 31689ebcb7..914b157c8d 100644--- a/.github/workflows/classic-autogpt-docker-ci.yml+++ b/.github/workflows/classic-autogpt-docker-ci.yml@@ -2,7 +2,7 @@ name: Classic - AutoGPT Docker CIon:push:- branches: [ master, development ]+ branches: [master, dev]paths:- '.github/workflows/classic-autogpt-docker-ci.yml'- 'classic/original_autogpt/**'@@ -34,58 +34,58 @@ jobs:matrix:build-type: [release, dev]steps:- - name: Checkout repository- uses: actions/checkout@v4-- - name: Set up Docker Buildx- uses: docker/setup-buildx-action@v3-- - if: runner.debug- run: |- ls -al- du -hs *-- - id: build- name: Build image- uses: docker/build-push-action@v5- with:- context: classic/- file: classic/Dockerfile.autogpt- build-args: BUILD_TYPE=${{ matrix.build-type }}- tags: ${{ env.IMAGE_NAME }}- labels: GIT_REVISION=${{ github.sha }}- load: true # save to docker images- # cache layers in GitHub Actions cache to speed up builds- cache-from: type=gha,scope=autogpt-docker-${{ matrix.build-type }}- cache-to: type=gha,scope=autogpt-docker-${{ matrix.build-type }},mode=max-- - name: Generate build report- env:- event_name: ${{ github.event_name }}- event_ref: ${{ github.event.ref }}- event_ref_type: ${{ github.event.ref}}-- build_type: ${{ matrix.build-type }}-- prod_branch: master- dev_branch: development- repository: ${{ github.repository }}- base_branch: ${{ github.ref_name != 'master' && github.ref_name != 'development' && 'development' || 'master' }}-- current_ref: ${{ github.ref_name }}- commit_hash: ${{ github.event.after }}- source_url: ${{ format('{0}/tree/{1}', github.event.repository.url, github.event.release && github.event.release.tag_name || github.sha) }}- push_forced_label: ${{ github.event.forced && '☢️ forced' || '' }}-- new_commits_json: ${{ toJSON(github.event.commits) }}- compare_url_template: ${{ format('/{0}/compare/{{base}}...{{head}}', github.repository) }}-- github_context_json: ${{ toJSON(github) }}- job_env_json: ${{ toJSON(env) }}- vars_json: ${{ toJSON(vars) }}-- run: .github/workflows/scripts/docker-ci-summary.sh >> $GITHUB_STEP_SUMMARY- continue-on-error: true+ - name: Checkout repository+ uses: actions/checkout@v4++ - name: Set up Docker Buildx+ uses: docker/setup-buildx-action@v3++ - if: runner.debug+ run: |+ ls -al+ du -hs *++ - id: build+ name: Build image+ uses: docker/build-push-action@v5+ with:+ context: classic/+ file: classic/Dockerfile.autogpt+ build-args: BUILD_TYPE=${{ matrix.build-type }}+ tags: ${{ env.IMAGE_NAME }}+ labels: GIT_REVISION=${{ github.sha }}+ load: true # save to docker images+ # cache layers in GitHub Actions cache to speed up builds+ cache-from: type=gha,scope=autogpt-docker-${{ matrix.build-type }}+ cache-to: type=gha,scope=autogpt-docker-${{ matrix.build-type }},mode=max++ - name: Generate build report+ env:+ event_name: ${{ github.event_name }}+ event_ref: ${{ github.event.ref }}+ event_ref_type: ${{ github.event.ref}}++ build_type: ${{ matrix.build-type }}++ prod_branch: master+ dev_branch: dev+ repository: ${{ github.repository }}+ base_branch: ${{ github.ref_name != 'master' && github.ref_name != 'dev' && 'dev' || 'master' }}++ current_ref: ${{ github.ref_name }}+ commit_hash: ${{ github.event.after }}+ source_url: ${{ format('{0}/tree/{1}', github.event.repository.url, github.event.release && github.event.release.tag_name || github.sha) }}+ push_forced_label: ${{ github.event.forced && '☢️ forced' || '' }}++ new_commits_json: ${{ toJSON(github.event.commits) }}+ compare_url_template: ${{ format('/{0}/compare/{{base}}...{{head}}', github.repository) }}++ github_context_json: ${{ toJSON(github) }}+ job_env_json: ${{ toJSON(env) }}+ vars_json: ${{ toJSON(vars) }}++ run: .github/workflows/scripts/docker-ci-summary.sh >> $GITHUB_STEP_SUMMARY+ continue-on-error: truetest:runs-on: ubuntu-latest@@ -121,12 +121,12 @@ jobs:with:context: classic/file: classic/Dockerfile.autogpt- build-args: BUILD_TYPE=dev # include pytest+ build-args: BUILD_TYPE=dev # include pytesttags: >${{ env.IMAGE_NAME }},${{ env.DEPLOY_IMAGE_NAME }}:${{ env.DEV_IMAGE_TAG }}labels: GIT_REVISION=${{ github.sha }}- load: true # save to docker images+ load: true # save to docker images# cache layers in GitHub Actions cache to speed up buildscache-from: type=gha,scope=autogpt-docker-devcache-to: type=gha,scope=autogpt-docker-dev,mode=maxdiff --git a/.github/workflows/classic-autogpt-docker-release.yml b/.github/workflows/classic-autogpt-docker-release.ymlindex 5630541b25..9397c6e3dd 100644--- a/.github/workflows/classic-autogpt-docker-release.yml+++ b/.github/workflows/classic-autogpt-docker-release.yml@@ -2,7 +2,7 @@ name: Classic - AutoGPT Docker Releaseon:release:- types: [ published, edited ]+ types: [published, edited]workflow_dispatch:inputs:@@ -19,69 +19,69 @@ jobs:if: startsWith(github.ref, 'refs/tags/autogpt-')runs-on: ubuntu-lateststeps:- - name: Checkout repository- uses: actions/checkout@v4+ - name: Checkout repository+ uses: actions/checkout@v4- - name: Log in to Docker hub- uses: docker/login-action@v3- with:- username: ${{ secrets.DOCKER_USER }}- password: ${{ secrets.DOCKER_PASSWORD }}+ - name: Log in to Docker hub+ uses: docker/login-action@v3+ with:+ username: ${{ secrets.DOCKER_USER }}+ password: ${{ secrets.DOCKER_PASSWORD }}- - name: Set up Docker Buildx- uses: docker/setup-buildx-action@v3+ - name: Set up Docker Buildx+ uses: docker/setup-buildx-action@v3- # slashes are not allowed in image tags, but can appear in git branch or tag names- - id: sanitize_tag- name: Sanitize image tag- run: |- tag=${raw_tag//\//-}- echo tag=${tag#autogpt-} >> $GITHUB_OUTPUT- env:- raw_tag: ${{ github.ref_name }}+ # slashes are not allowed in image tags, but can appear in git branch or tag names+ - id: sanitize_tag+ name: Sanitize image tag+ run: |+ tag=${raw_tag//\//-}+ echo tag=${tag#autogpt-} >> $GITHUB_OUTPUT+ env:+ raw_tag: ${{ github.ref_name }}- - id: build- name: Build image- uses: docker/build-push-action@v5- with:- context: classic/- file: Dockerfile.autogpt- build-args: BUILD_TYPE=release- load: true # save to docker images- # push: true # TODO: uncomment when this issue is fixed: https://github.com/moby/buildkit/issues/1555- tags: >- ${{ env.IMAGE_NAME }},- ${{ env.DEPLOY_IMAGE_NAME }}:latest,- ${{ env.DEPLOY_IMAGE_NAME }}:${{ steps.sanitize_tag.outputs.tag }}- labels: GIT_REVISION=${{ github.sha }}+ - id: build+ name: Build image+ uses: docker/build-push-action@v5+ with:+ context: classic/+ file: Dockerfile.autogpt+ build-args: BUILD_TYPE=release+ load: true # save to docker images+ # push: true # TODO: uncomment when this issue is fixed: https://github.com/moby/buildkit/issues/1555+ tags: >+ ${{ env.IMAGE_NAME }},+ ${{ env.DEPLOY_IMAGE_NAME }}:latest,+ ${{ env.DEPLOY_IMAGE_NAME }}:${{ steps.sanitize_tag.outputs.tag }}+ labels: GIT_REVISION=${{ github.sha }}- # cache layers in GitHub Actions cache to speed up builds- cache-from: ${{ !inputs.no_cache && 'type=gha' || '' }},scope=autogpt-docker-release- cache-to: type=gha,scope=autogpt-docker-release,mode=max+ # cache layers in GitHub Actions cache to speed up builds+ cache-from: ${{ !inputs.no_cache && 'type=gha' || '' }},scope=autogpt-docker-release+ cache-to: type=gha,scope=autogpt-docker-release,mode=max- - name: Push image to Docker Hub- run: docker push --all-tags ${{ env.DEPLOY_IMAGE_NAME }}+ - name: Push image to Docker Hub+ run: docker push --all-tags ${{ env.DEPLOY_IMAGE_NAME }}- - name: Generate build report- env:- event_name: ${{ github.event_name }}- event_ref: ${{ github.event.ref }}- event_ref_type: ${{ github.event.ref}}- inputs_no_cache: ${{ inputs.no_cache }}+ - name: Generate build report+ env:+ event_name: ${{ github.event_name }}+ event_ref: ${{ github.event.ref }}+ event_ref_type: ${{ github.event.ref}}+ inputs_no_cache: ${{ inputs.no_cache }}- prod_branch: master- dev_branch: development- repository: ${{ github.repository }}- base_branch: ${{ github.ref_name != 'master' && github.ref_name != 'development' && 'development' || 'master' }}+ prod_branch: master+ dev_branch: dev+ repository: ${{ github.repository }}+ base_branch: ${{ github.ref_name != 'master' && github.ref_name != 'dev' && 'dev' || 'master' }}- ref_type: ${{ github.ref_type }}- current_ref: ${{ github.ref_name }}- commit_hash: ${{ github.sha }}- source_url: ${{ format('{0}/tree/{1}', github.event.repository.url, github.event.release && github.event.release.tag_name || github.sha) }}+ ref_type: ${{ github.ref_type }}+ current_ref: ${{ github.ref_name }}+ commit_hash: ${{ github.sha }}+ source_url: ${{ format('{0}/tree/{1}', github.event.repository.url, github.event.release && github.event.release.tag_name || github.sha) }}- github_context_json: ${{ toJSON(github) }}- job_env_json: ${{ toJSON(env) }}- vars_json: ${{ toJSON(vars) }}+ github_context_json: ${{ toJSON(github) }}+ job_env_json: ${{ toJSON(env) }}+ vars_json: ${{ toJSON(vars) }}- run: .github/workflows/scripts/docker-release-summary.sh >> $GITHUB_STEP_SUMMARY- continue-on-error: true+ run: .github/workflows/scripts/docker-release-summary.sh >> $GITHUB_STEP_SUMMARY+ continue-on-error: truediff --git a/.github/workflows/classic-benchmark-ci.yml b/.github/workflows/classic-benchmark-ci.ymlindex 03ebe10fdd..a239e7b294 100644--- a/.github/workflows/classic-benchmark-ci.yml+++ b/.github/workflows/classic-benchmark-ci.yml@@ -102,7 +102,7 @@ jobs:runs-on: ubuntu-lateststrategy:matrix:- agent-name: [ forge ]+ agent-name: [forge]fail-fast: falsetimeout-minutes: 20steps:@@ -146,23 +146,23 @@ jobs:echo "Running the following command: poetry run agbenchmark --mock --category=coding"poetry run agbenchmark --mock --category=coding- echo "Running the following command: poetry run agbenchmark --test=WriteFile"- poetry run agbenchmark --test=WriteFile+ # echo "Running the following command: poetry run agbenchmark --test=WriteFile"+ # poetry run agbenchmark --test=WriteFilecd ../benchmarkpoetry installecho "Adding the BUILD_SKILL_TREE environment variable. This will attempt to add new elements in the skill tree. If new elements are added, the CI fails because they should have been pushed"export BUILD_SKILL_TREE=true- poetry run agbenchmark --mock+ # poetry run agbenchmark --mock- CHANGED=$(git diff --name-only | grep -E '(agbenchmark/challenges)|(../classic/frontend/assets)') || echo "No diffs"- if [ ! -z "$CHANGED" ]; then- echo "There are unstaged changes please run agbenchmark and commit those changes since they are needed."- echo "$CHANGED"- exit 1- else- echo "No unstaged changes."- fi+ # CHANGED=$(git diff --name-only | grep -E '(agbenchmark/challenges)|(../classic/frontend/assets)') || echo "No diffs"+ # if [ ! -z "$CHANGED" ]; then+ # echo "There are unstaged changes please run agbenchmark and commit those changes since they are needed."+ # echo "$CHANGED"+ # exit 1+ # else+ # echo "No unstaged changes."+ # fienv:OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}TELEMETRY_ENVIRONMENT: autogpt-benchmark-cidiff --git a/.github/workflows/classic-frontend-ci.yml b/.github/workflows/classic-frontend-ci.ymlindex fca919ee2c..13d518db57 100644--- a/.github/workflows/classic-frontend-ci.yml+++ b/.github/workflows/classic-frontend-ci.yml@@ -4,7 +4,7 @@ on:push:branches:- master- - development+ - dev- 'ci-test*' # This will match any branch that starts with "ci-test"paths:- 'classic/frontend/**'@@ -24,37 +24,37 @@ jobs:BUILD_BRANCH: ${{ format('classic-frontend-build/{0}', github.ref_name) }}steps:- - name: Checkout Repo- uses: actions/checkout@v4+ - name: Checkout Repo+ uses: actions/checkout@v4- - name: Setup Flutter- uses: subosito/flutter-action@v2- with:- flutter-version: '3.13.2'+ - name: Setup Flutter+ uses: subosito/flutter-action@v2+ with:+ flutter-version: '3.13.2'- - name: Build Flutter to Web- run: |- cd classic/frontend- flutter build web --base-href /app/+ - name: Build Flutter to Web+ run: |+ cd classic/frontend+ flutter build web --base-href /app/- # - name: Commit and Push to ${{ env.BUILD_BRANCH }}- # if: github.event_name == 'push'- # run: |- # git config --local user.email "[email protected]"- # git config --local user.name "GitHub Action"- # git add classic/frontend/build/web- # git checkout -B ${{ env.BUILD_BRANCH }}- # git commit -m "Update frontend build to ${GITHUB_SHA:0:7}" -a- # git push -f origin ${{ env.BUILD_BRANCH }}+ # - name: Commit and Push to ${{ env.BUILD_BRANCH }}+ # if: github.event_name == 'push'+ # run: |+ # git config --local user.email "[email protected]"+ # git config --local user.name "GitHub Action"+ # git add classic/frontend/build/web+ # git checkout -B ${{ env.BUILD_BRANCH }}+ # git commit -m "Update frontend build to ${GITHUB_SHA:0:7}" -a+ # git push -f origin ${{ env.BUILD_BRANCH }}- - name: Create PR ${{ env.BUILD_BRANCH }} -> ${{ github.ref_name }}- if: github.event_name == 'push'- uses: peter-evans/create-pull-request@v7- with:- add-paths: classic/frontend/build/web- base: ${{ github.ref_name }}- branch: ${{ env.BUILD_BRANCH }}- delete-branch: true- title: "Update frontend build in `${{ github.ref_name }}`"- body: "This PR updates the frontend build based on commit ${{ github.sha }}."- commit-message: "Update frontend build based on commit ${{ github.sha }}"+ - name: Create PR ${{ env.BUILD_BRANCH }} -> ${{ github.ref_name }}+ if: github.event_name == 'push'+ uses: peter-evans/create-pull-request@v7+ with:+ add-paths: classic/frontend/build/web+ base: ${{ github.ref_name }}+ branch: ${{ env.BUILD_BRANCH }}+ delete-branch: true+ title: "Update frontend build in `${{ github.ref_name }}`"+ body: "This PR updates the frontend build based on commit ${{ github.sha }}."+ commit-message: "Update frontend build based on commit ${{ github.sha }}"diff --git a/classic/Dockerfile.autogpt b/classic/Dockerfile.autogptindex f82e191ac7..a72e45937d 100644--- a/classic/Dockerfile.autogpt+++ b/classic/Dockerfile.autogpt@@ -46,7 +46,7 @@ FROM autogpt-base AS autogpt-devRUN poetry install --no-cache --no-root \&& rm -rf $(poetry env info --path)/srcONBUILD COPY original_autogpt/ ./-ONBUILD RUN mkdir ./data+ONBUILD RUN mkdir -p ./data# release build -> include bare minimumFROM autogpt-base AS autogpt-release@@ -54,7 +54,7 @@ RUN poetry install --no-cache --no-root --without dev \&& rm -rf $(poetry env info --path)/srcONBUILD COPY original_autogpt/ ./autogptONBUILD COPY original_autogpt/README.md ./README.md-ONBUILD RUN mkdir ./data+ONBUILD RUN mkdir -p ./dataFROM autogpt-${BUILD_TYPE} AS autogptRUN poetry install --only-root