Commit Graph

88 Commits

Author SHA1 Message Date
Mark Thomas
89bc34035b scuba: add log sequence numbers
Summary:
Add log sequence numbers to the scuba sample builder.  This provides an ordering
over the logs made by an individual instance of Mononoke, allowing them to be
sorted.

Reviewed By: krallin

Differential Revision: D22728880

fbshipit-source-id: 854bde51c7bfc469677ad08bb738e5097cb05ad5
2020-07-27 07:10:07 -07:00
Kostia Balytskyi
dde78cb83e backsyncer: move under commit_rewriting
Summary: Same as a previous diff. Let's keep the top-level dir tidy.

Reviewed By: krallin

Differential Revision: D22691638

fbshipit-source-id: 7f9a21f307efd9bbe37f515f475409c89b99cd31
2020-07-23 06:32:52 -07:00
Thomas Orozco
8a244dc0de mononoke/derived_data: log perf counters to derived data Scuba
Summary:
Like it says in the title. This would be helpful to understand why a particular
derivation took a given amount of time. To avoid having other work that shares
this CoreContext resulting in biased counters, I set this up so that we start
new perf counters for derivation.

Reviewed By: farnz

Differential Revision: D22595473

fbshipit-source-id: de85d5108aabde23cf6587662f15f25aac0cd650
2020-07-17 04:32:12 -07:00
Kostia Balytskyi
75db021d70 live_commit_sync_config: make it into a trait
Summary:
The goal is to make it easier to implement unit tests, which depend on `LiveCommitSyncConfig`. Specifically, `scs` has a piece of code, which instantiates `mononoke_api::Repo` with a test version of `CommitSyncConfig`. To migrate it to `LiveCommitSyncConfig`, I need to be able to create a test version of that. It **is** possible now, but would require me to turn a supplied instance of `CommitSyncConfig` back into `json`, which is cumbersome. Using a `dyn LiveCommitSyncConfig` there, instead of a concrete struct seems like a good idea.

Note also that we are using this technique in many places: most (all?) of our DB tables are traits, which we then implement for SQL-specific structs.

Finally, this diff does not actually migrate all of the current users of `LiveCommitSyncConfig` (the struct) to be users of `LiveCommitSyncConfig` (the trait), and instead makes them use `CfgrLiveCommitSyncConfig` (the trait impl). The idea is that we can migrate bits to use traits when needed (for example, in an upcoming `scs` diff). When not needed, it's fine to use concrete structs. Again, this is already the case in a a few places: we sometimes use `SqlSyncedCommitMapping` struct directly, instead of `T: SyncedCommitMapping` or `dyn SyncedCommitMapping`.

Reviewed By: StanislavGlebik

Differential Revision: D22383859

fbshipit-source-id: 8657fa39b11101684c1baae9f26becad6f890302
2020-07-08 08:34:06 -07:00
Stanislau Hlebik
886e34d17b mononoke: log size of fetched undesired files
Summary:
Just knowing the number of fetched undesired files doesn't give the full
picture. e.g. fetching lots of small files is better than fetching single
multi-Gb file.
So knowing the size of files is helpful

Reviewed By: krallin

Differential Revision: D22408400

fbshipit-source-id: 7653c1cdceccf50aeda9ce8a4880ee5178d4b107
2020-07-07 06:23:01 -07:00
Arun Kulshreshtha
5f0181f48c Regenerate all Cargo.tomls after upgrade to futures 0.3.5
Summary: D22381744 updated the version of `futures` in third-party/rust to 0.3.5, but did not regenerate the autocargo-managed Cargo.toml files in the repo. Although this is a semver-compatible change (and therefore should not break anything), it means that affected projects would see changes to all of their Cargo.toml files the next time they ran `cargo autocargo`.

Reviewed By: dtolnay

Differential Revision: D22403809

fbshipit-source-id: eb1fdbaf69c99549309da0f67c9bebcb69c1131b
2020-07-06 20:49:43 -07:00
Thomas Orozco
1db62473f2 mononoke/virtually_sharded_blobstore: track perf counters
Summary: Like it says in the title. Those are useful!

Reviewed By: farnz

Differential Revision: D22332479

fbshipit-source-id: f9bddad75fcbed2593c675f9ba45965bd87f1575
2020-07-03 05:53:10 -07:00
Thomas Orozco
bf3c2e19f0 mononoke/virtually_sharded_blobstore: a caching blobstore that deduplicates
Summary:
This introduces a caching blobstore that deduplicates reads and writes. The
underlying motivation is to improve performance for processes that might find
themsleves inadvertently reading the same data concurrently from a bunch of
independent callsites (most of Mononoke), or writing the same bit of data over
and over again.

The latter is particularly useful for things like commit cloud backfilling in
WWW, where some logger commits include the same blob being written hundreds or
thousands of times, and cause us to overload the underlying Zippy shard in
Manifold. This is however a problem we've also encountered in the past in e.g.
the deleted files manifest and had to solve there. This blobstore is a little
different in the sense that it solves that problem for all writers.

This comes at the cost of writes being dropped if they're known to be
redundant, which prevents updates through this blobstore. This is desirable for
most of Mononoke, but not all (notably, for skiplist updates it's not great).

For now, I'm going to add this behind an opt-in flag, and later on I'm planning
to make it opt-out and turn it off there (I'm thinking to use the CoreContext
for this).

Reviewed By: farnz

Differential Revision: D22285270

fbshipit-source-id: 4e3502ab2da52a3a0e0e471cd9bc4c10b84a3cc5
2020-07-03 05:53:10 -07:00
Johan Schuijt-Li
2b69716461 push compat() down one level from main
Summary: Migrate to new-style futures

Reviewed By: ikostia

Differential Revision: D22365232

fbshipit-source-id: 08ddd50be1c34fe90a453f369cea2e45323b63db
2020-07-03 02:36:09 -07:00
Stanislau Hlebik
8a137ae922 mononoke: add Scribe
Summary:
At the moment we can't test logging to scribe easily - we don't have a way to
mock it. Scribe are supposed to help with that.

They will let us to configure all scribe logs to go to a directory on a
filesystem similar to the way we configure scuba. The Scribe itself will
be stored in CoreContext

Reviewed By: farnz

Differential Revision: D22237730

fbshipit-source-id: 144340bcfb1babc3577026191428df48e30a0bb6
2020-06-29 12:15:22 -07:00
Harvey Hunt
026710c2cd mononoke: Remove --config_path from server arguments
Summary:
D21642461 (46d2b44c0e) converted Mononoke server to use the
`--mononoke-config-path` common argument style to select a config path.

Now that this change has been running for a while, remove the extra logic in
the server that allowed it to accept both the deprecated `--config_path / -P`
and the new arg.

Reviewed By: ikostia

Differential Revision: D22257386

fbshipit-source-id: 7da4ed4e0039d3659f8872693fa4940c58bae844
2020-06-29 07:28:36 -07:00
Kostia Balytskyi
9a00efc973 cmdlib: expose test-instance and local-configerator-path
Summary:
Before this diff only the main Mononoke server binary was able to use fs-based
`ConfigStore`, which is pretty useful in integration tests.

Reviewed By: farnz

Differential Revision: D22256618

fbshipit-source-id: 493a064a279250d01469c9ff7f747585581caf51
2020-06-26 06:51:07 -07:00
Simon Farnsworth
b1c85aaf4b Switch Blobstore to new-style futures
Summary:
Eventually, we want everything to be `async`/`await`; as a stepping stone in that direction, switch the remaining lobstore traits to new-style futures.

This just pushes the `.compat()` out to old-style futures, but it makes the move to non-'static lifetimes easier, as all the compile errors will relate to lifetime issues.

Reviewed By: krallin

Differential Revision: D22183228

fbshipit-source-id: 3fe3977f4469626f55cbf5636d17fff905039827
2020-06-26 03:54:42 -07:00
Stanislau Hlebik
a8209eb712 mononoke: pass PushParams to MononokeRepo
Summary:
In the next diffs it will be passed to unbundle processing so that we can use
scribe category to log pushed commits

Reviewed By: krallin

Differential Revision: D22212616

fbshipit-source-id: 17552bda11f102041a043f810125dc381e478611
2020-06-25 05:51:29 -07:00
Kostia Balytskyi
8c50e0d870 unbundle: use live_commit_sync_config for push redirection
Summary:
This diff enables `unbundle` flow to start creating `push_redirector` structs from hot-reloaded `CommitSyncConfig` (by using the `LiveCommitSyncConfig` struct).

Using `LiveCommitSyncConfig` unfortunately means that we need to make sure those tests, which don't use standard fixtures, need to have both the `.toml` and the `.json` commit sync configs present, which is a little verbose. But it's not too horrible.

Reviewed By: StanislavGlebik

Differential Revision: D21962960

fbshipit-source-id: d355210b5dac50d1b3ad277f99af5bab56c9b62e
2020-06-25 03:28:08 -07:00
Lukas Piatkowski
f9eb013d43 mononoke/configerator structs: change the OSS folder where configerator structs are saved
Summary:
Due to Thrift design of "include" statements in fbcode the thrift structures has to be contained in folders that are identical to the folder layout inside fbcode.

This diff changes the folder layout on Cargp.toml files and in fbcode_builder, there will be a next diff that changes this for ShipIt as well.

Reviewed By: ikostia

Differential Revision: D22208707

fbshipit-source-id: 65f9cafed2f0fcc8398a3887dfa622de9e139f68
2020-06-24 09:38:46 -07:00
Jeremy Fitzhardinge
1b4edb5567 eden: remove unused Rust dependencies
Summary:
Remove unused dependencies for Rust targets.

This failed to remove the dependencies in eden/scm/edenscmnative/bindings
because of the extra macro layer.

Manual edits (named_deps) and misc output in P133451794

Reviewed By: dtolnay

Differential Revision: D22083498

fbshipit-source-id: 170bbaf3c6d767e52e86152d0f34bf6daa198283
2020-06-17 17:55:03 -07:00
Kostia Balytskyi
de7fd72ed3 push_redirector: instantiate at request start
Summary:
The goal of the stack is to support hot reloading of `CommitSyncConfig`s everywhere: in `push_redirector`, `backsyncer`, `x-repo sync job` and so forth.

This diff in particular is a refactoring of how we instantiate the `PushRedirector` struct for the `unbundle` flow. Previously the struct would be instantiated when `RepoHandler` struct was built and would later be reused by `RepoClient`. Now we want to instantiate `PushRedirector` before we start processing the `unbundle` request, so that we can request the newest `CommitSyncConfig`. Note that this diff does not introduce the hot reload itself, it just lays the groundwork: instantiation of `PushRedirector` at request start.

To achieve this goal, `RepoClient` now contains a somewhat modified `PushRedirectorArgs` struct, whose goal is to own the unchanging stuff, needed to create a full `PushRedirector`.

Here are a few explicit non-goals for this hot reloading:
- the overall decision whether the repo is part of any `CommitSyncConfig` or not is still made at `RepoHandler` creation time. What this means is that if `CommitSyncConfig` is changed to have another small repo and Mononoke servers happens to know about that repo, it would not automatically pick up the fact that the repo should be a part of `CommitSyncConfig`
- same for removal (stopping push redirector is already possible via a different hot-reloaded config)
- changing anything about a large/small relationship is likely to be very complicated under the best circumstances of everything being down, let alone during a hot reload. This means that target repo cannot be changed via this mechanizm.

Essentially, the goal is only to be able to do a live change of how paths change between repos.

Reviewed By: StanislavGlebik

Differential Revision: D21904799

fbshipit-source-id: e40e6a9c39f4f03a436bd974f3cba26c690c5f27
2020-06-17 04:46:23 -07:00
Egor Tkachenko
d72c2b0b60 mononoke: opsfiles: Port deny_from_corp.sh hook
Summary: Ported deny_from_corp hook into mononoke.

Reviewed By: krallin

Differential Revision: D21329467

fbshipit-source-id: f5fa7a745b09a83b2624dd074155901f0bd31a55
2020-06-10 19:29:47 -07:00
Johan Schuijt-Li
1d4c5cbfc4 mononoke: replace instances of whitelist/blacklist/blackhole
Summary:
There are people that are hurt by usage of these terms, this should be more
then enough reason to replace these. Newly chosen terms are more
self-explanatory as well.

This doesn't yet touch the actualy config files, as that requires a bit more
effort than 1 diff and will require more coordination.

Reviewed By: krallin

Differential Revision: D21924440

fbshipit-source-id: e24fc638dc8c9d6d20b6f3fa5f0d0bbc91bbf77b
2020-06-10 19:29:30 -07:00
Lukas Piatkowski
f3753fd0bd permission_checker: add methods to parse MononokeIdentity from json and x509
Summary: This methods will replace the fbcode_build provided functions. Also add Cargo files for crates that are now thanks to that buildable in OSS.

Reviewed By: farnz

Differential Revision: D21549860

fbshipit-source-id: 69f4179aa7a9081d33fac1f2f88aa3b32cd31e17/
2020-06-10 18:16:04 -07:00
Lukas Piatkowski
8efc16b157 common/rust/identity_ext: unify identity parsing into a single crate
Summary: The `secure_utils` crate from common/rust/secure_utils was moved to rust-shed, the remaining crates in that folder are being refactored here into a single crate `identity_ext` for clarity.

Reviewed By: StanislavGlebik

Differential Revision: D21549861

fbshipit-source-id: 4da6566a09ba7a772e8062632f9d7520af2e09e6
2020-06-03 13:16:24 -07:00
Lukas Piatkowski
3d1587c3da rust-shed: add secure_utils to the shed
Reviewed By: StanislavGlebik

Differential Revision: D21549859

fbshipit-source-id: 0e143354a60578732ae1eed8c3c71b9f859e3958
2020-06-03 13:16:23 -07:00
Mark Thomas
6ad7e5c96e metaconfig/parser: use free functions for loading configuration
Summary:
Replace the use of `RepoConfigs::read*` associated functions with free
functions.  These didn't really need to be associated functions (and in the
case of the common and storage configs, really didn't belong there either).

Reviewed By: krallin

Differential Revision: D21837270

fbshipit-source-id: 2dc73a880ed66e11ea484b88b749582ebdf8a73f
2020-06-02 09:30:03 -07:00
Jeremy Fitzhardinge
04c7c17185 mononoke: remove unused deps for a couple of targets
Summary:
Just top-level mononoke and cache_warmup as a more or less random
selection.

Reviewed By: StanislavGlebik

Differential Revision: D21648852

fbshipit-source-id: 0e5137da9a7742377112e085e9d29182abdfbf41
2020-05-20 17:00:08 -07:00
Harvey Hunt
46d2b44c0e mononoke: Use MononokeApp for mononoke server
Summary:
Mononoke server is the only binary using plain `clap::App`, whilst all
other services use `MononokeApp`. The `MononokeApp` variant configures some
default arguments and provides consistent argument naming between binaries.

Update the server to use `MononokeApp` and add some logic to allow passing
either `--config_path` or `--mononoke-config-path` until we remove all uses of
`--config-path`.

Reviewed By: StanislavGlebik

Differential Revision: D21642461

fbshipit-source-id: f42e0b6625f3979ced0920db269bdb4528f99e49
2020-05-20 05:47:17 -07:00
Mark Thomas
5ae4554539 server: log when the server starts to listen for connections
Summary:
When starting up with many repos, it can take a while before the server is ready
to accept connections, and there is no log to indicate when that is the case.

Add one.

Reviewed By: farnz

Differential Revision: D21641189

fbshipit-source-id: 057ca06c1b1725799a8445841b6eea89bba783b0
2020-05-20 03:56:49 -07:00
Stefan Filip
60966c93e7 autocargo: regenerate
Summary: maintenance

Reviewed By: StanislavGlebik

Differential Revision: D21640322

fbshipit-source-id: d0b2ce604735c05d540d06835c8e4c8a940fbf5c
2020-05-19 16:08:40 -07:00
Stanislau Hlebik
daa1162e08 mononoke: remove getfiles from ratelimiter and perf counter
Summary:
See bottom diff in the stack for the motivation. Though you can probably guess
the motivation :)

Reviewed By: farnz

Differential Revision: D21623154

fbshipit-source-id: a0940d766a67080ddcb346c2e3313eb08699edad
2020-05-19 04:43:00 -07:00
Stanislau Hlebik
211032d5af mononoke: log undesired file/tree fetches
Summary:
Let's add an option to log how many files and trees were fetched in a
particular repo that start with a prefix.

Reviewed By: farnz

Differential Revision: D21617347

fbshipit-source-id: a57f74eadf32781e6c024e18da252c98af21996d
2020-05-18 04:12:54 -07:00
Alex Hornby
5df1989251 mononoke: walker: corpus dump bytes to inflight area and then move
Summary:
Update the corpus walker to dump the sampled bytes as early as possible to the Inflight area of the output dir, then move them to final location once path is known.

When walking large files and manifests this uses a lot less memory that holding the bytes in a map!

Layout is changed is to make comparison by file type easier.  we get a top level dir per extension, e.g. all .json files are under FileContent/byext/json

This also reduces the number of bytes taken from the sampling fingerprint used to make directories, 8 was overkill.  3 is enough to limit directory size.

Reviewed By: farnz

Differential Revision: D21168633

fbshipit-source-id: e0e108736611d552302e085d91707cca48436a01
2020-05-14 04:22:22 -07:00
Mark Thomas
1b79736298 remove support_bundle2_listkeys flag
Summary:
The `support_bundle2_listkeys` flag controls at runtime whether we support
`listkeys` in bundle2.  Since this was added before tunables were available,
it uses a value in the mutable counters SQL store.

We could migrate this to tunables, but in practice we have never disabled it,
so let's just make it the default.

Reviewed By: krallin

Differential Revision: D21546246

fbshipit-source-id: 066a375693757ea841ecf0fddb0cc91dc144fd6f
2020-05-13 11:00:56 -07:00
Thomas Orozco
6ac0c26e06 mononoke/context_concurrency_blobstore: use rate limit instead of semaphore
Summary:
Limits on concurrent calls are a bit hard to reason about, and it's not super
obvious what a good limit when all our underlying limits are expressed in QPS
(and when our data sets don't have peak concurrency - instead they have
completion time + # blob accesses).

Considering our past experience with ThrottledBlob has been quite positive
overall, I'd like to just use the same approach in ContextConcurrencyBlobstore.
To be safe, I've also updated this to be driven by tunables, which make it
easier to rollout and rollback.

Note that I removed `Debug` on `CoreContext` as part of this because it wasn't
used anywhere. We can bring back a meaningful implementation of `Debug` there
in the future if we want to. That triggered some warnings about unused fields,
which for now I just silenced.

Reviewed By: farnz

Differential Revision: D21449405

fbshipit-source-id: 5ca843694607888653a75067a4396b36e572f070
2020-05-12 06:49:25 -07:00
Thomas Orozco
f9d8000c82 mononoke/blobrepo/factory: convert this to async await
Summary:
This updates our blobrepo factory code to async / await. The underlying
motivation is to make this easier to modify. I've ran into this a few times
now, and I'm sure others have to, so I think it's time.

In doing so, I've simplified the code a little bit to stop passing futures
around when values will do. This makes the code a bit more sequential, but
considering none of those futures were eager in any way, it shouldn't really
make any difference.

Reviewed By: markbt

Differential Revision: D21427290

fbshipit-source-id: e70500b6421a95895247109cec75ca7fde317169
2020-05-12 06:49:25 -07:00
Thomas Orozco
01db12a1b2 mononoke/repo_listener: convert request_handler to an async fn
Summary:
I'd like to add some async fns to session creation. The motivation is that I
want to instantiate an AsyncRateLimiter there, and that requires an async
context because it needs to spawn on the Tokio runtime, and the best way to
enforce this is to just make the function async.

Reviewed By: StanislavGlebik

Differential Revision: D21427291

fbshipit-source-id: 75b0d41b62a77ade3d624e24adc57a938b722d9c
2020-05-12 06:49:25 -07:00
Kostia Balytskyi
3f9ba38f09 unbundle: save infinitepush unbundles into reversefillerqueue
Summary:
We want to be able to record all the bundles Mononoke processes to be later
replayed by Mercurail.

Reviewed By: krallin

Differential Revision: D21427622

fbshipit-source-id: b88e10e03d07dae35369286fe31022f36a1ee5cf
2020-05-07 05:12:14 -07:00
Lukas Piatkowski
5975838cc8 mononoke/rust-shed: apply new coding style convention that separates oss-only code
Summary: To make it easier to navigate the codebase the oss-only code will be from now on stored in a separate module, similarly to how the fbcode-only code is stored.

Reviewed By: markbt

Differential Revision: D21429060

fbshipit-source-id: aa7e80961de2897dae31bd0ec83488c683633b7a
2020-05-07 04:52:16 -07:00
Lukas Piatkowski
2a1863c35d mononoke/server: make the main mononoke binary OSS buildable
Summary: Covering repo_listener and microwave plus some final touch and we have a buildable Mononoke binary.

Reviewed By: krallin

Differential Revision: D21379008

fbshipit-source-id: cca3fbb53b90ce6d2c3f3ced7717404d6b04dd51
2020-05-06 06:11:02 -07:00
Lukas Piatkowski
7033889eac mononoke/repo_client: make repo_client buildable in OSS
Summary:
There are few related changes included in this diff:
- backsyncer is made public
- stubs for SessionContext::is_quicksand and scuba_ext::ScribeClientImplementation
- mononoke/hgproto is made buildable

Reviewed By: krallin

Differential Revision: D21330608

fbshipit-source-id: bf0a3c6f930cbbab28508e680a8ed7a0f10031e5
2020-05-06 06:11:02 -07:00
Lukas Piatkowski
5aea06ca2a mononoke/load_limiter: use trait objects to represent load_limiter
Summary: Making a trait out of LoadLimiter will help with providing different implementations of load limiting for OSS and FB.

Reviewed By: farnz

Differential Revision: D21302819

fbshipit-source-id: 1b982a367aa7126ca5d7772e4a2406dabbe9e13b
2020-05-04 04:36:03 -07:00
Harvey Hunt
3cd49f9d3c mononoke: Add tunables - a simple form of config hot reloading
Summary:
Currently, Mononoke's configs are loaded at startup and only refreshed
during restart. There are some exceptions to this, including throttling limits.
Other Mononoke services (such as the LFS server) have their own implementations
of hot reloadable configs, however there isn't a universally agreed upon method.

Static configs makes it hard to roll out features gradually and safely. If a
bad config option is enabled, it can't be rectified until the entire tier is
restarted. However, Mononoke's code is structured with static configs in mind
and doesn't support hot reloading. Changing this would require a lot of work
(imagine trying to swap out blobstore configs during run time) and wouldn't
necessarily provide much benefit.

Instead, add a subset of hot reloadable configs called tunables. Tunables are
accessible from anywhere in the code and are cheap to read as they only require
reading an atomic value. This means that they can be used even in hot code
paths.

Currently tunables support reloading boolean values and i64s. In the future,
I'd like to expand tunables to include more functionality, such as a rollout
percentage.

The `--tunables-config` flag points to a configerator spec that exports a
Tunables thrift struct. This allows differents tiers and Mononoke services to
have their own tunables. If this isn't provided, `MononokeTunables::default()`
will be used.

This diff adds a proc_macro that will generate the relevant `get` and `update`
methods for the fields added to a struct which derives `Tunables`. This struct is
then stored in a `once_cell` and can be accessed using `tunables::tunables()`.

To add a new tunable, add a field to the `MononokeTunables` struct that is of
type `AtomicBool` or `AtomicI64`. Update the relevant tunables configerator
config to include your new field, with the exact same name.

Removing a tunable from `MononokeTunables` is fine, as is removing a tunable
from configerator.

If the `--tunables-config` path isn't passed, then a default tunables config
located at `scm/mononoke/tunables/default` will be loaded. There is also the
`--disable-tunables` flag that won't load anything from configerator, it
will instead use the `Tunable` struct's `default()` method to initialise it.
This is useful in integration tests.

Reviewed By: StanislavGlebik

Differential Revision: D21177252

fbshipit-source-id: 02a93c1ceee99066019b23d81ea308e4c565d371
2020-04-30 16:08:30 -07:00
Thomas Orozco
a381722ad1 mononoke/cache_warmup: asyncify
Summary:
This updates cache_warmup to new futures, since I'd like to do a little bit of
work in there. This also changes a bit of functionality: until now we were
roundtripping through a hg changeset id un-necessarily so that updates it to
just use the bcs id instead.

Reviewed By: mitrandir77

Differential Revision: D21325484

fbshipit-source-id: 4d296c5fbe7c21dda681aed4ed9c572a38246893
2020-04-30 12:47:35 -07:00
Lukas Piatkowski
764023bc99 mononoke: replace all remaining usages of aclchecker with permission_checker
Summary: The changes to server/context, gotham_ext and the code that depends on them are the only reminding places where aclchecker is used directly and it is not easy to split this diff to convert them separately.

Reviewed By: krallin

Differential Revision: D21067809

fbshipit-source-id: a041ab141caa6fe6871e1fda6013e33f1f09bc56
2020-04-29 11:57:34 -07:00
Harvey Hunt
54e01c713a mononoke: Add init_mononoke helper function and update call sites
Summary:
Add a new function that initialises common parts of Mononoke:
- cachelib
- logging
- runtime

In the next diff, I will also update `init_mononoke` to initialise tunables
too.

I left some users of `init_runtime` unchanged (such as `mononoke_admin`) as
they conditionally enable cachelib.

Reviewed By: krallin

Differential Revision: D21177253

fbshipit-source-id: 40b534d1b244fd8dcd05e1cff1c9f3edfb32a4b9
2020-04-28 09:03:09 -07:00
Lukas Piatkowski
dace116e05 mononoke/repo_listener: replace aclchecker usage with permission_checker
Summary: The new API is more generic, use it in favour of the fbcode only aclchecker

Reviewed By: StanislavGlebik

Differential Revision: D21067812

fbshipit-source-id: fdbd61697f65bd34c114e6d37108f395c77c0b17
2020-04-28 03:23:31 -07:00
Mark Thomas
1135339320 mutationstore: add logging and perf counters
Summary:
Add debug logging and perf counters for the number of mutation entries stored
during `add_entries`, and the number of mutation entries fetched during
`all_predecessors`.

Reviewed By: StanislavGlebik

Differential Revision: D21065934

fbshipit-source-id: 9b2ff9720116e6a168706f994655daffb18d0ffc
2020-04-23 08:58:09 -07:00
Lukas Piatkowski
8bba936e5f mononoke/permission_checker: introduce MembershipChecker and its first usage in hooks
Summary: The new MembershipChecker and PermissionChecker traits will generalize access to various permission/acl systems (like LDAP) and leave the implementation details hidden behind an object trait.

Reviewed By: StanislavGlebik

Differential Revision: D21067811

fbshipit-source-id: 3bccd931f8acdb6c1e0cff4cb71917c9711b590b
2020-04-23 03:44:09 -07:00
Stanislau Hlebik
3193f4fab3 mononoke: fail with non-zero exit code in serve_forever if failure happened
Summary:
Previously our jobs would have exit with error code 0 even if there was an
actual error. The reason for this was because error was just ignored (or rather
just printed to stderr).
This is not a huge problem but it makes tw output confusing - it shows that
the task was "Completed" while in reality it "Failed"

Reviewed By: ahornby

Differential Revision: D20693297

fbshipit-source-id: 4f615e2ef11f2edbb9bdbcf49cb1635929fdae89
2020-04-17 14:57:56 -07:00
Gabriel Russo
03d4e52ab3 Bump tokio to 0.2.13
Summary:
This is needed because the tonic crate (see the diff stack) relies on tokio ^0.2.13

We can't go to a newer version because a bug that affects mononoke was introduced on 0.2.14 (discussion started on T65261126). The issue was reported upstream https://github.com/tokio-rs/tokio/issues/2390

This diff simply changed the version number on `fbsource/third-party/rust/Cargo.toml` and ran `fbsource/third-party/rust/reindeer/vendor`.

Also ran `buck run //common/rust/cargo_from_buck:cargo_from_buck` to fix the tokio version on generated cargo files

Reviewed By: krallin

Differential Revision: D21043344

fbshipit-source-id: e61797317a581aa87a8a54e9e2ae22655f22fb97
2020-04-15 12:18:00 -07:00
Simon Farnsworth
92fce3d518 Clean out unused deps from our TARGETS files
Summary:
We had accumulated lots of unused dependendencies, and had several test_deps in deps instead. Clean this all up to reduce build times and speed up autocargo processing.

Net removal is of around 500 unneeded dependency lines, which represented false dependencies; by removing them, we should get more parallelism in dev builds, and less overbuilding in CI.

Reviewed By: krallin, StanislavGlebik

Differential Revision: D20999762

fbshipit-source-id: 4db3772cbc3fb2af09a16601bc075ae8ed6f0c75
2020-04-14 03:38:11 -07:00