noi-techpark / odh-mentor-otp

4 stars 8 forks source link

A5 Front-end application prototype development #8

Closed rcavaliere closed 3 years ago

rcavaliere commented 4 years ago

Issues to be fixed: @zabuTNT @stefanocudini can you please verify these open issues and also if in general the prototype is working as expected?

rcavaliere commented 3 years ago

The front-end app was chosen (OTP React Redux). Next step is to prepare the dockerization

ghost commented 3 years ago

hi @alexlanz

I built a working docker version of the new UI. For now I have included everything necessary in the directory: `otp-app``` here: https://github.com/openmove/odh-mentor-otp/tree/otp-react-redux/otp-app

It works in standalone with a integrated nginx in the service that exposes everything in a different port from the OTP REST Api.

I was studying your other projects and boilerplates, but it is not clear to me how I could integrate this code into the same project structure, for example this path contains only one Dockerfile: https://github.com/noi-techpark/odh-mentor-otp/tree/development/infrastructure/docker

maybe it should be included in this part, as a new docker service?

https://github.com/openmove/odh-mentor-otp/blob/master/infrastructure/docker-compose.run.run.yml

current OTP's default UI does not require a separate image / building, instead this new otp-react-redux requires a separate building and configuration file: https://github.com/openmove/odh-mentor-otp/blob/otp-react-redux/otp-app/config.yml this file should be used only in the building time to define the entrypoints of the OTP API here: https://github.com/openmove/odh-mentor-otp/blob/otp-react-redux/otp-app/config.yml#L2

ghost commented 3 years ago

P.S. this component has no server side parts. it's a completely static javascript application. the only serverside part is a nginx that I added to be able to use it autonomously

alexlanz commented 3 years ago

Hi @stemove,

it's not a problem to add a separate building job for the frontend. However, when there are only static files that should be hosted, then we normally put them on a S3 bucket. An example could be found here: https://github.com/noi-techpark/davinci-innovation-scoreboard-web

What are the explict requirements? Do you need any help or is the link/example already enough?

rcavaliere commented 3 years ago

Decision: separate docker for the front-end application

bertolla commented 3 years ago

@rcavaliere As I tried to setup the client I noticed that the source code is only in part in our repository.

git clone --single-branch --branch master https://github.com/openmove/otp-ui.git
git clone --single-branch --branch mentor-meran https://github.com/openmove/otp-react-redux.git

Those are forks of the main official repositories but I thought we would be the once hosting the changes made on it. Maybe there is also a logical reason why it was done like this, we could also fork it but it would mean not following our general rules.

zabuTNT commented 3 years ago

Hi @bertolla , this is temporary because I'm working on it. I'm not totally sure about otp-react-redux, because there are some limitations and "american system" hardcoded inside. Temporary we can us it as a "demo" and see what is interesting and what not for future development.

When we have clear ideas about it we will move the "real" code.

rcavaliere commented 3 years ago

@bertolla @zabuTNT I agree with @zabuTNT. Let's integrate this PR, so we can see the prototype client working. With further PR will will deepen out all such dependancies and understand together how to manage them

rcavaliere commented 3 years ago

Status:

Next steps are updated in the user story description

bertolla commented 3 years ago

I deployed the gbfs container and opened the API outwards. It's reachable at: https://gbfs.otp.opendatahub.testingmachine.eu/

An example call is: https://gbfs.otp.opendatahub.testingmachine.eu/bz/station_status.json

I run the graph calculation again and redeployed all containers. The new version is out but I can't really see the bike data anywhere. Did I miss something? Furthermore, with the new version the public transport geometries are not shown anymore.

bertolla commented 3 years ago

I kind of found out now by going through the code. The settings for gbfs need to be made when creating the graph, not when deploying journey, so I had to redo some things.

zabuTNT commented 3 years ago

Hi @bertolla, exact, gbfs url must be set up when you build the graph.

In order to check if you have real-time updaters for your otp instance you can query the API:

https://<you-otp-instance>/otp/routers/openmove/updaters

bertolla commented 3 years ago

@zabuTNT During build of the graph the GBFS_HOST was set to https://gbfs.otp.opendatahub.testingmachine.eu/ and the port to 443. These are the changes I made for our environment: https://github.com/noi-techpark/odh-mentor-otp/compare/development...pipelines

Did I miss out on something? Is everything described in the README to make it work correctly?

zabuTNT commented 3 years ago

Hi @bertolla, are you sure that you are running the correct graph built with the updaters? Because if I go here: https://otp.opendatahub.testingmachine.eu/otp/routers/openmove/

I read that the build date is 1605004118321, that is the 10/11/2020, 6 days ago. And https://otp.opendatahub.testingmachine.eu/otp/routers/openmove/updaters says that no updaters are set.

So I think that you are running the old graph. This is strange because with --autoReload flag otp should detect that that graph is changed (if you are running an updated instance of otp with --autoReload flag.) https://github.com/noi-techpark/odh-mentor-otp/blob/development/infrastructure/docker/otp/docker-entrypoint.sh#L120

Anyway in /data do you have a file named router-config.json ? This is generated when you build the graph.

bertolla commented 3 years ago

Yes, a file named router-config.json was generated in the data folder and it contains following lines:

{"updaters":[{"type":"bike-rental","frequencySec":900,"sourceType":"gbfs","url":"https://gbfs.otp.opendatahub.testingmachine.eu:443/bz/"},{"type":"bike-rental","frequencySec":900,"sourceType":"gbfs","url":"https://gbfs.otp.opendatahub.testingmachine.eu:443/me/"}]}

The last graph which I run was after I merged the pull-request. The autoReload command should be ok. Even if I restart the container manually, nothing changes. Should there be any new Files in the openmove folder? Right now there is just Graph.obj You still should have access on the server, so if you want to check for yourself your welcome. Furthermore you could start the docker image yourself and see what's happening. If you are able to find the problem, could you please add the missing information to the doc?

zabuTNT commented 3 years ago

@bertolla

Right now there is just Graph.obj

Correct. Because when you build the graph embedRouterConfig default is true. https://docs.opentripplanner.org/en/latest/Configuration/#graph-build-configuration So the graph contains already all the information written in router-config.json. If you want you can move router-config.json inside openmove side by side with the graph, but it's not our case.

If you are able to find the problem, could you please add the missing information to the doc?

Yes, I'm going to check the logs of otp startup.

bertolla commented 3 years ago

@rcavaliere Bikesharing data seems to be working now.

rcavaliere commented 3 years ago

@bertolla @zabuTNT, yes I see the data, but I am not sure that the journey planner is working as expected with the bike sharing data... @zabuTNT can you please have a look and give me a feedback?

zabuTNT commented 3 years ago

Hi @rcavaliere, what did you mean? It seems correct to me in Bozen. Maybe in Meran cause the free floating system? I'll check it and eventually I will fix this with the refactor for 2.1 version.

example

2020-11-25-131649_1699x956_scrot

rcavaliere commented 3 years ago

OK, I checked Merano and I didn't manage to find a use case in which the trip planner suggests a bike sharing trip....

zabuTNT commented 3 years ago

Hi @rcavaliere probabably it's because the end-start point and the positions of the bikestations, if you are near the bikestations and/or set Optimize by Speed in the preferences I get a result.

2020-11-26-090524_685x543_scrot

2020-11-26-090057_1806x934_scrot

rcavaliere commented 3 years ago

@zabuTNT I see, it's a configuration setting... thanks for the notice, useful to understand the logic behind!

rcavaliere commented 3 years ago

@bertolla I see that the end-point https://journey.opendatahub.testingmachine.eu/ is at present down... can you please check? In the last days we saw that the application was a little unstable, after a minute or so that you were navigating through the APP you could a kind of server error, with the need to refresh the page in order to restart the application. We need to fix these infrastructure issues before we can completely the implemented prototype

bertolla commented 3 years ago

Testenvironments are never stable 100% of the times. In this case another new app filled the storage and the server crashed. In any case we are back online. I already created an issue for problem you encountered: #20

rcavaliere commented 3 years ago

@bertolla thanks. Let's limit this story to aspects that have to be improved in terms of supported functionalities. I have put a list in the US description. It's only a partial list since testing the application with issue #20 in place is difficult. Maybe some of the issues are related to the same problem. @zabuTNT and @stemove can you please check this?

zabuTNT commented 3 years ago

the bike-sharing only option works well, but I am never able to find with the bikesharing + ride a combination PT + bikesharing, even changing configurations in the trip planner search.

Sorry for the late answer, but I think that this is because in the new GTFS the bikes_allowed column is empty in trips.txt:

route_id,service_id,trip_id,shape_id,trip_headsign,trip_short_name,direction_id,block_id,wheelchair_accessible,bikes_allowed
"0-108-20a-1","TA+108A","1.TA.0-108-20a-1.2.H","0-108-20a-1.2.H","Mezzocorona, Stazione di Mezzocorona","","0","","2",""
"0-108-20a-1","TA+108B","2.TA.0-108-20a-1.2.H","0-108-20a-1.2.H","Mezzocorona, Stazione di Mezzocorona","","0","","2",""
"0-108-20a-1","TA+108A","3.TA.0-108-20a-1.1.R","0-108-20a-1.1.R","Bolzano, IVECO","","1","","2",""
"0-108-20a-1","TA+108B","4.TA.0-108-20a-1.1.R","0-108-20a-1.1.R","Bolzano, IVECO","","1","","2",""
"0-114-20a-1","TA+w-6#22","1.TA.0-114-20a-1.2.H","0-114-20a-1.2.H","Laives Z.I., Capolinea","","0","","2",""
"0-114-20a-1","TA+w-6#22","3.TA.0-114-20a-1.2.H","0-114-20a-1.2.H","Laives Z.I., Capolinea","","0","","2",""
"0-114-20a-1","TA+w-1","4.TA.0-114-20a-1.1.R","0-114-20a-1.1.R","Prato Isarco, bv. Collep.","","1","","2",""
"0-114-20a-1","TA+w-6#22","6.TA.0-114-20a-1.1.R","0-114-20a-1.1.R","Prato Isarco, bv. Collep.","","1","","2",""
"0-120-20a-2","TA#125","1.TA.0-120-20a-2.2.H","0-120-20a-2.2.H","Bolzano, Autostazione","","0","","2",""
"0-120-20a-2","TA#125","10.TA.0-120-20a-2.9.H","0-120-20a-2.9.H","Bolzano, Autostazione","","0","","2",""
"0-120-20a-2","TA#125","11.TA.0-120-20a-2.9.H","0-120-20a-2.9.H","Bolzano, Autostazione","","0","","2",""
"0-120-20a-2","TA+s#68","13.TA.0-120-20a-2.3.H","0-120-20a-2.3.H","Bolzano, Autostazione","","0","","2",""
rcavaliere commented 3 years ago

@zabuTNT ok I understand, but what about PT + bikesharing? In this case the transport of bikes is not necessary...

zabuTNT commented 3 years ago

@rcavaliere maybe it's fixed with the last GBFS, but in this case OTP try to use the quickest trip, and obviously, if your origin and /or destination is near a bus stops, why you should use a bike? The bus will be always quicker. This depends of the positions of the stops and the frequencesies of the services.

Probably a solution in order to see a PT+bikesharing could be setting to avoid the buses, and use the train only (you can do this in the settings of the website), then start from a point distant to a station and near a bike station. So the planner should use the bike in the city to arrive to the station and here the user will take the train.

rcavaliere commented 3 years ago

@rcavaliere will make a final test when the new GTFS is available

rcavaliere commented 3 years ago

Updates: GTFS-RT end-point available: https://efa.sta.bz.it/gtfs-r/?FORMAT=json Next week they will generate the new GTFS export. We can then make a new build (including the reference to the new RT feed) and complete testing

Piiit commented 3 years ago

blocked, because we are missing the new GTFS data

zabuTNT commented 3 years ago

@rcavaliere I opened the GTFS-RT but it seems that there aren't Entities

{
  "Header": {
    "GtfsRealtimeVersion": "1.0",
    "Incrementality": "FullDataset",
    "Timestamp": 1611315779
  },
  "Entity": []
}

then, but very important, when you set the GTFS-RT for OTP, the URL you set have to return a protobuffer file, so this url:

https://efa.sta.bz.it/gtfs-r/

not this:

https://efa.sta.bz.it/gtfs-r/?FORMAT=json

rcavaliere commented 3 years ago

@zabuTNT sure! I wanted to share the JSON version so to let you give the possibility to check the data.

The end-point is empty since there is no matching with the planned data (the new GTFS export has still to be built)

By the way, can you please indicate us how we can configure the new GTFS-RT feed, maybe directly in issue https://github.com/noi-techpark/odh-mentor-otp/issues/15?

stefanocudini commented 3 years ago

@rcavaliere I try to send you soon as possible a new PR with the new variable to configure GTFS-RT

rcavaliere commented 3 years ago

Seems that most of the open issues are solved now. Very good!