-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathMakefile
63 lines (53 loc) · 2.32 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
58
59
60
61
62
63
VENDOR ?= ArcadeAI
PROJECT ?= ArcadeAI
SOURCE ?= https://github.com/ArcadeAI/arcade-ai
LICENSE ?= MIT
DESCRIPTION ?= "Arcade AI for LLM Tool Serving"
REPOSITORY ?= arcadeai/arcade-ai
ECR_ENDPOINT ?= 471112909428.dkr.ecr.us-east-1.amazonaws.com
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
PORT ?= 8002
.PHONY: docker-build
docker-build: ## Build the Docker container
@echo "🛠️ Building Docker image ($(VERSION)).."
@echo "- Commit: $(COMMIT)"
@echo "- Build Date: $(BUILD_DATE)"
@docker build --build-arg PORT=$(PORT) -f Dockerfile -t $(REPOSITORY):$(VERSION) .. \
--build-arg PORT=$(PORT) \
--build-arg VERSION="$(VERSION)" \
--build-arg COMMIT="$(COMMIT)" \
--build-arg BUILD_DATE="$(BUILD_DATE)" \
--label=org.opencontainers.image.vendor="$(VENDOR)" \
--label=org.opencontainers.image.title="$(PROJECT)" \
--label=org.opencontainers.image.revision="$(COMMIT)" \
--label=org.opencontainers.image.version="$(VERSION)" \
--label=org.opencontainers.image.created="$(BUILD_DATE)" \
--label=org.opencontainers.image.source="$(SOURCE)" \
--label=org.opencontainers.image.licenses="$(LICENSE)" \
--label=org.opencontainers.image.description=$(DESCRIPTION)
.PHONY: docker-run
docker-run: ## Run the Docker container
@echo "\n🚀 Run the container with the following ..."
@echo ">>> docker run -d -p $(PORT):$(PORT) $(REPOSITORY):$(VERSION)"
.PHONY: publish-ecr
publish-ecr:
@echo "🚚 Pushing the Agent image to ECR.."
@docker tag $(REPOSITORY):$(VERSION) $(ECR_ENDPOINT)/$(REPOSITORY):$(VERSION)
@echo "- pushing $(ECR_ENDPOINT)/$(REPOSITORY):$(VERSION)"
@docker push $(ECR_ENDPOINT)/$(REPOSITORY):$(VERSION)
@echo $(VERSION) | grep -q $(RC_PART) || { \
docker tag $(REPOSITORY):$(VERSION) $(ECR_ENDPOINT)/$(REPOSITORY):latest; \
echo "- pushing $(ECR_ENDPOINT)/$(REPOSITORY):latest"; \
docker push $(ECR_ENDPOINT)/$(REPOSITORY):latest; \
}
.PHONY: ecr-login
ecr-login: # Login to ECR
@aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin $(ECR_ENDPOINT)
.PHONY: help
help:
@echo "🛠️ Actor Docker Commands:\n"
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.DEFAULT_GOAL := help