Commit Graph

221 Commits

Author SHA1 Message Date
Jeremy Fitzhardinge
04276f43b4 mononoke: hgproto: capture unbundle stream as Bytes
Summary:
Parse the unbundle command as an `unbundle` command with its `heads`
parameter, followed by a bundle2 stream which is parsed in order to capture it
as bytes, as a simulation of an actual stream.

Reviewed By: sid0

Differential Revision: D6209818

fbshipit-source-id: 9bc454319350e2047160347964740f3a3d2f592f
2017-11-01 18:51:21 -07:00
Stanislau Hlebik
a231885209 mononoke: fix param parsing for unbundle
Summary:
Even though the parameter is called `heads`, it's not necessarily heads.
It can be:
1) hex-encoded word "force" - "666f726365"
2) Hex-encoded list of heads
3) hex encoded word "hashed" and a hash of heads' hashes.

Proof: https://www.mercurial-scm.org/repo/hg/file/tip/mercurial/wireproto.py#l362

Previously we just parsed list of hashes, and it wasn't correct. This diff fixes it

Reviewed By: jsgf

Differential Revision: D6110315

fbshipit-source-id: 57ca12d13e3b719803b20ae1718d5f4309b806f5
2017-10-26 07:20:12 -07:00
Chris Konstad
af43755975 Tokio cleanup in scm/mononoke/server
Summary: Fixed up references to deprecated APIs.

Reviewed By: sid0

Differential Revision: D5960130

fbshipit-source-id: 6575e2f323b0c95a835e3d765833eca68b867934
2017-10-05 13:06:26 -07:00
Lukas Piatkowski
338941c73d logview: slog-logview crate for writing data into scribe for logview
Summary: compatible with rust's logview categorizer

Reviewed By: farnz

Differential Revision: D5986970

fbshipit-source-id: 59233de2050fb0904be32c0fcbd47fe65f3f0a10
2017-10-05 10:38:06 -07:00
Lukas Piatkowski
525abfb7e0 server: integrate slog-glog-fmt into mononoke server
Reviewed By: farnz

Differential Revision: D5911317

fbshipit-source-id: 029587b09abbfd5d1739a56c750117dae4cfd80c
2017-10-04 14:06:00 -07:00
Lukas Piatkowski
3a4f1a58d6 server: add drain for counting logs per level and exporting as stats
Reviewed By: farnz

Differential Revision: D5942926

fbshipit-source-id: 6164171d0ce2edf8ec1db5f24b337421fe46e21f
2017-10-04 14:06:00 -07:00
Lukas Piatkowski
ee8cf02e54 server: refactor the main function for future diffs
Summary:
There are few changes here:
- split main into more smaller functions
- add panic hook that exits the process if one of the threads paniced
- use never_type feature to better type functions that should never return
- few panics to error returning changes here and there

Reviewed By: farnz

Differential Revision: D5942238

fbshipit-source-id: 7407d95b61f64f3909c5bb14dd3aa1ddee452f3c
2017-10-04 14:06:00 -07:00
Lukas Piatkowski
4fbc0213a3 server: read config repo instead of command line arguments to start the server
Reviewed By: StanislavGlebik

Differential Revision: D5833380

fbshipit-source-id: bad649592a2aa15ad5bc1448266986bed4c6f989
2017-09-22 09:22:18 -07:00
Lukas Piatkowski
58badc5de4 server: add ThriftServer with ServiceFramework for fb303
Reviewed By: StanislavGlebik

Differential Revision: D5871327

fbshipit-source-id: e0f516c8767d4934155a67e82a5840a51b16a255
2017-09-22 03:35:38 -07:00
Lukas Piatkowski
ce481174a6 server: remove the --dry option
Summary: This diffs reverts D5842977 and adds fetching mononoke-config inside tupperware, so that it can be served by mononoke server

Reviewed By: StanislavGlebik

Differential Revision: D5866239

fbshipit-source-id: 6f3fd794e5274c8bab0c50efc9c95e31f88be688
2017-09-20 02:57:12 -07:00
Siddharth Agarwal
da22546d74 move state into a trait
Summary:
We're going to add more stores like obsmarkers and linknodes very
soon. Stuffing all of them into type parameters is going to get ugly very soon.

Instead, add a trait which represents all the state, and make `BlobRepo`
generic on that trait. Add a few implementations for common use cases like
files and RocksDB-based stores.

This allows the dependency lists for the Mononoke and Eden servers to be more
straightforward.

Reviewed By: jsgf

Differential Revision: D5850372

fbshipit-source-id: 37a0687611687b9616ebbddce70f53e1e5d3267b
2017-09-18 00:35:52 -07:00
Lukas Piatkowski
4462d9de59 server: add a temporary --dry option just for the initial deployment in tupperware
Summary: The idea is to deploy a no-op mononoke server to tupperware and slowly add more parts like fb303 page, proper args for startup etc.

Reviewed By: farnz

Differential Revision: D5842977

fbshipit-source-id: 227d144b71132e73b76ce7067ac998b1945cb5e1
2017-09-15 09:49:59 -07:00
Siddharth Agarwal
a74542da60 update and pull in uuid + subprocess
Summary:
Finally got an update working by removing the `mysql_async` crate.

Some notes:

* The `mysql_async` crate was responsible in this case: see https://github.com/rust-lang/cargo/issues/4066#issuecomment-328210204 for why.
* tokio/futures deprecated a bunch of stuff. I've filed a TODO for now.
* We finally pulled in error-chain 0.11, which has a bunch of nice improvements.

Reviewed By: kulshrax

Differential Revision: D5798282

fbshipit-source-id: a38a7b17ee0205428e2ea63334722aa408582493
2017-09-08 17:05:38 -07:00
Lukas Piatkowski
af5f649b3e server: rustfmt main.rs
Reviewed By: jsgf

Differential Revision: D5785200

fbshipit-source-id: 333b5d57a047ae99fbae5a5da551017ac7529a7e
2017-09-08 10:36:40 -07:00
Jeremy Fitzhardinge
a4c62d44e8 mononoke: server: repo: reformat and loosen constraints on repo error
Summary: Loosen type constraint on the error slightly, and rustfmt.

Reviewed By: sid0

Differential Revision: D5764616

fbshipit-source-id: 265071f775fac5ea40e8ba45a7da961904b3b397
2017-09-04 15:20:07 -07:00
Arun Kulshreshtha
38bc0eaa77 Update rust-crates-io in tp2 to include boxfnonce crate
Summary: The `boxfnonce` crate is a workaround for the lack of `FnBox` in stable Rust. Without it, it isn't possible to call a `Box<FnOnce>`.

Reviewed By: jsgf

Differential Revision: D5626687

fbshipit-source-id: 01ab37b98add5dae10f3c4834c2a330593639ab6
2017-08-14 20:33:25 -07:00
Pedro Rittner
99490863ef Update toolchain + crates-io to rust 1.19
Summary: As per title. This includes fixes by kulshrax to make things not break.

Reviewed By: jsgf

Differential Revision: D5569907

fbshipit-source-id: f6a4ad88b33caf8c8de3ef8db7932d36993e4e95
2017-08-10 07:23:49 -07:00
Jeremy Fitzhardinge
5a0efcfc3b mononoke: make server support multiple repos
Summary:
Server can construct boxed Repo instances, and performs all client protocol operations in terms of trait methods. This allows the repo to be set dynamically.

This currently makes the repo type a single setting which applies to all repos; this can be generalized to a per-repo setting later.

Reviewed By: sid0

Differential Revision: D5540670

fbshipit-source-id: ac450b078849d9bd65d6e3dc91b73d652ca86ce7
2017-08-02 17:43:24 -07:00
Jeremy Fitzhardinge
09b25e1507 mononoke: bookmarks: fold ListBookmarks into Bookmarks
Summary:
In practice, no users of Bookmarks will not want listing, and all
implementations need to be able to support it.

Reviewed By: StanislavGlebik

Differential Revision: D5540672

fbshipit-source-id: d64a3894c7cd14d329bd23809525935461289bc3
2017-08-02 17:43:24 -07:00
Siddharth Agarwal
8d7e114d2c explain why only uncompressed bundles work for now
Summary: It's because of an upstream Mercurial bug.

Reviewed By: StanislavGlebik

Differential Revision: D5535362

fbshipit-source-id: 4a035b7e70d52b0211a4a2d5e9df580152f43fac
2017-08-01 09:53:37 -07:00
facebook-github-bot
2b6af6b941 Initial commit
fbshipit-source-id: f75baa4ff6aa71973f677b752d7aba582cf4927f
2017-07-27 18:00:19 -07:00