Skip to content

Commit

Permalink
Add some docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Jeffery committed Jun 26, 2023
1 parent 38c9b34 commit ae788a2
Show file tree
Hide file tree
Showing 9 changed files with 366 additions and 341 deletions.
31 changes: 31 additions & 0 deletions BUILDING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Building

## Datastore binaries

We assume that you have a working `nix` install, with the `nix-command` and `flakes` features enabled.
This can be enabled by creating a file at `~/.config/nix/nix.conf` with the content `experimental-features = nix-command flakes` or adding the argument `--experimental-features "nix-command flakes"` to each `nix` command shown here.

To build _mergeable etcd_ and _dismerge_, run the following from the root:
```sh
nix build .#mergeable-etcd
nix build .#dismerge
```
Each command will produce a `result` symbolic link to the build result, you can have a look around and run things directly from there if desired (though not recommended).
Builds are cached so running the build command again should be cheap and will reinstate the `result` link for that build.

To build the client for _dismerge_ run:
```sh
nix build .#dismerge-client
```

## Docker images

This assumes that you have a working docker install that the current user can use.

To build and load the images for this repository (_mergeable etcd_, _dismerge_, _etcd_, _bencher_) run the following:
```sh
make docker-load
```
This will build each docker image in turn and load them into docker.
They will have names of the form `jeffas/<target>` where target is one of `mergeable-etcd`, `dismerge`, `etcd`, `bencher`.

46 changes: 23 additions & 23 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

204 changes: 102 additions & 102 deletions Cargo.nix
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,6 @@ rec {
# File a bug if you depend on any for non-debug work!
debug = internal.debugCrate { inherit packageId; };
};
"bencher-experiment" = rec {
packageId = "bencher-experiment";
build = internal.buildRustCrateWithFeatures {
packageId = "bencher-experiment";
};

# Debug support which might change between releases.
# File a bug if you depend on any for non-debug work!
debug = internal.debugCrate { inherit packageId; };
};
"dismerge" = rec {
packageId = "dismerge";
build = internal.buildRustCrateWithFeatures {
Expand Down Expand Up @@ -125,6 +115,16 @@ rec {
# File a bug if you depend on any for non-debug work!
debug = internal.debugCrate { inherit packageId; };
};
"exp-bencher" = rec {
packageId = "exp-bencher";
build = internal.buildRustCrateWithFeatures {
packageId = "exp-bencher";
};

# Debug support which might change between releases.
# File a bug if you depend on any for non-debug work!
debug = internal.debugCrate { inherit packageId; };
};
"mergeable-etcd" = rec {
packageId = "mergeable-etcd";
build = internal.buildRustCrateWithFeatures {
Expand Down Expand Up @@ -1499,98 +1499,6 @@ rec {
}
];

};
"bencher-experiment" = rec {
crateName = "bencher-experiment";
version = "0.1.0";
edition = "2021";
crateBin = [
{
name = "bencher-experiment";
path = "src/main.rs";
requiredFeatures = [ ];
}
];
# We can't filter paths with references in Nix 2.4
# See https://github.com/NixOS/nix/issues/5410
src = if ((lib.versionOlder builtins.nixVersion "2.4pre20211007") || (lib.versionOlder "2.5" builtins.nixVersion ))
then lib.cleanSourceWith { filter = sourceFilter; src = ./experiments/bencher; }
else ./experiments/bencher;
dependencies = [
{
name = "anyhow";
packageId = "anyhow";
}
{
name = "async-trait";
packageId = "async-trait";
}
{
name = "bencher";
packageId = "bencher";
}
{
name = "bollard";
packageId = "bollard";
}
{
name = "chrono";
packageId = "chrono";
}
{
name = "clap";
packageId = "clap 3.2.25";
features = [ "derive" ];
}
{
name = "csv";
packageId = "csv";
}
{
name = "etcd-proto";
packageId = "etcd-proto";
}
{
name = "exp";
packageId = "exp";
}
{
name = "futures";
packageId = "futures";
}
{
name = "mergeable-proto";
packageId = "mergeable-proto";
}
{
name = "polars";
packageId = "polars";
features = [ "lazy" "diagonal_concat" ];
}
{
name = "serde";
packageId = "serde";
features = [ "derive" ];
}
{
name = "serde_json";
packageId = "serde_json";
}
{
name = "tokio";
packageId = "tokio";
features = [ "macros" "rt" "rt-multi-thread" "fs" "signal" "sync" ];
}
{
name = "tracing";
packageId = "tracing";
}
{
name = "tracing-subscriber";
packageId = "tracing-subscriber";
}
];

};
"bitflags" = rec {
crateName = "bitflags";
Expand Down Expand Up @@ -3697,6 +3605,98 @@ rec {
}
];

};
"exp-bencher" = rec {
crateName = "exp-bencher";
version = "0.1.0";
edition = "2021";
crateBin = [
{
name = "exp-bencher";
path = "src/main.rs";
requiredFeatures = [ ];
}
];
# We can't filter paths with references in Nix 2.4
# See https://github.com/NixOS/nix/issues/5410
src = if ((lib.versionOlder builtins.nixVersion "2.4pre20211007") || (lib.versionOlder "2.5" builtins.nixVersion ))
then lib.cleanSourceWith { filter = sourceFilter; src = ./experiments/bencher; }
else ./experiments/bencher;
dependencies = [
{
name = "anyhow";
packageId = "anyhow";
}
{
name = "async-trait";
packageId = "async-trait";
}
{
name = "bencher";
packageId = "bencher";
}
{
name = "bollard";
packageId = "bollard";
}
{
name = "chrono";
packageId = "chrono";
}
{
name = "clap";
packageId = "clap 3.2.25";
features = [ "derive" ];
}
{
name = "csv";
packageId = "csv";
}
{
name = "etcd-proto";
packageId = "etcd-proto";
}
{
name = "exp";
packageId = "exp";
}
{
name = "futures";
packageId = "futures";
}
{
name = "mergeable-proto";
packageId = "mergeable-proto";
}
{
name = "polars";
packageId = "polars";
features = [ "lazy" "diagonal_concat" ];
}
{
name = "serde";
packageId = "serde";
features = [ "derive" ];
}
{
name = "serde_json";
packageId = "serde_json";
}
{
name = "tokio";
packageId = "tokio";
features = [ "macros" "rt" "rt-multi-thread" "fs" "signal" "sync" ];
}
{
name = "tracing";
packageId = "tracing";
}
{
name = "tracing-subscriber";
packageId = "tracing-subscriber";
}
];

};
"fast-float" = rec {
crateName = "fast-float";
Expand Down
Loading

0 comments on commit ae788a2

Please sign in to comment.