Skip to content

Commit

Permalink
reporting detailed status of services
Browse files Browse the repository at this point in the history
  • Loading branch information
Asone committed Aug 1, 2018
1 parent 56d6f93 commit a311fec
Show file tree
Hide file tree
Showing 2 changed files with 186 additions and 10 deletions.
195 changes: 185 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,203 @@ Tricoteuses is an application of [parlement ouvert](https://framagit.org/parleme

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
- [ ] [Tricoteuses-api](https://framagit.org/parlement-ouvert/tricoteuses-api) : A graphQl API for requesting database
- [ ] [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.

## Current services states

### DB

DB should be working. On removing the image and rebuilding, db will automatically fetch current data dump available.
DB should be working. On removing the image and rebuilding, db will automatically fetch current data dump available.

### daemon
### Daemon

Service container seems to run and no exception seems to be thrown at executing python scripts.
Daemon instance seems to be working. However data processing is stuck. Below are the different states of scripts :

We will have to configure the service in order to automatically process the scripts adequately.
#### aspireameli.py

### api
To execute, run in docker bash instance :
> `python3 aspireameli.py dbname="ameli"\ port="5432"\ host="db"\ user="opendata"\ password="ameli"`
Todo

### ui
#### aspireliasse.py

To run :

>`python3 aspireliasse.py data --verbose`
After init, script seems to be stuck in an infinite loop for retrieval of the same document :

````
INFO:aspireliasse:get_amendements(bibard=659, bibard_suffixe=, organe=CION_DEF, full=False)
INFO:aspireliasse:get_prochain_a_discuter(organe=CION-CEDU)
INFO:aspireliasse:get_prochain_a_discuter(organe=AN)
INFO:aspireliasse:get_prochain_a_discuter(organe=CION_TOUTE)
INFO:aspireliasse:get_prochain_a_discuter(organe=CION_LOIS)
INFO:aspireliasse:get_prochain_a_discuter(organe=CSCONF)
INFO:aspireliasse:get_prochain_a_discuter(organe=CION_FIN)
INFO:aspireliasse:get_prochain_a_discuter(organe=CION-DVP)
INFO:aspireliasse:get_prochain_a_discuter(organe=CION-SOC)
INFO:aspireliasse:get_prochain_a_discuter(organe=CION_AFETR)
INFO:aspireliasse:get_prochain_a_discuter(organe=CION-ECO)
^CINFO:aspireliasse:get_prochain_a_discuter(organe=CION_DEF)
INFO:aspireliasse:get_prochain_a_discuter(organe=CION-CEDU)
````

#### aspirenosparlementaires.py

To run :

>`python3 aspirenosparlementaires.py deputes/ --verbose`
Seems to be running but stays silent.

### API

Server itself starts, however some processing causing exceptions due to some hardcoded broken references for files.


### UI

Install & build works. Instance fails at starting, inside as outside docker, react-scripts instance won't launch.

Below are the data collected about both tests :


#### Within docker ####

##### Configuration #####

OS : linux alpine
node : v10.4.0
npm : 6.1.0
bsb : 4.0.2

##### Stacktrace output #####

```
bash-4.4# npm run build
> [email protected] build /tricoteuses-ui
> react-scripts build
Creating an optimized production build...
Failed to compile.
./src/index.re
/bin/sh: script: not found
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2018-08-01T21_08_51_032Z-debug.log
bash-4.4#
```

Using : `bsb build`, we get the following message, which is pretty much the one we get without docker :

```
bash-4.4# bsb -make-world
[12/12] Building src/Json.mlast.d
[1/6] Building src/Json_encode.cmi
We've found a bug for you!
/tricoteuses-ui/node_modules/@glennsl/bs-json/src/Json_encode.mli 18:20-29
16 │ (** [int n] makes a JSON number of the [int] [n] *)
17 │
18 │ external boolean : Js.boolean -> Js.Json.t = "%identity"
19 │ (** [boolean b] makes a JSON boolean of the [Js.boolean] [b] *)
20 │
This type constructor's parameter, `Js.boolean`, can't be found. Is it a typo?
[2/6] Building src/Json_decode.cmi
We've found a bug for you!
/tricoteuses-ui/node_modules/@glennsl/bs-json/src/Json_decode.mli 18:15-24
16 │ exception DecodeError of string
17 │
18 │ val boolean : Js.boolean decoder
19 │ (** Decodes a JSON value into a [Js.boolean]
20 │
This type constructor's parameter, `Js.boolean`, can't be found. Is it a typo?
Failure: /usr/local/lib/node_modules/bs-platform/lib/ninja.exe
Location: /tricoteuses-ui/node_modules/@glennsl/bs-json/lib/bs
```

##### Notes #####

`react-scripts` has been tried either globaly as localy. Stacktrace remains.




#### Without docker docker ####

##### Configuration #####

```
- OS : mac OS 10.13.6
- node : 8.11.2
- npm : 5.6.0
- brew : 1.7.1
- bsb : 4.0.2
```

##### Stacktrace output #####

```
[1/6] Building src/Json_encode.cmi
We've found a bug for you!
/Users/herbin/www/tricoteuses-ui/node_modules/@glennsl/bs-json/src/Json_encode.mli 18:20-29
16 │ (** [int n] makes a JSON number of the [int] [n] *)
17 │
18 │ external boolean : Js.boolean -> Js.Json.t = "%identity"
19 │ (** [boolean b] makes a JSON boolean of the [Js.boolean] [b] *)
20 │
This type constructor's parameter, `Js.boolean`, can't be found. Is it a typo?
[2/6] Building src/Json_decode.cmi
We've found a bug for you!
/Users/herbin/www/tricoteuses-ui/node_modules/@glennsl/bs-json/src/Json_decode.mli 18:15-24
16 │ exception DecodeError of string
17 │
18 │ val boolean : Js.boolean decoder
19 │ (** Decodes a JSON value into a [Js.boolean]
20 │
This type constructor's parameter, `Js.boolean`, can't be found. Is it a typo?
Failure: /usr/local/lib/node_modules/bs-platform/lib/ninja.exe
Location: /Users/herbin/www/tricoteuses-ui/node_modules/@glennsl/bs-json/lib/bs
```


##### Notes #####




### an-api

Install & build works. Instance not tested.

1 change: 1 addition & 0 deletions _provisioning/ui/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ RUN git clone https://framagit.org/parlement-ouvert/tricoteuses-ui.git

WORKDIR tricoteuses-ui

RUN npm i -g react-scripts
RUN npm install
RUN npm run prepare

Expand Down

0 comments on commit a311fec

Please sign in to comment.