-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
50 lines (38 loc) · 1.22 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
DOCKER_NAME = "madminer-workflow-ml"
DOCKER_REGISTRY = "madminertool"
DOCKER_VERSION = $(shell cat VERSION)
MLFLOW_USERNAME ?= $(shell whoami)
MLFLOW_TRACKING_URI ?= "file:///_mlflow"
YADAGE_INPUT_DIR = "$(PWD)/workflow"
YADAGE_SPEC_DIR = "$(PWD)/workflow/yadage"
YADAGE_WORK_DIR = "$(PWD)/.yadage"
.PHONY: check
check:
@echo "Checking code format"
@black --check "code"
.PHONY: build
build:
@echo "Building Docker image..."
@docker build . --tag $(DOCKER_REGISTRY)/$(DOCKER_NAME):$(DOCKER_VERSION)
.PHONY: push
push: build
@echo "Pushing Docker image..."
@docker login --username "${DOCKERUSER}" --password "${DOCKERPASS}"
@docker push $(DOCKER_REGISTRY)/$(DOCKER_NAME):$(DOCKER_VERSION)
.PHONY: yadage-clean
yadage-clean:
@echo "Cleaning previous run..."
@rm -rf $(YADAGE_WORK_DIR)
.PHONY: yadage-run
yadage-run: yadage-clean
@echo "Launching Yadage..."
@yadage-run $(YADAGE_WORK_DIR) "workflow.yml" \
-p data_file="/madminer/data/dummy_data.h5" \
-p input_file="input.yml" \
-p mlflow_args_s="\"''\"" \
-p mlflow_args_t="\"''\"" \
-p mlflow_args_e="\"''\"" \
-p mlflow_server=$(MLFLOW_TRACKING_URI) \
-p mlflow_username=$(MLFLOW_USERNAME) \
-d initdir=$(YADAGE_INPUT_DIR) \
--toplevel $(YADAGE_SPEC_DIR)