-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathMakefile
125 lines (86 loc) · 2.86 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# ---------------- configuration ----------------------
# if you have multiple SWI Prolog installations or an installation
# in a non-standard place, set PLLD to the appropriate plld invokation, eg
# PLLD=/usr/local/bin/plld -p /usr/local/bin/swipl
#PACKNAME=sparkle
#include ../Makefile.inc
SWIPL = swipl -p library=prolog
all: test
check:
install:
clean:
test:
echo "skipping tests. make realtest for actual tests"
realtest:
$(SWIPL) -l tests/tests.pl -g run_tests,halt
bigtest:
$(SWIPL) -l tests/bigtests.pl -g run_tests,halt
coverage:
$(SWIPL) -l tests/bigtests.pl -l tests/tests.pl -g "show_coverage(run_tests),halt"
t-%:
$(SWIPL) -l tests/$*_test.pl -g run_tests,halt
# --------------------
# Schemas
# --------------------
biopax-level3.owl:
wget http://www.biopax.org/release/biopax-level3.owl -O $@
# --------------------
# Run pengine
# --------------------
# TODO: get from pack
VERSION = v$(shell swipl -l pack.pl -g "version(V),writeln(V),halt.")
show-version:
echo $(VERSION)
IM = cmungall/sparqlprog
pe: pe-clean pe-build pe-run
pe-clean:
docker kill $(IM) || echo not running ;
docker rm $(IM) || echo not made
pe-build:
(test -f tests/out.tmp && rm tests/out.tmp || echo ok) && \
docker build -t $(IM):$(VERSION) . \
&& docker tag $(IM):$(VERSION) $(IM):latest
pe-run:
docker run -p 9083:9083 -e PORT=9083 --name sparqlprog $(IM)
pe-run-bg:
docker run -p 9083:9083 -e PORT=9083 --name sparqlprog $(IM) &
pe-test: pe-run-bg
sleep 3 ;\
python3 ../sparqlprog-python/sparqlprog.py -u http://localhost:9083 -e wd "continent(X)" ;\
docker kill sparqlprog ;\
docker rm sparqlprog
pe-publish: pe-build
@docker push $(IM):$(VERSION) \
&& docker push $(IM):latest
# First requires: heroku container:login
heroku-new-app:
heroku create
heroku-deploy:
heroku container:push web &&\
heroku logs
# --------------------
# Run pldoc server in Docker
# --------------------
# after running, connect to
# http://localhost:4000/pldoc/doc/work/prolog/sparqlprog.pl
pldoc-run:
docker run -v $(PWD)/:/work/ -w /work --name pldoc -p 4000:4000 -e PORT=4000 -it cmungall/sparqlprog swipl -p library=prolog -g [debug] && \
echo "server started, see http://localhost:4000/pldoc/"
# --------------------
# Run SPARQL service inside Docker
# --------------------
BGVERSION = 2.1.4
bg: bg-run pause bg-load
bg-data: examples/load-data/goslim_generic.ttl
examples/load-data:
mkdir $@
examples/load-data/%.ttl: examples/data/%.ttl.gz examples/load-data
gzip -dc $< > $@
bg-run:
docker run --name blazegraph -d -p 8889:8080 -v $(PWD)/examples/RWStore.properties:/RWStore.properties -v $(PWD)/examples/load-data/:/data lyrasis/blazegraph:$(BGVERSION)
pause:
sleep 1
bg-load: bg-data
curl -X POST --data-binary @examples/dataloader.txt --header 'Content-Type:text/plain' http://localhost:8889/bigdata/dataloader
bg-stop:
docker kill blazegraph; docker rm blazegraph