Commit Graph

257 Commits

Author SHA1 Message Date
Lukas Piatkowski
9ff11fa3ef config: add HookConfig to pass configs in hashmap into hooks code
Summary: In this diff the configs are parsed from toml and passed around to hook's execution context. The actual usage of configs will be introduced in separate diff.

Reviewed By: StanislavGlebik

Differential Revision: D13862837

fbshipit-source-id: 60ac10aa9c25d224e703e1e55bef13dc481ba07e
2019-01-30 05:04:22 -08:00
Stanislau Hlebik
67f220c89c mononoke: fix pushrebasing an empty commit
Summary:
Previously pushrebasing an empty commit failed because we assumed that root
manifest of a commit is always sent in a bundle. This diff removes this
assumption

Reviewed By: lukaspiatkowski

Differential Revision: D13818556

fbshipit-source-id: 44e96374ae343074f48e42a90c691b21e3c41386
2019-01-28 14:40:40 -08:00
Johan Schuijt-Li
3d1463231a disable authorization verification hook for import
Reviewed By: StanislavGlebik

Differential Revision: D13770727

fbshipit-source-id: 8830c63124bc12a40ffe624110d23a3713cad680
2019-01-23 08:00:55 -08:00
Stanislau Hlebik
bacf9f2d64 mononoke: update skiplist building
Summary:
Previously we rely on CachingChangesetFetcher to quickly fetch all commits into
memory, but CachingChangesetFetcher was deleted in D13695201. Instead let's use
`get_many()` method from Changesets trait to quickly fetch many changesets at
once into memory.

Reviewed By: lukaspiatkowski

Differential Revision: D13712783

fbshipit-source-id: 12e8fa148f7989028547ac8d374438e23b44b6d1
2019-01-21 12:58:44 -08:00
Pavel Aslanov
3a44162690 added: multiplexed blobstore scuba logging
Summary:
- Added scuba logging for put/get operation of `MultiplexedBlobstore`
- Added `blobstore_scuba_table` configuration field

Reviewed By: StanislavGlebik

Differential Revision: D13732064

fbshipit-source-id: 9ac0e31f9e1773321b2a7a4d8d561cce9289944b
2019-01-21 10:04:41 -08:00
Liubov Dmitrieva
234c33a241 populate phases table in blobimport
Summary:
We decided to populate phases table in 2 places: blobimport and push-rebase
(alredy done).

This diff is for blobimport. We know the commits are public.

Reviewed By: lukaspiatkowski

Differential Revision: D13731900

fbshipit-source-id: b64e5643e7cffd9e8fb842e9929f4c1ee7a66197
2019-01-21 07:02:15 -08:00
Lukas Piatkowski
eba422a209 blobstore healer: minimalistic implementation
Summary:
This version still misses:
- proper production-ready logging
- smarter handling of case where the queue entries related to each other do not fit in the limit or `older_than` limit, so the healer will heal much more entries without realizing it shouldn't do so.

Reviewed By: aslpavel

Differential Revision: D13528686

fbshipit-source-id: 0245becea7e4f0ac69383a7885ff3746d81c4add
2019-01-15 10:41:07 -08:00
Lukas Piatkowski
ceda67a78a blobstore: extract CacheOpsUtil for direct access for blobstores
Summary: refactor CacheOps to prepare for next diff

Reviewed By: aslpavel

Differential Revision: D13487500

fbshipit-source-id: f9023938d7c2c7573a7957bf38ec6b8641441b75
2019-01-15 09:38:26 -08:00
David Budischek
1558f571c1 Add JSON printing of 'mononoke_admin bonsai-fetch', j...
Reviewed By: StanislavGlebik

Differential Revision: D13622701

fbshipit-source-id: b0b61c23966f9485b99ead7196e276efa8e1e267
2019-01-15 04:02:05 -08:00
David Budischek
7fbfb4ad1d rustfmt mononoke_admin
Reviewed By: StanislavGlebik

Differential Revision: D13634949

fbshipit-source-id: ae97ecba84aa835ad141e4895d1861ad537abfdb
2019-01-15 04:02:05 -08:00
David Budischek
d94fe79b7f Prettify printing of mononoke_admin bonsai-fetch
Summary: Instead of dumping the debug output we print the most important information: Changeset id, author, message and file changes.

Reviewed By: StanislavGlebik

Differential Revision: D13621492

fbshipit-source-id: ea0f93f58516cc759d0dc9aac14545b1827ea136
2019-01-15 04:02:05 -08:00
Pavel Aslanov
1eea4fdb09 asynchronous blobrepo constructor
Summary:
- Support for gluster blubstore
- Asynchronous blobrepo constructor

Reviewed By: StanislavGlebik

Differential Revision: D13630033

fbshipit-source-id: 3e7f5a7be4451063dca3df2f5a7f70d30a2def58
2019-01-14 09:31:58 -08:00
Pavel Aslanov
2efacff245 rustfmt effected files
Summary: Format files effected by next commit in a stack

Reviewed By: StanislavGlebik

Differential Revision: D13650639

fbshipit-source-id: d4e37acd2bcd29b291968a529543c202f6944e1a
2019-01-14 09:31:58 -08:00
Lukas Piatkowski
5155134d0d blobrepo: generalize methods creating Blobrepo over any remote blobstore
Reviewed By: aslpavel

Differential Revision: D13464953

fbshipit-source-id: cb732204bea571788e5b45cee718e8ddf496dd0d
2019-01-10 02:57:36 -08:00
Lukas Piatkowski
2f8ddd0cfa mononoke admin: rustfmt main.rs for easier reviewing of next diffs
Reviewed By: HarveyHunt

Differential Revision: D13606992

fbshipit-source-id: 08600da1c390a552f80bf8b7c160daab78d16f9a
2019-01-09 04:27:33 -08:00
Lukas Piatkowski
813375d66a blobimport: add tracing and uploading traces on every blobimport run
Reviewed By: StanislavGlebik

Differential Revision: D13464745

fbshipit-source-id: 3e2ca21e70089c88a8c510cec1de2f20054a444b
2019-01-08 11:03:32 -08:00
Abhay Bothra
b81b8b0005 Add convert subcommand to mononoke admin tool
Summary:
Added new command which looks as:
```
admin-convert
convert between bonsai and hg changeset hashes

USAGE:
    admin convert <HASH> --from <from> --to <to>

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
    -f, --from <from>    Source hash type [possible values: hg, bonsai]
    -t, --to <to>        Target hash type [possible values: hg, bonsai]

ARGS:
    <HASH>    source hash
```

Reviewed By: StanislavGlebik

Differential Revision: D13494012

fbshipit-source-id: 1e1de7e1e28638b2001f612b9a2c9edda3979dc5
2019-01-07 11:00:48 -08:00
Stanislau Hlebik
92563375c5 mononoke: name variable correctly
Summary: Their names were mixed up

Reviewed By: ikostia

Differential Revision: D13565334

fbshipit-source-id: 1b56adb582900addf2f21ae9baa6dc4ea01c57cb
2019-01-02 10:24:12 -08:00
Jeremy Fitzhardinge
408e7665d9 mononoke: move RepositoryId into mononoke-types
Summary: There's nothing Mercurial-specific about identifying a repo. This also outright removes some dependencies on mercurial-types.

Reviewed By: StanislavGlebik

Differential Revision: D13512616

fbshipit-source-id: 4496a93a8d4e56cd6ca319dfd8effc71e694ff3e
2018-12-19 10:24:27 -08:00
Pavel Aslanov
eb75d48a95 correctly handle configurations with multiple blobstores
Summary: Correctly handle repository with multiple blobstores

Reviewed By: StanislavGlebik

Differential Revision: D13434206

fbshipit-source-id: f4ab70ec037deba150ed5c1ee8e53d23317b8e09
2018-12-18 06:55:56 -08:00
Harvey Hunt
162dafa9d9 mononoke: admin: Remove ability to build fbpkgs
Summary:
Now that mononoke's config can be built using normal fbpkg tools,
we can remove the ability for mononoke_admin to build configuration.

Reviewed By: StanislavGlebik

Differential Revision: D13399189

fbshipit-source-id: 17aff327773b9c904916f99030a732a99aa34134
2018-12-11 03:56:02 -08:00
Stanislau Hlebik
706e98799b mononoke: support many blobstores in metaconfig
Summary: Restructure the configs so that we can specify more than one blobstore

Reviewed By: lukaspiatkowski

Differential Revision: D13234286

fbshipit-source-id: a98ede17921ed6148add570288ac23636b086398
2018-12-05 05:58:07 -08:00
Lukas Piatkowski
5d9a151d85 mononoke: pass CoreContext down to blobstore
Reviewed By: jsgf

Differential Revision: D13324220

fbshipit-source-id: af7a2a650338ea66e504ea0acae1d103af10f8e3
2018-12-04 11:40:15 -08:00
Stanislau Hlebik
f07155b402 mononoke: remove mononoke configs, use toml files
Summary:
Config repo proved to be tricky to understand and hard to use. Let's just use
toml files.

Reviewed By: farnz

Differential Revision: D13179926

fbshipit-source-id: 3a44ee08c37284cc4c189c74b5c369ce82651cc6
2018-12-04 03:52:26 -08:00
Lukas Piatkowski
02e79837a4 mononoke: pass CoreContext down to bookmarks
Reviewed By: StanislavGlebik

Differential Revision: D13302943

fbshipit-source-id: 356ec3cd3c47f843a5869edb7079d4cbd0ee33aa
2018-12-04 01:16:32 -08:00
Lukas Piatkowski
14636545aa mononoke: pass CoreContext down to changesets
Reviewed By: StanislavGlebik

Differential Revision: D13277448

fbshipit-source-id: 6e9a8dac77af8ab991005d14f654e315c234fe44
2018-11-30 10:14:22 -08:00
Lukas Piatkowski
08db0a35eb mononoke: pass CoreContext down to bonsai-hg-mapping
Reviewed By: aslpavel

Differential Revision: D13277450

fbshipit-source-id: 97cfbd917b321727bb4d960c91a784787660eb5b
2018-11-30 10:14:22 -08:00
Stanislau Hlebik
af03216ee2 mononoke: admin command to build and read skiplist indexes
Summary:
Let's add a command that builds and reads a skiplist indexes. This indexes will
be used by getbundle wireproto request to decrease the latency and cpu usage.

Note that we are saving only the longest "jump" from the skiplist. This is done
in order to save space.

Reviewed By: jsgf

Differential Revision: D13169018

fbshipit-source-id: 4d654284b0c0d8a579444816781419ba6ad86baa
2018-11-29 08:19:30 -08:00
Tim Fox
d64d9121c5 Allow hook manager cache params to be configured
Summary: ${title}

Reviewed By: StanislavGlebik

Differential Revision: D13082486

fbshipit-source-id: fbdffdbfca218199dc2ac61abfcb8887b299db6d
2018-11-22 03:30:17 -08:00
Anastasiya Zhyrkevich
3919c0eb4c LFS verification tool
Summary:
Purpose:
- Sha256 alias link to file_content is a required part of LFS getfiles works correct.
LFS protocol uses SHA-256 to refer to the file content. Mononoke uses Blake2.
To support LFS in Mononoke we need to set up a link from SHA-256 hash of the content to blake2 of the content.
These links are called aliases.

- Aliases are uploading together with file content blobs.
But only for new push operations.
- If repo is blobimported from somewhere, we need to make sure, that all the links are in blobstore.
If repo was blobimported before aliases were added then it may miss aliases for some blobs.
- This tool can be used to
   - find if any aliases are missing
   - fill missing aliases.

Implementation:
- Run in repo.
- Iterate through all changesets.
- Go through all the file_content blobs in the changesets
- Verify/generate alias256 links to file_content blobs.

Mode supported:
- verify, count the number of errors and print to console
- generate, if blob is missing to add it to the blobstore

Reviewed By: StanislavGlebik

Differential Revision: D10461827

fbshipit-source-id: c2673c139e2f2991081c4024db7b85953d2c5e35
2018-11-08 03:41:40 -08:00
Simon Farnsworth
1818b9917f Make it possible to configure a sharded database
Summary:
Sharding filenodes by path should stop us knocking over databases -
make it configurable.

Reviewed By: StanislavGlebik

Differential Revision: D12894523

fbshipit-source-id: e27452f9b436842e1cb5e9e0968c1822f422b4c9
2018-11-05 10:28:40 -08:00
Stanislau Hlebik
ab1c7572cd mononoke: do not panic in blobimport
Summary:
Panic is useless here. It produces huge stack trace which just contains the
main function and makes it harder to debug the actual problem.

Let's just exit in case of errors.

Reviewed By: farnz

Differential Revision: D12912198

fbshipit-source-id: 1faeacfb96765ce047a801f6b072112f10b50b7b
2018-11-03 06:16:53 -07:00
Stanislau Hlebik
693ed31eaa mononoke: make sure there is at most one commit between RC and PROD
Summary:
Add one more restriction to the config repo to make sure we don't forget to
move PROD bookmark

Reviewed By: HarveyHunt

Differential Revision: D12857619

fbshipit-source-id: c4b5e65f2d0b437aad77d8ccc4b4971b60020af4
2018-10-31 07:49:35 -07:00
Stanislau Hlebik
aac38dc828 mononoke: add separate rc and prod config
Summary:
Let's have separate config bookmarks for release candidate and prod.
That will let us customize shadow tier behaviour.

This diff also adds checking of config repo consistency. It requires that RC
bookmark is a descendant of a PROD bookmark. This topology makes it easy to see
what are the changes between PROD and RC, and verification prevents divergence of
configs i.e. sutiations when somebody updated a prod config but forget to
rebase rc config.

Reviewed By: HarveyHunt

Differential Revision: D12857131

fbshipit-source-id: b60d8f7af16e3d530e5edeb22145ec0bd473ffe4
2018-10-31 06:33:29 -07:00
Lukas Piatkowski
cad69fedd0 filenodes: use sqlfilenodes instead of dieselfilenodes; pass myrouter_port around
Reviewed By: farnz

Differential Revision: D10338868

fbshipit-source-id: 60734d9635df442691cad3637aebd5bc838e03ad
2018-10-11 10:52:05 -07:00
Lowik Chanussot
395b124f5d Make get_manifest_by_nodeid accept HgManifestId
Summary: Make get_manifest_by_nodeid accept HgManifestId and correct all calls to get_manifest_by_nodeid.

Reviewed By: StanislavGlebik

Differential Revision: D10298425

fbshipit-source-id: 932e2a896657575c8998e5151ae34a96c164e2b2
2018-10-11 06:50:16 -07:00
Stanislau Hlebik
b298a691ca mononoke: fix changed file calculation
Summary:
One brainless idiot decided to prune all trees from changed files calcualation.
Since it also prunes subtrees, that leaves with just files in the root
directory.

Reviewed By: lukaspiatkowski

Differential Revision: D10302299

fbshipit-source-id: 8fe2c4ad8de998dfd4083d97cd816d85b5fec604
2018-10-11 05:50:48 -07:00
Stanislau Hlebik
a79d9d4a25 mononoke: add pushvars bypasses
Summary: Pushvars is a one more way to bypass hooks. This diff implements it

Reviewed By: purplefox

Differential Revision: D10257602

fbshipit-source-id: 1bd188239878ff917ded7db995ea2453da9f64c4
2018-10-11 05:50:48 -07:00
Stanislau Hlebik
ceba87afec mononoke: add commit message bypasses
Summary:
Let's add a logic to allow users to bypass hooks.

We'll have two ways to bypass hooks. One is via a string in commit message,
another is via pushvars.
This diff implements the first one.

Reviewed By: purplefox

Differential Revision: D10255378

fbshipit-source-id: 31e803a58e2f4798294f7c807933c8e26de3cfaf
2018-10-11 05:50:47 -07:00
Lukas Piatkowski
1d69b1f884 mononoke: add a flag for --myrouter-port, ignore it for now
Summary:
The idea for rollout is to:
- first make sure that Mononoke doesn't crash when a --myrouter-port is provided
- then tupperware configs will be modified to include myrouter as a collocated proces on every host and the port of that myrouter instance will be provided via command line
- lastly land the change that actually talks to myrouter

Reviewed By: StanislavGlebik

Differential Revision: D10258251

fbshipit-source-id: ea9d461b401d41ef624304084014c2227968d33f
2018-10-09 10:21:04 -07:00
Stanislau Hlebik
9685ca7c45 mononoke: actually pass comments
Summary: Fix copy-paste error

Reviewed By: farnz

Differential Revision: D10237928

fbshipit-source-id: 18ecfeefe5506ac51d621d8be0796565d11d3794
2018-10-08 09:06:26 -07:00
Stanislau Hlebik
d95fa203ce mononoke: pass change file type information to hooks
Summary:
Hooks need to know whether file was added, modified or removed. For example, we
can't fetch content of a removed file. Also hook authors may want to allow
modifying existing files of a particular type, but they may want to disallow
addition of new files of this type.

`cs.files()` doesn't give information about whether a file was
added/deleted/modified, so we have to use `get_changed_stream` function from
manifest_utils.

Note - currently it still returns incorrect list of changed files for merges.
It will be fixed in the next diffs.

Reviewed By: farnz

Differential Revision: D10237587

fbshipit-source-id: cd7f76334070cde451b4690071d03275e40c95f3
2018-10-08 09:06:26 -07:00
Tim Fox
debd4a5f95 Integrate hooks into mononoke write path
Summary: Integrate hook manager into the Mononoke pushrebase path

Reviewed By: lukaspiatkowski

Differential Revision: D9896005

fbshipit-source-id: ffd79b539288d95b134af97b776b7fcc3afa0ce7
2018-10-02 07:07:16 -07:00
Pavel Aslanov
e8e5131447 compare hg/mononoke changesets
Summary: This adds `--compare-commits` option for pushrebase replayer. Which also check that commits are close enough to treat them as equal for the purpose of pushrebase.

Reviewed By: StanislavGlebik

Differential Revision: D10084308

fbshipit-source-id: f1fd05173a9a7663125a89dd03b79b2deea40dc4
2018-10-02 03:52:01 -07:00
Simon Farnsworth
cd9679166e cleanup warning: causes has become iter_chain in new versions
Summary: This popped up while I was building Mononoke - fix it.

Reviewed By: StanislavGlebik

Differential Revision: D10126386

fbshipit-source-id: 117239dea88c3ecd921f852ce86691ba6aa8bb07
2018-10-01 07:39:00 -07:00
Stanislau Hlebik
6fe120cd26 mononoke: add all cachelib cmdline args
Summary:
Previously cachelib cmdline args were added only to cmd line binaries, but not
to Mononoke this diff fixes it.

Reviewed By: farnz

Differential Revision: D10083899

fbshipit-source-id: 8febba96561c5ab9a61f60fafc7a7e56985dc038
2018-09-27 08:09:07 -07:00
Simon Farnsworth
1c3f40aaf5 Log a JSON blob to Scribe for every commit to Manifold repos
Summary:
JSON blobs let other users of Mononoke learn what they need to know
about commits. When we get a commit, log a JSON blob to Scribe that other users can pick up to learn what they want to know.

Because Scribe does not guarantee ordering, and can sometimes lose messages, each message includes enough data to allow a tailer that wants to know about all commits to follow backwards and detect lost messages (and thus fix them up locally). It's expected that tailers will either sample this data, or have their own state that they can use to detect missing commits.

Reviewed By: StanislavGlebik

Differential Revision: D9995985

fbshipit-source-id: 527b6b8e1ea7f5268ce4ce4490738e085eeeac72
2018-09-27 04:25:16 -07:00
Shu-Ting Tseng
96a4cec203 replace testing database with xdb.mononoke_production
Summary:
This is mainly generated by

```
fbgs mononoke_test_2 -l -s | xargs sed -i 's/mononoke_test_2/mononoke_production/g'
```

mononoke config repo is still pending todo. But it's ok to do it in several run
as right now 2 names are pointing to the same shard.

Reviewed By: StanislavGlebik

Differential Revision: D9939694

fbshipit-source-id: ded772037844a220b18d99b207c976b88dafdaa5
2018-09-21 06:26:29 -07:00
Anastasiya Zhyrkevich
efb795b14b mononoke: add json flag to mononoke admin tool
Summary: boormarks get <BOOKMARKNAME> --json

Reviewed By: StanislavGlebik

Differential Revision: D9677271

fbshipit-source-id: e57f1ab324dcedfbb18c1f07f01b2cad9db0c1e3
2018-09-06 09:23:20 -07:00
Stanislau Hlebik
0403dba05c mononoke: remove unused options
Reviewed By: lukaspiatkowski

Differential Revision: D9627883

fbshipit-source-id: b235cb272f93178c942ebf662d77ca73c3790a40
2018-09-03 04:06:14 -07:00