Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding back feature from OTP 1: ability to override FE UI files #3508

Closed
wants to merge 2 commits into from

Conversation

jeffmaki
Copy link
Contributor

@jeffmaki jeffmaki commented Jun 1, 2021

Adding back a feature that seems to have been removed from OTP 2 but was in OTP 1 (I think? Or our branch at least?): the ability to override the FE UI files to a custom set of files using CLI parameters.

@jeffmaki jeffmaki requested a review from a team as a code owner June 1, 2021 14:50
@jeffmaki jeffmaki mentioned this pull request Jun 1, 2021
@t2gran t2gran added this to the 2.1 milestone Jun 1, 2021
description = "Path to serve local client files at.")
public String clientPath = null;

@Parameter(names = {"--disableNativeClient"},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you be open renaming it to "debug client", which is the name we use in the dev team?

Native client to me means something like C++ or iOS.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I'm ambivalent on the naming. I'll change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change complete

Copy link
Member

@abyrd abyrd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @jeffmaki! Several of us looked at this at today's meeting. There was some hesitation about whether serving static files from the filesystem should be part of OTP or external to it, since most of us are now building front ends in such a way that they can "serve themselves" via node etc. and in other cases are just running minimal servers in front of both the front end and OTP server along the lines of https://github.com/conveyal/combine-serve .

It would help the reviewers to know what the intended use case is, and what the benefits are to having it directly integrated into OTP. We were thinking it might have something to do with CORS - if so, note that if you send OTP an Origin header, OTP's CorsFilter class will cause it to echo back an Access-Control-Allow-Origin header with the same value. Of course it's debatable whether we should be circumventing CORS in this way, but this is existing behavior we have retained for the time being since OTP is not processing any sensitive personal data.

Personally I'm not against the addition of a static UI files server as a convenient development workaround, as the implementation is simple and makes use of functionality built into Grizzly.

In discussion there was definitely support for the switch disabling the debug client, as that's often not used at all in production deployments. But @t2gran had some thoughts on how that should be enabled/disabled to be consistent with other feature toggles.

@jeffmaki
Copy link
Contributor Author

jeffmaki commented Jun 3, 2021

Hey man!

Yeah, I get those concerns, and don't disagree.

The use case was around providing a specific debug client UI that certain deployments need and/or serving files up to a CDN and using OTP to reduce the number of artifacts to track and deploy together/make sure the UI and the backend code are always matched.

I get the concern certainly, but OTP is already serving static files--this doesn't change that, it just allows one to disable it and/or change the set of files it serves? Put another way, it seems no worse than what you have today?

@abyrd
Copy link
Member

abyrd commented Jun 3, 2021

I get the concern certainly, but OTP is already serving static files--this doesn't change that, it just allows one to disable it and/or change the set of files it serves? Put another way, it seems no worse than what you have today?

I would tend to agree. If this is something you know will be useful for CamSys and others I'm not against adding it. It seems like a straightforward tool to have at your disposal, a slight variation on what it's already doing. I was just requesting some background info so reviewers could make informed comments.

@t2gran
Copy link
Member

t2gran commented Jun 4, 2021

To turn the debug client on/off I suggest using the OTPFeature enum. It is designed to turn OTP features on and off, and it should be the place to look for that. It is set when the config is loaded and all you have to do is to add the enum value OTPDebugClient and document it in the Configuration.md. The reasons way I do not want a CLI parameter are:

  • In a cloud based deployment we want the CLI to stay the same between environments, config is likely to change.
  • I want as few CLI parameters as possible, and "everything" to be in the config files. My experience is that people forget to check the CLI parameters for features - they read the configuration documentation. So, to minimize support I want as much as possible in one place.

I think the path to an alternative debug client belong in the router-config file. All other paths are in the config files and there is functionality to parse and validate those. I think it should load the static-content in addition the debug client, making it two separate "things" - I am not sure what you planed here.

@jeffmaki
Copy link
Contributor Author

jeffmaki commented Jun 4, 2021

Okay... I wish we would have had this conversation at the beginning before we all wasted our time with an approach you don't like, but since it sounds like you have a strong opinion on how this works, would you like to outline what you are looking for with this feature?

I just need a way to override the debug UI with my own version, that's all I'm looking to achieve.

Specifically this piece:

I think it should load the static-content in addition the debug client, making it two separate "things" - I am not sure what you planed here.

Truth is, I have no plans in that regard. What are you looking for here?

@abyrd
Copy link
Member

abyrd commented Jul 8, 2021

Hi @jeffmaki, I would like to try to unstick this PR which has apparently stalled. Here and on #3499 people have expressed interest in reviewing and trying to finalize changes but are having trouble proceeding (I will comment separately on #3499). I think the main problem is just a shared sense of process.

Comments like those from @t2gran are not intended to shoot things down, they are just part of our usual process of debating and defending design choices. At this point we get multiple PRs per week from several organizations, and for each one we discuss or debate what should be done and how. Most of these go very smoothly, but critically the contributors mostly participate in the twice-weekly development meetings. From what I've seen this kind of back and forth about what we want to achieve, its implications, and the best way to implement and configure it go much more quickly in the context of those meetings. Most development work is managed in those meetings now, and the approach doesn't necessarily carry over well to Github text comments.

Would you be able to attend Tuesday/Thursday meetings? If not would you be able to talk directly with whoever's reviewing your PRs (probably @gmellemstrand)?

I will try to clarify some of these OTP2 process details in the PR/issue templates so it's more obvious up front to contributors creating new PRs and issues.

@jeffmaki
Copy link
Contributor Author

jeffmaki commented Jul 8, 2021 via email

@abyrd
Copy link
Member

abyrd commented Jul 8, 2021

Hey Andrew, thanks, really appreciate your efforts here. I'm not going to die on the sword over this one, I think it's a stylistic thing personally.

What I mean is that I don't even see a clash of strong stylistic positions here, it's just that a process/expectation has emerged of people describing and building a consensus around their technical and stylistic choices, usually in weekly development meetings.

This is (on the practical side) due to the observed efficiency of getting things merged in those meetings, and (on the conceptual side) due to an increased long-term focus on maintainability, technical debt, consistency, documentation etc. since OTP2 work began in earnest.

But I agree a process would be good so that it's clear what the requirements are to accept/reject something so one person can't shoot down something.

I think everyone agrees this needs to be more clearly stated. From what I've seen though the main criterion is just the amount of time and effort coordinating with other parties. There's been a big push to make OTP2 multilateral, and many of the more frequent contributors have invested large amounts of effort in describing and collaborating on their choices. My sense is that on this point there are order of magnitude differences in the budget and timeline commitments from different organizations. What one organization will perceive as complete production code waiting to be merged, may be perceived by other parties as essentially a draft that still needs to be prepared for review.

I'm also not trying to create any animosity (I don't really think there is any), but just describe what I've seen and experienced: it seems to me that there is in fact a consistent set of expectations being applied. It's just that those expectations are centered around significant investments of time in collaboration, discussion, documentation, etc. which some organizations consider essential while others do not.

Since approval and integration of contributions is clearly subject to expectations of this kind, they do need to be more clearly and prominently documented.

@jeffmaki
Copy link
Contributor Author

jeffmaki commented Jul 8, 2021 via email

@t2gran
Copy link
Member

t2gran commented Jul 20, 2021

But I agree a process would be good so that it's clear what the
requirements are to accept/reject something so one person can't shoot down
something. For example, there seems to be a lot of Google Cloud stuff in
the codebase for interfacing with GC's APIs and data storage, while my
understanding is that some of our AWS code of a similar nature was rejected
in the past.

I am not trying to block anything, but make sure OTP2 is moving forward and can be usable by as many organizations as possible. The OTP1 development came to a halt in 2016. The reasons for this is of course many and debatable. But, at least a couple of things struck me:

  • Very few resources were available to do reviews.
  • Very few organizations did any maintenance or had any resources allocated for it.
  • The codebase was turing into a "big-ball-of-mud"

To get OTP back on track we wanted to remove non-core functionality which no one used. The Sandbox and OTP Feature concepts were introduced to allow for experimental and organization-specific code. Most importantly making the maintenance easier. To be able to maintain software like OTP the only tool I know is to modularize it, breaking the system into smaller prices that can be reasoned about by them self. There is a lot of work left to do here.

The file loading is refactored to support multiple data sources. GCP is just a plugin that is enabled using the OTP Features. Adding support for AWS would be easy and I actually got to the point of testing it - but we do not want dead code in the codebase, so until there is an organization taking ownership of the AWS plugin and using it in production the code remains outside. I am not aware of rejecting support for AWS.

So, to improve OTP2 and make sure the development does not stop again, we (mostly @abyrd and I):

  • Watch out for features which are not core (use sandbox).
  • Ask for valid use-cases for new functionality to make sure OTP is the right place to implement it.
  • Make sure the implementation is done in the right place, where the responsibility should be to avoid duplication and addition of new layers, refactor if necessary.
  • Make sure non-functional features are kept (performance and memory usage)

It is also important to understand that there are no paid resources doing review or maintenance, so we try to push work onto the submitter of the PR. This is unfortunate, but a consequence of the limited resources available.

I do not like being the "devil's advocate", but I belive OTP2 has great potential, and it would be a great loss if it turns into a "big-ball-of-mud".

I would very much like to have a meeting with CS and possibly other US organizations to talk about how we can improve the process and working together.

@t2gran t2gran modified the milestones: 2.1, 2.2 Feb 25, 2022
@t2gran t2gran modified the milestones: 2.2, 2.3 Nov 1, 2022
@t2gran t2gran removed this from the 2.3 milestone Apr 24, 2023
@t2gran
Copy link
Member

t2gran commented Sep 15, 2023

We discussed this in yesterdays developer meeting and decided to close it. There has not been any activity on this for a long time.

@t2gran t2gran closed this Sep 15, 2023
@t2gran t2gran added this to the Rejected milestone Sep 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants