2
0
Fork 0
mirror of https://git.asonix.dog/asonix/pict-rs synced 2024-12-22 03:11:24 +00:00

Update object-storage docker section to try for garage support

Garage doesn't work yet. There's an incompatibility between rusty-s3 and garage
relevant code:
- https://github.com/paolobarbolini/rusty-s3/blob/main/src/actions/multipart_upload/create.rs#L81
- https://git.deuxfleurs.fr/Deuxfleurs/garage/src/branch/main/src/api/router_macros.rs#L174

Hopefully one of the sides fixes this soon. I asked in the garage matrix channel, and if they
point me back to rusty-s3 I'll open an issue there.
This commit is contained in:
asonix 2022-12-07 22:45:32 -06:00
parent 74cd3392fa
commit 0da6159cf1
7 changed files with 133 additions and 0 deletions

1
.gitignore vendored
View file

@ -3,3 +3,4 @@
/docker/dev/volumes
/client-examples/javascript/node_modules
/docker/object-storage/storage
/docker/object-storage/pict-rs-garage.toml

View file

@ -7,6 +7,7 @@ export GROUP_ID=$(id -g)
sudo docker-compose build --pull
sudo docker-compose up -d minio
sudo docker-compose up -d garage
sudo docker-compose up -d pictrs_proxy
sudo docker-compose up -d otel
sudo docker-compose up -d jaeger

View file

@ -14,6 +14,7 @@ services:
environment:
- PICTRS__TRACING__CONSOLE__ADDRESS=0.0.0.0:6669
- PICTRS__TRACING__OPENTELEMETRY__URL=http://otel:4137
- RUST_BACKTRACE=1
stdin_open: true
tty: true
volumes:
@ -37,6 +38,20 @@ services:
volumes:
- ./storage/minio:/mnt
garage:
image: dxflrs/garage:v0.8.0
ports:
- "3900:3900"
- "3901:3901"
- "3902:3902"
- "3903:3903"
- "3904:3904"
environment:
- RUST_LOG=debug
volumes:
- ./storage/garage:/mnt
- ./garage.toml:/etc/garage.toml
otel:
image: otel/opentelemetry-collector:latest
command: --config otel-local-config.yaml

View file

@ -0,0 +1,26 @@
metadata_dir = "./storage/garage/meta"
data_dir = "./storage/garage/data"
db_engine = "lmdb"
replication_mode = "none"
rpc_bind_addr = "[::]:3901"
rpc_public_addr = "127.0.0.1:3901"
rpc_secret = "01ab6c57fc5c5176a6de79953bc2566f902cb99bf6d9b4c0c83b888b06e11dae"
[s3_api]
s3_region = "garage"
api_bind_addr = "[::]:3900"
root_domain = ".s3.garage.localhost"
[s3_web]
bind_addr = "[::]:3902"
root_domain = ".web.garage.localhost"
index = "index.html"
[k2v_api]
api_bind_addr = "[::]:3904"
[admin]
api_bind_addr = "0.0.0.0:3903"
admin_token = "HDuy2Bw+clxp5I//nKN5ZS9uO8KHhhKFdQRfyPmutvc="

View file

@ -0,0 +1,26 @@
metadata_dir = "/mnt/meta"
data_dir = "/mnt/data"
db_engine = "lmdb"
replication_mode = "none"
rpc_bind_addr = "[::]:3901"
rpc_public_addr = "127.0.0.1:3901"
rpc_secret = "01ab6c57fc5c5176a6de79953bc2566f902cb99bf6d9b4c0c83b888b06e11dae"
[s3_api]
s3_region = "garage"
api_bind_addr = "[::]:3900"
root_domain = ".s3.garage.localhost"
[s3_web]
bind_addr = "[::]:3902"
root_domain = ".web.garage.localhost"
index = "index.html"
[k2v_api]
api_bind_addr = "[::]:3904"
[admin]
api_bind_addr = "0.0.0.0:3903"
admin_token = "HDuy2Bw+clxp5I//nKN5ZS9uO8KHhhKFdQRfyPmutvc="

View file

@ -0,0 +1,64 @@
#!/usr/bin/env bash
STDOUT=./out.log
STDERR=./err.log
rm "${STDOUT}" "${STDERR}"
node_id=$(garage -c garage-local.toml status 2>>"${STDERR}" | tail -n 1 | awk '{ print $1 }')
garage -c garage-local.toml layout assign -z dc1 -c 1 "${node_id}" >>"${STDOUT}" 2>>"${STDERR}"
garage -c garage-local.toml layout apply --version 1 >>"${STDOUT}" 2>>"${STDERR}"
garage -c garage-local.toml bucket create pict-rs >>"${STDOUT}" 2>>"${STDERR}"
garage -c garage-local.toml key new --name pict-rs-key >>"${STDOUT}" 2>>"${STDERR}"
key_id=$(garage -c garage-local.toml key info pict-rs-key 2>>"${STDERR}" | grep "Key ID" | awk '{ print $3 }')
secret_key=$(garage -c garage-local.toml key info pict-rs-key 2>>"${STDERR}" | grep "Secret key" | awk '{ print $3 }')
garage -c garage-local.toml bucket allow --read --write --owner pict-rs --key pict-rs-key >>"${STDOUT}" 2>>"${STDERR}"
cat > pict-rs-garage.toml <<EOF
[server]
address = '0.0.0.0:8080'
worker_id = 'pict-rs-1'
[tracing.logging]
format = 'normal'
targets = 'warn,tracing_actix_web=info,actix_server=info,actix_web=info'
[tracing.console]
buffer_capacity = 102400
[tracing.opentelemetry]
service_name = 'pict-rs'
targets = 'info'
[old_db]
path = '/mnt'
[media]
max_width = 10000
max_height = 10000
max_area = 40000000
max_file_size = 40
enable_silent_video = true
enable_full_video = true
video_codec = "vp9"
filters = ['blur', 'crop', 'identity', 'resize', 'thumbnail']
skip_validate_imports = false
[repo]
type = 'sled'
path = '/mnt/sled-repo-garage'
cache_capacity = 67108864
[store]
type = 'object_storage'
endpoint = 'http://garage:3900'
use_path_style = true
bucket_name = 'pict-rs'
region = 'garage'
access_key = '${key_id}'
secret_key = '${secret_key}'
EOF