This PR improves the Docker build process by shifting from building the
project within the Docker image to using pre-built wheels. The main
changes are:
1. **Updated Makefile:**
- **`VERSION` Variable:** Set to `0.1.0.dev0` to reflect the new default
development version.
- **`docker` Target:**
- Added steps to build the Arcade and toolkit wheels before building the
Docker image.
- Exports the required extras (`fastapi`, `evals`) to a
`requirements.txt` file.
- **`full-dist` Target:**
- Builds distributions for the main project and all toolkits.
- Copies all the built wheels to a centralized `./dist` directory.
- **`clean-dist` Target:**
- Cleans build artifacts from `./dist`, `arcade/dist`, and
`toolkits/*/dist` directories.
2. **Modified Dockerfile:**
- **Copy Pre-built Wheels:** Adjusted to copy wheels and the
`requirements.txt` from the `./dist` directory into the Docker image.
- **Installation Process:**
- Installs the Arcade wheel with the necessary extras.
- Installs toolkits from the copied wheel files, eliminating the need to
build them inside the Docker image.
- **Simplification:** Removed unnecessary commands, such as installing
build tools and copying the entire codebase, to streamline the
Dockerfile.
3. **Toolkits `pyproject.toml` Updates:**
- Changed the `arcade-ai` dependency version from `^0.1.0` to `0.1.*` in
all toolkit `pyproject.toml` files to ensure compatibility with the new
versioning scheme.
4. **Docker Makefile Adjustments:**
- Set the `VERSION` variable to `0.1.0.dev0` to align with the main
Makefile.
- Ensures consistent versioning across Docker-related build processes.
**Benefits:**
- **Efficiency:** Building wheels outside the Docker context reduces the
Docker image build time and resource consumption. overall docker image
size reduced by **1Gb**!!!
- **Reliability:** Using pre-built wheels ensures consistency across
different environments and simplifies dependency management.
- **Maintainability:** The Dockerfile and Makefiles are cleaner and more
straightforward, making them easier to understand and maintain.
**Notes:**
- Developers should run `make docker` to build and run the Docker
container using the new process.
- Ensure that any CI/CD pipelines are updated to accommodate these
changes in the build process. @sdreyer
71 lines
1.9 KiB
TOML
71 lines
1.9 KiB
TOML
[tool.poetry]
|
|
name = "arcade-ai"
|
|
version = "0.1.0"
|
|
description = ""
|
|
packages = [
|
|
{include="arcade", from="."}
|
|
]
|
|
authors = ["Arcade AI <sam@arcade-ai.com>"]
|
|
|
|
[build-system]
|
|
requires = ["poetry-core>=1.0.0"]
|
|
build-backend = "poetry.core.masonry.api"
|
|
|
|
|
|
[tool.poetry.dependencies]
|
|
python = ">=3.10,<4.0"
|
|
pydantic = "^2.7.0"
|
|
typer = "^0.9.0"
|
|
rich = "^13.7.1"
|
|
toml = "^0.10.2"
|
|
tomlkit = "^0.12.4"
|
|
openai = "^1.36.0" # TODO: relax to an earlier version that still has what we need
|
|
pyjwt = "^2.8.0"
|
|
loguru = "^0.7.0"
|
|
opentelemetry-instrumentation-fastapi = {version = "0.48b0", optional = true}
|
|
opentelemetry-exporter-otlp-proto-http = {version = "1.27.0", optional = true}
|
|
opentelemetry-exporter-otlp-proto-common = {version = "1.27.0", optional = true}
|
|
fastapi = {version = "^0.110.0", optional = true}
|
|
uvicorn = {version = "^0.30.0", optional = true}
|
|
scipy = {version = "^1.14.0", optional = true}
|
|
numpy = {version = "^2.0.0", optional = true}
|
|
scikit-learn = {version = "^1.5.0", optional = true}
|
|
|
|
[tool.poetry.extras]
|
|
fastapi = ["fastapi", "uvicorn", "opentelemetry-instrumentation-fastapi", "opentelemetry-exporter-otlp-proto-http", "opentelemetry-exporter-otlp-proto-common"]
|
|
evals = ["scipy", "numpy", "scikit-learn"]
|
|
|
|
[tool.poetry.group.dev.dependencies]
|
|
pytest = "^8.1.2"
|
|
pytest-cov = "^4.0.0"
|
|
mypy = "^1.5.1"
|
|
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"
|
|
|
|
[tool.mypy]
|
|
files = ["arcade"]
|
|
python_version = "3.10"
|
|
disallow_untyped_defs = "True"
|
|
disallow_any_unimported = "True"
|
|
no_implicit_optional = "True"
|
|
check_untyped_defs = "True"
|
|
warn_return_any = "True"
|
|
warn_unused_ignores = "True"
|
|
show_error_codes = "True"
|
|
ignore_missing_imports = "True"
|
|
|
|
[tool.pytest.ini_options]
|
|
testpaths = ["tests"]
|
|
|
|
[tool.coverage.report]
|
|
skip_empty = true
|
|
|
|
[tool.coverage.run]
|
|
branch = true
|
|
source = ["arcade"]
|