New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Service implementation #2

Merged
merged 40 commits into from Nov 6, 2017

Conversation

Projects
None yet
2 participants
@taganaka
Member

taganaka commented Oct 8, 2017

Features

  • Easy to scale thanks to producer/consumer architecture backed by redis
  • It generates for each plot a customizable set of different thumbs size
  • Embedding cached image in the page is easy as
<img src="//proxy/plot/:plot_public_id/:geometry">

Es:

<img src="/plot/cb638004-661c-4c11-802c-1fc1e2312577/356x280">
  • New public plots are discovered and cached automatically

Components

  • API: It is used to serve cached images to the client
  • Seeder: A recurring task would go through each available public plot by pinging Metabase's API and it will enqueue a new caching job
  • Worker: Responsible to perform screenshot and thumbs, consuming jobs enqueued by the Seeder

How to run locally with docker compose:

$ curl -XPOST -H "Content-Type: application/json" -d  '{"username": "user@domain.com", "password": "xxxxx"}'   https://graph.daf.teamdigitale.it/api/session
  • Make sure to have a jdk8 installed
  • Make sure to have a modern maven version installed
  • Copy config.properties.example to config-docker.properties and edit it accordingly
  • Compile it with:
$ mvn clean dependency:copy-dependencies  package -Dmaven.test.skip=true
  • Build the container with:
$ docker build -t italia/daf-metabase-cacher .

Run with:

$ docker-compose up

Once the service is up, a POC will be available at http://localhost:4567/

Live demo available at https://daf-cache.taganaka.com/

italia/daf-dataportal#46

@taganaka taganaka force-pushed the taganaka:master branch from dcbb348 to 122ba36 Oct 18, 2017

taganaka added some commits Oct 29, 2017

@ruphy

This comment has been minimized.

Member

ruphy commented Nov 6, 2017

This contribution is amazing! Thank you so much for it, merging! 😄 🥇

I also invited you to become part of the italia organization, so that you can display this contribution on your profile. 🎉 I am also granting you admin access to this repository, so that you can keep improving this code as you wish! Great job! 😄
Welcome to the community, and remember: with great power comes great responsibility.

If you wish to display your belonging pubicly, don't forget to change the visibility (you can do so here) after you accept the invitation!

@ruphy ruphy merged commit 1946235 into italia:master Nov 6, 2017

@taganaka

This comment has been minimized.

Member

taganaka commented Nov 7, 2017

@ruphy Glad you guys liked it!

Looking forward to continuing to improve this project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment