Summary: `hg gc` can now clean things up there, so suggest that.
Reviewed By: quark-zju, fugalh
Differential Revision: D19413816
fbshipit-source-id: 1c6c08ed9fb4757390883d908531d9b3a7da302d
Summary:
The intent is to allow macOS to make a best effort attempt
to detach any disk images associated with redirections.
D18795800 taught redirect to detach rather than a simple unmount,
and we need to give it an opportunity to detach when we unmount
gracefully so that all resources are released on shutdown.
The implementation of this diff ties into the same mechanism that
we use to shutdown the buck daemon when we unmount or restart which
has the nice side effect of showing the output from the underlying
`eden redirect unmount` command.
In an earlier iteration of this diff I tried making the server code
run `eden redirect unmount` but it happened too late in the process
to be effective: the thrift server had already been torn down in the
shutdown case and we need privs to perform the unmount.
Reviewed By: pkaush
Differential Revision: D18804080
fbshipit-source-id: 0b409130752121c56a46c9b2e46b50e5abee8200
Summary:
The Python 3 zipapp module always exits with return code 0 if the main
function returns. Therefore we need to add our own wrapper function that
handles calling `sys.exit()` if we want to exit with a non-zero status.
Reviewed By: wez
Differential Revision: D17678021
fbshipit-source-id: 5944c75d8e765ab3e3fa038fa6f2eee95ab0e780
Summary:
The sparse images that we mount in place of bind mounts on macos
can grow over time, and don't automatically shrink if their contents are
purged.
This commit teaches `eden gc` to run `hdiutil compact` on these images
to reclaim space.
The output from `hdiutil compact` is really verbose and noisy, so we
suppress it unless there is an error.
Reviewed By: simpkins
Differential Revision: D17254235
fbshipit-source-id: 944b3824717c8b46d8170ec729c04a93323ab7f0
Summary:
We're seeing an issue where for an Eden instance started
as root a subsequent chown doesn't chown the root of the bind mount
and thus makes it impossible to write into the directory.
Reviewed By: simpkins
Differential Revision: D17620135
fbshipit-source-id: 4ee511234c551bbfc7330a60ee85fc5efd329d73
Summary:
`require_checkout` returns an EdenCheckout, so infer_client_from_cwd
is no longer required.
Reviewed By: wez
Differential Revision: D17485008
fbshipit-source-id: b6ff6d4b28a48b56bd56fe7116313d6a64642f1e
Summary:
When passing a non-Eden path to `eden info`, it would spit out a
Python stack trace. Fix that by using the standard checkout lookup
code.
Reviewed By: wez
Differential Revision: D17484897
fbshipit-source-id: beae64c4aa81af201e7560b44f0d103196e4ab35
Summary:
Add a flag to cause `eden start` to exit successfully without doing anything
if EdenFS is already running. This flag makes it slightly easier for
automation to ensure that EdenFS is running, without logging warnings if
EdenFS was already running.
I also cleaned up the error message slightly when `eden start` is used
without this flag and fails if EdenFS was already running. Previously the
exception thrown was unhandled so it also printed a python backtrace. Now the
code throws an exception that is caught by the higher level command line code,
so it is printed in a more user-friendly way.
Reviewed By: wez
Differential Revision: D17440486
fbshipit-source-id: d7661ef7be7159bf5542b20e99a0b5495690e5a2
Summary:
It's possible that status includes ignored files from
the overlay that are no longer accessible because a bind mount
is overlaid on top of the overlay!
Ideally we'd account for the space occupied by those files,
but for now we'd rather not error out when attempting to stat
them, so silently ignore that class of error.
Reviewed By: chadaustin
Differential Revision: D17415965
fbshipit-source-id: 96d467ee4e85ad5bdc730e4cfffe4c15a83a12ed
Summary: This makes it a bit more human friendly
Reviewed By: chadaustin
Differential Revision: D17249465
fbshipit-source-id: 40d5afc77ded34237e1860d5b91e9257a732e480
Summary:
D17236366 will disable the getBindsMount thrift call and
remove the internal source of data about bind mounts. We instead
have a more current set of data from the `redirect` command, so
tech `eden chown` to use that data.
Reviewed By: chadaustin
Differential Revision: D17249433
fbshipit-source-id: 853f24e729814c501768e9834765e1be283d6aac
Summary:
Understanding disk usage and cleaning it up is a relatively frequently
asked question, and users are often shocked that "eden is using so much space"
when the reality is that they're just seeing the aggregate from a `du` command
that includes their build artifacts from their bind mounts.
This diff adds `eden du` as a friendly utility that helps to break down the
disk usage into meaningful categories and gives some hints on how to reclaim
space.
Reviewed By: chadaustin
Differential Revision: D17252322
fbshipit-source-id: 7348692c95cd319ca315c5be466b397b4969971d
Summary:
Update the `eden prefetch` code to use the `require_checkout()` function,
which correctly finds the correct EdenFS instance that is serving this
checkout. Previously the prefetch logic found the default EdenFS instance,
which may be different from the one that was serving the specified checkout.
Reviewed By: wez
Differential Revision: D16878489
fbshipit-source-id: fed366df61960b5b87399bcd1d2f3f79aefc8dba
Summary:
our argparse stuff was configured to require 1+ patterns
which meant that an invocation like:
```
echo 'fbcode/eden/fs/TARGETS' | eden prefetch --pattern-file /dev/stdin
```
would emit:
```
eden prefetch: error: the following arguments are required: PATTERN
```
the workaround was to specify a dummy pattern argument.
This diff fixes up the argparse config to make the pattern argument be 0+ patterns.
Reviewed By: pkaush
Differential Revision: D16831732
fbshipit-source-id: 93cb4c4677b1af8b9d4824bcad60708c40867375
Summary:
This was an unanticipated casualty of some unicode vs bytes
work in the past, and we hadn't gotten around to fixing this... until now!
Reviewed By: pkaush
Differential Revision: D16831603
fbshipit-source-id: dd38751e6d0b1c242937a7dbb150f3aa15d1c8ae
Summary: On POSIX system we use InodeTree structure to implement prefetch. These structures are missing on the Eden Windows. We will instead use mercurial's prefetch to prefetch the contents for us.
Reviewed By: strager
Differential Revision: D16742336
fbshipit-source-id: db0a389503cb98469707c07b6da412056f4dd72e
Summary: Until now we were running Edenfs on the console. Now we could use edenfsctl start.
Reviewed By: chadaustin
Differential Revision: D16565624
fbshipit-source-id: 9a12e52234d36d7b8ce4e3741ffb62655ae334b2
Summary: The Windows and Mac cli build scripts were not building the new fb303 thrift file. Also updated few cli code to use the new fb303 module.
Reviewed By: chadaustin
Differential Revision: D16508590
fbshipit-source-id: 386fa1bf77124d258ffb00edf56c9c827f32e795
Summary:
Enable the `edenfsctl debug` subcommands on Windows.
The `overlay` subcommand is the only debug subcommand that requires modules
not available on Windows. The overlay code uses the `fcntl` module for
locking the overlay. However, EdenFS on Windows does not use the overlay
directory structure used on Linux and Mac, so this subcommand isn't relevant
on Windows.
This moves the `overlay` subcommand to its own module, and changes the code to
avoid importing it on Windows. This lets us enable the rest of the debug
subcommands on Windows.
Reviewed By: pkaush
Differential Revision: D16354620
fbshipit-source-id: ee7ea01fa3a21018850f5ba590eb143d7a9718cf
Summary:
Centered clock between title and hostname
Removed bar
Defaulted update speed to 1s, with command line option to change
Gave more/less space to certain columns
Decreased padding to 1 character
Reviewed By: chadaustin
Differential Revision: D16195428
fbshipit-source-id: 6dbd6710727bcd3e65e87fc5bd269a39507dca9b
Summary:
I made the mistake of migrating the Thrift API for edenfs process
checks without a fallback for older edenfs running processes.
If getDaemonInfo() is not available, fall back on getPid().
Reviewed By: strager, pkaush
Differential Revision: D16365848
fbshipit-source-id: aee5c43c8c40db9a38fef7ca601f7639daa4adb8
Summary:
Open source fb303 will not have getPid() or getCommandLine(), so
introduce a new method for Eden's tests.
Reviewed By: fanzeyi
Differential Revision: D16292993
fbshipit-source-id: 5cdc006ec0ee15f50a3e1cebe9b46a3ea275ff78
Summary:
`eden top` used to refresh its data every 2 seconds, now process data accumulates and never leaves the screen (unless it is outdated and gets pushed off the screen by other processes).
For the old functionality, you can run `eden top -e` or `eden -top --ephemeral` which constantly refreshes the screen.
{F166770061}
Reviewed By: chadaustin
Differential Revision: D16157909
fbshipit-source-id: 5d739b4c92d1472337301f34dbf6b1f21e10b81b
Summary: Made a top class to better handle state within `eden top`. Right now, the only field is `running`, but later we will want to track the processes and rows.
Reviewed By: strager
Differential Revision: D16188183
fbshipit-source-id: 38e27dc87353f65212fcb47544707a8e34ba4c68
Summary: Taking out debug and rage (which internally imports debug) from Windows. To make debug comply it would take a bunch of ifs.
Reviewed By: strager
Differential Revision: D15997869
fbshipit-source-id: 1ce46c30d00201b351c8fe9100dcef5a490b5a6c
Summary:
This is part of the effort to make our bind-mount configuration more
visible and easier to change.
The idea is to generalize the concept of redirection and add a command to help
manage it.
The `eden redirect add` subcommand allows creating one of two different kinds
of redirection:
* `bind` - allocate some space using `mkscratch` and mount it into the repo
* `symlink` - allocate some space using `mkscratch` and create a symlink
that points to it from the repo
On Linux we use bind mounts to implement `bind` but on macOS, which doesn't
have a bind mount concept, we create a sparse disk image file that can grow
to match the size of the disk on which it is created (in practice these are a
7-15MB in size to start and grow as the user stores data into them).
The `eden redirect del` subcommand allows removing a redirection, including
the legacy `bind-mounts` configuration from `.eden/client/config.toml`.
The `eden redirect list` subcommand lists the effective set of redirections,
both from the new redirections configuration and the legacy `bind-mounts`
configuration, along with their state.
The `eden redirect fixup` subcommand iterates over the effective set of
redirections and can remove and reinstate any that are in a broken state.
Reviewed By: strager
Differential Revision: D15707319
fbshipit-source-id: a5dd8c44c9f748482d7b48855b1305d44267885c
Summary: We don't import fsck_mod on Windows. Hiding the fsck_mod.Error from python to make edenfsctl status work on Windows.
Reviewed By: strager
Differential Revision: D15912061
fbshipit-source-id: 918fd3cc5729b0c98b098de7c85bb340cdb1ca05
Summary:
Update the copyright & license headers in Python files to reflect the
relicensing to GPLv2
Reviewed By: wez
Differential Revision: D15487088
fbshipit-source-id: 9f2138dff41048d2c35f15e09a04ae5a9c9c80dd
Summary: Remove a number of unused imports detected by the linter.
Reviewed By: wez
Differential Revision: D15776268
fbshipit-source-id: 221f45d275664d037bbabcac9858b40266b4833e
Summary:
With systemd integration enabled, if edenfs is running, or if edenfs' systemd service is active, `edenfsctl start` does nothing. This behavior differs from `edenfsctl start` with systemd integration disabled, and can cause `edenfsctl restart` to think that it successfully started edenfs.
Make `edenfsctl start` fail if edenfs is running and healthy, or if edenfs' systemd service is active (yet edenfs is unhealthy).
Reviewed By: chadaustin
Differential Revision: D15703310
fbshipit-source-id: ce0a13780ee03de1f896a938d002901023e5bdd3
Summary:
get_edenfs_start_cmd checks if edenfs is already running, and fails if it is. Most of the time, this check is redundant. This function is effectively called in five places:
* `edenfsctl start`
* `edenfsctl clone` if not running
* `edenfsctl restart` (`_graceful_restart`) with takeover=True
* `edenfsctl restart` (`_start`) if not running
* `edenfsctl restart` (`_finish_restart`) after stopping edenfs
The check is only necessary in one of these places (`edenfsctl start`). Move the check.
This refactor will allow us to run the check if systemd is enabled without duplicating code.
This diff should not change behavior (ignoring unimportant race conditions).
Reviewed By: simpkins
Differential Revision: D15703308
fbshipit-source-id: cbd4a70a3e0eb23da0d65d641d89a5ac022cd79f
Summary:
Update `eden start` to treat the `--gdb` argument like `--foreground`, and
always start in non-systemd mode, even if this would be the default otherwise.
The `--gdb` flag automatically implies `--foreground`
Reviewed By: wez
Differential Revision: D15492158
fbshipit-source-id: 89d65f7aef8c31131c7d95e054995df8a138cc41
Summary:
This diff just stubs out some functions that were either
not present or that were doing linux specific things that would
error out when attempted on macOS.
This diff doesn't implement macOS equivalents of the functions;
each of those can be tackled separately in follow up diffs.
Reviewed By: simpkins
Differential Revision: D15453050
fbshipit-source-id: 228044fc416d9170a4ba3aef6cd9b40194707f17
Summary:
Update `eden start` to honor the `--if-necessary` flag even when starting
with systemd.
Reviewed By: chadaustin, strager
Differential Revision: D14356541
fbshipit-source-id: b7c12b11a2fd63eeee84026bf4418702f794cbf0
Summary:
Update most of the `eden/cli/config.py` to use `Path` instead of `str` where
appropriate. This also updates several of the APIs in `util.py` that were
affected as well.
Reviewed By: chadaustin
Differential Revision: D14356543
fbshipit-source-id: a8f6d15b8870bf689eeb78f9fc0e9a0c65c97218
Summary:
Remove the `CheckoutConfig.hooks_path` attribute which is no longer used
anywhere.
Reviewed By: strager
Differential Revision: D14356542
fbshipit-source-id: 28b7e7aeb197aeb5d04edf8adfdcfe7946ffa0c7
Summary:
If no mounts are configured `eden fsck` previously threw an exception when
trying to compute the return value. It called `max(return_codes)` on an empty
return codes list, which would fail. This changes the code to handle that
code specially and report a warning that there was nothing to check.
Reviewed By: chadaustin
Differential Revision: D14352112
fbshipit-source-id: 3815ef34a12834d642f3eee867dda6dc1117c2ef
Summary:
Update the fsck `check_all()` function to use the newer
`EdenInstance.get_checkouts()` API instead of the older, internal
`_get_directory_map()` method.
Reviewed By: chadaustin
Differential Revision: D14352113
fbshipit-source-id: f1ceae72747833d89d5afd11da585ba96b5615a4