-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
56 lines (43 loc) · 1.77 KB
/
Copy pathMakefile
File metadata and controls
56 lines (43 loc) · 1.77 KB
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
# Get the machine architecture.
# On arm64 (Apple Silicon M1/M2/etc.), `uname -m` outputs "arm64".
# On amd64 (Intel), `uname -m` outputs "x86_64".
ARCH := $(shell uname -m)
ifeq ($(ARCH), arm64)
this_arch=arm64
else ifeq ($(ARCH), x86_64)
this_arch=amd64
else
@echo "Unknown architecture: $(ARCH). Cannot determine if Mac is new (arm64) or old (amd64)."
endif
IMAGE_NAME=agent_workflow_container
CONTAINER_TAG=latest-$(this_arch)
DOCKER_OR_PODMAN=docker
#DOCKER_OR_PODMAN=podman
# If GEMINI_API_KEY is defined and not empty, set the docker environment flag
ENV_FLAGS =
ifneq ($(GEMINI_API_KEY),)
ENV_FLAGS += -e GEMINI_API_KEY
endif
container_build:
$(DOCKER_OR_PODMAN) build -t $(IMAGE_NAME):$(CONTAINER_TAG) .
container_live_as_user:
$(DOCKER_OR_PODMAN) run -it --rm \
--user $$(id -u):$$(id -g) \
$(ENV_FLAGS) \
$(IMAGE_NAME):$(CONTAINER_TAG) /bin/bash
container_live_as_root:
$(DOCKER_OR_PODMAN) run -it --rm \
$(ENV_FLAGS) \
$(IMAGE_NAME):$(CONTAINER_TAG) python3 /agent/main_loop.py --isolated --dir /opt --log
container_live_host_folder_access:
$(DOCKER_OR_PODMAN) run -it --rm \
-v `pwd`:/scratch -w /scratch/ \
--user $$(id -u):$$(id -g) \
$(ENV_FLAGS) \
$(IMAGE_NAME):$(CONTAINER_TAG) /bin/bash
black_out:
$(DOCKER_OR_PODMAN) run --rm -v`pwd`:/scratch --entrypoint='' --workdir /scratch/ $(IMAGE_NAME):$(CONTAINER_TAG) make black_in
black_in:
black -v --workers 1 *.py
mypy_out:
$(DOCKER_OR_PODMAN) run --rm -v`pwd`:/scratch --entrypoint='' --workdir /scratch/ $(IMAGE_NAME):$(CONTAINER_TAG) mypy --install-types --non-interactive --check-untyped-defs webserver_for_pdg/pdg_app.py webserver_for_pdg/library