Commit Graph

32 Commits

Author SHA1 Message Date
Lukas Piatkowski
4d4d90928f integration tests: use RocksDb based blobs rather than File based for testing
Summary: just to excersise our RocksDb blobstore which might come in handy more often than file based as it should be more efficient

Reviewed By: StanislavGlebik

Differential Revision: D7290069

fbshipit-source-id: ce776cfa14e43dc45cca796ef187655ba665d177
2018-03-16 13:41:55 -07:00
Stanislau Hlebik
f4a8559f13 mononoke: fix flakiness of test-eden-server.t
Summary:
It was flaky because server may not yet be ready to accept connections when we
send first request. Sometimes delay needs to be > 1 sec.
Let's query eden server in a loop until it responds.

Reviewed By: farnz

Differential Revision: D7233069

fbshipit-source-id: 8bcb5b2b8ebdc52d2447b33e18580e50c1e27031
2018-03-12 08:45:18 -07:00
Stanislau Hlebik
3526e7137b mononoke: use changesets table in repoinfo
Summary:
Changesets table gives us a relatively fast way to get generation number. Let's
use it inside repoinfo crate.

Reviewed By: sid0

Differential Revision: D7043829

fbshipit-source-id: 82557340a7f2fd6361f4e29c1a11e38e473eeb15
2018-02-26 09:43:24 -08:00
Stanislau Hlebik
9beeaeadc5 mononoke: add repoid to BlobRepo
Summary: Changests store requires it in it's api methods. Let's pass repoid from configs

Reviewed By: farnz

Differential Revision: D7043830

fbshipit-source-id: e4e4d5852d0ca8488cabe2140555508c143ab8df
2018-02-26 09:43:24 -08:00
Stanislau Hlebik
ebf46512ef mononoke: test cleanup, part 2
Summary: Cleanup blobimporting

Reviewed By: lukaspiatkowski

Differential Revision: D7000047

fbshipit-source-id: 2657a5608c3d58df71154dd2e97c4c899c33714a
2018-02-16 03:08:40 -08:00
Stanislau Hlebik
f503d1993c mononoke: test cleanup, part 1
Summary:
Use hgclone_treemanifest instead of hgcloneshallow.
Note that it changes the behaviour of test-infinitepush.t - now it sends
treegroup part too. Since we actually want to send treegroup part during
infinitepush push, that means that the test was broken and now it fixed.

Reviewed By: lukaspiatkowski

Differential Revision: D7000046

fbshipit-source-id: 61b4517f23081faab1738f44d27220ae8063e077
2018-02-16 03:08:40 -08:00
Lukas Piatkowski
dfd17c9d57 mononoke: create integration test for a basic push case to treemanifest repo
Summary: making this test work is a 2018 m1 milestone

Reviewed By: farnz

Differential Revision: D6950112

fbshipit-source-id: 798a1b8e722e96b27f0cb8267b82232d3fe0496d
2018-02-13 06:22:17 -08:00
Stanislau Hlebik
5d1bcd7a67 mononoke: fix test
Summary: Mercurial was updated, it doesn't print 'new head created' anymore

Reviewed By: farnz

Differential Revision: D6819007

fbshipit-source-id: 9ead8d0d9c165f3c8d9a6f519642012edfbc6013
2018-01-26 08:20:45 -08:00
Stanislau Hlebik
1417398de8 mononoke: move ssl config options to the separate toml config section
Summary: It removes a bit of copy-pastes code

Reviewed By: sid0

Differential Revision: D6627250

fbshipit-source-id: b110dcad998a240b6da60bc3347c7c5c0370aae0
2018-01-04 07:36:34 -08:00
Stanislau Hlebik
15d23af540 mononoke: get rid of filesblob state
Summary:
It won't be used in prod anyway, and for local use rocksdb blob state is still
preferable

Reviewed By: sid0

Differential Revision: D6627197

fbshipit-source-id: d9ca55b0221c050e8e8e35914aff22906198874a
2018-01-04 07:36:34 -08:00
Stanislau Hlebik
a095cc23da mononoke: add treenode_simple method
Summary:
Fetching file sizes is very expensive - it's one more round-trip to the
blobstore.
Add method that returns tree content, but doesn't fetch blob sizes.

Reviewed By: jsgf

Differential Revision: D6545108

fbshipit-source-id: 3d335eafa9dc367fb9e607f5c147b7e5c37cf133
2017-12-15 10:37:42 -08:00
Stanislau Hlebik
0cceb35e49 mononoke: select free port in the test
Summary:
Two tests can't be run simultaneously because they use the same port. This diff
fixes it.

Reviewed By: farnz

Differential Revision: D6457855

fbshipit-source-id: 3e5f82211bcd87abc608bdeab239fe680976316d
2017-12-06 07:37:23 -08:00
Stanislau Hlebik
95e0ae5c6e mononoke: do not use jq tool in integration tests
Summary:
It maybe not installed on the system. Let's use simple python script instead.

Note: unfortunately we can't use 'python -m json.tool' because we need to sort
entries in the list

Reviewed By: jsgf

Differential Revision: D6437136

fbshipit-source-id: 0703f45c46d220046b9ef484bdf406a7f936557b
2017-11-30 03:23:17 -08:00
Stanislau Hlebik
72d65064c5 mononoke: client auth on the eden server
Summary:
Config file needs to have ca file in PEM format.
It is used to authenticate client.

See code comments for more details.

Reviewed By: jsgf

Differential Revision: D6323439

fbshipit-source-id: 6b6f1fd68605b263dcb33b051843e10d3f5cb38e
2017-11-20 05:35:55 -08:00
Stanislau Hlebik
33b8a6aa62 mononoke: HTTPS in eden server
Summary:
Avoid using plain HTTP and use HTTPS instead.
To do this config needs to provide paths to server certificate and private key files in PEM format.
Then they will be converted to Pkcs12 archive.

This diff adds authentication of server i.e. client can check that it talks to a real server. Next diff adds authentication of a client.
Lower-level `hyper::server::Http::bind_connection()` is used instead of `hyper::server::Http::bind()` method in order to add TLS support.

See code comments for more details.

Implementation is more complicated than I expected it to be. I need to use 3 more new crates. Lmk if there is a better way to do this.

Reviewed By: jsgf

Differential Revision: D6323440

fbshipit-source-id: 544f27e6ec210ddf840212b0c0c94145980e8be3
2017-11-20 05:35:55 -08:00
Stanislau Hlebik
745c6c799e mononoke: read eden-server configs from toml file
Summary:
We have too many parameters, and cmd-line args are no longer good enough. Let's
use toml based config, with a format that's similar to mononoke server
repoconfig.

Reviewed By: farnz

Differential Revision: D6313512

fbshipit-source-id: 61379e93707a4fcbb42aa8a0392ce526dab19f2e
2017-11-20 05:35:55 -08:00
Siddharth Agarwal
e771348b76 blobrepo: incorporate linknodes in blob state
Summary: Also support them in `generate_memblob_repo.py`.

Reviewed By: jsgf

Differential Revision: D6215721

fbshipit-source-id: c8b855bbc74b619bc093b3aac449a283a1ad33ec
2017-11-13 22:01:55 -08:00
Stanislau Hlebik
160b89994e mononoke: accept urls with trailing slash and without
Summary: Let's not be too restrictive about urls

Reviewed By: markbt

Differential Revision: D6099460

fbshipit-source-id: 228a5b3a3cc0f09d68307a3695952543a2f5f05a
2017-11-01 19:11:20 -07:00
Stanislau Hlebik
e300d76095 mononoke: add logging to eden-server and improve error reporting
Summary:
1) Glog logging is added
2) The whole error chain is reported

Reviewed By: markbt

Differential Revision: D6099290

fbshipit-source-id: 1ec9a7fe4c6b9f2b918f47852884ba8afa997916
2017-11-01 19:11:20 -07:00
Lukas Piatkowski
0a76eb6f45 blobimport: add optional thrift service and stats counters
Reviewed By: farnz

Differential Revision: D6030720

fbshipit-source-id: 26971f13061e9a3a1e65d339fc7bdc444b5165fd
2017-10-11 10:58:08 -07:00
Lukas Piatkowski
565afd9615 blobimport: use drain from slog-glog-fmt for logging
Summary: the glog drain does not swallow f.e. backtrace of error_chain errors, so it is a bit easier to debug the tool

Reviewed By: farnz

Differential Revision: D6021671

fbshipit-source-id: 32bfe01bfd77d85c37a2a446cb3e5d000763c689
2017-10-11 05:50:46 -07:00
Stanislau Hlebik
2e51af1bc3 mononoke: add more integration tests
Summary: Make sure we use treemanifest in the tests, and add commit with a directory

Reviewed By: farnz

Differential Revision: D5974524

fbshipit-source-id: 5ef9f110243001e1916509f53741cccb42dc8deb
2017-10-05 00:02:17 -07:00
Stanislau Hlebik
486e5ed681 mononoke: use cpupool in eden server
Summary:
In Eden server we want to return list of file sizes for each file in the directory.
For now we are doing a separate call to the blobrepo. Since there can be lots of such calls, let's make them in parallel using cpupool

Reviewed By: lukaspiatkowski

Differential Revision: D5950452

fbshipit-source-id: 6b852a49c201ccc14ceb8f950dd61fa5cdebad0a
2017-10-03 11:50:46 -07:00
Stanislau Hlebik
d904a5c13f mononoke: handle null manifest pointer specially
Summary:
Previously blob importing failed if commit has null manifest pointer. This diff
fixes it by returning empty blob.

Reviewed By: lukaspiatkowski

Differential Revision: D5953225

fbshipit-source-id: 196e4dc3aaf2820ddeee366f20966e598aee97cb
2017-10-03 09:05:52 -07:00
Stanislau Hlebik
5961c7558a mononoke: filelog metadata problem fix
Summary:
Mercurial filelog entries may have metadata fields in the beginning, usually used to track copies/renames. Previously mononoke eden server returned this metadata as part of the file blob.
This diff changes it. Now `get_content()` method returns file content without metadata, and to make it consistent, both `get_content()` of the blobrepo and revlog repo do the same.

This decision certainly has it's tradeoffs, because now it's more difficult to get metadata (`get_raw_content` needs to be used).
But we'll probably change how metadata is stored anyway, that's why I think changing `get_content` method is fine.

This diff also cleans up server/src/main.rs file, because previously it had to strip metadata itself.
Also diff fixes problem in metadata parsing - it previously failed if file is less than 2 bytes

Reviewed By: farnz

Differential Revision: D5901476

fbshipit-source-id: f3ade0179710352590068c238e6a733aab68a512
2017-09-26 00:36:55 -07:00
Stanislau Hlebik
c474b57a9e blobimport: add an option to postpone compaction
Summary: Compaction can slow down blobimporting a lot. Let's add an option to postpone it till the end

Reviewed By: farnz

Differential Revision: D5882003

fbshipit-source-id: 0611a8e94b3d7331bdacf909d820526f547414a0
2017-09-22 08:33:25 -07:00
Stanislau Hlebik
ab14a6f6c9 mononoke: support rocksdb blobstore in eden server
Reviewed By: lukaspiatkowski

Differential Revision: D5861654

fbshipit-source-id: 036249899910c7aa1acda0632e6a3dcd15bf8f72
2017-09-21 08:25:23 -07:00
Siddharth Agarwal
d24cf40483 make eden-server and mononoke server bookmarks be in the same dirs
Summary: I'm going to move this to a common location very soon.

Reviewed By: jsgf

Differential Revision: D5850319

fbshipit-source-id: 09937659330de93cf74bf827f225418dd413865d
2017-09-18 00:35:52 -07:00
Stanislau Hlebik
1087dfc4b3 mononoke: use method to get file blob in eden server
Reviewed By: jsgf

Differential Revision: D5553374

fbshipit-source-id: 7390fd6ed09319c3a10ece3dfcf44c1c4f3cd057
2017-08-09 08:39:07 -07:00
Stanislau Hlebik
22b6b350a1 mononoke: add eden server method that returns content of the manifest entry
Summary: Method that returns content of the manifest entry in json format.

Reviewed By: sid0

Differential Revision: D5527659

fbshipit-source-id: 1832b645f69da40cbd620a6bff318e25594c5148
2017-08-09 08:39:07 -07:00
Stanislau Hlebik
ed4e09ba6e mononoke: regex-based url handling
Summary:
Soon I'm going to add more different url handlers. And current url handling is
neither robust nor extendable. Let's use regexes to do url handling

Reviewed By: jsgf

Differential Revision: D5489445

fbshipit-source-id: f418c3f40892903b573a33e57899b47e5719a5ea
2017-08-02 01:01:55 -07:00
facebook-github-bot
2b6af6b941 Initial commit
fbshipit-source-id: f75baa4ff6aa71973f677b752d7aba582cf4927f
2017-07-27 18:00:19 -07:00