diff --git a/Makefile b/Makefile index 3694042d..8e1de8c4 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -VERSION ?= "0.0.0.dev" +VERSION ?= "0.1.0.dev0" .PHONY: install install: ## Install the poetry environment and install the pre-commit hooks @@ -54,27 +54,39 @@ build-and-publish: build publish ## Build and publish. .PHONY: docker docker: ## Build and run the Docker container + @echo "🚀 Building arcade and toolkit wheels..." + @make full-dist + @echo "Writing extras [fastapi, evals] to requirements.txt" + @cd arcade && poetry export --extras "fastapi evals" --output ../dist/requirements.txt + @echo "🚀 Building Docker image" @cd docker && make docker-build @cd docker && make docker-run .PHONY: full-dist -full-dist: clean-dist ## Build all projects and copy wheels to arcade/dist - @echo "🚀 Building all projects and copying wheels to arcade/dist" +full-dist: clean-dist ## Build all projects and copy wheels to ./dist + @echo " Building a full distribution with toolkits" + + @echo "Setting version to $(VERSION)" + @make set-version + + @echo "🛠️ Building all projects and copying wheels to ./dist" + @mkdir -p dist/toolkits # Build the main arcade project - @echo "Building arcade project..." + @echo "🛠️ Building arcade project wheel..." @cd arcade && poetry build - # Create the arcade/dist directory if it doesn't exist - @mkdir -p arcade/dist/toolkits + # Copy the main arcade project wheel to the dist directory + @cp arcade/dist/*.whl dist/ + @echo "🛠️ Building all projects and copying wheels to ./dist" # Build and copy wheels for each toolkit @for toolkit_dir in toolkits/*; do \ if [ -d "$$toolkit_dir" ]; then \ toolkit_name=$$(basename "$$toolkit_dir"); \ echo "Building $$toolkit_name project..."; \ cd "$$toolkit_dir" && poetry build; \ - cp dist/*.whl ../../arcade/dist/toolkits; \ + cp dist/*.whl ../../dist/toolkits; \ cd -; \ fi; \ done @@ -82,9 +94,17 @@ full-dist: clean-dist ## Build all projects and copy wheels to arcade/dist @echo "✅ All projects built and wheels copied to arcade/dist" .PHONY: clean-dist -clean-dist: ## Clean the arcade/dist directory +clean-dist: ## Clean all built distributions + @echo "🗑️ Cleaning dist directory" + @rm -rf dist @echo "🗑️ Cleaning arcade/dist directory" @rm -rf arcade/dist + @echo "🗑️ Cleaning toolkits/*/dist directory" + @for toolkit_dir in toolkits/*; do \ + if [ -d "$$toolkit_dir" ]; then \ + rm -rf "$$toolkit_dir"/dist; \ + fi; \ + done .PHONY: help help: diff --git a/arcade/arcade/cli/main.py b/arcade/arcade/cli/main.py index ac4c8e3f..9ec5341c 100644 --- a/arcade/arcade/cli/main.py +++ b/arcade/arcade/cli/main.py @@ -141,7 +141,6 @@ def show( toolkit: Optional[str] = typer.Option( None, "-t", "--toolkit", help="The toolkit to show the tools of" ), - actor: Optional[str] = typer.Option(None, help="A running actor address to list tools from"), debug: bool = typer.Option(False, "--debug", "-d", help="Show debug information"), ) -> None: """ @@ -155,14 +154,20 @@ def show( table = Table(show_header=True, header_style="bold magenta") table.add_column("Name") table.add_column("Description") - table.add_column("Toolkit") + table.add_column("Package") table.add_column("Version") - for tool in catalog: - table.add_row(tool.name, tool.description, tool.meta.toolkit, tool.version) + tool_names = catalog.get_tool_names() + for tool_name in tool_names: + tool = catalog.get_tool(tool_name) + package = tool.meta.package if tool.meta.package else tool.meta.toolkit + table.add_row(str(tool_name), tool.description, package, tool.version) console.print(table) + # used when debugging a broken package on import. + # `arcade show` is the first command used after + # a toolkit package is created. except Exception as e: if debug: raise diff --git a/arcade/pyproject.toml b/arcade/pyproject.toml index 92d2fb00..519a4411 100644 --- a/arcade/pyproject.toml +++ b/arcade/pyproject.toml @@ -43,7 +43,7 @@ pre-commit = "^3.4.0" tox = "^4.11.1" pytest-asyncio = "^0.23.7" types-toml = "^0.10.8" - +poetry-plugin-export = "^1.7.0" [tool.poetry.scripts] arcade = "arcade.cli.main:cli" diff --git a/docker/Dockerfile b/docker/Dockerfile index 3310659b..e2ea1066 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -4,10 +4,12 @@ FROM python:3.10-slim # Define build arguments with default values ARG PORT=8001 ARG HOST=0.0.0.0 +ARG VERSION=0.1.0 # Set environment variables using the build arguments ENV PORT=${PORT} ENV HOST=${HOST} +ENV VERSION=${VERSION} ENV OTEL_ENABLE=false ENV ARCADE_WORK_DIR=/app @@ -22,32 +24,20 @@ RUN apt-get update && apt-get install -y \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* -WORKDIR /app - -RUN pip install build poetry - -# Copy the parent directory contents into the container -COPY . . - WORKDIR /app/arcade -# Build the project -RUN python -m build +# Copy the parent directory contents into the container +COPY ./dist . -# Build the project and install the wheel with extras -RUN poetry export --extras "fastapi evals" --output requirements.txt - -# Install the wheel with extras -RUN python -m pip install dist/arcade_ai-0.1.0-py3-none-any.whl[fastapi,evals] uvicorn -RUN python -m pip install -r requirements.txt - -WORKDIR /app/toolkits +# Install the wheel with extras (not evals for now) +RUN python -m pip install ./arcade_ai-${VERSION}-py3-none-any.whl +RUN python -m pip install -r ./requirements.txt # Install toolkits from the toolkits directory RUN set -e; \ - for toolkit in ./*; do \ + for toolkit in ./toolkits/*; do \ echo "Installing toolkit $toolkit"; \ - pip install $toolkit; \ + python -m pip install $toolkit; \ done diff --git a/docker/Makefile b/docker/Makefile index 549384c7..e6995ff6 100644 --- a/docker/Makefile +++ b/docker/Makefile @@ -6,7 +6,7 @@ DESCRIPTION ?= "Arcade AI for LLM Tool Serving" REPOSITORY ?= arcadeai/arcade-ai ECR_ENDPOINT ?= 471112909428.dkr.ecr.us-east-1.amazonaws.com -VERSION ?= dev +VERSION ?= 0.1.0.dev0 COMMIT ?= $(shell git describe --dirty --always --abbrev=15) BUILD_DATE ?= $(shell date -u +"%Y-%m-%dT%H:%M:%SZ") IMAGE_NAME ?= actor diff --git a/docker/toolkits.txt b/docker/toolkits.txt deleted file mode 100644 index 42dfb95c..00000000 --- a/docker/toolkits.txt +++ /dev/null @@ -1,5 +0,0 @@ -google -slack -math -search -x diff --git a/toolkits/google/pyproject.toml b/toolkits/google/pyproject.toml index cc7888bd..bb4e59b2 100644 --- a/toolkits/google/pyproject.toml +++ b/toolkits/google/pyproject.toml @@ -6,7 +6,7 @@ authors = ["Sam Partee ", "Eric Gustin "] [tool.poetry.dependencies] python = "^3.10" -arcade-ai = "^0.1.0" +arcade-ai = "0.1.*" google-api-core = "2.19.1" google-api-python-client = "2.137.0" google-auth = "2.32.0" diff --git a/toolkits/math/pyproject.toml b/toolkits/math/pyproject.toml index 47fb3e97..4012d6dd 100644 --- a/toolkits/math/pyproject.toml +++ b/toolkits/math/pyproject.toml @@ -7,7 +7,7 @@ authors = ["Nate "] [tool.poetry.dependencies] python = "^3.10" -arcade-ai = "^0.1.0" +arcade-ai = "0.1.*" [tool.poetry.dev-dependencies] pytest = "^8.3.0" diff --git a/toolkits/search/pyproject.toml b/toolkits/search/pyproject.toml index 8f34835b..ec2b65f3 100644 --- a/toolkits/search/pyproject.toml +++ b/toolkits/search/pyproject.toml @@ -6,7 +6,7 @@ authors = ["Sam Partee "] [tool.poetry.dependencies] python = "^3.10" -arcade-ai = "^0.1.0" +arcade-ai = "0.1.*" serpapi = "^0.1.5" [tool.poetry.dev-dependencies] diff --git a/toolkits/slack/pyproject.toml b/toolkits/slack/pyproject.toml index c35eaf73..2fdf7f22 100644 --- a/toolkits/slack/pyproject.toml +++ b/toolkits/slack/pyproject.toml @@ -6,7 +6,7 @@ authors = ["Nate Barbettini "] [tool.poetry.dependencies] python = "^3.10" -arcade-ai = "^0.1.0" +arcade-ai = "0.1.*" slack-sdk = "^3.31.0" [tool.poetry.dev-dependencies] diff --git a/toolkits/x/pyproject.toml b/toolkits/x/pyproject.toml index 83ef7510..0451f9e4 100644 --- a/toolkits/x/pyproject.toml +++ b/toolkits/x/pyproject.toml @@ -6,7 +6,7 @@ authors = ["Eric Gustin "] [tool.poetry.dependencies] python = "^3.10" -arcade-ai = "^0.1.0" +arcade-ai = "0.1.*" httpx = "^0.27.2" [tool.poetry.dev-dependencies]