Commit Graph

182 Commits

Author SHA1 Message Date
Walter Tetzner
5315a97e2f Allow specifying the RE CAS use-case when setting the objectId
Summary:
We have a concept in Hargow collect Volumettes, which are directories of data. The backend storage for them is the RE CAS, and we would like to be able to mount volumettes using eden.

However, we have our own use-cases, which have their own storage (Manifold buckets and ZippDBs). So to make this work, we need some way to be able to specify the use-case.

We pass the use-case in using a new `--re-use-case` parameter, and store it in a `CheckoutConfig` option under `recas/use-case`.

Reviewed By: miaoyipu

Differential Revision: D41001049

fbshipit-source-id: a4b3d5c602e29a71560d17d3d3802b4b0a5922c0
2022-11-17 07:48:59 -08:00
Katie Mancini
6823a627b6 teach EdenFS to auto migrate folks on Ventura
Reviewed By: xavierd

Differential Revision: D40243654

fbshipit-source-id: d5c19a8e1be2db1075f1e21c96816a5902dc9ee7
2022-10-20 11:24:07 -07:00
Michael Cuevas
79b143db02 add lazy flag to umount suggestion
Summary: if the mount is busy when we run `sudo umount`, users will need to pass the lazy flag as well. Let's suggest it by default since it doesn't hurt

Reviewed By: genevievehelsel

Differential Revision: D40477030

fbshipit-source-id: 03539cd0418232c92942359435cfc5497355800f
2022-10-19 17:56:18 -07:00
Moti Zilberman
8f0de56219 Allow setting and querying case-sensitivity
Summary:
Currently, the case-sensitivity of an Eden checkout is set at clone time based on the OS: Linux = case-sensitive, macOS and Windows = case-insensitive. This works fine but leads to patchy integration test coverage of case-sensitivity features, since coverage is tied to the OS the tests happen to be running on. Relatedly, there's no clean way to query the case-sensitivity of an existing checkout other than reaching into `config.toml`.

Here we introduce a pair of hidden `eden clone` flags to allow changing case sensitivity, and add a `case_sensitive` boolean field to the output of `eden info`. Because we don't want end-users to rely on this, setting case sensitivity to anything other than the default on each platform triggers a warning.

I will use this in a separate diff to refactor certain existing integration tests (namely `casing_test` and parts of `glob_test`) to run with all possible case-sensitivity settings on every platform.

Reviewed By: xavierd

Differential Revision: D40180643

fbshipit-source-id: 4b4c935f3c9bb40f8e3564383a91dc38ea25eab5
2022-10-17 13:02:28 -07:00
Muir Manders
29d29e0f14 cli: support ".sl" repos
Summary: Add basic support to sniff ".hg" vs ".sl" dot dir, and otherwise default based on env vars.

Reviewed By: quark-zju

Differential Revision: D39900481

fbshipit-source-id: d9900755f54711a9d067d8fd65f2fc25aa278a7a
2022-10-07 13:57:40 -07:00
Michael Cuevas
ab6f7ac212 bail early when we hit an unmount timeout/exception
Summary:
Removing state underneath a running EdenFS mount is a bad idea. In the past, we rarely hit the timeout so this was fine. We've now seen more and more people hit this timeout (due to thrift queue timeouts).

Let's avoid messing up the EdenFS state even further and instead give users methods for remediating a hanging mount.

Reviewed By: fanzeyi

Differential Revision: D40113414

fbshipit-source-id: 35f2c11717be346d2c14b3392a7ee6d98b603483
2022-10-06 19:19:25 -07:00
Michael Cuevas
1476e6d83b raise unmount thrift call timeout for eden rm
Summary: Unmounting can take some time (especially since we're seeing frequent thrift queue timeouts). Let's raise the timeout a bit and give the user a warning message that it may take longer than usual.

Reviewed By: fanzeyi

Differential Revision: D40113277

fbshipit-source-id: d96d909d8ff66e23d2f7862584a3d0556aecc72d
2022-10-06 19:19:25 -07:00
Michael Cuevas
407c4882e6 revive code for removing non-edenfs mounts with eden rm
Reviewed By: genevievehelsel

Differential Revision: D40078704

fbshipit-source-id: dab5801607868000f246dfc7b8d364f4d6781499
2022-10-06 19:19:25 -07:00
Praveen Kumar Ramakrishnan
9f2b9bfadd Http backend type in eden cli
Summary: Adding http backend in the eden server and cli. Following recas as a template.

Reviewed By: chadaustin

Differential Revision: D39641932

fbshipit-source-id: ff840fb9603b2b9d794da53d5b0df50ee7ebcb1e
2022-09-30 12:41:17 -07:00
Katie Mancini
6c98347bfc make clone respect starting eden
Summary:
eden clone trys to start eden if it isn't healthy. starting doesn't count as
healthy. lets wait for eden to start instead of starting it in clone.

This should get rid of more flock errors on windows and some sort of pid file
error on linux and mac as well. Xavier just noticed this flock error today.

There might be more of these healthy/starting check issues in the cli. will
audit for them.

Reviewed By: xavierd

Differential Revision: D39765586

fbshipit-source-id: 8949ccb7d4bbba8ee8df607d37c767b055113398
2022-09-29 15:41:53 -07:00
Mark Shroyer
e0779babd3 Fix rage pastry title's hostname substitution
Summary:
The default rage.reporter config assumes shell substitution of `$(hostname)`,
but as implemented this doesn't work.  So pastries created by `eden rage` all
have the same title `eden rage from $(hostname)`.

This change enables `{hostname}` variable (not shell) substitution for `eden
rage`.

Side note, it looks like we popen the rage.reporter in at least three different
places:

- https://www.internalfb.com/code/fbsource/[dcfed651fdd7]/fbcode/eden/fs/cli/main.py?lines=2024
- https://www.internalfb.com/code/fbsource/[dcfed651fdd7]/fbcode/eden/fs/cli/rage.py?lines=312
- https://www.internalfb.com/code/fbsource/[dcfed651fdd7]/fbcode/eden/fs/cli/facebook/rage.py?lines=265

The instance in main.py is the only one that seems to be invoked when running
`eden rage`.  Are the others dead code?

Reviewed By: fanzeyi

Differential Revision: D39709054

fbshipit-source-id: 6c5a45bf948b00cd730fbb065095b995e27011f6
2022-09-21 16:55:38 -07:00
Xavier Deguillard
c16653cd76 cli_rs: add a --clean-orphaned option
Summary:
This will only clean the orphaned redirections. This will be used in a nightly
script to clean all the orphaned redirections on a periodic manner
automatically instead of having users run `eden du --clean` manually.

Reviewed By: MichaelCuevas

Differential Revision: D39488493

fbshipit-source-id: 2146aa1aea6b7a4fda129f7676dba577eb14050e
2022-09-14 10:27:48 -07:00
Mark Shroyer
832520f857 Add edenfsctl --checkout-dir flag
Summary:
Adds a flag to edenfsctl to let us specify a checkout directory outside our current working directory. This is necessary if we're going to use `buck2 run edenfsctl` as an `eden-dev` replacement, since buck requires us to run from the source directory, which may be different from the checkout we want edenfsctl to operate on.

With this change, we can approximate `eden-dev` like this:

```
% buck2 run edenfsctl -- --config-dir=$HOME/local/eden-dev-state --checkout-dir=$HOME/fbsource-dev trace fs
```

This is implemented by altering both the Rust and Python entry points to accept the new flag and change to the given directory.

Reviewed By: xavierd

Differential Revision: D38961247

fbshipit-source-id: 814306871ebf01f1cabab87c98e85adce68b4ac8
2022-08-30 12:35:27 -07:00
Vladimir Oster
2a708a085e Adding progress bar to eden rm
Summary:
We would like to improve the UX of the *eden rm* command. The *eden rm* command seems to "hang" from the users' perspective when it is performing a large task such as deleting a large directory tree in a repo that has been crawled in for some or other reason. This diff introduces a couple of print outs to indicate what the command is doing, and is introducing a progress spinner for the *rmtree* command.

Since the *shutil.rmtree* command is a black box, we can take advantage of the internal recursive behavior and produce a spinner that spins as long as the command keeps executing.

Reviewed By: xavierd

Differential Revision: D38754866

fbshipit-source-id: d04b403baa8c2de00c11e3f4f851605afc099ba6
2022-08-18 22:09:49 -07:00
Zeyi (Rice) Fan
220e55fec8 doctor: improve doctor error reporting
Summary:
It is often hard if any eden doctor checks failed in the middle and hard to debug where it went wrong.

This diff adds some error context and improves how we report these exceptions so we can see where it is originated from.

Reviewed By: xavierd

Differential Revision: D38593356

fbshipit-source-id: 322f17a8f6290ba7c38ede0cf9f125341a3f83f2
2022-08-10 20:23:28 -07:00
Yipu Miao
005dbebae8 Enable RECAS backingstore on Mac
Summary: Enable RECAS backing store on Mac. This seems working.

Reviewed By: genevievehelsel

Differential Revision: D38373195

fbshipit-source-id: 201f056b67a9b2ab6bd90c8a35a7fc8b43dbf07c
2022-08-03 10:50:52 -07:00
Genevieve Helsel
7228d7080c Back out "Make 'eden rm' remove normal directories as well"
Reviewed By: MichaelCuevas

Differential Revision: D37797673

fbshipit-source-id: 29ed9cc907d91b5c3686e9710918e11993429445
2022-07-12 14:49:39 -07:00
Durham Goode
98aae84004 Make 'eden rm' remove normal directories as well
Summary:
Users get confused about when to use eden rm and when to use rm -rf.
Usually they just want a big hammer that gets rid of a repository, so let's make
'eden rm' do 'rm -rf' if necessary.

Reviewed By: xavierd

Differential Revision: D37390756

fbshipit-source-id: 9484026b6df94561f05a9ca5f5c10c8ee65f131d
2022-07-06 15:53:53 -07:00
Yipu Miao
c36dcf8de2 Do not enable use_write_back_cache for RECAS
Summary: There is an issue on write_back_cache for flash disk, that might cause builds very slow so disable for now.

Reviewed By: genevievehelsel

Differential Revision: D37510215

fbshipit-source-id: 6246682f8ce78766d1cd4599854f6b565d4474c5
2022-06-29 13:40:50 -07:00
Chad Austin
fa70a35dc4 opt into strict pyre by default
Summary: Files that don't pass pyre strict are annotated with # pyre-unsafe

Reviewed By: xavierd

Differential Revision: D37160746

fbshipit-source-id: 9701cada3c8afc80f3b65e770120ce8bf66d3a10
2022-06-16 14:28:49 -07:00
Michael Cuevas
a47af72deb Back out "add rage report hint"
Reviewed By: kmancini

Differential Revision: D36173381

fbshipit-source-id: db9e2f13f3ea428a8970e120c129e02391f02f4d
2022-06-02 16:03:02 -07:00
Yipu Miao
b77889fa21 Add a Checkout config to enable FUSE writeback cache feature
Summary: Enabling FUSE_WRITEBACK_CACHE will help writing performance on Eden.

Reviewed By: chadaustin

Differential Revision: D35910286

fbshipit-source-id: d3a8a6194adaca2dcc090db3ec892129c1eaa759
2022-05-16 16:01:59 -07:00
John Reese
2940ae3a2a apply import merging for fbcode (4 of 11)
Summary:
Applies new import merging and sorting from µsort v1.0.

When merging imports, µsort will make a best-effort to move associated
comments to match merged elements, but there are known limitations due to
the diynamic nature of Python and developer tooling. These changes should
not produce any dangerous runtime changes, but may require touch-ups to
satisfy linters and other tooling.

Note that µsort uses case-insensitive, lexicographical sorting, which
results in a different ordering compared to isort. This provides a more
consistent sorting order, matching the case-insensitive order used when
sorting import statements by module name, and ensures that "frog", "FROG",
and "Frog" always sort next to each other.

For details on µsort's sorting and merging semantics, see the user guide:
https://usort.readthedocs.io/en/stable/guide.html#sorting

Reviewed By: lisroach

Differential Revision: D36402162

fbshipit-source-id: 6d180e9003d466c4f866fc9d454c6531766ca1dd
2022-05-15 12:53:03 -07:00
Zeyi (Rice) Fan
3fa3d40548 cli: various improvements to eden rm
Summary:
- Ignore encoding errors when parsing output from `handle.exe`
- Split cleanup and destroy mount, so the error message makes more sense.
- Print exception stacktrace if `--debug` is passed in `eden rm`.

Reviewed By: chadaustin

Differential Revision: D36210915

fbshipit-source-id: 71f2541aae62902ef9d6aac9b233f1ff59580e73
2022-05-11 19:30:27 -07:00
Michael Cuevas
0c581d8c35 add rage report hint
Reviewed By: kmancini

Differential Revision: D36173251

fbshipit-source-id: 97e950647be04afdd14a9b60a59e3c0cb540d1de
2022-05-09 15:08:05 -07:00
Michael Cuevas
23fd6f25d0 add --press-to-continue flag to edenfsctl commands
Summary:
When an `edenfsctl` command is invoked from the E-Menu, a PowerShell Window is opened and is immediately closed once the command finishes. This makes it hard/impossible for the user to see the command's output.

The desired behavior here is to keep the Window open long enough for the user to acknowledge the output. I did this by adding a `--press-to-continue` flag to all `edenfsctl` commands. This will mainly be used by the E-Menu, but may have uses elsewhere.

Reviewed By: chadaustin

Differential Revision: D36137709

fbshipit-source-id: a46bebb5bb5820949cd4b70579a29406afb34048
2022-05-04 21:20:06 -07:00
Xavier Deguillard
cb0d447098 service: goodbye systemd
Summary:
Our systemd code is unused, and is causing a bunch of tests to fail. In the
case where systemd is needed again in the future, its shape will be
significantly different than what we have today, so there even less need to
keep this version around.

Reviewed By: fanzeyi

Differential Revision: D35829902

fbshipit-source-id: 6013f5fe7c3debdcfbb9929d2748819a96403fe7
2022-04-28 09:18:22 -07:00
Michael Cuevas
c75d54ab68 let users know when they try to remove a non-existent directory
Summary: Typoing a path with `eden rm` would tell users that there isn't an existing checkout with that name. That can be confusing. Instead, we should be more specific and let users know when they typo'd

Reviewed By: kmancini

Differential Revision: D35690339

fbshipit-source-id: 8d2bae48d3bb3724cd6c1b4049af3df71c04a287
2022-04-27 00:06:24 -07:00
Zeyi (Rice) Fan
fc5f91a30e cli: do not start if the current daemon is already starting
Summary:
When EdenFS is starting, `eden start` will attempt to start another EdenFS daemon then it will get a flock error.

On Windows, sometimes we saw a long EdenFS startup process, and this behavior misleads people to think they are not able to start EdenFS.

Reviewed By: xavierd

Differential Revision: D35799954

fbshipit-source-id: 5f58e3ad89962f61d233f962a3e464fe55a9cd8b
2022-04-25 21:36:06 -07:00
Michael Cuevas
6e6321099b add report option to eden rage
Summary: This will be used in a later diff to give users a "one click" report option.

Reviewed By: chadaustin

Differential Revision: D35330514

fbshipit-source-id: 0d9f3987d788d21cebc71afc796c252eb71028a3
2022-04-25 16:44:06 -07:00
Zeyi (Rice) Fan
8e952af34e cli: do not suggest cd trick after restart on Windows
Summary: This trick doesn't matter on Windows, so let's not suggest it on Windows.

Reviewed By: chadaustin

Differential Revision: D35820427

fbshipit-source-id: 44c1d0373d20d921fa55a8edf7e3d9565682a609
2022-04-21 18:45:10 -07:00
Zeyi (Rice) Fan
3f8d38c374 attempting to stop internal daemon when shutting down EdenFS
Reviewed By: chadaustin

Differential Revision: D35150381

fbshipit-source-id: 0f3dcc785a430635322c4752ea22ece759e843df
2022-04-20 20:02:11 -07:00
Xavier Deguillard
9b18fad80d config: add reset state in SNAPSHOT
Summary:
In order to properly support reset on Windows, EdenFS needs to keep track of
both the checked out revision, and the reset one. Since this state needs to
persist across EdenFS restarts, we'll need to store it in the SNAPSHOT file.

This diff merely adds support for this new SNAPSHOT format, but doesn't write
it.

Reviewed By: chadaustin

Differential Revision: D35448641

fbshipit-source-id: 59fbafdadc885dfec8efd119c4fe1ff582987af0
2022-04-11 12:53:30 -07:00
Xavier Deguillard
d6f5cad598 cli: remove implementation of eden strace
Summary:
This is the same as `eden trace fs`, redirect people to that. The command will
simply be removed later.

Reviewed By: fanzeyi

Differential Revision: D35483104

fbshipit-source-id: bdacda6c5e6f9d8d809f44b64b1178aacbee4228
2022-04-08 12:09:27 -07:00
Zeyi (Rice) Fan
7b95b98626 cli: compatibility with older Python 3
Summary:
Certain users have older Python 3 version installed and it would cause issues on these machine.

This diff fixes them.

Reviewed By: kmancini

Differential Revision: D35150380

fbshipit-source-id: e230b6990114ef1835724aa34e4307873b34b93f
2022-04-01 12:53:44 -07:00
Zeyi (Rice) Fan
751eae02eb cli: allow eden rm to remove unknown directories that failed cleanup
Summary:
Some times, when user failed their `eden rm` on Windows because of files being in use by other process. They would try to run the same `eden rm` command again. It wouldn't work because the mount point is no longer an EdenFS directory so we bail out.

This has confused our user a bit and this diff will allow `eden rm` to detect if the path is a previously EdenFS mount on Windows, and continue the clean up process.

Reviewed By: xavierd

Differential Revision: D34794411

fbshipit-source-id: eaa86390257412daf80908bf88559b8f639c7a36
2022-03-15 10:34:19 -07:00
Yipu Miao
211e0f9dc5 Ignore redirection for nested mount
Summary: Currently eden redirection list will list all redirections include its nested mounts and redirection in the nested mounts. It is better to ignore the nested mounts and redirection in the nested mounts if list redirection from its ancestor mount.

Reviewed By: chadaustin

Differential Revision: D34156017

fbshipit-source-id: ba3ed5e6b5c79b4a62034f5f8563705cf886a44d
2022-03-11 17:05:00 -08:00
Zeyi (Rice) Fan
94199ba4b9 cli: allow edenfsctl to show tracekback when configured
Summary:
Sometimes on Windows, we receive user reports that `edenfsctl` hangs indefinitely. We would like to see where it hangs in these cases. Adding this will allow us to see the traceback when ctrl-c edenfsctl with the environment variable set.

Note `--debug` is shared with Rust edenfsctl (where it enables verbose logging).

Reviewed By: xavierd

Differential Revision: D34731381

fbshipit-source-id: 24477d05c01d353f9f7a45fc3c5d28f29b62e3be
2022-03-10 11:15:37 -08:00
Xavier Deguillard
e2e886df96 cli: codemod Eden to EdenFS
Summary:
Let's be consistent and use EdenFS everywhere in our user facing documentation
and messages.

Reviewed By: fanzeyi

Differential Revision: D34692175

fbshipit-source-id: 6346bd9ac3516199fe47123d81833d2c457efbbc
2022-03-07 18:41:29 -08:00
Zeyi (Rice) Fan
5bc49f102d windows: fix asyncio bug
Summary:
On Windows, the default asyncio event loop would throw an exception on tear down.

This diff fixes that by opting to the older event loop. The older event loop doesn't support subprocess but it doesn't look like we use it anyway.

https://stackoverflow.com/a/62413786/694963

Reviewed By: xavierd

Differential Revision: D34486221

fbshipit-source-id: 765056f1e82c9a53d89482527725154445e59494
2022-02-28 16:20:34 -08:00
Pyre Bot Jr
8643478791 Add annotations to eden
Reviewed By: shannonzhu

Differential Revision: D34331483

fbshipit-source-id: 5f4c543cba2a9b1b02af10bec55fd42d6dd0b322
2022-02-17 21:40:17 -08:00
Katie Mancini
db1a5e8d10 easy nfs\fuse migration
Summary:
macFUSE support on apple is going away soon. If macFUSE breaks for folks,
they will need to migrate to NFS. This makes the migration a one command step.

In case folks see any issues with NFS during our migration we also have
an option to migrate back to fuse. This will temporarily unblock them
while we fix any bugs that come up.

Reviewed By: xavierd

Differential Revision: D34081417

fbshipit-source-id: ea89345b5ccc019cbfe6387a1dfa366ae9dd6345
2022-02-14 20:52:39 -08:00
Pyre Bot Jr
bb5656edfc Add annotations to eden
Reviewed By: shannonzhu

Differential Revision: D34217873

fbshipit-source-id: 93794c9e7e63d12b709fca1d636e71916ef0eb5c
2022-02-14 12:17:43 -08:00
Xavier Deguillard
a29d465ee8 fs: fix license header
Summary:
With Facebook having been renamed Meta Platforms, we need to change the license
headers.

Reviewed By: fanzeyi

Differential Revision: D33407812

fbshipit-source-id: b11bfbbf13a48873f0cea75f212cc7b07a68fb2e
2022-01-04 15:00:07 -08:00
Xavier Deguillard
43d9a4f011 cli: remove unecessary hg cat when cloning
Summary:
On clone, the CLI tries to open an .arcconfig file at the given revision for
the solve purpose of printing a slightly different log message. Since this log
isn't necessary to be present, let's avoid the `hg cat` and simplify the code a
bit on top of making it faster.

This should make cloning a couple of seconds faster on Windows due to Mercurial
taking roughly a second to start.

Reviewed By: chadaustin

Differential Revision: D33070099

fbshipit-source-id: 81c5cba8348d0c8d82c57a6656e6eb79c2b1f878
2021-12-14 09:04:58 -08:00
Michael Cuevas
7dc2726981 add nested checkout restrictions to eden clone
Summary:
By default, we do not want to support nested checkouts. Their behavior is not well defined and can cause issues.

This diff disallows nested checkouts unless specifically requested by users. They can use the --allow-nested-checkout or -n flags to force nested checkout creation. If these flags are not used, the clone is aborted and an error message is printed.

Reviewed By: chadaustin

Differential Revision: D32514269

fbshipit-source-id: d04a7ef82c6d31993801648da42e4182167f37e6
2021-12-10 11:07:32 -08:00
Xavier Deguillard
9dd8d50e98 cli: when printing mounts, always use forward slash
Summary:
On Windows, printing paths by default use backward slashes, but forward
slashses are also acceptable. For the sake of making tests pass, let's always
use forward slashes.

Reviewed By: chadaustin

Differential Revision: D32960607

fbshipit-source-id: c1424c4a090d805bab337fc6d540563e8205e5dc
2021-12-08 15:45:17 -08:00
Xavier Deguillard
0a820ed7d0 config: remove overlay.enable_tree_overlay
Summary:
This config has been enabled for many months now, let's simply assume it is set
to true on Windows.

Reviewed By: genevievehelsel

Differential Revision: D32192585

fbshipit-source-id: 76829a031f859594a5139dd09a6479cabeda2089
2021-11-10 10:03:52 -08:00
Grace Ku
34fce2383c cli_rs: Scaffolding for minitop subcommand
Summary:
As a first step, as I ramp up on Rust and the edenfsctl codebase and in order to more quickly support basic top functionality in windows, we're adding a minitop subcommand that will have a subset of the `eden top` output.

This diff adds scaffolding for the minitop subcommand.

Reviewed By: fanzeyi

Differential Revision: D31841478

fbshipit-source-id: 7020e81a0c8021bad45de835f2e279c049b76200
2021-10-21 16:16:29 -07:00
Katie Mancini
864a6c1c1a make eden removal on windows a bit more graceful
Summary:
When eden is not running on windows `eden rm` will spit out some error
messages and exits with error code 1. But it does actually successfully
remove the repo.

On linux removing a repo while eden is not running behaves just like if
eden were running.

Let's make the removal more graceful on windows.

Reviewed By: xavierd

Differential Revision: D31519805

fbshipit-source-id: d393922a9474e64251142207ae38a602766f17bf
2021-10-12 10:22:05 -07:00