-
Notifications
You must be signed in to change notification settings - Fork 87
/
Copy pathMakefile
50 lines (42 loc) · 1.33 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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