Open eivindga opened 11 months ago
First of all - great idea. I think this makes a lot of sense.
Some feedback:
How will this change https://adt.transhub.io/3.x/packages/ ? Will it continue to be supported, but with somewhat different paths? Or is the plan to phase out the existing service? If so, when?
The mechanism where Sporveien (and others) can download only what they need for their particular vehicle/screen type is great. It will save bandwidth, storage space - and with a large number of vehicles: Ultimately money.
"Rclone" was probably selected because "Rclone" can be used to access (for example) S3 and other file storage services. This means Ruter will only need to provide credentials to PTOs - no servers or other infrastructure.
At the same time: This requires every PTO to to install a new software component ("rclone") where they want to retrieve the files. For servers, that's probably easy. For old embedded operating systems - less so. Could Ruter please consider using Rsync over SSH an an alternative?
Feeback to other items:
No need for specialized software by each operator.
The safety regime for SL18 will always mean that updates are downloaded to a backend server. Then they are tested on simulator. Then they are deployed to vehicles in traffic. It will never be 100% automatic. That's just the safety and approval regime used - it's the "law". So the SL18 backend team will need change the current functionality used to download media/dpi and make new packages available in the SL18 "content distribution" system.
Allow each operator to synchronize only the files needed for their vehicle setup
Great!
Improve stability of synchronization from todays mixed environments
Likely. We don't really see this.
Low data transfers during sync may allow operators to sync directly from each vehicle
Safety regime. Won't be allowed. That said - it'd likely be even lower if using "rsync" instead of "rclone". :)
makes it possible to display dpi-app directly from the internet with all the associated media files, if desirable.
Might make a lot of sense for some PTOs.
I am not sure what you mean by not needing a local webserver. Are you intending to run the browser from file://? That would seem strange to me as you would have to download to all TFTs instead of one local source. Or is the intention to run the web application and sources over the mobile network? I don't think that is a good solution in general, caching on a local web server in the vehicle is better in my opinion.
How would you know which folders to bring locally as it depends on how you configured the TFTs?
We use rsync for this today instead of rclone, else that is basically what we do.
Using a zip files however makes sure you don't get file name encoding issues across platform so keep that in mind.
I second the use of rsync instead of rclone. Less dependencies, easier to use on various targets and stable.
As mentioned above we would also always sync to our backend server and then push to the vehicles, so it doesn't really make things easier, mostly work for the sake of changing.
For us, just lettings us now which files are unnecessary to sync would be use, like the structures, but since it creates a dependency on configuration the sign in the vehicle, you would likely end up syncing all not to have to maintain a match.
We have thought about lazy loading to the vehicle instead, based on the first request from the DPI application.
@audunf
How will this change https://adt.transhub.io/3.x/packages/ ? Will it continue to be supported, but with somewhat different paths? Or is the plan to phase out the existing service? If so, when?
The intention is to develop the new synchronization service in cooperation with the operators and allow our users to opt-in in to the new solution in the beginning. Meaning both solutions will be working for a period of time. The existing service will most likely be a downstream result from the new service, so that we ensure the resulting files are the same everywhere.
How long we will keep the existing service around really depends on the usage from the operators. I doubt that we can turn off the existing solution until all operators either agree to do so or have signed on to ADT 4 or 5 (I'm guessing 2025/26?).
"Rclone" was probably selected because "Rclone" can be used to access (for example) S3 and other file storage services. This means Ruter will only need to provide credentials to PTOs - no servers or other infrastructure.
One of the reasons we find Rclone attractive is that we might avoid having to deal with credentials all together. Our suggestion is to put up a public web-server which operators may synchronize against. Ref: https://rclone.org/http/
My opinionated view is that rsync is a more "standard" way to transfer files
This is 100% correct. Rsync is great and should be your go-to-tool for most data transfer operations between trusted parties. We do think however that running a public accessible rsync daemon server might pose a risk. And running a private rsync server requires us to spend time managing keys. (it is also non-trivial for us to setup a rsync daemon server in our kubernetes environment, while setting up a web-server is something we do all the time)
That being said, we have not concluded that Rsync is out of the picture, just that it requires more work and maintenance from our side.
@NiclasLindgren
I am not sure what you mean by not needing a local webserver. ... Or is the intention to run the web application and sources over the mobile network?
yes, this is the correct interpretation. This is not going to be the recommended setup for our existing fleet of vehicles any time soon.
But we keep the door open for more "light-weight" dpi installations in case there is a demand for it in the future. E.g. displays managed by other commercial entities like Clear Channel or simpler vehicle setups like in mini-vans and such.
How would you know which folders to bring locally as it depends on how you configured the TFTs?
Is this something you wished you had more information about? As an api? You probably will get this information from the future operator portal, but we could consider other options for sharing this information also.
We have a list of vehicleId's and what displays / configs they are supposed to be setup to use, so we could consider using this information in some way.
@eivindga I forget that the content is public information. :)
Right. So rclone
itself won't be mandatory - just one of several possible ways to synchronize the data.
Key takeaways:
app
and for the different screen sizes/configurations. Each PTO pulls what they needOn reading this again I see that you state that the transport protocol is HTTP, and that rclone
is a suggestion. Could be an idea to emphasize HTTP even more, and just mention rclone
as one of several options to sync the content towards the end of the text? On first reading, rclone
appeared mandatory due to the emphasis. Very specific, somewhat fringe mandatory tools are a red flag. HTTP is the opposite. :)
@audunf
There will be a public HTTP(S) endpoint serving the files
Yes
Each PTO should poll this X times per day (realistically: Once per day)
I think our ambition is having this more frequent than once a day. That way we are able to create content and have it available on vehicles within minutes, not days.
There will be directories for app and for the different screen sizes/configurations. Each PTO pulls what they need
Yes, exactly
Files must be unpacked to the on-board/local web server in the same directory structure they are found (mention that?)
Yes, I will try to clarify that in the original description.
Regarding Rclone being mandatory and fringe tool, I would argue it is pretty widely used and especially well suited for this task. 42k stars on Github and supporting a plethora of ways the operators can synchronize files.
Examples:
By configuring multiple remote endpoints using the technology of your choice, you may synchronize files between the remotes with a single command from your backend:
Rclone config:
[ruter-dpi-app]
type = http
url = http://example-host.transhub.io/ruter/
[SL18-tram01]
type = sftp
host = 172.102.0.123
user = sporveien
key_file = /home/bruxy/.ssh/id_rsa
Sync files between the two remotes:
rclone sync --create-empty-src-dirs ruter-dpi-app:app SL18-tram01:www/app
I think our ambition is having this more frequent than once a day. That way we are able to create content and have it available on vehicles within minutes, not days.
Understandable ambition, and this could absolutely be more agile. Current process is:
If there is a wish to speed up/remove the test, paperwork, and approval parts then you'll need to talk to "Sporveien Trikken" - likely the Tech. Reponsible and the Safety & Security group. There will need to be arguments about how Ruter "owns" this part of the experience, and not Sporveien. Might be they don't see it quite that way. :-) For vehicles that are in operation (out driving) this might be a particularly hard sell. They'll ask what is gained by taking what will be perceived as a substantial increase in risk.
Might be that it could be approved as a "standard change".
Background
The current solution for file sync to the vehicles is not optimal and requires the operators to build their own software solution for syncing. This leads to the operators having different routines for synchronizing files and different type of errors may occur.
See current spec here: https://adt.transhub.io/3.x/packages/
Some operators also question the need to synchronize all media content, as it might not be applicable for the transportation mode they are providing. Eg. safety videos for boats are now synced to buses
Ruter also have a business requirement to make the synchronization solution more flexible, to allow for campaign creations on same day.
Suggestion
Provide an easier and more standardized way of synchronizing media files using a HTTP webserver and Rclone directly to each vehicle (or back office).
The backend providing the files will be a standard http server, which may also serve as a simple hosting solution for vehicle setups without local webservers.
The media files are to be stored in folder based on the names of the screen configs, in addition to some shared folders which are to be synchronized to all vehicles.
Benefits
Example
rclone.conf
Syncing of the DPI-app to www/app-folder (on-board vehicle)
Syncing of shared media / resources, and media intended for screen config 1:
These should be setup to run as cron-expressions every X minutes.
File structure on Ruters HTTP server: