-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
57 lines (49 loc) · 1.83 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
51
52
53
54
55
56
57
# Makefile
# Variables
VENV_DIR := venv
DAGSTER_ENV := dagster/.env
DAGSTER_ENV_EXAMPLE := .env.example
SLING_ENV := infra/.sling/env.yaml
SLING_ENV_EXAMPLE := infra/.sling/env.example.yaml
REQUIREMENTS_FILE := ./requirements/dagster-requirements.txt
.PHONY: lakehouse-setup lakehouse-init lakehouse-serve lakehouse-kill
# Command for setting up the environment
lakehouse-setup:
@echo "Checking for virtual environment..."
@if [ ! -d "$(VENV_DIR)" ]; then \
echo "No virtual environment found, creating one..."; \
python -m venv $(VENV_DIR); \
echo "Activating virtual environment..."; \
source $(VENV_DIR)/bin/activate && \
echo "Installing requirements..." && \
pip install -r $(REQUIREMENTS_FILE); \
cd ./dagster && pip install -e ".[dev]"; \
elif [ -z "$$VIRTUAL_ENV" ]; then \
echo "Virtual environment is not activated. Activating..."; \
source $(VENV_DIR)/bin/activate; \
else \
echo "Virtual environment is already activated."; \
fi
@echo "Checking .env file in dagster..."
@if [ ! -f "$(DAGSTER_ENV)" ]; then \
echo "No .env file found, copying from .env.example..."; \
cp $(DAGSTER_ENV_EXAMPLE) $(DAGSTER_ENV); \
fi
@echo "Checking env.yaml for infra sling..."
@if [ ! -f "$(SLING_ENV)" ]; then \
echo "No env.yaml file found, copying from env.example.yaml..."; \
cp $(SLING_ENV_EXAMPLE) $(SLING_ENV); \
fi
@echo "setup complete, ensure environment variables are correctly configured..."
# Command for initializing the lakehouse setup
lakehouse-init: lakehouse-setup
@echo "Starting Docker containers..."
@docker-compose up -d
# Command for starting the Dagster development server
lakehouse-serve:
@echo "Starting Dagster server..."
@. $(VENV_DIR)/bin/activate && cd ./dagster && dagster dev
# Command for stopping Docker containers
lakehouse-kill:
@echo "Stopping Docker containers..."
@docker-compose down