-
Notifications
You must be signed in to change notification settings - Fork 41
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
RFC: Registry UI #450
Comments
I'm personally not a huge fan of pre-generating all pages, as then each change we do to the frontend will:
I would instead heavily suggest going with either
Slightly relevant blog post: https://blog.cloudflare.com/serverless-rendering-with-cloudflare-workers/ Though I personally believe a simple javascript frontend that fetches the markdown files and renders them is the most boring solution. Static generation also heavily limits our flexibility for the future, like wanting to add new dynamically fetched components, which I strongly dislike. |
To consider: Documentation is not 1 version per module/provider, it needs to be available for each module / provider version. So, it's much, much more than 10GB. |
@DicsyDel I downloaded all versions for the experiment. |
Ok for a web UI but it would be also useful a command line option for searching providers like
Matteo |
@matteoredaelli thank you for your input. Since the CLI search is a separate effort, please open a separate issue for it. |
Is it intended that the UI is an app that uses an API that the registry has or built into the registry and can not be separated from it? |
@flickerfly the current UI in development indexes the registry data in the registry repo and uploads it to a separate R2 bucket, which is consumed by a React frontend. Why do you ask? |
I'm interested in the registry as a tool to enable air-gapped and scripted installs/updates of infrastructure. In that case, I wouldn't need and would consider the UI to introduce potential additional vulnerabilities I'd like to not track. Keeping them as isolated capabilities would enhance my registry experience in these disconnected spaces. |
As indicated in the other thread, the OpenTofu registry is not suitable for that. Please look for one of the many self-hosted Terraform/OpenTofu registry implementations. |
UI code? |
@NoelJacob I'm sorry, I don't understand your question. |
I dont know what @NoelJacob thumb means exactly either, but I would vote for a golang with htmx style GUI system rather than react. a ton of golang devs are using it to escape the Web GUI has gotten way too complex problem, and we want control back. https://htmx.org/examples/ is your curious. Here is a golang todo that uses htmx: Here is a golang todo using a htmx also:
Things that I like:
No need for S3, etc you can run the Backend and Frontend in this repo. Your keeping state in 1 place. On the server. You can cache using Caddy. Basically it's very standard golang stack. You can sue bleve or zinc for search and indexing if you want. |
Hey @gedw99 thank you for your input. The registry UI is almost complete, we plan to release it in the next few weeks. Given that we have a generous sponsorship from Cloudflare, we are using the R2 buckets to host everything and GitHub Actions to generate static files. |
Ah makes sense then . no worries . S3 and statics is a decent start. I run golang as WASM on Cloudflare that does htmx too . It works well , using https://github.com/syumai/workers |
Closing this as https://search.opentofu.org is now available in beta. |
Abstract
The registry needs a user interface to display documentation to users and make it searchable. This RFC will detail the technical implementation of the registry UI for the purposes of making a decision.
Design considerations
During the preliminary discussions, we have outlined the following criteria:
Background research
To evaluate the size of the registry, I have downloaded about half of all providers present in the OpenTofu registry. The docs folders amounted to roughly 6 GB of data and 850k files. By extrapolation, this would mean that the registry UI would be roughly 10-15 GB in size and contain 1.5-2M files if hosted statically, assuming one markdown file corresponds to one HTML file. Packing all files related to a provider/version is not feasible because some providers (AWS, Azure, etc) contain hundreds of files and would negatively impact loading times.
Front-end technology
When it comes to front-end technology, we have three options:
Given the performance and search indexing requirements above, solution 1 seems to be the most appropriate, although solution 3 is definitely intriguing because it would require very little maintenance.
Front-end optimization
HTTP/2 promised that it would make front-end loading times faster with Server Push, but it has several problems and hasn't gained wide adoption. It has since been removed from browsers. The alternatives to server push require extra round trips.
It is worth noting that using external sources, such as linked CSS files may cause caching issues across such a vast number of HTML files and therefore, CSS files should either be inlined or strictly URL-versioned.
One of the alternatives that we should make use of is inlining critical resources, such as CSS files. Since the registry UI can be fairly minimalistic in its appearance, inlining resources is feasible. Incidentally, this technique also bypasses caching issues with linked resources.
Build process
In order to build the HTML files, we should create a Go library that does the following:
LICENSE
/LICENSE.txt
/LICENSE.md
files, as well as thedocs/
and/orwebsite/docs
folders.For development purposes, we may want to provide a separate binary that lets provider authors start this in their local development version.
Costs
Based on the R2 pricing, the initial upload and any full refresh will cost us 5-10 USD and the storage will cost us $0.015 per month.
The text was updated successfully, but these errors were encountered: