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

codeunderhood.com still online? #69

Closed
vsoch opened this issue Mar 3, 2022 · 10 comments
Closed

codeunderhood.com still online? #69

vsoch opened this issue Mar 3, 2022 · 10 comments

Comments

@vsoch
Copy link

vsoch commented Mar 3, 2022

Hi! I wanted to check out codeunderhood.com but it's just infinitely spinning (and I suspect will time out). Is this a temporary thing or is it permanently offline? If the latter, do you have a container build that would make it easy to preview locally, or someone using it that I could look at? Thanks!

@robinp
Copy link
Member

robinp commented Mar 3, 2022

Hi @vsoch! The backend is down since I don't have the bandwidth to keep it updated, but good point, should update the readme and add docker.

Are you interested with a specific backend in mind, or just generally curious? The main branch used to support Kythe serving tables (for accurate crossreferencing), but that is not an approach I'm actively pursuing. There's a branch which works on top of Zoekt search indices, and also has some more UI features.

I think the latter might make more sense to see, as it is a path more accessible to developers (Zoekt indices are really easy to set up). If that sounds right, will set up some Dockers sometime the week.

@vsoch
Copy link
Author

vsoch commented Mar 3, 2022

I’m not familiar with the backend, but I would support what is simplest and your intuition says is right! I’d be happy to test and give feedback if you want to add Docker in the coming weeks.

@robinp
Copy link
Member

robinp commented Mar 9, 2022

Hey @vsoch - please have a look at the README of https://github.com/TreeTide/underhood#getting-started-super-quickly.

After cloning, should be able to

$ cd docker
$ docker-compose -f docker-compose-demo.yml up

and then visit http://localhost:8080/ to (Ctrl+)click around in the demo index. Or use plain docker-compose.yml with your own index. See the README for nav usage using keys.

Ping if doesn't work.

@vsoch
Copy link
Author

vsoch commented Mar 9, 2022

Woot! Will try tonight and let you know how it goes!

@vsoch
Copy link
Author

vsoch commented Mar 9, 2022

Worked perfectly! So a question for you - what are the limits of scaling this? E.g., I see in the demo Dockerfile you are cloning each repo and then running the indexer. In practice I think that would work for a small number of repos, especially if you have to keep them around! How would it work for say, repos in the thousands, each with anywhere between 1 and 25 releases? Would the source code need to come from its own database, and then the index the same? I'm trying to figure out if it will work for a few use cases I have in mind. Thank you!

@robinp
Copy link
Member

robinp commented Mar 10, 2022

Hey @vsoch. The limiting factor would be the Zoekt backend, but I don't expect that problematic for that scale (and even later, it can be horizontally sharded). See https://github.com/sourcegraph/zoekt/blob/master/doc/faq.md#how-much-resources-does-zoekt-require (there seems a limit of 64 branches to index per repo).

Zoekt itself is fast to index, and the backend can pick up reindexed shards on the fly.

Note: the UI doesn't currently differentiate between results from different branches. That is supposedly a small fix, but would need to happen for the multi-branch usecase. Now the filetree displays both branches, but results don't have the indication, also they load the wrong source (from a random branch).

Note 2: if the repos/branches change frequently, the UI doesn't automatically pick that up and refresh yet. See #61 .

Note 3: while this works fairly well, there are no tests either on the UI or the gateway, to set your expectations.

Edit: re "where source needs to come from", I'm not sure what you mean. Zoekt has small indexer tools to index a given directory, or git repo etc. There is maybe also a small server to keep pulling updates and reindex changing repos on the fly? The serving is pretty agnostic to how the Zoekt shards are constructed.

@vsoch
Copy link
Author

vsoch commented Mar 10, 2022

Thank you @robinp for providing the development environment and answering my questions! We definitely will consider trying out underhood when the time comes. Thank you again!

@vsoch vsoch closed this as completed Mar 10, 2022
@sergei-dyshel
Copy link

sergei-dyshel commented Dec 28, 2022

@robinp

The main branch used to support Kythe serving tables (for accurate crossreferencing), but that is not an approach I'm actively pursuing.

Looks like UnderHood is the only viable alternative to deprecated sample UI in Kythe. How much work is needed to support Kythe again?

@kamahen
Copy link

kamahen commented Dec 28, 2022

I wrote a simple UI for supporting Kythe facts (not using the serving tables, but instead reading the JSON facts and converting them to another form). It's only been used with the facts that I generated, and I haven't done any work on it for a while. If you want more details, I can supply them (it's a fairly simple Javascript front end that queries (using JSON) a backend written in Prolog (I used Prolog because it could compute the transitive relationships dynamically rather than requiring them to be computed ahead of time, the way the Kythe server did things).

I've used the Underhood browser, built with the sources from github. It took a few iterations to get working (mostly because I was unfamiliar with nx), but I think the necessary stuff was added to its documentation. If not, I can search my emails to find the information and put together some notes.

@robinp
Copy link
Member

robinp commented Dec 29, 2022

Hey - indeed, the readme should give pointers. Nix is a (mostly) deterministic package manager, so while it will likely seem to download half the internet, the result should be usable. It seems 192e550 is a commit before the Zoekt work started, could have a look there.

See https://github.com/TreeTide/underhood#getting-started-quickly about compiling the frontend and backend, also how to run on some kythe index. (Well, it worked somewhat with the Kythe version of the time - if the API didn't change much, could still work).

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

No branches or pull requests

4 participants