Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ Current

### Added:

- [Add dockerfile and update README](https://github.com/yahoo/fili/pull/429)
* Make a Dockerfile for the Wikipedia example

- [Add Uptime Status Metric](https://github.com/yahoo/fili/pull/518)
* Add a metric to show how long Fili has been running

Expand Down
12 changes: 6 additions & 6 deletions fili-generic-example/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Fili Generic Loader Application
==================================

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

Expand Down Expand Up @@ -72,11 +72,11 @@ Here are some sample queries that you can run to verify your server:
}
```

- Count of edits by hour for the last 72 hours:
- Count of edits by hour for the last 72 hours:

GET http://localhost:9998/v1/data/wikiticker/day/?metrics=count&dateTime=PT72H/current
Note: this will should be something like the response below since the

Note: this will should be something like the response below since the
wikiticker table doesn't have data for the past 72 hours from now.
```json
{
Expand All @@ -94,7 +94,7 @@ Here are some sample queries that you can run to verify your server:

## Notable Restrictions

- Using this is great for testing out fili and druid, but it can't do interesting things with metrics.
- Using this is great for testing out Fili and druid, but it can't do interesting things with metrics.
- This can only use 1 timegrain even though a datasource in druid *could* have more.

## Importing and Running in IntelliJ
Expand Down
29 changes: 29 additions & 0 deletions fili-wikipedia-example/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
FROM druidio/example-cluster:latest
LABEL maintainer="https://groups.google.com/forum/#!forum/fili-developers"

# fili github information
ENV GITHUB_OWNER yahoo
ENV BRANCH master

RUN apt-get update && apt-get install -y --no-install-recommends git curl

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 \
&& ln -s /usr/local/apache-maven-3.2.5 /usr/local/apache-maven \
&& ln -s -f /usr/local/apache-maven/bin/mvn /usr/local/bin/mvn

# fili code goes here
RUN mkdir -p /usr/local/fili

# update in case of new commits
ADD https://api.github.com/repos/$GITHUB_OWNER/fili/git/refs/heads/$BRANCH fili-branch.json
RUN git clone -q --branch ${BRANCH} --depth 1 https://github.com/$GITHUB_OWNER/fili.git /usr/local/fili

WORKDIR /usr/local/fili

# install Fili in the container
RUN mvn -U -B install -DskipTests=true -Dmaven.javadoc.skip=true -Dcheckstyle.skip

EXPOSE 9998

RUN chmod +x /usr/local/fili/fili-wikipedia-example/entrypoint.sh
ENTRYPOINT ["/usr/local/fili/fili-wikipedia-example/entrypoint.sh"]
43 changes: 43 additions & 0 deletions fili-wikipedia-example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,49 @@ Here are some sample queries that you can run to verify your server:

GET http://localhost:9998/v1/data/wikipedia/hour/?format=debug&metrics=count&dateTime=PT72H/current

## Running Fili with Docker

There is a [Docker image](https://hub.docker.com/r/mpardesh/fili/) for Fili which can be found on
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to migrate this to the fili.io account.

Dockerhub. If you would like to experiment with Fili without having to download its dependencies, you can
[install](https://www.docker.com/community-edition) and start Docker. Then run these commands:

docker pull mpardesh/fili:1.0
docker run --name fili-wikipedia-example -i --rm -p 3001:8081 -p 3000:8082 -p 9998:9998 mpardesh/fili:1.0

This will start a container. Please wait a few minutes for Druid to get ready.

Once Druid is ready, you can start querying! Here is a
[sample query](http://localhost:9998/v1/data/wikipedia/day/?metrics=deleted&dateTime=2013-08-01/PT24H)
to get started:

http://localhost:9998/v1/data/wikipedia/day/?metrics=deleted&dateTime=2013-08-01/PT24H

If Druid isn't ready yet, you will see this message:

{
"rows": [],
"meta": {
"missingIntervals": ["2013-08-01 00:00:00.000/2013-08-02 00:00:00.000"]
}
}

If the query is successful, you should see this:

{
"rows": [{
"dateTime": "2013-08-01 00:00:00.000",
"deleted": -39917308
}]
}

To stop the container, run

docker stop fili-wikipedia-example

in a different terminal tab.

Note: the data used with Docker is from a different day than the data used with Druid quickstart.

## Importing and Running in IntelliJ

1. In IntelliJ, go to `File -> Open`
Expand Down
23 changes: 23 additions & 0 deletions fili-wikipedia-example/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/sh

export HOSTIP="$(resolveip -s $HOSTNAME)"
/usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf &
echo "Waiting for Druid to finish setting up"

time_left=300

while ! curl http://localhost:8081/druid/coordinator/v1/datasources | grep -q "wikipedia"; do
if [ "$time_left" -le 0 ]
then
echo "Druid is having trouble setting up"
exit
fi
sleep 5
time_left=$(( time_left - 5 ))
done

echo "Druid finished setting up. Starting Fili"
mvn -pl fili-generic-example exec:java -Dbard__fili_port=9998
-Dbard__druid_coord=http://localhost:8081/druid/coordinator/v1
-Dbard__non_ui_druid_broker=http://localhost:8082/druid/v2
-Dbard__ui_druid_broker=http://localhost:8082/druid/v2