mirror of
https://github.com/deuxfleurs-org/garage.git
synced 2026-08-13 15:46:53 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 432131f5b8 |
+1
-12
@@ -245,17 +245,6 @@ node:
|
||||
nix-daemon: 1
|
||||
|
||||
steps:
|
||||
- name: multiarch-docker
|
||||
image: nixpkgs/nix:nixos-22.05
|
||||
environment:
|
||||
DOCKER_AUTH:
|
||||
from_secret: docker_auth
|
||||
HOME: "/root"
|
||||
commands:
|
||||
- mkdir -p /root/.docker
|
||||
- echo $DOCKER_AUTH > /root/.docker/config.json
|
||||
- export CONTAINER_TAG=${DRONE_TAG:-$DRONE_COMMIT}
|
||||
- nix-shell --attr release --run "multiarch_docker"
|
||||
- name: refresh-index
|
||||
image: nixpkgs/nix:nixos-22.05
|
||||
environment:
|
||||
@@ -280,6 +269,6 @@ trigger:
|
||||
|
||||
---
|
||||
kind: signature
|
||||
hmac: 103a04785c98f5376a63ce22865c2576963019bbc4d828f200d2a470a3c821ea
|
||||
hmac: 362639b4c9541ad9bd06ff7f72b5235b2b0216bcb16eececd25285b6fe94ba6f
|
||||
|
||||
...
|
||||
|
||||
@@ -51,15 +51,15 @@ to store 2 TB of data in total.
|
||||
|
||||
## Get a Docker image
|
||||
|
||||
Our docker image is currently named `dxflrs/garage` and is stored on the [Docker Hub](https://hub.docker.com/r/dxflrs/garage/tags?page=1&ordering=last_updated).
|
||||
We encourage you to use a fixed tag (eg. `v0.8.0`) and not the `latest` tag.
|
||||
For this example, we will use the latest published version at the time of the writing which is `v0.8.0` but it's up to you
|
||||
to check [the most recent versions on the Docker Hub](https://hub.docker.com/r/dxflrs/garage/tags?page=1&ordering=last_updated).
|
||||
Our docker image is currently named `dxflrs/amd64_garage` and is stored on the [Docker Hub](https://hub.docker.com/r/dxflrs/amd64_garage/tags?page=1&ordering=last_updated).
|
||||
We encourage you to use a fixed tag (eg. `v0.4.0`) and not the `latest` tag.
|
||||
For this example, we will use the latest published version at the time of the writing which is `v0.4.0` but it's up to you
|
||||
to check [the most recent versions on the Docker Hub](https://hub.docker.com/r/dxflrs/amd64_garage/tags?page=1&ordering=last_updated).
|
||||
|
||||
For example:
|
||||
|
||||
```
|
||||
sudo docker pull dxflrs/garage:v0.8.0
|
||||
sudo docker pull dxflrs/amd64_garage:v0.4.0
|
||||
```
|
||||
|
||||
## Deploying and configuring Garage
|
||||
@@ -125,7 +125,7 @@ docker run \
|
||||
-v /etc/garage.toml:/etc/garage.toml \
|
||||
-v /var/lib/garage/meta:/var/lib/garage/meta \
|
||||
-v /var/lib/garage/data:/var/lib/garage/data \
|
||||
dxflrs/garage:v0.8.0
|
||||
lxpz/garage_amd64:v0.4.0
|
||||
```
|
||||
|
||||
It should be restarted automatically at each reboot.
|
||||
|
||||
@@ -16,7 +16,7 @@ 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 (`scrub`, `block_refs`, etc.)
|
||||
2. Disable API and web access. Garage does not support disabling
|
||||
2. Disable api and web access. Garage does not support disabling
|
||||
these endpoints but you can change the port number or stop your reverse
|
||||
proxy for instance.
|
||||
3. Check once again that your cluster is healty. Run again `garage repair --all-nodes --yes tables` which is quick.
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
+++
|
||||
title = "Migrating from 0.7 to 0.8"
|
||||
weight = 13
|
||||
+++
|
||||
|
||||
**This guide explains how to migrate to 0.8 if you have an existing 0.7 cluster.
|
||||
We don't recommend trying to migrate to 0.8 directly from 0.6 or older.**
|
||||
|
||||
**We make no guarantee that this migration will work perfectly:
|
||||
back up all your data before attempting it!**
|
||||
|
||||
Garage v0.8 introduces new data tables that allow the counting of objects in buckets in order to implement bucket quotas.
|
||||
A manual migration step is required to first count objects in Garage buckets and populate these tables with accurate data.
|
||||
|
||||
The migration steps are as follows:
|
||||
|
||||
1. Disable API and web access. Garage v0.7 does not support disabling
|
||||
these endpoints but you can change the port number or stop your reverse proxy for instance.
|
||||
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 (`scrub`, `block_refs`, etc.)
|
||||
3. Check that queues are empty: run `garage stats` to query them or inspect metrics in the Grafana dashboard.
|
||||
4. Turn off Garage v0.7
|
||||
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.7.tar.zst meta/`
|
||||
6. Install Garage v0.8
|
||||
7. **Before starting Garage v0.8**, run the offline migration step: `garage offline-repair --yes object_counters`.
|
||||
This can take a while to run, depending on the number of objects stored in your cluster.
|
||||
8. Turn on Garage v0.8
|
||||
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.
|
||||
+1
-1
@@ -137,7 +137,7 @@ let
|
||||
/* [2] */ hardeningDisable = [ "pie" ];
|
||||
};
|
||||
overrideArgs = old: {
|
||||
/* [4] */ features = [ "bundled-libs" "sled" "metrics" "k2v" ]
|
||||
/* [4] */ features = [ "bundled-libs" "sled" "metrics" ]
|
||||
++ (if release then [ "kubernetes-discovery" "telemetry-otlp" "lmdb" "sqlite" ] else []);
|
||||
};
|
||||
})
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
pkgs:
|
||||
pkgs.buildGoModule rec {
|
||||
pname = "manifest-tool";
|
||||
version = "2.0.5";
|
||||
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "estesp";
|
||||
repo = "manifest-tool";
|
||||
rev = "v${version}";
|
||||
sha256 = "hjCGKnE0yrlnF/VIzOwcDzmQX3Wft+21KCny/opqdLg=";
|
||||
} + "/v2";
|
||||
|
||||
vendorSha256 = null;
|
||||
|
||||
checkPhase = "true";
|
||||
|
||||
meta = with pkgs.lib; {
|
||||
description = "Command line tool to create and query container image manifest list/indexes";
|
||||
homepage = "https://github.com/estesp/manifest-tool";
|
||||
license = licenses.asl20;
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
||||
@@ -10,7 +10,6 @@ let
|
||||
overlays = [ cargo2nixOverlay ];
|
||||
};
|
||||
kaniko = (import ./nix/kaniko.nix) pkgs;
|
||||
manifest-tool = (import ./nix/manifest-tool.nix) pkgs;
|
||||
winscp = (import ./nix/winscp.nix) pkgs;
|
||||
|
||||
in
|
||||
@@ -85,34 +84,6 @@ function to_docker {
|
||||
--verbosity=debug
|
||||
}
|
||||
|
||||
function multiarch_docker {
|
||||
manifest-tool push from-spec <(cat <<EOF
|
||||
image: dxflrs/garage:''${CONTAINER_TAG}
|
||||
manifests:
|
||||
-
|
||||
image: dxflrs/arm64_garage:''${CONTAINER_TAG}
|
||||
platform:
|
||||
architecture: arm64
|
||||
os: linux
|
||||
-
|
||||
image: dxflrs/amd64_garage:''${CONTAINER_TAG}
|
||||
platform:
|
||||
architecture: amd64
|
||||
os: linux
|
||||
-
|
||||
image: dxflrs/386_garage:''${CONTAINER_TAG}
|
||||
platform:
|
||||
architecture: 386
|
||||
os: linux
|
||||
-
|
||||
image: dxflrs/arm_garage:''${CONTAINER_TAG}
|
||||
platform:
|
||||
architecture: arm
|
||||
os: linux
|
||||
EOF
|
||||
)
|
||||
}
|
||||
|
||||
function refresh_index {
|
||||
aws \
|
||||
--endpoint-url https://garage.deuxfleurs.fr \
|
||||
@@ -142,7 +113,6 @@ function refresh_index {
|
||||
nativeBuildInputs = [
|
||||
pkgs.awscli2
|
||||
kaniko
|
||||
manifest-tool
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -174,11 +174,7 @@ impl<A: ApiHandler> ApiServer<A> {
|
||||
|
||||
let current_context = Context::current();
|
||||
let current_span = current_context.span();
|
||||
current_span.update_name::<String>(format!(
|
||||
"{} API {}",
|
||||
A::API_NAME_DISPLAY,
|
||||
endpoint.name()
|
||||
));
|
||||
current_span.update_name::<String>(format!("S3 API {}", endpoint.name()));
|
||||
current_span.set_attribute(KeyValue::new("endpoint", endpoint.name()));
|
||||
endpoint.add_span_attributes(current_span);
|
||||
|
||||
|
||||
@@ -607,7 +607,7 @@ impl BlockManagerLocked {
|
||||
path2.set_extension("tmp");
|
||||
let mut f = fs::File::create(&path2).await?;
|
||||
f.write_all(data).await?;
|
||||
f.sync_all().await?;
|
||||
//f.sync_all().await?;
|
||||
drop(f);
|
||||
|
||||
fs::rename(path2, path).await?;
|
||||
@@ -620,13 +620,13 @@ impl BlockManagerLocked {
|
||||
// Now, we do an fsync on the containing directory, to ensure that the rename
|
||||
// is persisted properly. See:
|
||||
// http://thedjbway.b0llix.net/qmail/syncdir.html
|
||||
let dir = fs::OpenOptions::new()
|
||||
/*let dir = fs::OpenOptions::new()
|
||||
.read(true)
|
||||
.mode(0)
|
||||
.open(directory)
|
||||
.await?;
|
||||
dir.sync_all().await?;
|
||||
drop(dir);
|
||||
drop(dir);*/
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user