Skip to content

Commit 7f7fc3f

Browse files
committed
perf: move to rustfs
Moves the minio instance we're using from a 3y old version to rustfs, a new s3 compliant bucket with active support. Signed-off-by: Luca Zaninotto <luca.zaninotto@secomind.com>
1 parent f60be20 commit 7f7fc3f

3 files changed

Lines changed: 50 additions & 50 deletions

File tree

.env

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
22
# This file is part of Edgehog.
33
#
4-
# Copyright 2023-2024 SECO Mind Srl
4+
# Copyright 2023-2026 SECO Mind Srl
55
#
66
# Licensed under the Apache License, Version 2.0 (the "License");
77
# you may not use this file except in compliance with the License.
@@ -43,14 +43,14 @@ DOCKER_COMPOSE_EDGEHOG_BASE_DOMAIN=edgehog.localhost
4343
# configuration for Astarte.
4444
DOCKER_COMPOSE_ASTARTE_BASE_DOMAIN=astarte.localhost
4545

46-
S3_ACCESS_KEY_ID=minioadmin
47-
S3_SECRET_ACCESS_KEY=minioadmin
46+
S3_ACCESS_KEY_ID=rustfsadmin
47+
S3_SECRET_ACCESS_KEY=rustfsadmin
4848
S3_REGION=local
4949
S3_SCHEME=http://
50-
S3_HOST=minio
50+
S3_HOST=rustfs
5151
S3_PORT=9000
5252
S3_BUCKET=edgehog
53-
S3_ASSET_HOST=http://minio-storage.${DOCKER_COMPOSE_EDGEHOG_BASE_DOMAIN}/edgehog
53+
S3_ASSET_HOST=http://rustfs-storage.${DOCKER_COMPOSE_EDGEHOG_BASE_DOMAIN}/edgehog
5454
S3_GCP_CREDENTIALS=
5555

5656
SEEDS_REALM=test

.github/workflows/backend-minio.yaml

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#
1717
# SPDX-License-Identifier: Apache-2.0
1818

19-
name: Minio Integration Test
19+
name: Rustfs Integration Test
2020
on:
2121
workflow_call:
2222
workflow_dispatch:
@@ -31,7 +31,7 @@ env:
3131
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3232

3333
jobs:
34-
integration-minio:
34+
integration-rustfs:
3535
runs-on: ubuntu-latest
3636
services:
3737
postgres:
@@ -47,36 +47,37 @@ jobs:
4747
--health-retries 5
4848
steps:
4949
- uses: actions/checkout@v6
50-
- name: Start MinIO
50+
- name: Start Rustfs
5151
run: |
5252
docker run -d \
53-
--name minio \
53+
--name rustfs \
5454
-p 9000:9000 \
5555
-p 9001:9001 \
56-
-e MINIO_ROOT_USER=minioadmin \
57-
-e MINIO_ROOT_PASSWORD=minioadmin \
58-
minio/minio:latest \
59-
server /data --console-address ":9001"
56+
-e RUSTFS_ACCESS_KEY=rustfsadmin \
57+
-e RUSTFS_SECRET_KEY=rustfsadmin \
58+
-e RUSTFS_CONSOLE_ENABLE=false \
59+
rustfs/rustfs:latest \
60+
/data
6061
61-
- name: Wait for MinIO to be ready
62+
- name: Wait for Rustfs to be ready
6263
run: |
63-
echo "Waiting for MinIO to start..."
64+
echo "Waiting for Rustfs to start..."
6465
for i in {1..30}; do
65-
if curl -f http://localhost:9000/minio/health/live 2>/dev/null; then
66-
echo "MinIO is ready!"
66+
if curl -s http://localhost:9000/ 2>/dev/null; then
67+
echo "Rustfs is ready!"
6768
break
6869
fi
69-
echo "Attempt $i/30: MinIO not ready yet..."
70+
echo "Attempt $i/30: Rustfs not ready yet..."
7071
sleep 2
7172
done
7273
7374
- name: Bucket setup
7475
run: |
7576
wget https://dl.min.io/client/mc/release/linux-amd64/mc
7677
chmod +x ./mc
77-
./mc alias set minio http://localhost:9000 minioadmin minioadmin;
78-
./mc mb minio/edgehog;
79-
./mc anonymous set download minio/edgehog;
78+
./mc alias set rustfs http://localhost:9000 rustfsadmin rustfsadmin;
79+
./mc mb rustfs/edgehog;
80+
./mc anonymous set download rustfs/edgehog;
8081
8182
- uses: team-alembic/staple-actions/actions/mix-task@main
8283
with:
@@ -88,8 +89,8 @@ jobs:
8889
POSTGRES_PASSWORD: postgres
8990
POSTGRES_HOST: postgres
9091
STORAGE_TYPE: s3
91-
S3_ACCESS_KEY_ID: minioadmin
92-
S3_SECRET_ACCESS_KEY: minioadmin
92+
S3_ACCESS_KEY_ID: rustfsadmin
93+
S3_SECRET_ACCESS_KEY: rustfsadmin
9394
S3_REGION: local
9495
S3_SCHEME: http://
9596
S3_HOST: localhost

docker-compose.yml

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
#
21
# This file is part of Edgehog.
32
#
4-
# Copyright 2021-2025 SECO Mind Srl
3+
# Copyright 2021-2026 SECO Mind Srl
54
#
65
# Licensed under the Apache License, Version 2.0 (the "License");
76
# you may not use this file except in compliance with the License.
@@ -16,7 +15,6 @@
1615
# limitations under the License.
1716
#
1817
# SPDX-License-Identifier: Apache-2.0
19-
#
2018

2119
services:
2220
postgres:
@@ -77,8 +75,8 @@ services:
7775
- ${SEEDS_REALM_PRIVATE_KEY_FILE}:/keys/realm_private.pem:z
7876
depends_on:
7977
- postgres
80-
- minio
81-
- minio-init
78+
- rustfs
79+
- rustfs-init
8280
labels:
8381
- "traefik.enable=true"
8482
- "traefik.http.routers.edgehog-backend.rule=Host(`api.${DOCKER_COMPOSE_EDGEHOG_BASE_DOMAIN}`)"
@@ -115,43 +113,44 @@ services:
115113
- "traefik.http.routers.edgehog-device-forwarder.service=edgehog-device-forwarder"
116114
- "traefik.http.services.edgehog-device-forwarder.loadbalancer.server.port=4001"
117115

118-
minio:
119-
image: minio/minio:RELEASE.2023-01-18T04-36-38Z
116+
rustfs:
117+
image: rustfs/rustfs:latest
120118
volumes:
121-
- "minio-data-v2:/data"
119+
- "rustfs-data-v2:/data"
122120
environment:
123-
MINIO_ROOT_USER: "minioadmin"
124-
MINIO_ROOT_PASSWORD: "minioadmin"
125-
command: server --console-address ":9001" /data
121+
RUSTFS_ACCESS_KEY: "rustfsadmin"
122+
RUSTFS_SECRET_KEY: "rustfsadmin"
123+
RUSTFS_CONSOLE_ENABLE: true
124+
command: /data
126125
labels:
127126
- "traefik.enable=true"
128-
- "traefik.http.routers.edgehog-minio-storage.rule=Host(`minio-storage.${DOCKER_COMPOSE_EDGEHOG_BASE_DOMAIN}`)"
129-
- "traefik.http.routers.edgehog-minio-storage.entrypoints=web"
130-
- "traefik.http.routers.edgehog-minio-storage.service=edgehog-minio-storage"
131-
- "traefik.http.services.edgehog-minio-storage.loadbalancer.server.port=9000"
132-
- "traefik.http.routers.edgehog-minio-console.rule=Host(`minio.${DOCKER_COMPOSE_EDGEHOG_BASE_DOMAIN}`)"
133-
- "traefik.http.routers.edgehog-minio-console.entrypoints=web"
134-
- "traefik.http.routers.edgehog-minio-console.service=edgehog-minio-console"
135-
- "traefik.http.services.edgehog-minio-console.loadbalancer.server.port=9001"
127+
- "traefik.http.routers.edgehog-rustfs-storage.rule=Host(`rustfs-storage.${DOCKER_COMPOSE_EDGEHOG_BASE_DOMAIN}`)"
128+
- "traefik.http.routers.edgehog-rustfs-storage.entrypoints=web"
129+
- "traefik.http.routers.edgehog-rustfs-storage.service=edgehog-rustfs-storage"
130+
- "traefik.http.services.edgehog-rustfs-storage.loadbalancer.server.port=9000"
131+
- "traefik.http.routers.edgehog-rustfs-console.rule=Host(`rustfs.${DOCKER_COMPOSE_EDGEHOG_BASE_DOMAIN}`)"
132+
- "traefik.http.routers.edgehog-rustfs-console.entrypoints=web"
133+
- "traefik.http.routers.edgehog-rustfs-console.service=edgehog-rustfs-console"
134+
- "traefik.http.services.edgehog-rustfs-console.loadbalancer.server.port=9001"
136135

137-
minio-init:
136+
rustfs-init:
138137
image: minio/mc:RELEASE.2023-01-11T03-14-16Z
139138
depends_on:
140-
- minio
139+
- rustfs
141140
entrypoint: |
142141
/bin/sh -c "
143-
while ! curl -s http://minio:9000 >/dev/null; do sleep 0.1; done;
144-
/usr/bin/mc alias set minio http://minio:9000 minioadmin minioadmin;
145-
/usr/bin/mc mb minio/edgehog;
146-
/usr/bin/mc anonymous set download minio/edgehog;
142+
while ! curl -s http://rustfs:9000 >/dev/null; do sleep 0.1; done;
143+
/usr/bin/mc alias set rustfs http://rustfs:9000 rustfsadmin rustfsadmin;
144+
/usr/bin/mc mb rustfs/edgehog;
145+
/usr/bin/mc anonymous set download rustfs/edgehog;
147146
exit 0;
148147
"
149148
150149
registry:
151150
image: registry:3
152151
restart: on-failure
153152
environment:
154-
REGISTRY_AUTH: htpasswd
153+
REGISTRY_AUTH: htpasswdocker run minio/mc ls playd
155154
REGISTRY_AUTH_HTPASSWD_REALM: Registry-Realm
156155
REGISTRY_AUTH_HTPASSWD_PATH: /auth/registry.passwd
157156
REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY: /data
@@ -218,7 +217,7 @@ configs:
218217
volumes:
219218
postgres-data:
220219
pgadmin-data:
221-
minio-data-v2:
220+
rustfs-data-v2:
222221
driver: local
223222
registry-auth:
224223
registry-data:

0 commit comments

Comments
 (0)