mirror of
https://github.com/deuxfleurs-org/garage.git
synced 2026-08-15 00:23:11 +00:00
Compare commits
11 Commits
v0.9.0-rc1
...
v0.9.0
| Author | SHA1 | Date | |
|---|---|---|---|
| 952c9570c4 | |||
| 3d7892477d | |||
| d4932c31ea | |||
| e75fe2157d | |||
| 2d5d7a7031 | |||
| 0c431b0c03 | |||
| 1c13135f25 | |||
| 2448eb7713 | |||
| 6790e24f5a | |||
| 9ccc1d6f4a | |||
| 920dec393a |
+13
-9
@@ -42,12 +42,6 @@ steps:
|
||||
- nix-build --no-build-output --attr clippy.amd64 --argstr git_version ${DRONE_TAG:-$DRONE_COMMIT}
|
||||
- nix-shell --attr integration --run ./script/test-smoke.sh || (cat /tmp/garage.log; false)
|
||||
|
||||
- name: upgrade tests
|
||||
image: nixpkgs/nix:nixos-22.05
|
||||
commands:
|
||||
- nix-build --no-build-output --attr clippy.amd64 --argstr git_version ${DRONE_TAG:-$DRONE_COMMIT}
|
||||
- nix-shell --attr integration --run "./script/test-upgrade.sh v0.8.4 x86_64-unknown-linux-musl" || (cat /tmp/garage.log; false)
|
||||
|
||||
trigger:
|
||||
event:
|
||||
- custom
|
||||
@@ -71,11 +65,16 @@ steps:
|
||||
- nix-build --no-build-output --attr pkgs.amd64.release --argstr git_version ${DRONE_TAG:-$DRONE_COMMIT}
|
||||
- nix-shell --attr rust --run "./script/not-dynamic.sh result-bin/bin/garage"
|
||||
|
||||
- name: integration
|
||||
- name: integration tests
|
||||
image: nixpkgs/nix:nixos-22.05
|
||||
commands:
|
||||
- nix-shell --attr integration --run ./script/test-smoke.sh || (cat /tmp/garage.log; false)
|
||||
|
||||
- name: upgrade tests
|
||||
image: nixpkgs/nix:nixos-22.05
|
||||
commands:
|
||||
- nix-shell --attr integration --run "./script/test-upgrade.sh v0.8.4 x86_64-unknown-linux-musl" || (cat /tmp/garage.log; false)
|
||||
|
||||
- name: push static binary
|
||||
image: nixpkgs/nix:nixos-22.05
|
||||
environment:
|
||||
@@ -122,11 +121,16 @@ steps:
|
||||
- nix-build --no-build-output --attr pkgs.i386.release --argstr git_version ${DRONE_TAG:-$DRONE_COMMIT}
|
||||
- nix-shell --attr rust --run "./script/not-dynamic.sh result-bin/bin/garage"
|
||||
|
||||
- name: integration
|
||||
- name: integration tests
|
||||
image: nixpkgs/nix:nixos-22.05
|
||||
commands:
|
||||
- nix-shell --attr integration --run ./script/test-smoke.sh || (cat /tmp/garage.log; false)
|
||||
|
||||
- name: upgrade tests
|
||||
image: nixpkgs/nix:nixos-22.05
|
||||
commands:
|
||||
- nix-shell --attr integration --run "./script/test-upgrade.sh v0.8.4 i686-unknown-linux-musl" || (cat /tmp/garage.log; false)
|
||||
|
||||
- name: push static binary
|
||||
image: nixpkgs/nix:nixos-22.05
|
||||
environment:
|
||||
@@ -291,6 +295,6 @@ trigger:
|
||||
|
||||
---
|
||||
kind: signature
|
||||
hmac: dcf68ed6536e3fd9b359377e4c6c1d321fa9cc0f6fe5645d69c8f1d604569b4c
|
||||
hmac: 0c4b57eb4b27b7c6a6ff21ab87f0767fe3eb90f5d95d5cbcdccf794e9d2a5d86
|
||||
|
||||
...
|
||||
|
||||
Generated
+9
-9
@@ -1198,7 +1198,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "garage"
|
||||
version = "0.8.4"
|
||||
version = "0.9.0"
|
||||
dependencies = [
|
||||
"assert-json-diff",
|
||||
"async-trait",
|
||||
@@ -1249,7 +1249,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "garage_api"
|
||||
version = "0.8.4"
|
||||
version = "0.9.0"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"base64 0.21.3",
|
||||
@@ -1295,7 +1295,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "garage_block"
|
||||
version = "0.8.4"
|
||||
version = "0.9.0"
|
||||
dependencies = [
|
||||
"arc-swap",
|
||||
"async-compression",
|
||||
@@ -1321,7 +1321,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "garage_db"
|
||||
version = "0.8.4"
|
||||
version = "0.9.0"
|
||||
dependencies = [
|
||||
"clap 4.4.0",
|
||||
"err-derive",
|
||||
@@ -1336,7 +1336,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "garage_model"
|
||||
version = "0.8.4"
|
||||
version = "0.9.0"
|
||||
dependencies = [
|
||||
"arc-swap",
|
||||
"async-trait",
|
||||
@@ -1364,7 +1364,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "garage_rpc"
|
||||
version = "0.8.4"
|
||||
version = "0.9.0"
|
||||
dependencies = [
|
||||
"arc-swap",
|
||||
"async-trait",
|
||||
@@ -1399,7 +1399,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "garage_table"
|
||||
version = "0.8.4"
|
||||
version = "0.9.0"
|
||||
dependencies = [
|
||||
"arc-swap",
|
||||
"async-trait",
|
||||
@@ -1421,7 +1421,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "garage_util"
|
||||
version = "0.8.4"
|
||||
version = "0.9.0"
|
||||
dependencies = [
|
||||
"arc-swap",
|
||||
"async-trait",
|
||||
@@ -1455,7 +1455,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "garage_web"
|
||||
version = "0.8.4"
|
||||
version = "0.9.0"
|
||||
dependencies = [
|
||||
"err-derive",
|
||||
"futures",
|
||||
|
||||
@@ -33,7 +33,7 @@ args@{
|
||||
ignoreLockHash,
|
||||
}:
|
||||
let
|
||||
nixifiedLockHash = "3f325a8a549c43a788ff702e65f6de2d42ad19a46067248e29108e90212ca2f5";
|
||||
nixifiedLockHash = "1a87886681a3ef0b83c95addc26674a538b8a93d35bc80db8998e1fcd0821f6c";
|
||||
workspaceSrc = if args.workspaceSrc == null then ./. else args.workspaceSrc;
|
||||
currentLockHash = builtins.hashFile "sha256" (workspaceSrc + /Cargo.lock);
|
||||
lockHashIgnored = if ignoreLockHash
|
||||
@@ -57,16 +57,16 @@ in
|
||||
{
|
||||
cargo2nixVersion = "0.11.0";
|
||||
workspace = {
|
||||
garage_db = rustPackages.unknown.garage_db."0.8.4";
|
||||
garage_util = rustPackages.unknown.garage_util."0.8.4";
|
||||
garage_rpc = rustPackages.unknown.garage_rpc."0.8.4";
|
||||
garage_db = rustPackages.unknown.garage_db."0.9.0";
|
||||
garage_util = rustPackages.unknown.garage_util."0.9.0";
|
||||
garage_rpc = rustPackages.unknown.garage_rpc."0.9.0";
|
||||
format_table = rustPackages.unknown.format_table."0.1.1";
|
||||
garage_table = rustPackages.unknown.garage_table."0.8.4";
|
||||
garage_block = rustPackages.unknown.garage_block."0.8.4";
|
||||
garage_model = rustPackages.unknown.garage_model."0.8.4";
|
||||
garage_api = rustPackages.unknown.garage_api."0.8.4";
|
||||
garage_web = rustPackages.unknown.garage_web."0.8.4";
|
||||
garage = rustPackages.unknown.garage."0.8.4";
|
||||
garage_table = rustPackages.unknown.garage_table."0.9.0";
|
||||
garage_block = rustPackages.unknown.garage_block."0.9.0";
|
||||
garage_model = rustPackages.unknown.garage_model."0.9.0";
|
||||
garage_api = rustPackages.unknown.garage_api."0.9.0";
|
||||
garage_web = rustPackages.unknown.garage_web."0.9.0";
|
||||
garage = rustPackages.unknown.garage."0.9.0";
|
||||
k2v-client = rustPackages.unknown.k2v-client."0.0.4";
|
||||
};
|
||||
"registry+https://github.com/rust-lang/crates.io-index".addr2line."0.21.0" = overridableMkRustCrate (profileName: rec {
|
||||
@@ -1705,9 +1705,9 @@ in
|
||||
};
|
||||
});
|
||||
|
||||
"unknown".garage."0.8.4" = overridableMkRustCrate (profileName: rec {
|
||||
"unknown".garage."0.9.0" = overridableMkRustCrate (profileName: rec {
|
||||
name = "garage";
|
||||
version = "0.8.4";
|
||||
version = "0.9.0";
|
||||
registry = "unknown";
|
||||
src = fetchCrateLocal (workspaceSrc + "/src/garage");
|
||||
features = builtins.concatLists [
|
||||
@@ -1734,14 +1734,14 @@ in
|
||||
format_table = (rustPackages."unknown".format_table."0.1.1" { inherit profileName; }).out;
|
||||
futures = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".futures."0.3.28" { inherit profileName; }).out;
|
||||
futures_util = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".futures-util."0.3.28" { inherit profileName; }).out;
|
||||
garage_api = (rustPackages."unknown".garage_api."0.8.4" { inherit profileName; }).out;
|
||||
garage_block = (rustPackages."unknown".garage_block."0.8.4" { inherit profileName; }).out;
|
||||
garage_db = (rustPackages."unknown".garage_db."0.8.4" { inherit profileName; }).out;
|
||||
garage_model = (rustPackages."unknown".garage_model."0.8.4" { inherit profileName; }).out;
|
||||
garage_rpc = (rustPackages."unknown".garage_rpc."0.8.4" { inherit profileName; }).out;
|
||||
garage_table = (rustPackages."unknown".garage_table."0.8.4" { inherit profileName; }).out;
|
||||
garage_util = (rustPackages."unknown".garage_util."0.8.4" { inherit profileName; }).out;
|
||||
garage_web = (rustPackages."unknown".garage_web."0.8.4" { inherit profileName; }).out;
|
||||
garage_api = (rustPackages."unknown".garage_api."0.9.0" { inherit profileName; }).out;
|
||||
garage_block = (rustPackages."unknown".garage_block."0.9.0" { inherit profileName; }).out;
|
||||
garage_db = (rustPackages."unknown".garage_db."0.9.0" { inherit profileName; }).out;
|
||||
garage_model = (rustPackages."unknown".garage_model."0.9.0" { inherit profileName; }).out;
|
||||
garage_rpc = (rustPackages."unknown".garage_rpc."0.9.0" { inherit profileName; }).out;
|
||||
garage_table = (rustPackages."unknown".garage_table."0.9.0" { inherit profileName; }).out;
|
||||
garage_util = (rustPackages."unknown".garage_util."0.9.0" { inherit profileName; }).out;
|
||||
garage_web = (rustPackages."unknown".garage_web."0.9.0" { inherit profileName; }).out;
|
||||
git_version = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".git-version."0.3.5" { inherit profileName; }).out;
|
||||
hex = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".hex."0.4.3" { inherit profileName; }).out;
|
||||
sodiumoxide = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".kuska-sodiumoxide."0.2.5-0" { inherit profileName; }).out;
|
||||
@@ -1777,9 +1777,9 @@ in
|
||||
};
|
||||
});
|
||||
|
||||
"unknown".garage_api."0.8.4" = overridableMkRustCrate (profileName: rec {
|
||||
"unknown".garage_api."0.9.0" = overridableMkRustCrate (profileName: rec {
|
||||
name = "garage_api";
|
||||
version = "0.8.4";
|
||||
version = "0.9.0";
|
||||
registry = "unknown";
|
||||
src = fetchCrateLocal (workspaceSrc + "/src/api");
|
||||
features = builtins.concatLists [
|
||||
@@ -1798,11 +1798,11 @@ in
|
||||
form_urlencoded = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".form_urlencoded."1.2.0" { inherit profileName; }).out;
|
||||
futures = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".futures."0.3.28" { inherit profileName; }).out;
|
||||
futures_util = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".futures-util."0.3.28" { inherit profileName; }).out;
|
||||
garage_block = (rustPackages."unknown".garage_block."0.8.4" { inherit profileName; }).out;
|
||||
garage_model = (rustPackages."unknown".garage_model."0.8.4" { inherit profileName; }).out;
|
||||
garage_rpc = (rustPackages."unknown".garage_rpc."0.8.4" { inherit profileName; }).out;
|
||||
garage_table = (rustPackages."unknown".garage_table."0.8.4" { inherit profileName; }).out;
|
||||
garage_util = (rustPackages."unknown".garage_util."0.8.4" { inherit profileName; }).out;
|
||||
garage_block = (rustPackages."unknown".garage_block."0.9.0" { inherit profileName; }).out;
|
||||
garage_model = (rustPackages."unknown".garage_model."0.9.0" { inherit profileName; }).out;
|
||||
garage_rpc = (rustPackages."unknown".garage_rpc."0.9.0" { inherit profileName; }).out;
|
||||
garage_table = (rustPackages."unknown".garage_table."0.9.0" { inherit profileName; }).out;
|
||||
garage_util = (rustPackages."unknown".garage_util."0.9.0" { inherit profileName; }).out;
|
||||
hex = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".hex."0.4.3" { inherit profileName; }).out;
|
||||
hmac = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".hmac."0.12.1" { inherit profileName; }).out;
|
||||
http = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".http."0.2.9" { inherit profileName; }).out;
|
||||
@@ -1832,9 +1832,9 @@ in
|
||||
};
|
||||
});
|
||||
|
||||
"unknown".garage_block."0.8.4" = overridableMkRustCrate (profileName: rec {
|
||||
"unknown".garage_block."0.9.0" = overridableMkRustCrate (profileName: rec {
|
||||
name = "garage_block";
|
||||
version = "0.8.4";
|
||||
version = "0.9.0";
|
||||
registry = "unknown";
|
||||
src = fetchCrateLocal (workspaceSrc + "/src/block");
|
||||
features = builtins.concatLists [
|
||||
@@ -1848,10 +1848,10 @@ in
|
||||
bytesize = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".bytesize."1.3.0" { inherit profileName; }).out;
|
||||
futures = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".futures."0.3.28" { inherit profileName; }).out;
|
||||
futures_util = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".futures-util."0.3.28" { inherit profileName; }).out;
|
||||
garage_db = (rustPackages."unknown".garage_db."0.8.4" { inherit profileName; }).out;
|
||||
garage_rpc = (rustPackages."unknown".garage_rpc."0.8.4" { inherit profileName; }).out;
|
||||
garage_table = (rustPackages."unknown".garage_table."0.8.4" { inherit profileName; }).out;
|
||||
garage_util = (rustPackages."unknown".garage_util."0.8.4" { inherit profileName; }).out;
|
||||
garage_db = (rustPackages."unknown".garage_db."0.9.0" { inherit profileName; }).out;
|
||||
garage_rpc = (rustPackages."unknown".garage_rpc."0.9.0" { inherit profileName; }).out;
|
||||
garage_table = (rustPackages."unknown".garage_table."0.9.0" { inherit profileName; }).out;
|
||||
garage_util = (rustPackages."unknown".garage_util."0.9.0" { inherit profileName; }).out;
|
||||
hex = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".hex."0.4.3" { inherit profileName; }).out;
|
||||
opentelemetry = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".opentelemetry."0.17.0" { inherit profileName; }).out;
|
||||
rand = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".rand."0.8.5" { inherit profileName; }).out;
|
||||
@@ -1864,9 +1864,9 @@ in
|
||||
};
|
||||
});
|
||||
|
||||
"unknown".garage_db."0.8.4" = overridableMkRustCrate (profileName: rec {
|
||||
"unknown".garage_db."0.9.0" = overridableMkRustCrate (profileName: rec {
|
||||
name = "garage_db";
|
||||
version = "0.8.4";
|
||||
version = "0.9.0";
|
||||
registry = "unknown";
|
||||
src = fetchCrateLocal (workspaceSrc + "/src/db");
|
||||
features = builtins.concatLists [
|
||||
@@ -1896,9 +1896,9 @@ in
|
||||
};
|
||||
});
|
||||
|
||||
"unknown".garage_model."0.8.4" = overridableMkRustCrate (profileName: rec {
|
||||
"unknown".garage_model."0.9.0" = overridableMkRustCrate (profileName: rec {
|
||||
name = "garage_model";
|
||||
version = "0.8.4";
|
||||
version = "0.9.0";
|
||||
registry = "unknown";
|
||||
src = fetchCrateLocal (workspaceSrc + "/src/model");
|
||||
features = builtins.concatLists [
|
||||
@@ -1917,11 +1917,11 @@ in
|
||||
err_derive = (buildRustPackages."registry+https://github.com/rust-lang/crates.io-index".err-derive."0.3.1" { profileName = "__noProfile"; }).out;
|
||||
futures = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".futures."0.3.28" { inherit profileName; }).out;
|
||||
futures_util = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".futures-util."0.3.28" { inherit profileName; }).out;
|
||||
garage_block = (rustPackages."unknown".garage_block."0.8.4" { inherit profileName; }).out;
|
||||
garage_db = (rustPackages."unknown".garage_db."0.8.4" { inherit profileName; }).out;
|
||||
garage_rpc = (rustPackages."unknown".garage_rpc."0.8.4" { inherit profileName; }).out;
|
||||
garage_table = (rustPackages."unknown".garage_table."0.8.4" { inherit profileName; }).out;
|
||||
garage_util = (rustPackages."unknown".garage_util."0.8.4" { inherit profileName; }).out;
|
||||
garage_block = (rustPackages."unknown".garage_block."0.9.0" { inherit profileName; }).out;
|
||||
garage_db = (rustPackages."unknown".garage_db."0.9.0" { inherit profileName; }).out;
|
||||
garage_rpc = (rustPackages."unknown".garage_rpc."0.9.0" { inherit profileName; }).out;
|
||||
garage_table = (rustPackages."unknown".garage_table."0.9.0" { inherit profileName; }).out;
|
||||
garage_util = (rustPackages."unknown".garage_util."0.9.0" { inherit profileName; }).out;
|
||||
hex = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".hex."0.4.3" { inherit profileName; }).out;
|
||||
netapp = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".netapp."0.10.0" { inherit profileName; }).out;
|
||||
opentelemetry = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".opentelemetry."0.17.0" { inherit profileName; }).out;
|
||||
@@ -1934,9 +1934,9 @@ in
|
||||
};
|
||||
});
|
||||
|
||||
"unknown".garage_rpc."0.8.4" = overridableMkRustCrate (profileName: rec {
|
||||
"unknown".garage_rpc."0.9.0" = overridableMkRustCrate (profileName: rec {
|
||||
name = "garage_rpc";
|
||||
version = "0.8.4";
|
||||
version = "0.9.0";
|
||||
registry = "unknown";
|
||||
src = fetchCrateLocal (workspaceSrc + "/src/rpc");
|
||||
features = builtins.concatLists [
|
||||
@@ -1958,8 +1958,8 @@ in
|
||||
format_table = (rustPackages."unknown".format_table."0.1.1" { inherit profileName; }).out;
|
||||
futures = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".futures."0.3.28" { inherit profileName; }).out;
|
||||
futures_util = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".futures-util."0.3.28" { inherit profileName; }).out;
|
||||
garage_db = (rustPackages."unknown".garage_db."0.8.4" { inherit profileName; }).out;
|
||||
garage_util = (rustPackages."unknown".garage_util."0.8.4" { inherit profileName; }).out;
|
||||
garage_db = (rustPackages."unknown".garage_db."0.9.0" { inherit profileName; }).out;
|
||||
garage_util = (rustPackages."unknown".garage_util."0.9.0" { inherit profileName; }).out;
|
||||
gethostname = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".gethostname."0.4.3" { inherit profileName; }).out;
|
||||
hex = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".hex."0.4.3" { inherit profileName; }).out;
|
||||
itertools = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".itertools."0.10.5" { inherit profileName; }).out;
|
||||
@@ -1982,9 +1982,9 @@ in
|
||||
};
|
||||
});
|
||||
|
||||
"unknown".garage_table."0.8.4" = overridableMkRustCrate (profileName: rec {
|
||||
"unknown".garage_table."0.9.0" = overridableMkRustCrate (profileName: rec {
|
||||
name = "garage_table";
|
||||
version = "0.8.4";
|
||||
version = "0.9.0";
|
||||
registry = "unknown";
|
||||
src = fetchCrateLocal (workspaceSrc + "/src/table");
|
||||
dependencies = {
|
||||
@@ -1993,9 +1993,9 @@ in
|
||||
bytes = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".bytes."1.4.0" { inherit profileName; }).out;
|
||||
futures = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".futures."0.3.28" { inherit profileName; }).out;
|
||||
futures_util = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".futures-util."0.3.28" { inherit profileName; }).out;
|
||||
garage_db = (rustPackages."unknown".garage_db."0.8.4" { inherit profileName; }).out;
|
||||
garage_rpc = (rustPackages."unknown".garage_rpc."0.8.4" { inherit profileName; }).out;
|
||||
garage_util = (rustPackages."unknown".garage_util."0.8.4" { inherit profileName; }).out;
|
||||
garage_db = (rustPackages."unknown".garage_db."0.9.0" { inherit profileName; }).out;
|
||||
garage_rpc = (rustPackages."unknown".garage_rpc."0.9.0" { inherit profileName; }).out;
|
||||
garage_util = (rustPackages."unknown".garage_util."0.9.0" { inherit profileName; }).out;
|
||||
hex = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".hex."0.4.3" { inherit profileName; }).out;
|
||||
hexdump = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".hexdump."0.1.1" { inherit profileName; }).out;
|
||||
opentelemetry = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".opentelemetry."0.17.0" { inherit profileName; }).out;
|
||||
@@ -2007,9 +2007,9 @@ in
|
||||
};
|
||||
});
|
||||
|
||||
"unknown".garage_util."0.8.4" = overridableMkRustCrate (profileName: rec {
|
||||
"unknown".garage_util."0.9.0" = overridableMkRustCrate (profileName: rec {
|
||||
name = "garage_util";
|
||||
version = "0.8.4";
|
||||
version = "0.9.0";
|
||||
registry = "unknown";
|
||||
src = fetchCrateLocal (workspaceSrc + "/src/util");
|
||||
features = builtins.concatLists [
|
||||
@@ -2025,7 +2025,7 @@ in
|
||||
digest = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".digest."0.10.7" { inherit profileName; }).out;
|
||||
err_derive = (buildRustPackages."registry+https://github.com/rust-lang/crates.io-index".err-derive."0.3.1" { profileName = "__noProfile"; }).out;
|
||||
futures = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".futures."0.3.28" { inherit profileName; }).out;
|
||||
garage_db = (rustPackages."unknown".garage_db."0.8.4" { inherit profileName; }).out;
|
||||
garage_db = (rustPackages."unknown".garage_db."0.9.0" { inherit profileName; }).out;
|
||||
hex = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".hex."0.4.3" { inherit profileName; }).out;
|
||||
hexdump = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".hexdump."0.1.1" { inherit profileName; }).out;
|
||||
http = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".http."0.2.9" { inherit profileName; }).out;
|
||||
@@ -2051,18 +2051,18 @@ in
|
||||
};
|
||||
});
|
||||
|
||||
"unknown".garage_web."0.8.4" = overridableMkRustCrate (profileName: rec {
|
||||
"unknown".garage_web."0.9.0" = overridableMkRustCrate (profileName: rec {
|
||||
name = "garage_web";
|
||||
version = "0.8.4";
|
||||
version = "0.9.0";
|
||||
registry = "unknown";
|
||||
src = fetchCrateLocal (workspaceSrc + "/src/web");
|
||||
dependencies = {
|
||||
err_derive = (buildRustPackages."registry+https://github.com/rust-lang/crates.io-index".err-derive."0.3.1" { profileName = "__noProfile"; }).out;
|
||||
futures = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".futures."0.3.28" { inherit profileName; }).out;
|
||||
garage_api = (rustPackages."unknown".garage_api."0.8.4" { inherit profileName; }).out;
|
||||
garage_model = (rustPackages."unknown".garage_model."0.8.4" { inherit profileName; }).out;
|
||||
garage_table = (rustPackages."unknown".garage_table."0.8.4" { inherit profileName; }).out;
|
||||
garage_util = (rustPackages."unknown".garage_util."0.8.4" { inherit profileName; }).out;
|
||||
garage_api = (rustPackages."unknown".garage_api."0.9.0" { inherit profileName; }).out;
|
||||
garage_model = (rustPackages."unknown".garage_model."0.9.0" { inherit profileName; }).out;
|
||||
garage_table = (rustPackages."unknown".garage_table."0.9.0" { inherit profileName; }).out;
|
||||
garage_util = (rustPackages."unknown".garage_util."0.9.0" { inherit profileName; }).out;
|
||||
http = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".http."0.2.9" { inherit profileName; }).out;
|
||||
hyper = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".hyper."0.14.27" { inherit profileName; }).out;
|
||||
hyperlocal = (rustPackages."registry+https://github.com/rust-lang/crates.io-index".hyperlocal."0.8.0" { inherit profileName; }).out;
|
||||
|
||||
+8
-8
@@ -18,14 +18,14 @@ default-members = ["src/garage"]
|
||||
|
||||
[workspace.dependencies]
|
||||
format_table = { version = "0.1.1", path = "src/format-table" }
|
||||
garage_api = { version = "0.8.4", path = "src/api" }
|
||||
garage_block = { version = "0.8.4", path = "src/block" }
|
||||
garage_db = { version = "0.8.4", path = "src/db", default-features = false }
|
||||
garage_model = { version = "0.8.4", path = "src/model", default-features = false }
|
||||
garage_rpc = { version = "0.8.4", path = "src/rpc" }
|
||||
garage_table = { version = "0.8.4", path = "src/table" }
|
||||
garage_util = { version = "0.8.4", path = "src/util" }
|
||||
garage_web = { version = "0.8.4", path = "src/web" }
|
||||
garage_api = { version = "0.9.0", path = "src/api" }
|
||||
garage_block = { version = "0.9.0", path = "src/block" }
|
||||
garage_db = { version = "0.9.0", path = "src/db", default-features = false }
|
||||
garage_model = { version = "0.9.0", path = "src/model", default-features = false }
|
||||
garage_rpc = { version = "0.9.0", path = "src/rpc" }
|
||||
garage_table = { version = "0.9.0", path = "src/table" }
|
||||
garage_util = { version = "0.9.0", path = "src/util" }
|
||||
garage_web = { version = "0.9.0", path = "src/web" }
|
||||
k2v-client = { version = "0.0.4", path = "src/k2v-client" }
|
||||
|
||||
[profile.dev]
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
+++
|
||||
title = "Migrating from 0.8 to 0.9"
|
||||
weight = 14
|
||||
+++
|
||||
|
||||
**This guide explains how to migrate to 0.9 if you have an existing 0.8 cluster.
|
||||
We don't recommend trying to migrate to 0.9 directly from 0.7 or older.**
|
||||
|
||||
**We make no guarantee that this migration will work perfectly:
|
||||
back up all your data before attempting it!**
|
||||
|
||||
The following are **breaking changes** in Garage v0.9 that require your attention when migrating:
|
||||
|
||||
- LMDB is now the default metadata db engine and Sled is deprecated. If you were using Sled, make sure to specify `db_engine = "sled"` in your configuration file, or take the time to [convert your database](https://garagehq.deuxfleurs.fr/documentation/reference-manual/configuration/#db-engine-since-v0-8-0).
|
||||
|
||||
- Capacity values are now in actual byte units. The translation from the old layout will assign 1 capacity = 1Gb by default, which might be wrong for your cluster. This does not cause any data to be moved around, but you might want to re-assign correct capacity values post-migration.
|
||||
|
||||
- Multipart uploads that were started in Garage v0.8 will not be visible in Garage v0.9 and will have to be restarted from scratch.
|
||||
|
||||
- Changes to the admin API: some `v0/` endpoints have been replaced by `v1/` counterparts with updated/uniformized syntax. All other endpoints have also moved to `v1/` by default, without syntax changes, but are still available under `v0/` for compatibility.
|
||||
|
||||
|
||||
## Simple migration procedure (takes cluster offline for a while)
|
||||
|
||||
The migration steps are as follows:
|
||||
|
||||
1. Disable API and web access. You may do this by stopping your reverse proxy or by commenting out
|
||||
the `api_bind_addr` values in your `config.toml` file and restarting Garage.
|
||||
2. Do `garage repair --all-nodes --yes tables` and `garage repair --all-nodes --yes blocks`,
|
||||
check the logs and check that all data seems to be synced correctly between
|
||||
nodes. If you have time, do additional checks (`versions`, `block_refs`, etc.)
|
||||
3. Check that the block resync queue and Merkle queue are empty:
|
||||
run `garage stats -a` to query them or inspect metrics in the Grafana dashboard.
|
||||
4. Turn off Garage v0.8
|
||||
5. **Backup the metadata folder of all your nodes!** For instance, use the following command
|
||||
if your metadata directory is `/var/lib/garage/meta`: `cd /var/lib/garage ; tar -acf meta-v0.8.tar.zst meta/`
|
||||
6. Install Garage v0.9
|
||||
7. Update your configuration file if necessary.
|
||||
8. Turn on Garage v0.9
|
||||
9. Do `garage repair --all-nodes --yes tables` and `garage repair --all-nodes --yes blocks`.
|
||||
Wait for a full table sync to run.
|
||||
10. Your upgraded cluster should be in a working state. Re-enable API and Web
|
||||
access and check that everything went well.
|
||||
11. Monitor your cluster in the next hours to see if it works well under your production load, report any issue.
|
||||
12. You might want to assign correct capacity values to all your nodes. Doing so might cause data to be moved
|
||||
in your cluster, which should also be monitored carefully.
|
||||
|
||||
## Minimal downtime migration procedure
|
||||
|
||||
The migration to Garage v0.9 can be done with almost no downtime,
|
||||
by restarting all nodes at once in the new version.
|
||||
|
||||
The migration steps are as follows:
|
||||
|
||||
1. Do `garage repair --all-nodes --yes tables` and `garage repair --all-nodes --yes blocks`,
|
||||
check the logs and check that all data seems to be synced correctly between
|
||||
nodes. If you have time, do additional checks (`versions`, `block_refs`, etc.)
|
||||
|
||||
2. Turn off each node individually; back up its metadata folder (see above); turn it back on again.
|
||||
This will allow you to take a backup of all nodes without impacting global cluster availability.
|
||||
You can do all nodes of a single zone at once as this does not impact the availability of Garage.
|
||||
|
||||
3. Prepare your binaries and configuration files for Garage v0.9
|
||||
|
||||
4. Shut down all v0.8 nodes simultaneously, and restart them all simultaneously in v0.9.
|
||||
Use your favorite deployment tool (Ansible, Kubernetes, Nomad) to achieve this as fast as possible.
|
||||
Garage v0.9 should be in a working state as soon as it starts.
|
||||
|
||||
5. Proceed with repair and monitoring as described in steps 9-12 above.
|
||||
@@ -21,4 +21,4 @@ version: 0.4.1
|
||||
# incremented each time you make changes to the application. Versions are not expected to
|
||||
# follow Semantic Versioning. They should reflect the version the application is using.
|
||||
# It is recommended to use it with quotes.
|
||||
appVersion: "v0.8.4"
|
||||
appVersion: "v0.9.0"
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "garage_api"
|
||||
version = "0.8.4"
|
||||
version = "0.9.0"
|
||||
authors = ["Alex Auvolat <alex@adnab.me>"]
|
||||
edition = "2018"
|
||||
license = "AGPL-3.0"
|
||||
|
||||
@@ -25,7 +25,8 @@ use crate::admin::bucket::*;
|
||||
use crate::admin::cluster::*;
|
||||
use crate::admin::error::*;
|
||||
use crate::admin::key::*;
|
||||
use crate::admin::router::{Authorization, Endpoint};
|
||||
use crate::admin::router_v0;
|
||||
use crate::admin::router_v1::{Authorization, Endpoint};
|
||||
use crate::helpers::host_to_bucket;
|
||||
|
||||
pub struct AdminApiServer {
|
||||
@@ -229,7 +230,12 @@ impl ApiHandler for AdminApiServer {
|
||||
type Error = Error;
|
||||
|
||||
fn parse_endpoint(&self, req: &Request<Body>) -> Result<Endpoint, Error> {
|
||||
Endpoint::from_request(req)
|
||||
if req.uri().path().starts_with("/v0/") {
|
||||
let endpoint_v0 = router_v0::Endpoint::from_request(req)?;
|
||||
Endpoint::from_v0(endpoint_v0)
|
||||
} else {
|
||||
Endpoint::from_request(req)
|
||||
}
|
||||
}
|
||||
|
||||
async fn handle(
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
pub mod api_server;
|
||||
mod error;
|
||||
mod router;
|
||||
mod router_v0;
|
||||
mod router_v1;
|
||||
|
||||
mod bucket;
|
||||
mod cluster;
|
||||
|
||||
@@ -1,160 +0,0 @@
|
||||
use std::borrow::Cow;
|
||||
|
||||
use hyper::{Method, Request};
|
||||
|
||||
use crate::admin::error::*;
|
||||
use crate::router_macros::*;
|
||||
|
||||
pub enum Authorization {
|
||||
None,
|
||||
MetricsToken,
|
||||
AdminToken,
|
||||
}
|
||||
|
||||
router_match! {@func
|
||||
|
||||
/// List of all Admin API endpoints.
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub enum Endpoint {
|
||||
Options,
|
||||
CheckDomain,
|
||||
Health,
|
||||
Metrics,
|
||||
GetClusterStatus,
|
||||
GetClusterHealth,
|
||||
ConnectClusterNodes,
|
||||
// Layout
|
||||
GetClusterLayout,
|
||||
UpdateClusterLayout,
|
||||
ApplyClusterLayout,
|
||||
RevertClusterLayout,
|
||||
// Keys
|
||||
ListKeys,
|
||||
CreateKey,
|
||||
ImportKey,
|
||||
GetKeyInfo {
|
||||
id: Option<String>,
|
||||
search: Option<String>,
|
||||
show_secret_key: Option<String>,
|
||||
},
|
||||
DeleteKey {
|
||||
id: String,
|
||||
},
|
||||
UpdateKey {
|
||||
id: String,
|
||||
},
|
||||
// Buckets
|
||||
ListBuckets,
|
||||
CreateBucket,
|
||||
GetBucketInfo {
|
||||
id: Option<String>,
|
||||
global_alias: Option<String>,
|
||||
},
|
||||
DeleteBucket {
|
||||
id: String,
|
||||
},
|
||||
UpdateBucket {
|
||||
id: String,
|
||||
},
|
||||
// Bucket-Key Permissions
|
||||
BucketAllowKey,
|
||||
BucketDenyKey,
|
||||
// Bucket aliases
|
||||
GlobalAliasBucket {
|
||||
id: String,
|
||||
alias: String,
|
||||
},
|
||||
GlobalUnaliasBucket {
|
||||
id: String,
|
||||
alias: String,
|
||||
},
|
||||
LocalAliasBucket {
|
||||
id: String,
|
||||
access_key_id: String,
|
||||
alias: String,
|
||||
},
|
||||
LocalUnaliasBucket {
|
||||
id: String,
|
||||
access_key_id: String,
|
||||
alias: String,
|
||||
},
|
||||
}}
|
||||
|
||||
impl Endpoint {
|
||||
/// Determine which S3 endpoint a request is for using the request, and a bucket which was
|
||||
/// possibly extracted from the Host header.
|
||||
/// Returns Self plus bucket name, if endpoint is not Endpoint::ListBuckets
|
||||
pub fn from_request<T>(req: &Request<T>) -> Result<Self, Error> {
|
||||
let uri = req.uri();
|
||||
let path = uri.path();
|
||||
let query = uri.query();
|
||||
|
||||
let mut query = QueryParameters::from_query(query.unwrap_or_default())?;
|
||||
|
||||
let res = router_match!(@gen_path_parser (req.method(), path, query) [
|
||||
OPTIONS _ => Options,
|
||||
GET "/check" => CheckDomain,
|
||||
GET "/health" => Health,
|
||||
GET "/metrics" => Metrics,
|
||||
GET "/v1/status" => GetClusterStatus,
|
||||
GET "/v1/health" => GetClusterHealth,
|
||||
POST ("/v0/connect" | "/v1/connect") => ConnectClusterNodes,
|
||||
// Layout endpoints
|
||||
GET "/v1/layout" => GetClusterLayout,
|
||||
POST "/v1/layout" => UpdateClusterLayout,
|
||||
POST "/v1/layout/apply" => ApplyClusterLayout,
|
||||
POST ("/v0/layout/revert" | "/v1/layout/revert") => RevertClusterLayout,
|
||||
// API key endpoints
|
||||
GET "/v1/key" if id => GetKeyInfo (query_opt::id, query_opt::search, query_opt::show_secret_key),
|
||||
GET "/v1/key" if search => GetKeyInfo (query_opt::id, query_opt::search, query_opt::show_secret_key),
|
||||
POST "/v1/key" if id => UpdateKey (query::id),
|
||||
POST "/v1/key" => CreateKey,
|
||||
POST "/v1/key/import" => ImportKey,
|
||||
DELETE ("/v0/key" | "/v1/key") if id => DeleteKey (query::id),
|
||||
GET ("/v0/key" | "/v1/key") => ListKeys,
|
||||
// Bucket endpoints
|
||||
GET ("/v0/bucket" | "/v1/bucket") if id => GetBucketInfo (query_opt::id, query_opt::global_alias),
|
||||
GET ("/v0/bucket" | "/v1/bucket") if global_alias => GetBucketInfo (query_opt::id, query_opt::global_alias),
|
||||
GET ("/v0/bucket" | "/v1/bucket") => ListBuckets,
|
||||
POST ("/v0/bucket" | "/v1/bucket") => CreateBucket,
|
||||
DELETE ("/v0/bucket" | "/v1/bucket") if id => DeleteBucket (query::id),
|
||||
PUT ("/v0/bucket" | "/v1/bucket") if id => UpdateBucket (query::id),
|
||||
// Bucket-key permissions
|
||||
POST ("/v0/bucket/allow" | "/v1/bucket/allow") => BucketAllowKey,
|
||||
POST ("/v0/bucket/deny" | "/v1/bucket/deny") => BucketDenyKey,
|
||||
// Bucket aliases
|
||||
PUT ("/v0/bucket/alias/global" | "/v1/bucket/alias/global") => GlobalAliasBucket (query::id, query::alias),
|
||||
DELETE ("/v0/bucket/alias/global" | "/v1/bucket/alias/global") => GlobalUnaliasBucket (query::id, query::alias),
|
||||
PUT ("/v0/bucket/alias/local" | "/v1/bucket/alias/local") => LocalAliasBucket (query::id, query::access_key_id, query::alias),
|
||||
DELETE ("/v0/bucket/alias/local" | "/v1/bucket/alias/local") => LocalUnaliasBucket (query::id, query::access_key_id, query::alias),
|
||||
]);
|
||||
|
||||
if let Some(message) = query.nonempty_message() {
|
||||
debug!("Unused query parameter: {}", message)
|
||||
}
|
||||
|
||||
Ok(res)
|
||||
}
|
||||
/// Get the kind of authorization which is required to perform the operation.
|
||||
pub fn authorization_type(&self) -> Authorization {
|
||||
match self {
|
||||
Self::Health => Authorization::None,
|
||||
Self::CheckDomain => Authorization::None,
|
||||
Self::Metrics => Authorization::MetricsToken,
|
||||
_ => Authorization::AdminToken,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
generateQueryParameters! {
|
||||
keywords: [],
|
||||
fields: [
|
||||
"format" => format,
|
||||
"id" => id,
|
||||
"search" => search,
|
||||
"globalAlias" => global_alias,
|
||||
"alias" => alias,
|
||||
"accessKeyId" => access_key_id,
|
||||
"showSecretKey" => show_secret_key
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,143 @@
|
||||
use std::borrow::Cow;
|
||||
|
||||
use hyper::{Method, Request};
|
||||
|
||||
use crate::admin::error::*;
|
||||
use crate::router_macros::*;
|
||||
|
||||
router_match! {@func
|
||||
|
||||
/// List of all Admin API endpoints.
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub enum Endpoint {
|
||||
Options,
|
||||
CheckDomain,
|
||||
Health,
|
||||
Metrics,
|
||||
GetClusterStatus,
|
||||
GetClusterHealth,
|
||||
ConnectClusterNodes,
|
||||
// Layout
|
||||
GetClusterLayout,
|
||||
UpdateClusterLayout,
|
||||
ApplyClusterLayout,
|
||||
RevertClusterLayout,
|
||||
// Keys
|
||||
ListKeys,
|
||||
CreateKey,
|
||||
ImportKey,
|
||||
GetKeyInfo {
|
||||
id: Option<String>,
|
||||
search: Option<String>,
|
||||
},
|
||||
DeleteKey {
|
||||
id: String,
|
||||
},
|
||||
UpdateKey {
|
||||
id: String,
|
||||
},
|
||||
// Buckets
|
||||
ListBuckets,
|
||||
CreateBucket,
|
||||
GetBucketInfo {
|
||||
id: Option<String>,
|
||||
global_alias: Option<String>,
|
||||
},
|
||||
DeleteBucket {
|
||||
id: String,
|
||||
},
|
||||
UpdateBucket {
|
||||
id: String,
|
||||
},
|
||||
// Bucket-Key Permissions
|
||||
BucketAllowKey,
|
||||
BucketDenyKey,
|
||||
// Bucket aliases
|
||||
GlobalAliasBucket {
|
||||
id: String,
|
||||
alias: String,
|
||||
},
|
||||
GlobalUnaliasBucket {
|
||||
id: String,
|
||||
alias: String,
|
||||
},
|
||||
LocalAliasBucket {
|
||||
id: String,
|
||||
access_key_id: String,
|
||||
alias: String,
|
||||
},
|
||||
LocalUnaliasBucket {
|
||||
id: String,
|
||||
access_key_id: String,
|
||||
alias: String,
|
||||
},
|
||||
}}
|
||||
|
||||
impl Endpoint {
|
||||
/// Determine which S3 endpoint a request is for using the request, and a bucket which was
|
||||
/// possibly extracted from the Host header.
|
||||
/// Returns Self plus bucket name, if endpoint is not Endpoint::ListBuckets
|
||||
pub fn from_request<T>(req: &Request<T>) -> Result<Self, Error> {
|
||||
let uri = req.uri();
|
||||
let path = uri.path();
|
||||
let query = uri.query();
|
||||
|
||||
let mut query = QueryParameters::from_query(query.unwrap_or_default())?;
|
||||
|
||||
let res = router_match!(@gen_path_parser (req.method(), path, query) [
|
||||
OPTIONS _ => Options,
|
||||
GET "/check" => CheckDomain,
|
||||
GET "/health" => Health,
|
||||
GET "/metrics" => Metrics,
|
||||
GET "/v0/status" => GetClusterStatus,
|
||||
GET "/v0/health" => GetClusterHealth,
|
||||
POST "/v0/connect" => ConnectClusterNodes,
|
||||
// Layout endpoints
|
||||
GET "/v0/layout" => GetClusterLayout,
|
||||
POST "/v0/layout" => UpdateClusterLayout,
|
||||
POST "/v0/layout/apply" => ApplyClusterLayout,
|
||||
POST "/v0/layout/revert" => RevertClusterLayout,
|
||||
// API key endpoints
|
||||
GET "/v0/key" if id => GetKeyInfo (query_opt::id, query_opt::search),
|
||||
GET "/v0/key" if search => GetKeyInfo (query_opt::id, query_opt::search),
|
||||
POST "/v0/key" if id => UpdateKey (query::id),
|
||||
POST "/v0/key" => CreateKey,
|
||||
POST "/v0/key/import" => ImportKey,
|
||||
DELETE "/v0/key" if id => DeleteKey (query::id),
|
||||
GET "/v0/key" => ListKeys,
|
||||
// Bucket endpoints
|
||||
GET "/v0/bucket" if id => GetBucketInfo (query_opt::id, query_opt::global_alias),
|
||||
GET "/v0/bucket" if global_alias => GetBucketInfo (query_opt::id, query_opt::global_alias),
|
||||
GET "/v0/bucket" => ListBuckets,
|
||||
POST "/v0/bucket" => CreateBucket,
|
||||
DELETE "/v0/bucket" if id => DeleteBucket (query::id),
|
||||
PUT "/v0/bucket" if id => UpdateBucket (query::id),
|
||||
// Bucket-key permissions
|
||||
POST "/v0/bucket/allow" => BucketAllowKey,
|
||||
POST "/v0/bucket/deny" => BucketDenyKey,
|
||||
// Bucket aliases
|
||||
PUT "/v0/bucket/alias/global" => GlobalAliasBucket (query::id, query::alias),
|
||||
DELETE "/v0/bucket/alias/global" => GlobalUnaliasBucket (query::id, query::alias),
|
||||
PUT "/v0/bucket/alias/local" => LocalAliasBucket (query::id, query::access_key_id, query::alias),
|
||||
DELETE "/v0/bucket/alias/local" => LocalUnaliasBucket (query::id, query::access_key_id, query::alias),
|
||||
]);
|
||||
|
||||
if let Some(message) = query.nonempty_message() {
|
||||
debug!("Unused query parameter: {}", message)
|
||||
}
|
||||
|
||||
Ok(res)
|
||||
}
|
||||
}
|
||||
|
||||
generateQueryParameters! {
|
||||
keywords: [],
|
||||
fields: [
|
||||
"format" => format,
|
||||
"id" => id,
|
||||
"search" => search,
|
||||
"globalAlias" => global_alias,
|
||||
"alias" => alias,
|
||||
"accessKeyId" => access_key_id
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,235 @@
|
||||
use std::borrow::Cow;
|
||||
|
||||
use hyper::{Method, Request};
|
||||
|
||||
use crate::admin::error::*;
|
||||
use crate::admin::router_v0;
|
||||
use crate::router_macros::*;
|
||||
|
||||
pub enum Authorization {
|
||||
None,
|
||||
MetricsToken,
|
||||
AdminToken,
|
||||
}
|
||||
|
||||
router_match! {@func
|
||||
|
||||
/// List of all Admin API endpoints.
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub enum Endpoint {
|
||||
Options,
|
||||
CheckDomain,
|
||||
Health,
|
||||
Metrics,
|
||||
GetClusterStatus,
|
||||
GetClusterHealth,
|
||||
ConnectClusterNodes,
|
||||
// Layout
|
||||
GetClusterLayout,
|
||||
UpdateClusterLayout,
|
||||
ApplyClusterLayout,
|
||||
RevertClusterLayout,
|
||||
// Keys
|
||||
ListKeys,
|
||||
CreateKey,
|
||||
ImportKey,
|
||||
GetKeyInfo {
|
||||
id: Option<String>,
|
||||
search: Option<String>,
|
||||
show_secret_key: Option<String>,
|
||||
},
|
||||
DeleteKey {
|
||||
id: String,
|
||||
},
|
||||
UpdateKey {
|
||||
id: String,
|
||||
},
|
||||
// Buckets
|
||||
ListBuckets,
|
||||
CreateBucket,
|
||||
GetBucketInfo {
|
||||
id: Option<String>,
|
||||
global_alias: Option<String>,
|
||||
},
|
||||
DeleteBucket {
|
||||
id: String,
|
||||
},
|
||||
UpdateBucket {
|
||||
id: String,
|
||||
},
|
||||
// Bucket-Key Permissions
|
||||
BucketAllowKey,
|
||||
BucketDenyKey,
|
||||
// Bucket aliases
|
||||
GlobalAliasBucket {
|
||||
id: String,
|
||||
alias: String,
|
||||
},
|
||||
GlobalUnaliasBucket {
|
||||
id: String,
|
||||
alias: String,
|
||||
},
|
||||
LocalAliasBucket {
|
||||
id: String,
|
||||
access_key_id: String,
|
||||
alias: String,
|
||||
},
|
||||
LocalUnaliasBucket {
|
||||
id: String,
|
||||
access_key_id: String,
|
||||
alias: String,
|
||||
},
|
||||
}}
|
||||
|
||||
impl Endpoint {
|
||||
/// Determine which S3 endpoint a request is for using the request, and a bucket which was
|
||||
/// possibly extracted from the Host header.
|
||||
/// Returns Self plus bucket name, if endpoint is not Endpoint::ListBuckets
|
||||
pub fn from_request<T>(req: &Request<T>) -> Result<Self, Error> {
|
||||
let uri = req.uri();
|
||||
let path = uri.path();
|
||||
let query = uri.query();
|
||||
|
||||
let mut query = QueryParameters::from_query(query.unwrap_or_default())?;
|
||||
|
||||
let res = router_match!(@gen_path_parser (req.method(), path, query) [
|
||||
OPTIONS _ => Options,
|
||||
GET "/check" => CheckDomain,
|
||||
GET "/health" => Health,
|
||||
GET "/metrics" => Metrics,
|
||||
GET "/v1/status" => GetClusterStatus,
|
||||
GET "/v1/health" => GetClusterHealth,
|
||||
POST "/v1/connect" => ConnectClusterNodes,
|
||||
// Layout endpoints
|
||||
GET "/v1/layout" => GetClusterLayout,
|
||||
POST "/v1/layout" => UpdateClusterLayout,
|
||||
POST "/v1/layout/apply" => ApplyClusterLayout,
|
||||
POST "/v1/layout/revert" => RevertClusterLayout,
|
||||
// API key endpoints
|
||||
GET "/v1/key" if id => GetKeyInfo (query_opt::id, query_opt::search, query_opt::show_secret_key),
|
||||
GET "/v1/key" if search => GetKeyInfo (query_opt::id, query_opt::search, query_opt::show_secret_key),
|
||||
POST "/v1/key" if id => UpdateKey (query::id),
|
||||
POST "/v1/key" => CreateKey,
|
||||
POST "/v1/key/import" => ImportKey,
|
||||
DELETE "/v1/key" if id => DeleteKey (query::id),
|
||||
GET "/v1/key" => ListKeys,
|
||||
// Bucket endpoints
|
||||
GET "/v1/bucket" if id => GetBucketInfo (query_opt::id, query_opt::global_alias),
|
||||
GET "/v1/bucket" if global_alias => GetBucketInfo (query_opt::id, query_opt::global_alias),
|
||||
GET "/v1/bucket" => ListBuckets,
|
||||
POST "/v1/bucket" => CreateBucket,
|
||||
DELETE "/v1/bucket" if id => DeleteBucket (query::id),
|
||||
PUT "/v1/bucket" if id => UpdateBucket (query::id),
|
||||
// Bucket-key permissions
|
||||
POST "/v1/bucket/allow" => BucketAllowKey,
|
||||
POST "/v1/bucket/deny" => BucketDenyKey,
|
||||
// Bucket aliases
|
||||
PUT "/v1/bucket/alias/global" => GlobalAliasBucket (query::id, query::alias),
|
||||
DELETE "/v1/bucket/alias/global" => GlobalUnaliasBucket (query::id, query::alias),
|
||||
PUT "/v1/bucket/alias/local" => LocalAliasBucket (query::id, query::access_key_id, query::alias),
|
||||
DELETE "/v1/bucket/alias/local" => LocalUnaliasBucket (query::id, query::access_key_id, query::alias),
|
||||
]);
|
||||
|
||||
if let Some(message) = query.nonempty_message() {
|
||||
debug!("Unused query parameter: {}", message)
|
||||
}
|
||||
|
||||
Ok(res)
|
||||
}
|
||||
/// Some endpoints work exactly the same in their v1/ version as they did in their v0/ version.
|
||||
/// For these endpoints, we can convert a v0/ call to its equivalent as if it was made using
|
||||
/// its v1/ URL.
|
||||
pub fn from_v0(v0_endpoint: router_v0::Endpoint) -> Result<Self, Error> {
|
||||
match v0_endpoint {
|
||||
// Cluster endpoints
|
||||
router_v0::Endpoint::ConnectClusterNodes => Ok(Self::ConnectClusterNodes),
|
||||
// - GetClusterStatus: response format changed
|
||||
// - GetClusterHealth: response format changed
|
||||
|
||||
// Layout endpoints
|
||||
router_v0::Endpoint::RevertClusterLayout => Ok(Self::RevertClusterLayout),
|
||||
// - GetClusterLayout: response format changed
|
||||
// - UpdateClusterLayout: query format changed
|
||||
// - ApplyCusterLayout: response format changed
|
||||
|
||||
// Key endpoints
|
||||
router_v0::Endpoint::ListKeys => Ok(Self::ListKeys),
|
||||
router_v0::Endpoint::CreateKey => Ok(Self::CreateKey),
|
||||
router_v0::Endpoint::GetKeyInfo { id, search } => Ok(Self::GetKeyInfo {
|
||||
id,
|
||||
search,
|
||||
show_secret_key: Some("true".into()),
|
||||
}),
|
||||
router_v0::Endpoint::DeleteKey { id } => Ok(Self::DeleteKey { id }),
|
||||
// - UpdateKey: response format changed (secret key no longer returned)
|
||||
|
||||
// Bucket endpoints
|
||||
router_v0::Endpoint::GetBucketInfo { id, global_alias } => {
|
||||
Ok(Self::GetBucketInfo { id, global_alias })
|
||||
}
|
||||
router_v0::Endpoint::ListBuckets => Ok(Self::ListBuckets),
|
||||
router_v0::Endpoint::CreateBucket => Ok(Self::CreateBucket),
|
||||
router_v0::Endpoint::DeleteBucket { id } => Ok(Self::DeleteBucket { id }),
|
||||
router_v0::Endpoint::UpdateBucket { id } => Ok(Self::UpdateBucket { id }),
|
||||
|
||||
// Bucket-key permissions
|
||||
router_v0::Endpoint::BucketAllowKey => Ok(Self::BucketAllowKey),
|
||||
router_v0::Endpoint::BucketDenyKey => Ok(Self::BucketDenyKey),
|
||||
|
||||
// Bucket alias endpoints
|
||||
router_v0::Endpoint::GlobalAliasBucket { id, alias } => {
|
||||
Ok(Self::GlobalAliasBucket { id, alias })
|
||||
}
|
||||
router_v0::Endpoint::GlobalUnaliasBucket { id, alias } => {
|
||||
Ok(Self::GlobalUnaliasBucket { id, alias })
|
||||
}
|
||||
router_v0::Endpoint::LocalAliasBucket {
|
||||
id,
|
||||
access_key_id,
|
||||
alias,
|
||||
} => Ok(Self::LocalAliasBucket {
|
||||
id,
|
||||
access_key_id,
|
||||
alias,
|
||||
}),
|
||||
router_v0::Endpoint::LocalUnaliasBucket {
|
||||
id,
|
||||
access_key_id,
|
||||
alias,
|
||||
} => Ok(Self::LocalUnaliasBucket {
|
||||
id,
|
||||
access_key_id,
|
||||
alias,
|
||||
}),
|
||||
|
||||
// For endpoints that have different body content syntax, issue
|
||||
// deprecation warning
|
||||
_ => Err(Error::bad_request(format!(
|
||||
"v0/ endpoint is no longer supported: {}",
|
||||
v0_endpoint.name()
|
||||
))),
|
||||
}
|
||||
}
|
||||
/// Get the kind of authorization which is required to perform the operation.
|
||||
pub fn authorization_type(&self) -> Authorization {
|
||||
match self {
|
||||
Self::Health => Authorization::None,
|
||||
Self::CheckDomain => Authorization::None,
|
||||
Self::Metrics => Authorization::MetricsToken,
|
||||
_ => Authorization::AdminToken,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
generateQueryParameters! {
|
||||
keywords: [],
|
||||
fields: [
|
||||
"format" => format,
|
||||
"id" => id,
|
||||
"search" => search,
|
||||
"globalAlias" => global_alias,
|
||||
"alias" => alias,
|
||||
"accessKeyId" => access_key_id,
|
||||
"showSecretKey" => show_secret_key
|
||||
]
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "garage_block"
|
||||
version = "0.8.4"
|
||||
version = "0.9.0"
|
||||
authors = ["Alex Auvolat <alex@adnab.me>"]
|
||||
edition = "2018"
|
||||
license = "AGPL-3.0"
|
||||
|
||||
+1
-6
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "garage_db"
|
||||
version = "0.8.4"
|
||||
version = "0.9.0"
|
||||
authors = ["Alex Auvolat <alex@adnab.me>"]
|
||||
edition = "2018"
|
||||
license = "AGPL-3.0"
|
||||
@@ -11,11 +11,6 @@ readme = "../../README.md"
|
||||
[lib]
|
||||
path = "lib.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "convert"
|
||||
path = "bin/convert.rs"
|
||||
required-features = ["cli"]
|
||||
|
||||
[dependencies]
|
||||
err-derive = "0.3"
|
||||
hexdump = "0.1"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "garage"
|
||||
version = "0.8.4"
|
||||
version = "0.9.0"
|
||||
authors = ["Alex Auvolat <alex@adnab.me>"]
|
||||
edition = "2018"
|
||||
license = "AGPL-3.0"
|
||||
|
||||
@@ -1,39 +1,30 @@
|
||||
use std::path::PathBuf;
|
||||
|
||||
use structopt::StructOpt;
|
||||
|
||||
use garage_db::*;
|
||||
|
||||
use clap::Parser;
|
||||
|
||||
/// K2V command line interface
|
||||
#[derive(Parser, Debug)]
|
||||
#[clap(author, version, about, long_about = None)]
|
||||
struct Args {
|
||||
/// Input DB path
|
||||
#[clap(short = 'i')]
|
||||
#[derive(StructOpt, Debug)]
|
||||
pub struct ConvertDbOpt {
|
||||
/// Input database path (not the same as metadata_dir, see
|
||||
/// https://garagehq.deuxfleurs.fr/documentation/reference-manual/configuration/#db-engine-since-v0-8-0)
|
||||
#[structopt(short = "i")]
|
||||
input_path: PathBuf,
|
||||
/// Input DB engine
|
||||
#[clap(short = 'a')]
|
||||
/// Input database engine (sled, lmdb or sqlite; limited by db engines
|
||||
/// enabled in this build)
|
||||
#[structopt(short = "a")]
|
||||
input_engine: String,
|
||||
|
||||
/// Output DB path
|
||||
#[clap(short = 'o')]
|
||||
/// Output database path
|
||||
#[structopt(short = "o")]
|
||||
output_path: PathBuf,
|
||||
/// Output DB engine
|
||||
#[clap(short = 'b')]
|
||||
/// Output database engine
|
||||
#[structopt(short = "b")]
|
||||
output_engine: String,
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let args = Args::parse();
|
||||
pretty_env_logger::init();
|
||||
|
||||
match do_conversion(args) {
|
||||
Ok(()) => println!("Success!"),
|
||||
Err(e) => eprintln!("Error: {}", e),
|
||||
}
|
||||
}
|
||||
|
||||
fn do_conversion(args: Args) -> Result<()> {
|
||||
pub(crate) fn do_conversion(args: ConvertDbOpt) -> Result<()> {
|
||||
let input = open_db(args.input_path, args.input_engine)?;
|
||||
let output = open_db(args.output_path, args.output_engine)?;
|
||||
output.import(&input)?;
|
||||
@@ -42,16 +33,19 @@ fn do_conversion(args: Args) -> Result<()> {
|
||||
|
||||
fn open_db(path: PathBuf, engine: String) -> Result<Db> {
|
||||
match engine.as_str() {
|
||||
#[cfg(feature = "sled")]
|
||||
"sled" => {
|
||||
let db = sled_adapter::sled::Config::default().path(&path).open()?;
|
||||
Ok(sled_adapter::SledDb::init(db))
|
||||
}
|
||||
#[cfg(feature = "sqlite")]
|
||||
"sqlite" | "sqlite3" | "rusqlite" => {
|
||||
let db = sqlite_adapter::rusqlite::Connection::open(&path)?;
|
||||
db.pragma_update(None, "journal_mode", &"WAL")?;
|
||||
db.pragma_update(None, "synchronous", &"NORMAL")?;
|
||||
Ok(sqlite_adapter::SqliteDb::init(db))
|
||||
}
|
||||
#[cfg(feature = "lmdb")]
|
||||
"lmdb" | "heed" => {
|
||||
std::fs::create_dir_all(&path).map_err(|e| {
|
||||
Error(format!("Unable to create LMDB data directory: {}", e).into())
|
||||
@@ -63,11 +57,13 @@ fn open_db(path: PathBuf, engine: String) -> Result<Db> {
|
||||
env_builder.max_dbs(100);
|
||||
env_builder.map_size(map_size);
|
||||
unsafe {
|
||||
env_builder.flag(heed::flags::Flags::MdbNoMetaSync);
|
||||
env_builder.flag(lmdb_adapter::heed::flags::Flags::MdbNoMetaSync);
|
||||
}
|
||||
let db = env_builder.open(&path)?;
|
||||
Ok(lmdb_adapter::LmdbDb::init(db))
|
||||
}
|
||||
e => Err(Error(format!("Invalid DB engine: {}", e).into())),
|
||||
e => Err(Error(
|
||||
format!("Invalid or unsupported DB engine: {}", e).into(),
|
||||
)),
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,8 @@ pub(crate) mod layout;
|
||||
pub(crate) mod structs;
|
||||
pub(crate) mod util;
|
||||
|
||||
pub(crate) mod convert_db;
|
||||
|
||||
pub(crate) use cmd::*;
|
||||
pub(crate) use init::*;
|
||||
pub(crate) use layout::*;
|
||||
|
||||
@@ -3,6 +3,8 @@ use structopt::StructOpt;
|
||||
|
||||
use garage_util::version::garage_version;
|
||||
|
||||
use crate::cli::convert_db;
|
||||
|
||||
#[derive(StructOpt, Debug)]
|
||||
pub enum Command {
|
||||
/// Run Garage server
|
||||
@@ -54,6 +56,10 @@ pub enum Command {
|
||||
/// Low-level debug operations on data blocks
|
||||
#[structopt(name = "block", version = garage_version())]
|
||||
Block(BlockOperation),
|
||||
|
||||
/// Convert metadata db between database engine formats
|
||||
#[structopt(name = "convert-db", version = garage_version())]
|
||||
ConvertDb(convert_db::ConvertDbOpt),
|
||||
}
|
||||
|
||||
#[derive(StructOpt, Debug)]
|
||||
@@ -453,7 +459,7 @@ pub enum RepairWhat {
|
||||
/// Do a full sync of metadata tables
|
||||
#[structopt(name = "tables", version = garage_version())]
|
||||
Tables,
|
||||
/// Repair (resync/rebalance) the set of stored blocks
|
||||
/// Repair (resync/rebalance) the set of stored blocks in the cluster
|
||||
#[structopt(name = "blocks", version = garage_version())]
|
||||
Blocks,
|
||||
/// Repropagate object deletions to the version table
|
||||
@@ -471,7 +477,7 @@ pub enum RepairWhat {
|
||||
#[structopt(subcommand)]
|
||||
cmd: ScrubCmd,
|
||||
},
|
||||
/// Rebalance data blocks among storage locations
|
||||
/// Rebalance data blocks among HDDs on individual nodes
|
||||
#[structopt(name = "rebalance", version = garage_version())]
|
||||
Rebalance,
|
||||
}
|
||||
|
||||
@@ -176,6 +176,9 @@ async fn main() {
|
||||
Command::OfflineRepair(repair_opt) => {
|
||||
repair::offline::offline_repair(opt.config_file, opt.secrets, repair_opt).await
|
||||
}
|
||||
Command::ConvertDb(conv_opt) => {
|
||||
cli::convert_db::do_conversion(conv_opt).map_err(From::from)
|
||||
}
|
||||
Command::Node(NodeOperation::NodeId(node_id_opt)) => {
|
||||
node_id_command(opt.config_file, node_id_opt.quiet)
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "garage_model"
|
||||
version = "0.8.4"
|
||||
version = "0.9.0"
|
||||
authors = ["Alex Auvolat <alex@adnab.me>"]
|
||||
edition = "2018"
|
||||
license = "AGPL-3.0"
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "garage_rpc"
|
||||
version = "0.8.4"
|
||||
version = "0.9.0"
|
||||
authors = ["Alex Auvolat <alex@adnab.me>"]
|
||||
edition = "2018"
|
||||
license = "AGPL-3.0"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "garage_table"
|
||||
version = "0.8.4"
|
||||
version = "0.9.0"
|
||||
authors = ["Alex Auvolat <alex@adnab.me>"]
|
||||
edition = "2018"
|
||||
license = "AGPL-3.0"
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "garage_util"
|
||||
version = "0.8.4"
|
||||
version = "0.9.0"
|
||||
authors = ["Alex Auvolat <alex@adnab.me>"]
|
||||
edition = "2018"
|
||||
license = "AGPL-3.0"
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "garage_web"
|
||||
version = "0.8.4"
|
||||
version = "0.9.0"
|
||||
authors = ["Alex Auvolat <alex@adnab.me>", "Quentin Dufour <quentin@dufour.io>"]
|
||||
edition = "2018"
|
||||
license = "AGPL-3.0"
|
||||
|
||||
Reference in New Issue
Block a user