ae8f56a799
Summary: Like it says in the title, this updates our HTTP stack to Hyper. There are a few reasons to do this here: - We can remove all the manual parsing & generation of HTTP, and instead let Hyper (i.e. a HTTP framework) handle HTTP for us. - We can use / reuse more pre-existing abstractions for things where we have to implement HTTP handling (rather than just try to update to a websocket ASAP), like the net speed test. - And finally, my main motivation for this is that this will make it much easier to load EdenAPI into Mononoke Server as a service. At this point, we have a `Request` to pass into a function that returns a `Response`, which is exactly what EdenAPI is, so hooking it in will be trivial. There's a lot going on in this diff, so here is an overview. Overall, our connection handling process is: - Accept connection - Perform TLS handshake - Check if the remote is trusted - Check ALPN: - If hgcli, then read the preamble then run wireproto over the socket. - If http, hand off the socket to Hyper. Hyper will call into our MononokeHttpService (which is a Hyper Service) once per request. - If websocket upgrade, accept the upgrade, then run wireproto over the resulting I/O (i.e. the upgraded connection). An upgrade takes over the connection, so implicitly this means there won't be further requests. - If health check or net speed test, handle it. There might be multiple requests here via connection reuse. - This is where hooking EdenAPI will happen. We can instantiate Gotham here: it also is a Hyper Service, so we just need to call it. While in there, I've modelled those various states using structs instead of passing a handful of arguments here or there. Reviewed By: johansglock Differential Revision: D26018641 fbshipit-source-id: dd757d72fe0f17f7c98c1948a6aa34d0c4d95cbf |
||
---|---|---|
.github/workflows | ||
build | ||
CMake | ||
common | ||
configerator/structs/scm/mononoke | ||
eden | ||
.gitignore | ||
.projectid | ||
.travis.yml | ||
build.bat | ||
build.sh | ||
CMakeLists.txt | ||
CODE_OF_CONDUCT.md | ||
CONTRIBUTING.md | ||
LICENSE | ||
make-client.py | ||
README.md | ||
requirements_ubuntu.txt | ||
rustfmt.toml |
EdenSCM
EdenSCM is a cross-platform, highly scalable source control management system.
It aims to provide both user-friendly and powerful interfaces for users, as well as extreme scalability to deal with repositories containing many millions of files and many millions of commits.
EdenSCM is comprised of three main components:
- The
eden
CLI: The client-side command line interface for users to interact with EdenSCM. - Mononoke: The server-side part of EdenSCM.
- EdenFS: A virtual filesystem for efficiently checking out large repositories.
EdenSCM's scalability goals are to ensure that all source control operations scale with the number of files in use by a developer, and not with the size of the repository itself. This enables fast, performant developer experiences even in massive repositories with many long files and very long commit histories.
The eden
CLI
The eden
CLI was originally based on
Mercurial, and shares many aspects of the UI
and features of Mercurial.
The CLI code can be found in the eden/scm
subdirectory.
Building the eden
CLI
The eden
CLI currently builds and runs on Linux, Mac, and Windows. The
setup.py
script is the main interface for building the CLI.
Mononoke
Mononoke is the server-side component of EdenSCM.
Despite having originally evolved from Mercurial, EdenSCM is not a distributed source control system. In order to support massive repositories, not all repository data is downloaded to the client system when checking out a repository. Clients ideally only download the minimal amount of data necessary, and then fetch additional data from the server as it is needed.
Building Mononoke
The Mononoke code lives under eden/mononoke
Mononoke currently builds and runs only on Linux, and is not yet buildable
outside of Facebook's internal environment. Work is still in progress to
support building Mononoke with Rust's cargo
build system.
EdenFS
EdenFS is a virtual file system for managing EdenSCM checkouts.
EdenFS speeds up operations in large repositories by only populating working
directory files on demand, as they are accessed. This makes operations like
checkout
much faster, in exchange for a small performance hit when first
accessing new files. This is quite beneficial in large repositories where
developers often only work with a small subset of the repository at a time.
EdenFS has similar performance advantages to using sparse checkouts, but a much better user experience. Unlike with sparse checkouts, EdenFS does not require manually curating the list of files to check out, and users can transparently access any file without needing to update the profile.
EdenFS also keeps track of which files have been modified, allowing very
efficient status
queries that do not need to scan the working directory.
The filesystem monitoring tool Watchman
also integrates with EdenFS, allowing it to more efficiently track updates to
the filesystem.
More detailed EdenFS design documentation can be found at eden/fs/docs/Overview.md.
Building EdenFS
EdenFS currently builds on Linux, Mac, and Windows.
The recommended way to build EdenFS is using the build.sh
script in the
top-level of the repository. This script will download and build all of the
necessary dependencies for EdenFS, before building EdenFS itself. On Windows
use the build.bat
script instead of build.sh
.
This build script will create an output directory outside of the repository
where it will perform the build. You can control this output directory
location by passing a --scratch-path
argument to the build script.
On Ubuntu, install the requirements in requirements_ubuntu.txt
. You will
also need m4 and Rust installed.
Support
EdenSCM is the primary source control system used at Facebook, and is used for Facebook's main monorepo code base.
Support for using EdenSCM outside of Facebook is still highly experimental. While we would be interested to hear feedback if you run into issues, supporting external users is not currently a high priority for the development team, so we unfortunately cannot guarantee prompt support at this time.
License
See LICENSE.