Skip to content
This repository has been archived by the owner on Mar 25, 2019. It is now read-only.

Service implementation #2

Merged
merged 40 commits into from
Nov 6, 2017
Merged

Service implementation #2

merged 40 commits into from
Nov 6, 2017

Conversation

taganaka
Copy link
Member

@taganaka 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

@ruphy
Copy link
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
Copy link
Member Author

taganaka commented Nov 7, 2017

@ruphy Glad you guys liked it!

Looking forward to continuing to improve this project

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants