Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

To merge main #47

Open
wants to merge 29 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.env
.env~
.secrets
.secrets~
112 changes: 112 additions & 0 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
name: Pipeline

on: push

jobs:
code-quality:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
# - name: Setup Python
# uses: actions/setup-python@v4
# with:
# python-version: 3.10.12
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.4.1
virtualenvs-in-project: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: |
poetry install --no-interaction --no-root
- name: pylint
run: |
source .venv/bin/activate
pylint build tests
- name: black
run: |
source .venv/bin/activate
black --check .

run-tests:
needs: code-quality
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
# - name: Setup Python
# uses: actions/setup-python@v4
# with:
# python-version: 3.10.12
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.4.1
virtualenvs-in-project: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: |
poetry install --no-interaction --no-root
- name: Run all tests with pytest
run: |
source .venv/bin/activate
pytest --cov
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}

publish-all-images:
needs: run-tests
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Get Git Commit Tag Name
uses: olegtarasov/get-tag@v2.1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
# - name: Setup Python
# uses: actions/setup-python@v4
# with:
# python-version: 3.10.12
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.4.1
virtualenvs-in-project: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: |
poetry install --no-interaction --no-root
- name: Publish Image to Docker Hub
env:
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }}
DOCKER_HUB_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }}
run: |
source .venv/bin/activate
python -m build.publish
42 changes: 35 additions & 7 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,61 @@ on:
pull_request:
branches: [ "runautogpt-main" ]
jobs:
<<<<<<< HEAD
run-autogpt-in-githubaction:
=======
python-package-build:
>>>>>>> f1e604a (starting to work)
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10"]
python-version: [
#"3.10",
"3.x"]
steps:


- uses: actions/checkout@v3
- name: Checkout repository
uses: actions/checkout@master
with:
submodules: 'true'
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
#- name: Set up Python ${{ matrix.python-version }}
#3 uses: actions/setup-python@v3
# with:
# architecture: x64
# python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
#python -m pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install podman-compose
#- name: Lint with flake8
# run: |
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Docker Compose Action
uses: isbang/compose-action@v1.5.1
- name: Docker Compose Action build
#uses: meta-introspector/compose-action@main
env:
GITHUB_PAT: ${{ secrets.PAT }}
GITHUB_REPO: "jmikedupont2/ai-ticket"
run: docker-compose build


- name: create openai
env:
GITHUB_PAT: ${{ secrets.PAT }}
GITHUB_REPO: "jmikedupont2/ai-ticket"
run: |
GITHUB_PAT=${{ secrets.PAT }} GITHUB_REPO="jmikedupont2/ai-ticket" docker-compose up -d mockopenai

- name: run autogpt
env:
GITHUB_PAT: ${{ secrets.PAT }}
GITHUB_REPO: "jmikedupont2/ai-ticket"
run: |
GITHUB_PAT=${{ secrets.PAT }} GITHUB_REPO="jmikedupont2/ai-ticket" docker-compose run autogpt


5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -160,4 +160,7 @@ cython_debug/
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

*~
*~
/dckr_pat_.txt
/github_pat.txt
/.secrets
9 changes: 9 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,12 @@
[submodule "vendor/Auto-GPT-Benchmarks"]
path = vendor/Auto-GPT-Benchmarks
url = https://github.com/Significant-Gravitas/Auto-GPT-Benchmarks
[submodule "vendor/act_base"]
path = vendor/act_base
url = https://github.com/meta-introspector/act_base/
[submodule "vendor/python-poetry"]
path = vendor/python-poetry
url = https://github.com/meta-introspector/python-poetry
[submodule "vendor/basic_agent"]
path = vendor/basic_agent
url = https://github.com/meta-introspector/basic_agent
4 changes: 4 additions & 0 deletions .secrets.example.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
GITHUB_TOKEN=
GITHUB_PAT=
PAT=this isused
DOCKER=
46 changes: 39 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,44 @@
FROM python:3.10-slim
# The Poetry installation is provided through the base image. Please check the
# base image if you interested in the details.
# Base image: https://hub.docker.com/r/pfeiffermax/python-poetry
# Dockerfile: https://github.com/max-pfeiffer/python-poetry/blob/main/build/Dockerfile
ARG BASE_IMAGE
FROM ${BASE_IMAGE}
RUN apt update
RUN apt install -y git

LABEL maintainer="Mike DuPont <jmikedupont2@gmail.com>"

ENV PYTHONUNBUFFERED=1 \
# https://docs.python.org/3/using/cmdline.html#envvar-PYTHONDONTWRITEBYTECODE
PYTHONDONTWRITEBYTECODE=1 \
PYTHONPATH=/application_root \
# https://python-poetry.org/docs/configuration/#virtualenvsin-project
POETRY_VIRTUALENVS_IN_PROJECT=true \
POETRY_CACHE_DIR="/application_root/.cache" \
VIRTUAL_ENVIRONMENT_PATH="/application_root/.venv" \
POETRY_HOME="/opt/poetry"
# https://python-poetry.org/docs/#installing-manually
RUN python -m venv ${VIRTUAL_ENVIRONMENT_PATH}

# Adding the virtual environment to PATH in order to "activate" it.
# https://docs.python.org/3/library/venv.html#how-venvs-work
ENV PATH="$VIRTUAL_ENVIRONMENT_PATH/bin:$PATH"

# Set the WORKDIR to the application root.
# https://www.uvicorn.org/settings/#development
# https://docs.docker.com/engine/reference/builder/#workdir
WORKDIR ${PYTHONPATH}

# https://python-poetry.org/docs/configuration/#cache-directory
RUN mkdir ${POETRY_CACHE_DIR}

WORKDIR /opt/ai-ticket
COPY pyproject.toml /opt/ai-ticket/
COPY setup.cfg /opt/ai-ticket/
COPY README.md /opt/ai-ticket/
COPY requirements.txt /opt/ai-ticket/
COPY ./src/ /opt/ai-ticket/src/
RUN pip install /opt/ai-ticket/


RUN apt update
RUN apt install -y git
RUN pip install --trusted-host pypi.python.org -r requirements.txt

RUN ls ${VIRTUAL_ENVIRONMENT_PATH}/bin/activate
RUN pip install /opt/ai-ticket/ && pip install --trusted-host pypi.python.org -r requirements.txt
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
test_build:
sudo docker-compose build

test:
bash ./runact.sh
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# ai-ticket
# AI-Ticket
The AI Ticket system to handle the AI with tickets.
Human Powered AI-Ops to Help you with the last mile of your AI code generated system.

Expand Down Expand Up @@ -35,3 +35,11 @@ Welcome to our innovative user-driven workflow, designed to empower you to inter
- Be mindful of providing timely and appropriate responses to prevent workflow stalls.

This user-driven ticket-based workflow offers flexibility, control, and a unique way to collaborate with our system. Dive in, generate tickets, and explore the possibilities of this interactive and dynamic approach.


# Infrastructure

The docker images are organized like this :

* act_base is the foundation of all actions.
* poetry_base is contains the poetry magic layer with shared containers.
82 changes: 62 additions & 20 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,79 @@
version: '3'
services:

act_base: #root base of action
build: vendor/act_base
image: h4ckermike/act_base

poetry_base: # use poetry
image: h4ckermike/poetry_base
build:
context: vendor/python-poetry/build
args:
BASE_IMAGE: h4ckermike/act_base
POETRY_VERSION: 1.6.1
entrypoint: /bin/bash
stdin_open: true # docker run -i
tty: true # docker run -t

ai_ticket:
image: ai_ticket
depends_on:
- act_base

ai_ticket: # the ticket to unite
image: h4ckermike/ai_ticket
build:
context: .
#entrypoint: /bin/bash
#stdin_open: true # docker run -i
#tty: true # docker run -t

autogpt:
#entrypoint: bash -c "poetry run pip install /opt/ai-ticket && poetry run autogpt --install-plugin-deps --skip-news -y"
entrypoint: bash -c "poetry run pip install /opt/ai-ticket && poetry run autogpt --install-plugin-deps --skip-news -y --ai-name 'meta-autogpt' --ai-role 'you will introspect autogpt and reveal its internals via reflection and comprehension' --ai-goal 'Observe your behaviour' --ai-goal 'Reflect over your outcomes' --ai-goal 'Orient yourself to your knowledge' --ai-goal 'Decide on your next step' --ai-goal 'Act on your chosen next experiment' "

# uncomment thse next 3 lines for debugging
#entrypoint: /bin/bash
#stdin_open: true # docker run -i
#tty: true # docker run -t
args:
BASE_IMAGE: h4ckermike/poetry_base
depends_on:
- poetry_base

basic_agent: #basic agent
image: h4ckermike/basic_agent
build:
context: vendor/Auto-GPT/
context: vendor/basic_agent/
args:
BASE_IMAGE: h4ckermike/ai_ticket
depends_on:
- mockopenai
- ai_ticket

mockopenai:
mockopenai: # interface
depends_on:
- ai_ticket

environment:
- GITHUB_PAT=${GITHUB_PAT}
- GITHUB_REPO=${GITHUB_REPO}

image: h4ckermike/mockopenai
build:
context: vendor/lollms/
args:
BASE_IMAGE: h4ckermike/ai_ticket
volumes:
- /var/run/docker.sock:/var/run/docker.sock

ports:
- "5000:5000"
- "5000:8080"

autogpt: #the beast
entrypoint: bash -c "poetry run pip install /opt/ai-ticket && poetry run autogpt --install-plugin-deps --skip-news -y --ai-name 'meta-autogpt' --ai-role 'you will introspect autogpt and reveal its internals via reflection and comprehension' --ai-goal 'Observe your behaviour' --ai-goal 'Reflect over your outcomes' --ai-goal 'Orient yourself to your knowledge' --ai-goal 'Decide on your next step' --ai-goal 'Act on your chosen next experiment' "


# uncomment thse next 3 lines for debugging
#entrypoint: /bin/bash
#stdin_open: true # docker run -i
#tty: true # docker run -t
environment:
- GITHUB_PAT="${GITHUB_PAT}"
- GITHUB_REPO="jmikedupont2/ai-ticket"
- OPENAI_API_KEY=your-openai-api-key
- OPENAI_API_BASE=http://mockopenai:8080/v1
build:
context: vendor/Auto-GPT/
dockerfile: slim/Dockerfile
args:
BASE_IMAGE: h4ckermike/basic_agent

depends_on:
- basic_agent
- mockopenai
image: h4ckermike/autogpt
7 changes: 7 additions & 0 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading