Summary: This commit changes MononokeBackingStore to use new APIs provided by Mononoke API Server.
Reviewed By: chadaustin
Differential Revision: D8882789
fbshipit-source-id: 0f06ca5f850af9fb52f1d593b9abd715a541488a
Summary: This commit adds support for changeset information retriving at `/<repo>/changeset/<commit hash>`.
Reviewed By: StanislavGlebik
Differential Revision: D8880547
fbshipit-source-id: ed68c577316693e0c685c347405b5d344d1bc87e
Summary: This commit adds support for `/<repo>/tree/<treehash>` (retrieving tree content by hash) .
Reviewed By: StanislavGlebik
Differential Revision: D8870870
fbshipit-source-id: 8b3271c819e47d112a8b44097f626360a05540d1
Summary: This commit implements the `<repo>/blob/<blobhash>` API that Eden needs.
Reviewed By: StanislavGlebik
Differential Revision: D8870300
fbshipit-source-id: eca9dc434c8fb584dfba1542c5242fbee18e6619
Summary: This commit adds support to ls operation that lists files in a folder at some commit.
Reviewed By: StanislavGlebik
Differential Revision: D8729389
fbshipit-source-id: cad6d02da075e94b5269cc18052a5a3916ddac86
Summary:
Back out "[mononoke] Switch to cachelib for blob caching"
Original commit changeset: 2549d85dfcba
Back out "[mononoke] Remove unused asyncmemo imports"
Original commit changeset: e34f8c34a3f6
Back out "mononoke: fix blobimport"
Original commit changeset: b540201b93f1
Reviewed By: StanislavGlebik
Differential Revision: D8989404
fbshipit-source-id: e4e7c629cb4dcf196aa56eb07a53a45f6008eb4e
Summary:
Added support for queries which use bookmark names in place of node hashes. This involved:
* Creating a method `string_to_bookmark_changeset_id`, which takes a string, treats it as a bookmark, and tries to find the corresponding changeset id in the repo.
* Modifying the `is_ancestor call` in `MononokeRepoActor` to try to interpret the query strings as bookmarks if they can't be interpretted as node hashes.
* Introducing the `cloned` crate from `//common/rust` into the API server to make the above methods cleaner.
* Modifying the integration test to add a bookmark to the test repo and attempt querying using the bookmark name.
Reviewed By: fanzeyi
Differential Revision: D8976793
fbshipit-source-id: 3a2b58cac0fb80ee18fad8529bd58af5b54f85ef
Summary: Update actix and actix-web to the latest version
Reviewed By: sunshowers
Differential Revision: D8965698
fbshipit-source-id: 18324161c832ccce4d908799a703368cd615996c
Summary:
Moved two types of functionality to a shared 'helpers' file so that they can be used by other indexes:
* Getting the Generation number of a changeset. The BlobRepo method currently returns an Option<Generation> as the success type, so putting the combinator calls to get the underlying Generation or map to an Error as a separate method will help keep the code more readible, and allow this logic to be reused in other parts.
* Checking if a node exists in the repo. This wraps the changeset_exists method from BlobRepo and returns an error if it was false or an error itself, else success with a void item. This just helps with code readability, so it will be obvious if the result of a future is being used, or if its success is just a prereq for the rest of the operations.
* Convert a collection of HgChangesetId to a collection of (HgNodeHash, Generation). Again, will help with code readability in more complicated functions, since the combinators of this method are, in my opinion, cluttering up the other methods using this functionality and making them more difficult to follow.
Reviewed By: StanislavGlebik
Differential Revision: D8919874
fbshipit-source-id: fc6cdf6e3a1f0dfa73c74ec94f0abac4a7860794
Summary:
Adding support to the Mononoke API server for naive is_ancestor queries using a BFS.
The API server now supports queries as:
Request URL: "{repo}/is_ancestor/{proposed_ancestor}/{proposed_descendent}"
where the arguments in the URL are:
- repo: the name of the repo to query reachability in
- proposed_ancestor: a 20 byte hex encoded string representing a node hash
- proposed_descendent: a 20 byte hex encoded string representing a node hash
Response: One of:
- the string, "true", if 'proposed_ancestor' is an ancestor of 'proposed_descendent' in 'repo'.
- the string, "false", if the above condition isn't satisfied.
- an error if the query couldn't be performed
This involved adding:
- new enum values for the MononokeRepoQuery and MononokeRepoResponse structs for 'IsAncestor' queries and responses.
- a dependency on the 'mononoke/reachabilityindex' crate.
- a 'is_ancestor' function to the MononokeRepoActor struct, which delegates queries to a GenerationNumberBFS index.
- appropriate url handling to the server object in main
- New enums to the API server ErrorKind, and appropriate down casting from the ReachabilityIndex ErrorKind.
- Integration tests which made the test repo in test-apiserver.t have a few branches, and queries the API server for reachability of pairs of commits.
Reviewed By: fanzeyi
Differential Revision: D8844221
fbshipit-source-id: 1ba102fede378688243827850ff67aabc587a748
Summary:
cachelib can shrink caches to avoid running into OOM, while still
giving as close to full-sized cache performance as possible. Make it possible
for Rust users of cachelib to request cache shrinking on low memory, while
choosing a strategy that suits them.
Reviewed By: Imxset21
Differential Revision: D8895814
fbshipit-source-id: ca4eb5b002c9ed922e7f7f56de002313a0d2303b
Summary:
Start deprecating AsyncMemo for caching purposes, by removing its use
as a blobstore cache.
Reviewed By: StanislavGlebik
Differential Revision: D8840496
fbshipit-source-id: 2549d85dfcba6647e9b0824ab55ab76165a17564
Summary: It really bugs me to have a file with many different things. It is time to split these into individual files. Hope this is not an overdesign.
Reviewed By: kulshrax
Differential Revision: D8862772
fbshipit-source-id: 91f211764e0ffe8a9fb127c3d2f7c9890e1ce0f4
Summary: This commit cleans up the code in the API Server, and move the logic of mononoke related operation to the `api` crate.
Reviewed By: kulshrax
Differential Revision: D8849200
fbshipit-source-id: 5a53c8db1f76661efebce8ebb79a327350059837
Summary: This commit renames `/blob/` to `/raw/`. This helps users to distinguish the proposed "get file content by hash" API from the original "get file content by path".
Reviewed By: kulshrax
Differential Revision: D8869635
fbshipit-source-id: 79d9cdaeb7e4e55b3d804d4530fb17835104cc32
Summary:
This commit added three options to specify locations to SSL certificates so the API server will accept encrypted traffic.
Currently this only works in HTTP/1.1 due to a bug in HTTP/2 parsing in actix-web. Once they fixed the bug upstream we will be able to serve HTTP/2 traffic as well.
Reviewed By: jsgf
Differential Revision: D8703861
fbshipit-source-id: 0d4e68276013a8aeb6ee006e5175b8caeba767cb
Summary:
This commit:
* add `--with-scuba` to apiserver.tw so we collect scuba metrics in tw deployed jobs.
* disable scuba for `/status` as it adds too much noise in apiserver's scuba table.
Reviewed By: kulshrax
Differential Revision: D8848271
fbshipit-source-id: 2f9638bd7ccb44f8ae02172097ccc38b3818b0e4
Summary:
This is a series of patches which adds Cargo.toml files to all the crates and tries to build them. There is individual patch for each crate which tells whether that crate build successfully right now using cargo or not, and if not, reason behind that.
Following are the reasons why the crates don't build:
* failure_ext and netstring crates which are internal
* error related to tokio_io, there might be an patched version of tokio_io internally
* actix-web depends on httparse which uses nightly features
All the build is done using rustc version `rustc 1.27.0-dev`.
Pull Request resolved: https://github.com/facebookexperimental/mononoke/pull/7
Differential Revision: D8778746
Pulled By: jsgf
fbshipit-source-id: 927a7a20b1d5c9643869b26c0eab09e90048443e
Summary: This commit bridges messages logged via `log` crate to be forwarded to `slog` using `slog-stdlog` crate. This allows us to see debug messages printed from third party crates that are using `log` instead of `slog`.
Reviewed By: StanislavGlebik
Differential Revision: D8703996
fbshipit-source-id: f847b76a52c262eded4f576a5d9065574ff7e4dd
Summary: This commit adds a scuba middleware for actix. It will automatically collects metrics from the request and the response.
Reviewed By: StanislavGlebik
Differential Revision: D8706387
fbshipit-source-id: 4dddad0d977d42718ce53e1e4fd7b771a1eda7df
Summary: This commit splits middleware.rs into mod middleware, and move logic of computing responsive to a separate trait so it can be shared.
Reviewed By: StanislavGlebik
Differential Revision: D8715657
fbshipit-source-id: cf06249d41b9fbe1a4a7500ed5e8024bbf376d3f
Summary:
We've recently added a flag in a config repo to enable or disable the repo.
Let's use it in apiserver as well.
P. S.
As I think about it now, it maybe worth filtering enabled/disabled flag in
RepoConfig
Reviewed By: lukaspiatkowski
Differential Revision: D8732450
fbshipit-source-id: 1cd59f5a91dec28efd1e2c122f2f1ea58ded6ac1
Summary:
There are so many individual arguments here that it's honestly hard to keep
track.
It is unfortunate that a bunch of string copies have to be done, but not really
a big deal.
Reviewed By: jsgf
Differential Revision: D8675237
fbshipit-source-id: 6a333d01579532a0a88c3e26b2db86b46cf45955
Summary: This commit changes the API from directly asking for NodeHash to changeset id and path of the file.
Reviewed By: StanislavGlebik
Differential Revision: D8628826
fbshipit-source-id: 1fa37cf36db0ca00530f3a60de78da1d1d232398
Summary: This commit implements a `Responder` for `MononokeRepoResponse` so it can be used as the return type of an actix-web handler. So the only need to be done to write a handler that accepts a `MononokeRepoQuery` is to assembly the struct.
Reviewed By: StanislavGlebik
Differential Revision: D8630086
fbshipit-source-id: 782252072f5fbb692f3ce0387370c8aaa48f4396
Summary: This commit adds /status to return ok for Tupperware health check.
Reviewed By: kulshrax
Differential Revision: D8629282
fbshipit-source-id: 8f36bf73d4d9399721c68649e6b475362770889b
Summary: This commit implements the retrieving logic for the api server.
Reviewed By: StanislavGlebik
Differential Revision: D8507784
fbshipit-source-id: 109b7fad35c5fefca593d04ac63d57534f9bd12b
Summary: It's no longer test, we use it in prod
Reviewed By: farnz
Differential Revision: D8611639
fbshipit-source-id: dc52e0bcdc26c704c0d9cf820d7aa5deae3e06e4
Summary: This commit lets apiserver reads Mononoke's config repository and creates MononokeRepo based on it.
Reviewed By: kulshrax
Differential Revision: D8465574
fbshipit-source-id: 0af1ad5f62499f83261e21bac605725156fc22d0
Summary: This revision adds an initial binary target for Mononoke API Server as well as a few basic options and logging.
Reviewed By: kulshrax
Differential Revision: D8413745
fbshipit-source-id: 65523433284e970348efcafd724ae28102d85671