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

🔧 Add Makefile #26

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
50 changes: 50 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
.PHONY: docker docker-build docker-run install clean

# Docker image name
IMAGE_NAME = aide

# Python version and venv
PYTHON = python3.10
VENV_NAME = .venv

# Default directories for logs and workspaces
WORKSPACE_BASE ?= $(PWD)/workspaces
LOGS_DIR ?= $(PWD)/logs

# Virtual environment installation
install:
@echo "Creating virtual environment..."
@$(PYTHON) -m venv $(VENV_NAME)
@echo "Installing dependencies..."
@. $(VENV_NAME)/bin/activate && \
pip install --upgrade pip && \
pip install -r requirements.txt && \
pip install -e .
@echo "Installation complete. Activate the virtual environment with: source $(VENV_NAME)/bin/activate"

# Docker commands combined
docker: docker-build docker-run

# Build Docker image
docker-build:
docker build -t $(IMAGE_NAME) .

# Run Docker container
docker-run:
@mkdir -p "$(LOGS_DIR)" "$(WORKSPACE_BASE)"
docker run -it --rm \
-v "$(LOGS_DIR):/app/logs" \
-v "$(WORKSPACE_BASE):/app/workspaces" \
-v "$(PWD)/aide/example_tasks:/app/data" \
-e OPENAI_API_KEY="$(OPENAI_API_KEY)" \
$(IMAGE_NAME) \
data_dir=/app/data/house_prices \
goal="Predict the sales price for each house" \
eval="Use the RMSE metric between the logarithm of the predicted and observed values."

# Clean up
clean:
@echo "Cleaning up..."
rm -rf $(VENV_NAME)
rm -rf workspaces/* logs/*
docker rmi $(IMAGE_NAME) || true