From 09c74340122522fd4f77c89e94a59c9d152bbfa6 Mon Sep 17 00:00:00 2001 From: Asone Date: Wed, 15 Aug 2018 14:39:39 +0200 Subject: [PATCH 1/2] feature: add wikidata container --- Makefile | 4 +++- _provisioning/wikidata-api/Dockerfile | 27 +++++++++++++++++++++++++++ docker-compose.yml | 10 ++++++++++ 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 _provisioning/wikidata-api/Dockerfile diff --git a/Makefile b/Makefile index d2f413d..a8958cb 100644 --- a/Makefile +++ b/Makefile @@ -3,4 +3,6 @@ an-data-fetcher : an-pics-fetcher : docker-compose run assemblee cargo run -p tricoteuses_api_assemblee_photos_fetcher -- -c Config.toml -v hatvp-data-fetcher: - docker-compose run hatvp cargo run -p tricoteuses_api_hatvp_fetcher -- -c Config.toml -v \ No newline at end of file + docker-compose run hatvp cargo run -p tricoteuses_api_hatvp_fetcher -- -c Config.toml -v +wikidata-data-fetcher: + docker-compose run wikidata cargo run -p tricoteuses_api_wikidata_fetcher -- -c Config.toml -v diff --git a/_provisioning/wikidata-api/Dockerfile b/_provisioning/wikidata-api/Dockerfile new file mode 100644 index 0000000..93364e7 --- /dev/null +++ b/_provisioning/wikidata-api/Dockerfile @@ -0,0 +1,27 @@ +FROM rustlang/rust:nightly + +LABEL AUTHOR="Nelson Herbin " +LABEL NAME=tricoteuses-wikidata-api +LABEL VERSION=1 + +RUN apt-get update && \ +apt-get install -y unzip + +ENV JQ_VERSION='1.5' + +RUN wget --no-check-certificate https://raw.githubusercontent.com/stedolan/jq/master/sig/jq-release.key -O /tmp/jq-release.key && \ + wget --no-check-certificate https://raw.githubusercontent.com/stedolan/jq/master/sig/v${JQ_VERSION}/jq-linux64.asc -O /tmp/jq-linux64.asc && \ + wget --no-check-certificate https://github.com/stedolan/jq/releases/download/jq-${JQ_VERSION}/jq-linux64 -O /tmp/jq-linux64 && \ + gpg --import /tmp/jq-release.key && \ + gpg --verify /tmp/jq-linux64.asc /tmp/jq-linux64 && \ + cp /tmp/jq-linux64 /usr/bin/jq && \ + chmod +x /usr/bin/jq && \ + rm -f /tmp/jq-release.key && \ + rm -f /tmp/jq-linux64.asc && \ + rm -f /tmp/jq-linux64 + +RUN git clone https://framagit.org/tricoteuses/tricoteuses-api-wikidata.git + +WORKDIR tricoteuses-api-wikidata + +EXPOSE 8003 \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 451b13b..4886c55 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -73,6 +73,16 @@ services: - ./_data:/hatvp-data/ ports: - 8002:8002 + wikidata: + build: + context: ./_provisioning/wikidata-api + environment: + - ROCKET_ENV=staging + command: cargo run -p tricoteuses_api_wikidata -- -c Config.toml -v + volumes: + - ./_data:/wikidata-data/ + ports: + - 8003:8003 volumes: pgdata: From 23b9a02b867bebca757a32527f40b34baa61bc03 Mon Sep 17 00:00:00 2001 From: Asone Date: Wed, 15 Aug 2018 14:55:19 +0200 Subject: [PATCH 2/2] doc: update documentation --- README.md | 74 +++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 56 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index f534beb..8b7f9a8 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,68 @@ # Docker containers for tricoteuses application -This repo is an intent to provide docker containers for tricoteuses application. +This repo provides docker containers for tricoteuses applications. -Tricoteuses is an application of [parlement ouvert](https://framagit.org/parlement-ouvert) which intends to open the data of the french parlement so it can be easily used by contributors. +Tricoteuses are a set of software from [parlement ouvert](https://framagit.org/parlement-ouvert) which intends to open the data of the french parlement so it can be easily used by contributors. -Tricoteuses comes in 3 different softwares interacting through a postgres database. +Softwares are the following : -Softwares are the following : - - [ ] [Postgres]() - - [ ] [Tricoteuses-daemon](https://framagit.org/parlement-ouvert/tricoteuses-daemon) : An software for automatic feed our database + - [x] [Tricoteuses-api-assemble](): Provides a GraphQL server for data fetched from the french parlament. + - [x] [Tricoteuses-api-hatvp](): Provides a GraphQL server for data fetched from the [`Hatvp`]() institution. + - [x] [Tricoteuses-api-wikidata](): Provides a GraphQL server for parlamentaries biographic data fetched from [wikidata]()(https://framagit.org/tricoteuses/tricoteuses-api-wikidata). - [ ] [Tricoteuses-api](https://framagit.org/parlement-ouvert/tricoteuses-api) : A graphQL API for requesting database - - [ ] [Tricoteuses-ui](https://framagit.org/parlement-ouvert/tricoteuses-ui) : Front-end application for exploring data. - - [ ] A new GraphQL API for specific use with `assemblée nationale` data. + - [ ] [Tricoteuses-ui](https://framagit.org/parlement-ouvert/tricoteuses-ui) : Front-end application for exploring data. +- [ ] [Tricoteuses-daemon](https://framagit.org/parlement-ouvert/tricoteuses-daemon) : feeds the postgres database automatically ## Current services states +### **[Functional] assemblee (Assemblée Nationale)** + +#### Fetch data ### + +You will need to fetch Parlament data if you deploy on a new environment. You can use `make` command to launch data fetching with : + +``` +make an-data-fetcher +make an-pics-fetcher +``` + +### usage ### +Run `docker-compose up assemblee` to launch webserver. + +A documented graphiQL interface is available at [localhost:8000](http://localhost:8000) + + +### **[Functional] hatvp (Haute autorité de la transparence de la vie publique)** + +#### Fetch data ### + +You will need to fetch hatvp data if you deploy on a new environment. You can use `make` command to launch data fetching with : + +``` +make hatvp-data-fetch +``` + +### usage ### +Run `docker-compose up hatvp` to launch webserver. + +A documented graphiQL interface is available at [localhost:8002](http://localhost:8002) + +### **[Functional] Wikidata (Biographic data)** + +#### Fetch data ### + +You will need to fetch wikidata data if you deploy on a new environment. You can use `make` command to launch data fetching with : + +``` +make wikidata-data-fetch +``` + +### usage ### +Run `docker-compose up wikidata` to launch webserver. + +A documented graphiQL interface is available at [localhost:8003](http://localhost:8003) + + ### DB DB should be working. On removing the image and rebuilding, db will automatically fetch current data dump available. @@ -196,13 +244,3 @@ Failure: /usr/local/lib/node_modules/bs-platform/lib/ninja.exe ##### Notes ##### - -### assemblee - -`assemblee` service should run fine. - -You will need to fetch Parlament data if you deploy on a new environment. You can use `make` command to launch data fetching with - -`make an-data-fetcher` . It will run `docker-compose run assemblee cargo run -p tricoteuses_api_assemblee_open_data_fetcher -- -c Config.toml`. - -Run `docker-compose up assemblee` to launch webserver.