generated from CDCgov/template
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
71 lines (54 loc) · 1.88 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
64
65
66
67
68
69
70
71
REGISTRY=cfaprdbatchcr.azurecr.io/
IMAGE_NAME=cfa-epinow2-pipeline
BRANCH=$(shell git branch --show-current)
CONFIG_CONTAINER=rt-epinow2-config
ifeq ($(BRANCH), 'main')
TAG=latest
else
TAG=$(BRANCH)
endif
CONFIG=test.json
JOB=batch-test
deps:
docker build -t $(REGISTRY)$(IMAGE_NAME)-dependencies:$(TAG) -f Dockerfile-dependencies
pull:
az acr login --name 'cfaprdbatchcr'
docker pull $(REGISTRY)$(IMAGE_NAME)-dependencies:$(TAG)
docker pull $(REGISTRY)$(IMAGE_NAME):test-$(TAG)
build:
docker build -t $(REGISTRY)$(IMAGE_NAME):test-$(TAG) \
--build-arg TAG=$(TAG) -f Dockerfile .
tag:
docker tag $(IMAGE_NAME):$(TAG) $(REGISTRY)$(IMAGE_NAME):$(TAG)
config:
gh workflow run \
-R cdcgov/cfa-config-generator run-workload.yaml \
-f disease=all \
-f state=all
run-batch:
docker build -f Dockerfile-batch -t batch . --no-cache
docker run --rm \
--env-file .env \
-it \
batch python job.py "$(IMAGE)" "$(CONFIG_CONTAINER)" "$(POOL)" "$(JOB)"
run:
docker run --mount type=bind,source=$(PWD),target=/mnt -it \
--env-file .env \
--rm $(REGISTRY)$(IMAGE_NAME):test-$(TAG) \
Rscript -e "CFAEpiNow2Pipeline::orchestrate_pipeline('$(CONFIG)', config_container = 'rt-epinow2-config', input_dir = '/mnt/input', output_dir = '/mnt', output_container = 'zs-test-pipeline-update')"
up:
docker run --mount type=bind,source=$(PWD),target=/cfa-epinow2-pipeline -it \
--env-file .env \
--rm $(REGISTRY)$(IMAGE_NAME):test-$(TAG) /bin/bash
run-function:
docker run --mount type=bind,source=$(PWD),target=/cfa-epinow2-pipeline -it \
--rm $(REGISTRY)$(IMAGE_NAME):$(TAG) \
Rscript -e "CFAEpiNow2Pipeline::run_pipeline('/cfa-epinow2-pipeline/configs/baa631b0a39111efbec600155d6da693_MS_Influenza_1731703176.json')"
push:
docker push $(REGISTRY)$(IMAGE_NAME):$(TAG)
test:
Rscript -e "testthat::test_local()"
document:
Rscript -e "roxygen2::roxygenize()"
check:
Rscript -e "rcmdcheck::rcmdcheck()"