-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathMakefile
More file actions
50 lines (42 loc) · 1.6 KB
/
Copy pathMakefile
File metadata and controls
50 lines (42 loc) · 1.6 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
################################################################################
#
# Makefile for ASKCOS
#
################################################################################
.PHONY: build debug push test setup_pages
VERSION ?= latest
GIT_HASH := $(shell git log -1 --format='format:%H')
GIT_DATE := $(shell git log -1 --format='format:%cs')
GIT_DESCRIBE := $(shell git describe --tags --always --dirty)
REGISTRY ?= askcos/askcos-core
TAG ?= $(VERSION)
DATA_VERSION ?= $(VERSION)
main build:
@echo Building docker image: $(REGISTRY):$(TAG)
@sed \
-e 's/{VERSION}/$(VERSION)/g' \
-e 's/{GIT_HASH}/$(GIT_HASH)/g' \
-e 's/{GIT_DATE}/$(GIT_DATE)/g' \
-e 's/{GIT_DESCRIBE}/$(GIT_DESCRIBE)/g' \
Dockerfile | docker build -t $(REGISTRY):$(TAG) \
--build-arg DATA_VERSION=$(DATA_VERSION) \
-f - .
build_ci:
@echo Building docker image: $(REGISTRY):$(TAG)
@sed \
-e 's/{VERSION}/$(VERSION)/g' \
-e 's/{GIT_HASH}/$(GIT_HASH)/g' \
-e 's/{GIT_DATE}/$(GIT_DATE)/g' \
-e 's/{GIT_DESCRIBE}/$(GIT_DESCRIBE)/g' \
Dockerfile | docker build -t $(REGISTRY):$(TAG) \
--cache-from $(REGISTRY):dev \
--build-arg BUILDKIT_INLINE_CACHE=1 \
--build-arg DATA_VERSION=$(DATA_VERSION) \
-f - .
push: build_ci
@docker push $(REGISTRY):$(TAG)
debug:
docker run -it --rm -w /usr/local/askcos-core $(VOLUMES) $(REGISTRY):$(TAG) /bin/bash
test:
docker run --rm -w /usr/local/askcos-core $(VOLUMES) $(REGISTRY):$(TAG) python -m unittest discover -v -p '*test.py' -s askcos
docker run --rm -w /usr/local/askcos-core $(VOLUMES) $(REGISTRY):$(TAG) python -m unittest -v askcos.retrosynthetic.mcts.tree_builder_test