-
Notifications
You must be signed in to change notification settings - Fork 0
Integrate rustfs #40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Integrate rustfs #40
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -63,9 +63,9 @@ services: | |
| environment: | ||
| - GOPIE_SERVE_HOST=${GOPIE_SERVE_HOST} | ||
| - GOPIE_SERVE_PORT=${GOPIE_SERVE_PORT} | ||
| - GOPIE_S3_ACCESS_KEY=${MINIO_ACCESS_KEY} | ||
| - GOPIE_S3_SECRET_KEY=${MINIO_SECRET_KEY} | ||
| - GOPIE_S3_REGION=${MINIO_REGION} | ||
| - GOPIE_S3_ACCESS_KEY=${RUSTFS_ACCESS_KEY} | ||
| - GOPIE_S3_SECRET_KEY=${RUSTFS_SECRET_KEY} | ||
| - GOPIE_S3_REGION=${RUSTFS_REGION} | ||
| - GOPIE_S3_ENDPOINT=${GOPIE_S3_ENDPOINT} | ||
| - GOPIE_LOGGER_LEVEL=${GOPIE_LOGGER_LEVEL} | ||
| - GOPIE_LOGGER_FILE=${GOPIE_LOGGER_FILE} | ||
|
|
@@ -158,41 +158,40 @@ services: | |
| - gopie | ||
|
|
||
| ######################################################################### | ||
| ##### MINIO ####### | ||
| ##### RUSTFS ####### | ||
| ######################################################################### | ||
| minio: | ||
| image: minio/minio | ||
| rustfs: | ||
| image: rustfs/rustfs:latest | ||
| restart: always | ||
| ports: | ||
| - "9000:9000" | ||
| - "9002:9002" | ||
| volumes: | ||
| - ./volumes/minio/data:/export | ||
| - ./volumes/minio/config:/root/.minio | ||
| - "9000:9000" # S3 API | ||
| - "9001:9001" # RustFS Console | ||
| environment: | ||
| - MINIO_ACCESS_KEY=minioadmin | ||
| - MINIO_SECRET_KEY=minioadmin | ||
| - RUSTFS_ACCESS_KEY=rustfsadmin | ||
| - RUSTFS_SECRET_KEY=rustfsadmin | ||
| - RUSTFS_CONSOLE_ENABLE=true | ||
| - RUSTFS_ADDRESS=:9000 | ||
| volumes: | ||
| - ./volumes/rustfs/data:/data | ||
| networks: | ||
| - gopie | ||
| command: server -console-address :9002 /export | ||
| healthcheck: | ||
| test: ["CMD", "mc", "ready", "local"] | ||
| interval: 5s | ||
| timeout: 5s | ||
| retries: 5 | ||
|
|
||
| createbuckets: | ||
| image: minio/mc | ||
| create-buckets: | ||
| image: amazon/aws-cli:latest | ||
| depends_on: | ||
| minio: | ||
| condition: service_healthy | ||
| - rustfs | ||
| environment: | ||
| - AWS_ACCESS_KEY_ID=rustfsadmin | ||
| - AWS_SECRET_ACCESS_KEY=rustfsadmin | ||
| - AWS_DEFAULT_REGION=us-east-1 | ||
| networks: | ||
| - gopie | ||
| entrypoint: > | ||
| /bin/sh -c " | ||
| echo 'Minio is up. Creating the bucket!!' && | ||
| /usr/bin/mc alias set myminio http://minio:9000 minioadmin minioadmin && | ||
| /usr/bin/mc mb -p myminio/gopie && | ||
| /usr/bin/mc anonymous set public myminio/gopie | ||
| sleep 5; | ||
| aws s3 mb s3://gopie --endpoint-url http://rustfs:9000 || true; | ||
| echo 'Buckets created successfully'; | ||
| exit 0; | ||
| " | ||
|
Comment on lines
+179
to
195
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Inconsistent bucket creation and missing healthcheck. Two issues:
🔎 Add the missing downloads bucket: entrypoint: >
/bin/sh -c "
sleep 5;
aws s3 mb s3://gopie --endpoint-url http://rustfs:9000 || true;
+ aws s3 mb s3://downloads --endpoint-url http://rustfs:9000 || true;
echo 'Buckets created successfully';
exit 0;
"🤖 Prompt for AI Agents |
||
|
|
||
| gopie-reindex: | ||
|
|
@@ -211,11 +210,11 @@ services: | |
| ports: | ||
| - "3020:3020" | ||
| environment: | ||
| - COMPANION_AWS_ENDPOINT=${MINIO_ENDPOINT} | ||
| - COMPANION_AWS_REGION=${MINIO_REGION} | ||
| - COMPANION_AWS_BUCKET=${MINIO_BUCKET} | ||
| - COMPANION_AWS_KEY=${MINIO_ACCESS_KEY} | ||
| - COMPANION_AWS_SECRET=${MINIO_SECRET_KEY} | ||
| - COMPANION_AWS_ENDPOINT=${RUSTFS_ENDPOINT} | ||
| - COMPANION_AWS_REGION=${RUSTFS_REGION} | ||
| - COMPANION_AWS_BUCKET=${RUSTFS_BUCKET} | ||
| - COMPANION_AWS_KEY=${RUSTFS_ACCESS_KEY} | ||
| - COMPANION_AWS_SECRET=${RUSTFS_SECRET_KEY} | ||
| - COMPANION_DOMAIN=${COMPANION_DOMAIN} | ||
| - COMPANION_PROTOCOL=${COMPANION_PROTOCOL} | ||
| - COMPANION_DATADIR=${COMPANION_DATADIR} | ||
|
|
@@ -224,7 +223,7 @@ services: | |
| networks: | ||
| - gopie | ||
| depends_on: | ||
| - minio | ||
| - rustfs | ||
|
|
||
| ######################################################################### | ||
| ##### CHAT SERVER SERVICES ##### | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -378,16 +378,20 @@ export function DatasetUploadWizard({ projectId }: DatasetUploadWizardProps) { | |
| s3Url = `s3://${bucket}/${key}`; | ||
| } | ||
| } else { | ||
| // Non-S3 URL, might be MinIO, presigned URL, or proxy | ||
| // For localhost:9000 (MinIO) or similar, the format is usually: http://localhost:9000/bucket/key | ||
| // Try to extract path assuming format: /bucket/key | ||
| // Non-S3 URL, might be RUSTFS, presigned URL, or proxy | ||
| // For localhost:9000 (RUSTFS) or similar, the format is usually: http://localhost:9000/bucket | ||
| // Try to extract path assuming format: /bucket | ||
| if (pathParts.length >= 2) { | ||
| const bucket = pathParts[0]; | ||
| const key = pathParts.slice(1).join("/"); | ||
| s3Url = `s3://${bucket}/${key}`; | ||
| } else if (pathParts.length === 1) { | ||
| // Only one path part, assume it's just the bucket | ||
| s3Url = `s3://${pathParts[0]}`; | ||
| const uploadResponse = useUploadStore.getState() | ||
| .uploadResponse as { body?: { key?: string } } | undefined; | ||
|
|
||
| const key = uploadResponse?.body?.key; | ||
| s3Url = `${key ? `s3://${pathParts[0]}/${key}` : `s3://${pathParts[0]}`}`; | ||
|
Comment on lines
+381
to
+394
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Validate that the s3:// URL includes a key and consider refactoring duplicated logic. This code has the same issue as in Additionally, this URL parsing logic is duplicated across multiple upload components, which increases maintenance burden. 🔎 Proposed fix with validation } else {
// Non-S3 URL, might be RUSTFS, presigned URL, or proxy
// For localhost:9000 (RUSTFS) or similar, the format is usually: http://localhost:9000/bucket
// Try to extract path assuming format: /bucket
if (pathParts.length >= 2) {
const bucket = pathParts[0];
const key = pathParts.slice(1).join("/");
s3Url = `s3://${bucket}/${key}`;
} else if (pathParts.length === 1) {
- // Only one path part, assume it's just the bucket
const uploadResponse = useUploadStore.getState()
.uploadResponse as { body?: { key?: string } } | undefined;
const key = uploadResponse?.body?.key;
- s3Url = `${key ? `s3://${pathParts[0]}/${key}` : `s3://${pathParts[0]}`}`;
+ if (!key) {
+ throw new Error("Upload response missing object key for single-path URL");
+ }
+ s3Url = `s3://${pathParts[0]}/${key}`;
} else {Refactoring suggestion: Consider extracting the S3 URL parsing logic into a shared utility function (e.g., // lib/utils/s3-url-parser.ts
export function parseUploadUrlToS3(
uploadURL: string,
uploadResponse?: { body?: { key?: string } }
): string {
// Consolidated parsing logic here
}Then use it in both files: s3Url = parseUploadUrlToS3(uploadURL, useUploadStore.getState().uploadResponse);🤖 Prompt for AI Agents |
||
| } else { | ||
| // No path parts, this shouldn't happen | ||
| throw new Error("No path found in upload URL"); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix RUSTFS_ADDRESS format to include IP binding.
The RUSTFS_ADDRESS environment variable should be
0.0.0.0:9000instead of:9000to properly bind to all interfaces. Additionally, addRUSTFS_CONSOLE_ADDRESS=0.0.0.0:9001to explicitly configure the console binding. The official RustFS configuration uses RUSTFS_ADDRESS=0.0.0.0:9000 and RUSTFS_CONSOLE_ADDRESS=0.0.0.0:9001.Also consider adding a healthcheck: "curl -f http://localhost:9000/health && curl -f http://localhost:9001/rustfs/console/health" to ensure proper service readiness before bucket creation attempts. The default RUSTFS_ACCESS_KEY and RUSTFS_SECRET_KEY values are intended for development only — rotate these credentials for production.
🤖 Prompt for AI Agents