Skip to content

Commit 4d635c7

Browse files
committed
Added dockerfile and updated README
1 parent af20b1b commit 4d635c7

File tree

3 files changed

+73
-15
lines changed

3 files changed

+73
-15
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Current
99
-------
1010

1111
### Added:
12+
- [Added dockerfile and updated README](https://github.com/yahoo/fili/pull/429)
1213

1314
- [Add Table-wide Availability](https://github.com/yahoo/fili/pull/414)
1415
* Add `availableIntervals` field to tables endpoint by union the availability for the logical table without taking
@@ -975,7 +976,7 @@ New Capabilities & Enhancements:
975976
- Cleaned up dependencies in pom files
976977
* Moved version management of dependencies up to the parent Pom's dependency management section
977978
* Cleaned up the parent Pom's dependency section to only be those dependencies that truly _every_ sub-project should
978-
depend on.
979+
depend on.
979980
* Cleaned up sub-project Pom dependency sections to handle and better use the dependencies the parent Pom provides
980981

981982
### Deprecated:

fili-generic-example/Dockerfile

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
FROM druidio/example-cluster:latest
2+
LABEL maintainer="https://groups.google.com/forum/#!forum/fili-developers"
3+
4+
# fili github information
5+
ENV GITHUB_OWNER=yahoo BRANCH=master
6+
7+
RUN apt-get update && apt-get install -y --no-install-recommends git
8+
9+
RUN wget -q -O - http://archive.apache.org/dist/maven/maven-3/3.2.5/binaries/apache-maven-3.2.5-bin.tar.gz | tar -xzf - -C /usr/local \
10+
&& ln -s /usr/local/apache-maven-3.2.5 /usr/local/apache-maven \
11+
&& ln -s -f /usr/local/apache-maven/bin/mvn /usr/local/bin/mvn
12+
13+
# fili code goes here
14+
RUN mkdir -p /usr/local/fili
15+
16+
# update in case of new commits
17+
ADD https://api.github.com/repos/$GITHUB_OWNER/fili/git/refs/heads/$BRANCH \
18+
fili-branch.json
19+
RUN git clone -q --branch "$BRANCH" --depth 1 \
20+
https://github.com/$GITHUB_OWNER/fili.git /usr/local/fili
21+
22+
WORKDIR /usr/local/fili
23+
24+
# install Fili in the container
25+
RUN mvn -U -B install -DskipTests=true -Dmaven.javadoc.skip=true -Dcheckstyle.skip
26+
27+
EXPOSE 9998
28+
29+
RUN apt-get purge --auto-remove -y git
30+
31+
ENTRYPOINT export HOSTIP="$(resolveip -s $HOSTNAME)" \
32+
&& exec /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf \
33+
& mvn -pl fili-generic-example exec:java -Dbard__fili_port=9998 \
34+
-Dbard__druid_coord=http://localhost:8081/druid/coordinator/v1 \
35+
-Dbard__non_ui_druid_broker=http://localhost:8082/druid/v2 \
36+
-Dbard__ui_druid_broker=http://localhost:8082/druid/v2
37+

fili-generic-example/README.md

Lines changed: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Fili Generic Loader Application
22
==================================
33

4-
This application will automatically configure fili to work with **any** instance
4+
This application will automatically configure Fili to work with **any** instance
55
of Druid and show the basic metrics and dimensions. This lets you test what it's
66
like using Fili without putting any effort into setting it up.
77

@@ -13,6 +13,15 @@ Note that this was last tested using [version 0.9.1](https://github.com/yahoo/fi
1313

1414
## Setup and Launching
1515

16+
### Docker
17+
There is a Fili Dockerfile which is available on Dockerhub. To start playing around with Fili, you can download and open Docker. Then
18+
run the command
19+
```bash
20+
docker run --name fili-generic-example -i --rm -p 3001:8081 -p 3000:8082 fili:1.0
21+
```
22+
Once you run this command, please wait a few minutes for Druid and Fili to spin up.
23+
24+
### Manual
1625
1. Have a [Druid](http://druid.io/docs/latest/tutorials/quickstart.html) cluster running on your Unix based machine.
1726

1827
2. Clone this repository to your computer.
@@ -58,26 +67,37 @@ Here are some sample queries that you can run to verify your server:
5867

5968
### Specific to Wikipedia data
6069

61-
- If everything is working, the [query below](http://localhost:9998/v1/data/wikiticker/day/?metrics=deleted&dateTime=2015-09-12/PT24H)
70+
- If everything is working, the [query below](http://localhost:9998/v1/data/wikipedia/day/?metrics=deleted&dateTime=2015-09-12/PT24H)
6271
```bash
63-
curl "http://localhost:9998/v1/data/wikiticker/day/?metrics=deleted&dateTime=2015-09-12/PT24H" -H "Content-Type: application/json" | python -m json.tool
72+
curl "http://localhost:9998/v1/data/wikipedia/day/?metrics=deleted&dateTime=2013-08-01/PT24H" -H "Content-Type: application/json" | python -m json.tool
6473
```
6574
should show something like:
6675
```
6776
{
6877
"rows": [{
69-
"dateTime": "2015-09-12 00:00:00.000",
70-
"deleted": 394298.0
78+
"dateTime": "2013-08-01 00:00:00.000",
79+
"deleted": -39917308
7180
}]
7281
}
7382
```
7483

75-
- Count of edits by hour for the last 72 hours:
76-
77-
GET http://localhost:9998/v1/data/wikiticker/day/?metrics=count&dateTime=PT72H/current
78-
79-
Note: this will should be something like the response below since the
80-
wikiticker table doesn't have data for the past 72 hours from now.
84+
If you see this message while running Docker it means that Druid isn't ready yet:
85+
86+
```json
87+
{
88+
"rows": [],
89+
"meta": {
90+
"missingIntervals": ["2013-08-01 00:00:00.000/2013-08-02 00:00:00.000"]
91+
}
92+
}
93+
```
94+
95+
- Count of edits by hour for the last 72 hours:
96+
97+
GET http://localhost:9998/v1/data/wikipedia/day/?metrics=count&dateTime=PT72H/current
98+
99+
Note: this will should be something like the response below since the
100+
wikipedia table doesn't have data for the past 72 hours from now.
81101
```json
82102
{
83103
"rows": [],
@@ -87,14 +107,14 @@ Here are some sample queries that you can run to verify your server:
87107
}
88108
```
89109

90-
- Show [debug info](http://localhost:9998/v1/data/wikiticker/day/?format=debug&metrics=count&dateTime=PT72H/current),
110+
- Show [debug info](http://localhost:9998/v1/data/wikipedia/day/?format=debug&metrics=count&dateTime=PT72H/current),
91111
including the query sent to Druid:
92112

93-
GET http://localhost:9998/v1/data/wikiticker/day/?format=debug&metrics=count&dateTime=PT72H/current
113+
GET http://localhost:9998/v1/data/wikipedia/day/?format=debug&metrics=count&dateTime=PT72H/current
94114

95115
## Notable Restrictions
96116

97-
- Using this is great for testing out fili and druid, but it can't do interesting things with metrics.
117+
- Using this is great for testing out Fili and druid, but it can't do interesting things with metrics.
98118
- This can only use 1 timegrain even though a datasource in druid *could* have more.
99119
100120
## Importing and Running in IntelliJ

0 commit comments

Comments
 (0)