-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
144 lines (126 loc) · 3.9 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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
.ONESHELL:
DOCKER_COMPOSE_LOCAL_DIR = ./run/docker-compose
VERSION=$(shell cat ./.mvn/maven.config | grep revision | cut -d '=' -f2)-SNAPSHOT
DOCS_SRC_DIR=sphinx-docs
PUBLISHED_DOCS_DIR=docs
###################
## MAVEN
###################
compile:
./mvnw clean compile
build:
./mvnw clean install -DskipTests
test:
./mvnw clean test
package:
./mvnw clean package -Dmaven.test.skip=true
start:
cd maestro-app
../mvnw spring-boot:run
###################
## DOCKER
###################
docker-push:
docker push overture/maestro:$(VERSION)
docker-build:
docker build -f ci-cd/Dockerfile . -t overture/maestro:$(VERSION)
# use this when you want to run maestro as container
docker-start:
cd $(DOCKER_COMPOSE_LOCAL_DIR) && docker-compose up -d
docker-stop:
cd $(DOCKER_COMPOSE_LOCAL_DIR) && docker-compose down
# only starts the infrastructure containers needed by maestro
# use this when you run maestro from the ide (not as a container)
docker-start-dev:
cd $(DOCKER_COMPOSE_LOCAL_DIR) && docker-compose -f docker-compose.dev.yml up -d
docker-clean:
docker system prune
###################
## REST API
###################
rest-health:
curl -X GET http://localhost:11235/
rest-index-study:
curl -X POST \
http://localhost:11235/index/repository/collab/study/PACA-CA \
-H 'Content-Type: application/json' \
-H 'cache-control: no-cache' \
-d '{}'
rest-index-analysis:
curl -X POST \
http://localhost:11235/index/repository/collab/study/PACA-CA/analysis/ad7cabf8-df45-40f8-9fcb-67d8933f46e6 \
-H 'Content-Type: application/json' \
-H 'cache-control: no-cache'
rest-index-repo:
curl -X POST \
http://localhost:11235/index/repository/collab \
-H 'Content-Type: application/json' \
-H 'cache-control: no-cache'
###################
## KAFKA
###################
## the curl requests here run against the kafka rest proxy
## SONG analysis topic
kafka-analysis-publish:
curl -X POST \
http://localhost:8082/topics/song-analysis \
-H 'Accept: application/vnd.kafka.v2+json' \
-H 'Content-Type: application/vnd.kafka.json.v2+json' \
-H 'cache-control: no-cache' \
-d '{
"records": [
{"value" : { "analysisId" : "EGAZ00001254368", "studyId" : "PEME-CA", "songServerId": "collab", "state": "PUBLISHED" } }
]
}'
kafka-song-queue:
docker exec -t kafka.maestro.dev bash -c "/usr/bin/kafka-console-consumer --bootstrap-server localhost:9092 \
--topic song-analysis --from-beginning"
kafka-song-dlq:
docker exec -t kafka.maestro.dev bash -c "/usr/bin/kafka-console-consumer --bootstrap-server localhost:9092 \
--topic maestro_song_analysis_dlq --from-beginning"
## Maestro requests topic
kafka-maestro-topic:
curl -X GET \
http://localhost:8082/topics/maestro_index_requests \
-H 'cache-control: no-cache'
kafka-index-study:
curl -X POST \
http://localhost:8082/topics/maestro_index_requests \
-H 'Accept: application/vnd.kafka.v2+json' \
-H 'Content-Type: application/vnd.kafka.json.v2+json' \
-H 'cache-control: no-cache' \
-d '{
"records": [
{"value" : { "repositoryCode" : "collab", "studyId" : "PACA-CA" } }
]
}'
kafka-index-analysis:
curl -X POST \
http://localhost:8082/topics/maestro_index_requests \
-H 'Accept: application/vnd.kafka.v2+json' \
-H 'Content-Type: application/vnd.kafka.json.v2+json' \
-H 'cache-control: no-cache' \
-d '{
"records": [
{"value" : { "repositoryCode" : "collab", "studyId" : "PEME-CA", "analysisId" : "EGAZ00001254247", "removeAnalysis": false } }
]
}'
kafka-index-repo:
curl -X POST \
http://localhost:8082/topics/maestro_index_requests \
-H 'Accept: application/vnd.kafka.v2+json' \
-H 'Content-Type: application/vnd.kafka.json.v2+json' \
-H 'cache-control: no-cache' \
-d '{
"records": [
{"value" : { "repositoryCode" : "aws" } }
]
}'
########################################
## documentation
########################################
build-docs:
cd $(DOCS_SRC_DIR)
make singlehtml
rm -r ../$(PUBLISHED_DOCS_DIR)/*
cp -r ./build/singlehtml/* ../$(PUBLISHED_DOCS_DIR)