From bc513c2604356919f3cec13d92787eceff917bdf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 1 Mar 2025 06:02:44 +0000 Subject: [PATCH 01/15] Bump the dependencies group with 5 updates Bumps the dependencies group with 5 updates: | Package | From | To | | --- | --- | --- | | [clap](https://github.com/clap-rs/clap) | `4.5.30` | `4.5.31` | | [rand](https://github.com/rust-random/rand) | `0.8.5` | `0.9.0` | | [uuid](https://github.com/uuid-rs/uuid) | `1.14.0` | `1.15.1` | | [rust-embed](https://github.com/pyros2097/rust-embed) | `8.5.0` | `8.6.0` | | [strum](https://github.com/Peternator7/strum) | `0.26.3` | `0.27.1` | Updates `clap` from 4.5.30 to 4.5.31 - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.30...v4.5.31) Updates `rand` from 0.8.5 to 0.9.0 - [Release notes](https://github.com/rust-random/rand/releases) - [Changelog](https://github.com/rust-random/rand/blob/master/CHANGELOG.md) - [Commits](https://github.com/rust-random/rand/compare/0.8.5...0.9.0) Updates `uuid` from 1.14.0 to 1.15.1 - [Release notes](https://github.com/uuid-rs/uuid/releases) - [Commits](https://github.com/uuid-rs/uuid/compare/v1.14.0...v1.15.1) Updates `rust-embed` from 8.5.0 to 8.6.0 - [Changelog](https://github.com/pyrossh/rust-embed/blob/master/changelog.md) - [Commits](https://github.com/pyros2097/rust-embed/commits) Updates `strum` from 0.26.3 to 0.27.1 - [Release notes](https://github.com/Peternator7/strum/releases) - [Changelog](https://github.com/Peternator7/strum/blob/master/CHANGELOG.md) - [Commits](https://github.com/Peternator7/strum/compare/v0.26.3...v0.27.1) --- updated-dependencies: - dependency-name: clap dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dependencies - dependency-name: rand dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dependencies - dependency-name: uuid dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dependencies - dependency-name: rust-embed dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dependencies - dependency-name: strum dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dependencies ... Signed-off-by: dependabot[bot] --- Cargo.lock | 44 ++++++++++++++++++++++---------------------- Cargo.toml | 6 +++--- ecstore/Cargo.toml | 2 +- iam/Cargo.toml | 2 +- rustfs/Cargo.toml | 6 +++--- 5 files changed, 30 insertions(+), 30 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f73fb046d..22369cd87 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -803,9 +803,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.30" +version = "4.5.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92b7b18d71fad5313a1e320fa9897994228ce274b60faa4d694fe0ea89cd9e6d" +checksum = "027bb0d98429ae334a8698531da7077bdf906419543a35a55c2cb1b66437d767" dependencies = [ "clap_builder", "clap_derive", @@ -813,9 +813,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.30" +version = "4.5.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a35db2071778a7344791a4fb4f95308b5673d219dee3ae348b86642574ecc90c" +checksum = "5589e0cba072e0f3d23791efac0fd8627b49c829c196a492e88168e6a669d863" dependencies = [ "anstream", "anstyle", @@ -1183,7 +1183,7 @@ dependencies = [ "chacha20poly1305", "jsonwebtoken", "pbkdf2", - "rand 0.8.5", + "rand 0.9.0", "serde_json", "sha2 0.10.8", "test-case", @@ -2004,7 +2004,7 @@ dependencies = [ "path-clean", "pin-project-lite", "protos", - "rand 0.8.5", + "rand 0.9.0", "reader", "reed-solomon-erasure", "regex", @@ -3025,7 +3025,7 @@ dependencies = [ "lazy_static", "log", "madmin", - "rand 0.8.5", + "rand 0.9.0", "regex", "serde", "serde_json", @@ -3545,7 +3545,7 @@ dependencies = [ "common", "lazy_static", "protos", - "rand 0.8.5", + "rand 0.9.0", "serde", "serde_json", "tokio", @@ -5301,9 +5301,9 @@ dependencies = [ [[package]] name = "rust-embed" -version = "8.5.0" +version = "8.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa66af4a4fdd5e7ebc276f115e895611a34739a9c1c01028383d612d550953c0" +checksum = "0b3aba5104622db5c9fc61098de54708feb732e7763d7faa2fa625899f00bf6f" dependencies = [ "rust-embed-impl", "rust-embed-utils", @@ -5312,9 +5312,9 @@ dependencies = [ [[package]] name = "rust-embed-impl" -version = "8.5.0" +version = "8.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6125dbc8867951125eec87294137f4e9c2c96566e61bf72c45095a7c77761478" +checksum = "1f198c73be048d2c5aa8e12f7960ad08443e56fd39cc26336719fdb4ea0ebaae" dependencies = [ "proc-macro2", "quote", @@ -5326,9 +5326,9 @@ dependencies = [ [[package]] name = "rust-embed-utils" -version = "8.5.0" +version = "8.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e5347777e9aacb56039b0e1f28785929a8a3b709e87482e7442c72e7c12529d" +checksum = "5a2fcdc9f40c8dc2922842ca9add611ad19f332227fc651d015881ad1552bd9a" dependencies = [ "sha2 0.10.8", "walkdir", @@ -6105,18 +6105,18 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "strum" -version = "0.26.3" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" +checksum = "f64def088c51c9510a8579e3c5d67c65349dcf755e5479ad3d010aa6454e2c32" dependencies = [ "strum_macros", ] [[package]] name = "strum_macros" -version = "0.26.4" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" +checksum = "c77a8c5abcaf0f9ce05d62342b7d298c346515365c36b673df4ebe3ced01fde8" dependencies = [ "heck 0.5.0", "proc-macro2", @@ -6942,9 +6942,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.14.0" +version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93d59ca99a559661b96bf898d8fce28ed87935fd2bea9f05983c1464dd6c71b1" +checksum = "e0f540e3240398cce6128b64ba83fdbdd86129c16a3aa1a3a252efd66eb3d587" dependencies = [ "getrandom 0.3.1", "rand 0.9.0", @@ -6954,9 +6954,9 @@ dependencies = [ [[package]] name = "uuid-macro-internal" -version = "1.14.0" +version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1be57878a5f7e409a1a82be6691922b11e59687a168205b1f21b087c4acdd194" +checksum = "9521621447c21497fac206ffe6e9f642f977c4f82eeba9201055f64884d9cb01" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index b111d405e..3121dfaf4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,7 +36,7 @@ backon = "1.3.0" bytes = "1.9.0" bytesize = "1.3.0" chrono = { version = "0.4.40", features = ["serde"] } -clap = { version = "4.5.27", features = ["derive", "env"] } +clap = { version = "4.5.31", features = ["derive", "env"] } dioxus = { version = "0.6.3", features = ["router"] } dirs = "6.0.0" ecstore = { path = "./ecstore" } @@ -66,7 +66,7 @@ prost-build = "0.13.4" prost-types = "0.13.4" protobuf = "3.7" protos = { path = "./common/protos" } -rand = "0.8.5" +rand = "0.9.0" reqwest = { version = "0.12.12", default-features = false, features = ["rustls-tls", "charset", "http2", "macos-system-configuration", "stream"] } rfd = { version = "0.15.2", default-features = false, features = ["xdg-portal", "tokio"] } rmp = "0.8.14" @@ -99,7 +99,7 @@ tracing-subscriber = { version = "0.3.19", features = ["env-filter", "time"] } tracing-appender = "0.2.3" transform-stream = "0.3.1" url = "2.5.4" -uuid = { version = "1.12.1", features = [ +uuid = { version = "1.15.1", features = [ "v4", "fast-rng", "macro-diagnostics", diff --git a/ecstore/Cargo.toml b/ecstore/Cargo.toml index d332c9043..cacafa49d 100644 --- a/ecstore/Cargo.toml +++ b/ecstore/Cargo.toml @@ -32,7 +32,7 @@ s3s.workspace = true http.workspace = true highway = "1.3.0" url.workspace = true -uuid = { version = "1.12.1", features = ["v4", "fast-rng", "serde"] } +uuid = { version = "1.15.1", features = ["v4", "fast-rng", "serde"] } reed-solomon-erasure = { version = "6.0.0", features = ["simd-accel"] } transform-stream = "0.3.1" lazy_static.workspace = true diff --git a/iam/Cargo.toml b/iam/Cargo.toml index e6e47259a..6c66d8f6e 100644 --- a/iam/Cargo.toml +++ b/iam/Cargo.toml @@ -18,7 +18,7 @@ ecstore = { path = "../ecstore" } serde_json.workspace = true async-trait.workspace = true thiserror.workspace = true -strum = { version = "0.26.3", features = ["derive"] } +strum = { version = "0.27.1", features = ["derive"] } arc-swap = "1.7.1" crypto = { path = "../crypto" } ipnetwork = { version = "0.21.1", features = ["serde"] } diff --git a/rustfs/Cargo.toml b/rustfs/Cargo.toml index 4097167a7..54973ed68 100644 --- a/rustfs/Cargo.toml +++ b/rustfs/Cargo.toml @@ -59,7 +59,7 @@ tower.workspace = true tracing-error.workspace = true tracing-subscriber.workspace = true transform-stream.workspace = true -uuid = "1.12.1" +uuid = "1.15.1" url.workspace = true admin = { path = "../api/admin" } axum.workspace = true @@ -73,7 +73,7 @@ iam = { path = "../iam" } jsonwebtoken = "9.3.0" tower-http = { version = "0.6.2", features = ["cors"] } mime_guess = "2.0.5" -rust-embed = { version = "8.5.0", features = ["interpolate-folder-path"] } +rust-embed = { version = "8.6.0", features = ["interpolate-folder-path"] } [build-dependencies] prost-build.workspace = true @@ -85,7 +85,7 @@ futures-util.workspace = true # uuid = { version = "1.8.0", features = ["v4", "fast-rng", "serde"] } ecstore = { path = "../ecstore" } s3s.workspace = true -clap = { version = "4.5.27", features = ["derive","env"] } +clap = { version = "4.5.31", features = ["derive","env"] } tracing-subscriber = { version = "0.3.19", features = ["env-filter", "time"] } hyper-util = { version = "0.1.10", features = [ "tokio", From 94798f70d3d155e22590354a26b3ddca1baa3835 Mon Sep 17 00:00:00 2001 From: loverustfs <155562731+loverustfs@users.noreply.github.com> Date: Sat, 1 Mar 2025 21:48:41 +0800 Subject: [PATCH 02/15] Update README.md --- README.md | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3bfa6b7a2..5fd8cc4c6 100644 --- a/README.md +++ b/README.md @@ -1 +1,32 @@ -# s3-rustfs \ No newline at end of file +# How to compile RustFS + +| Must package | Version | +| - | - | +| Rust | 1.8.5 | +| protoc | 27.0 | +| flatc | 24.0+ | + + +Download Links: +https://github.com/google/flatbuffers/releases/download/v24.3.25/Linux.flatc.binary.g++-13.zip +https://github.com/protocolbuffers/protobuf/releases/download/v27.0/protoc-27.0-linux-x86_64.zip + +Or use Docker: + +- uses: arduino/setup-protoc@v3 + with: + version: "27.0" + + - uses: Nugine/setup-flatc@v1 + with: + version: "24.3.25" + + + +# How to add Console web + +1. Wget http://dl.rustfs.com/console/console.latest.tar.gz + +2. Mkdir in this repos folder `./rustfs/static` + + From d136b09fc2d43762da6a9b79df9ca16f7419c5a6 Mon Sep 17 00:00:00 2001 From: loverustfs <155562731+loverustfs@users.noreply.github.com> Date: Sat, 1 Mar 2025 21:54:35 +0800 Subject: [PATCH 03/15] Update README.md --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index 5fd8cc4c6..6e586b1f1 100644 --- a/README.md +++ b/README.md @@ -29,4 +29,23 @@ Or use Docker: 2. Mkdir in this repos folder `./rustfs/static` +3. Compile RustFS + +# Star RustFS + +Add Env infomation: + +``` +export RUST_LOG="rustfs=debug,ecstore=debug,s3s=debug,iam=debug" +export RUSTFS_VOLUMES="./target/volume/test" +export RUSTFS_ADDRESS="0.0.0.0:9000" +export RUSTFS_CONSOLE_ENABLE=true +export RUSTFS_CONSOLE_ADDRESS="0.0.0.0:9001" +export RUSTFS_SERVER_ENDPOINT="http://127.0.0.1:9000" +``` + +You need replace your real data folder: +``` +./rustfs /data/rustfs +``` From 44b02afdfd767647f2956430f3af0138db66f185 Mon Sep 17 00:00:00 2001 From: loverustfs <155562731+loverustfs@users.noreply.github.com> Date: Sat, 1 Mar 2025 22:28:19 +0800 Subject: [PATCH 04/15] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6e586b1f1..d1351cfe4 100644 --- a/README.md +++ b/README.md @@ -25,9 +25,9 @@ Or use Docker: # How to add Console web -1. Wget http://dl.rustfs.com/console/console.latest.tar.gz +1. wget [http://dl.rustfs.com/console/console.latest.tar.gz](https://dl.rustfs.com/console/rustfs-console-latest.zip) -2. Mkdir in this repos folder `./rustfs/static` +2. mkdir in this repos folder `./rustfs/static` 3. Compile RustFS From e9ba18536263e9ff0167db6c93542a28eba18599 Mon Sep 17 00:00:00 2001 From: houseme Date: Sat, 1 Mar 2025 23:14:30 +0800 Subject: [PATCH 05/15] feat: add remote file download, extraction, and packaging process in build.yml (#245) * fix * update README.md --- .github/workflows/build.yml | 68 ++++++++++++++++++++++++++++++++++--- README.md | 27 +++++++-------- 2 files changed, 77 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b85c3f800..3543e702b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,9 +15,9 @@ jobs: strategy: matrix: variant: - - { profile: dev, target: x86_64-unknown-linux-gnu, glibc: "default" } - - { profile: release, target: x86_64-unknown-linux-gnu, glibc: "default" } - - { profile: release, target: x86_64-unknown-linux-gnu, glibc: "2.31" } + - { profile: dev, target: x86_64-unknown-linux-gnu, glibc: "default" } + - { profile: release, target: x86_64-unknown-linux-gnu, glibc: "default" } + - { profile: release, target: x86_64-unknown-linux-gnu, glibc: "2.31" } steps: - uses: actions/checkout@v4 @@ -32,10 +32,70 @@ jobs: --target ${{ matrix.variant.target }} \ --glibc ${{ matrix.variant.glibc }} + # Download the zip file(Linux/macOS used bash) + - name: Download Static Assets (Linux/macOS) + run: | + url="https://dl.rustfs.com/console/rustfs-console-latest.zip" + file=$(basename "$url") + curl -L -o "$file" "$url" + if [ ! -f "$file" ]; then + echo "Error: Failed to download $file" + exit 1 + fi + echo "Downloaded $file successfully" + ls -l "$file" + ls -la + + # Unzip the zip file(Linux/macOS used bash) + - name: Extract Static Assets (Linux/macOS) + run: | + ls -la + # Find the first .zip or .tar.gz file + file="" + for f in *.zip *.tar.gz; do + if [ -f "$f" ]; then + file="$f" + break + fi + done + if [ -z "$file" ]; then + echo "Error: No .zip or .tar.gz file found in the current directory" + ls -la # Displays the contents of the current directory for debugging + exit 1 + fi + # Outputs the name of the file found + echo "Found file: $file" + mkdir -p static + if [[ "$file" == *.zip ]]; then + echo "Unzipping $file to static/" + unzip "$file" -d static || { echo "Error: Failed to unzip $file"; exit 1; } + elif [[ "$file" == *.tar.gz ]]; then + echo "Extracting $file to static/" + tar -xzf "$file" -C static || { echo "Error: Failed to extract $file"; exit 1; } + else + echo "Error: Unsupported file format: $file" + exit 1 + fi + # Check whether the decompression is successful + if [ $? -ne 0 ]; then + echo "Error: Failed to extract $file" + exit 2 + fi + rm "$file" + ls -la static + # Packing binaries and static directory(Linux/macOS used bash) + - name: Package Binary and Static Assets (Linux/macOS) + run: | + mkdir -p release-package + cp target/artifacts/rustfs.${{ matrix.variant.profile }}.${{ matrix.variant.target }}.${{ matrix.variant.glibc }} release-package/ + cp -r static release-package/ + zip -r rustfs${{ matrix.variant.profile }}-${{ matrix.variant.target }}-${{ matrix.variant.glibc }}.zip release-package/* + ls -la + - uses: actions/upload-artifact@v4 with: name: rustfs.${{ matrix.variant.profile }}.${{ matrix.variant.target }}.${{ matrix.variant.glibc }} - path: ./target/artifacts/* + path: ./release-package/rustfs.${{ matrix.variant.profile }}.${{ matrix.variant.target }}.${{ matrix.variant.glibc }}.zip merge: runs-on: ubuntu-latest diff --git a/README.md b/README.md index d1351cfe4..1e4f16b5f 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,26 @@ # How to compile RustFS -| Must package | Version | -| - | - | -| Rust | 1.8.5 | -| protoc | 27.0 | -| flatc | 24.0+ | +| Must package | Version | +|--------------|---------| +| Rust | 1.8.5 | +| protoc | 27.0 | +| flatc | 24.0+ | +Download Links: -Download Links: https://github.com/google/flatbuffers/releases/download/v24.3.25/Linux.flatc.binary.g++-13.zip + https://github.com/protocolbuffers/protobuf/releases/download/v27.0/protoc-27.0-linux-x86_64.zip Or use Docker: - uses: arduino/setup-protoc@v3 - with: - version: "27.0" - - - uses: Nugine/setup-flatc@v1 - with: - version: "24.3.25" - + with: + version: "27.0" +- uses: Nugine/setup-flatc@v1 + with: + version: "24.3.25" # How to add Console web @@ -31,7 +30,6 @@ Or use Docker: 3. Compile RustFS - # Star RustFS Add Env infomation: @@ -46,6 +44,7 @@ export RUSTFS_SERVER_ENDPOINT="http://127.0.0.1:9000" ``` You need replace your real data folder: + ``` ./rustfs /data/rustfs ``` From 4fb9913c93c801d6d3727687fc66850b58eaf6bd Mon Sep 17 00:00:00 2001 From: weisd Date: Sat, 1 Mar 2025 23:29:30 +0800 Subject: [PATCH 06/15] use rand 0.8.5 --- Cargo.lock | 8 ++++---- Cargo.toml | 2 +- scripts/static.sh | 1 + 3 files changed, 6 insertions(+), 5 deletions(-) create mode 100755 scripts/static.sh diff --git a/Cargo.lock b/Cargo.lock index 22369cd87..b2d925856 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1183,7 +1183,7 @@ dependencies = [ "chacha20poly1305", "jsonwebtoken", "pbkdf2", - "rand 0.9.0", + "rand 0.8.5", "serde_json", "sha2 0.10.8", "test-case", @@ -2004,7 +2004,7 @@ dependencies = [ "path-clean", "pin-project-lite", "protos", - "rand 0.9.0", + "rand 0.8.5", "reader", "reed-solomon-erasure", "regex", @@ -3025,7 +3025,7 @@ dependencies = [ "lazy_static", "log", "madmin", - "rand 0.9.0", + "rand 0.8.5", "regex", "serde", "serde_json", @@ -3545,7 +3545,7 @@ dependencies = [ "common", "lazy_static", "protos", - "rand 0.9.0", + "rand 0.8.5", "serde", "serde_json", "tokio", diff --git a/Cargo.toml b/Cargo.toml index 3121dfaf4..6385bdf77 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -66,7 +66,7 @@ prost-build = "0.13.4" prost-types = "0.13.4" protobuf = "3.7" protos = { path = "./common/protos" } -rand = "0.9.0" +rand = "0.8.5" reqwest = { version = "0.12.12", default-features = false, features = ["rustls-tls", "charset", "http2", "macos-system-configuration", "stream"] } rfd = { version = "0.15.2", default-features = false, features = ["xdg-portal", "tokio"] } rmp = "0.8.14" diff --git a/scripts/static.sh b/scripts/static.sh new file mode 100755 index 000000000..9fd7469d8 --- /dev/null +++ b/scripts/static.sh @@ -0,0 +1 @@ +curl -L "https://dl.rustfs.com/console/rustfs-console-latest.zip" -o tempfile.zip && unzip -o tempfile.zip -d ./rustfs/static && rm tempfile.zip \ No newline at end of file From 637db138fd5126da3823ca53b759700ce8652e07 Mon Sep 17 00:00:00 2001 From: houseme Date: Sat, 1 Mar 2025 23:49:04 +0800 Subject: [PATCH 07/15] test build action --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3543e702b..f1b0d5fbd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -86,6 +86,7 @@ jobs: # Packing binaries and static directory(Linux/macOS used bash) - name: Package Binary and Static Assets (Linux/macOS) run: | + ls -la target/artifacts mkdir -p release-package cp target/artifacts/rustfs.${{ matrix.variant.profile }}.${{ matrix.variant.target }}.${{ matrix.variant.glibc }} release-package/ cp -r static release-package/ From 7ffe6a90634e887199ed6eaf94f48c8c81f9775a Mon Sep 17 00:00:00 2001 From: houseme Date: Sun, 2 Mar 2025 00:28:45 +0800 Subject: [PATCH 08/15] improve buidl.yml --- .github/workflows/build.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f1b0d5fbd..50dae5e9d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -88,7 +88,11 @@ jobs: run: | ls -la target/artifacts mkdir -p release-package - cp target/artifacts/rustfs.${{ matrix.variant.profile }}.${{ matrix.variant.target }}.${{ matrix.variant.glibc }} release-package/ + if [ -f target/artifacts/rustfs.${{ matrix.variant.profile }}.${{ matrix.variant.target }}.glibc${{ matrix.variant.glibc }}.bin ]; then + cp target/artifacts/rustfs.${{ matrix.variant.profile }}.${{ matrix.variant.target }}.glibc${{ matrix.variant.glibc }}.bin release-package/ + else + cp target/artifacts/rustfs.${{ matrix.variant.profile }}.${{ matrix.variant.target }}.bin release-package/ + fi cp -r static release-package/ zip -r rustfs${{ matrix.variant.profile }}-${{ matrix.variant.target }}-${{ matrix.variant.glibc }}.zip release-package/* ls -la From cff10f8c550f109c41e7ee01294baff8b8ffea20 Mon Sep 17 00:00:00 2001 From: Nugine Date: Sun, 2 Mar 2025 00:37:56 +0800 Subject: [PATCH 09/15] ci: enable cache for test --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 09c54587d..3c43685dd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -83,8 +83,7 @@ jobs: - uses: actions/checkout@v4 - uses: ./.github/actions/setup with: - cache-shared-key: "develop" - cache-save-if: "false" + cache-shared-key: "test" - run: cargo test --all --exclude e2e_test s3s-e2e: From f113f8afea03b97d6d1d7476fa43bc759671e4ae Mon Sep 17 00:00:00 2001 From: houseme Date: Sun, 2 Mar 2025 00:59:46 +0800 Subject: [PATCH 10/15] ci: optimize GitHub Actions build workflow and fix artifact merging - Fix artifact pattern matching in merge step to use consistent name pattern - Standardize artifact naming convention with clear format - Improve static assets handling with simpler download and extraction - Add 7-day retention policy for artifacts to manage storage - Use output variables to ensure consistency between artifact names and paths - Optimize package creation process to eliminate redundant nesting - Enhance error handling and script readability --- .github/workflows/build.yml | 89 ++++++++++++------------------------- 1 file changed, 29 insertions(+), 60 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 50dae5e9d..7d4e1697d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,75 +32,43 @@ jobs: --target ${{ matrix.variant.target }} \ --glibc ${{ matrix.variant.glibc }} - # Download the zip file(Linux/macOS used bash) - - name: Download Static Assets (Linux/macOS) + - name: Download and Extract Static Assets run: | url="https://dl.rustfs.com/console/rustfs-console-latest.zip" - file=$(basename "$url") - curl -L -o "$file" "$url" - if [ ! -f "$file" ]; then - echo "Error: Failed to download $file" - exit 1 - fi - echo "Downloaded $file successfully" - ls -l "$file" - ls -la - - # Unzip the zip file(Linux/macOS used bash) - - name: Extract Static Assets (Linux/macOS) - run: | - ls -la - # Find the first .zip or .tar.gz file - file="" - for f in *.zip *.tar.gz; do - if [ -f "$f" ]; then - file="$f" - break - fi - done - if [ -z "$file" ]; then - echo "Error: No .zip or .tar.gz file found in the current directory" - ls -la # Displays the contents of the current directory for debugging - exit 1 - fi - # Outputs the name of the file found - echo "Found file: $file" mkdir -p static - if [[ "$file" == *.zip ]]; then - echo "Unzipping $file to static/" - unzip "$file" -d static || { echo "Error: Failed to unzip $file"; exit 1; } - elif [[ "$file" == *.tar.gz ]]; then - echo "Extracting $file to static/" - tar -xzf "$file" -C static || { echo "Error: Failed to extract $file"; exit 1; } - else - echo "Error: Unsupported file format: $file" - exit 1 - fi - # Check whether the decompression is successful - if [ $? -ne 0 ]; then - echo "Error: Failed to extract $file" - exit 2 - fi - rm "$file" + curl -L -o static_assets.zip "$url" + unzip -o static_assets.zip -d static + rm static_assets.zip ls -la static - # Packing binaries and static directory(Linux/macOS used bash) - - name: Package Binary and Static Assets (Linux/macOS) + + - name: Package Binary and Static Assets + id: package run: | - ls -la target/artifacts - mkdir -p release-package - if [ -f target/artifacts/rustfs.${{ matrix.variant.profile }}.${{ matrix.variant.target }}.glibc${{ matrix.variant.glibc }}.bin ]; then - cp target/artifacts/rustfs.${{ matrix.variant.profile }}.${{ matrix.variant.target }}.glibc${{ matrix.variant.glibc }}.bin release-package/ - else - cp target/artifacts/rustfs.${{ matrix.variant.profile }}.${{ matrix.variant.target }}.bin release-package/ + # Create artifact filename + ARTIFACT_NAME="rustfs-${{ matrix.variant.profile }}-${{ matrix.variant.target }}" + if [ "${{ matrix.variant.glibc }}" != "default" ]; then + ARTIFACT_NAME="${ARTIFACT_NAME}-glibc${{ matrix.variant.glibc }}" fi - cp -r static release-package/ - zip -r rustfs${{ matrix.variant.profile }}-${{ matrix.variant.target }}-${{ matrix.variant.glibc }}.zip release-package/* + echo "artifact_name=${ARTIFACT_NAME}" >> $GITHUB_OUTPUT + + # Determine binary path + bin_path="target/artifacts/rustfs.${{ matrix.variant.profile }}.${{ matrix.variant.target }}.bin" + if [ -f "target/artifacts/rustfs.${{ matrix.variant.profile }}.${{ matrix.variant.target }}.glibc${{ matrix.variant.glibc }}.bin" ]; then + bin_path="target/artifacts/rustfs.${{ matrix.variant.profile }}.${{ matrix.variant.target }}.glibc${{ matrix.variant.glibc }}.bin" + fi + + # Create package + mkdir -p ${ARTIFACT_NAME} + cp "$bin_path" ${ARTIFACT_NAME}/rustfs + cp -r static/* ${ARTIFACT_NAME}/ + zip -r ${ARTIFACT_NAME}.zip ${ARTIFACT_NAME} ls -la - uses: actions/upload-artifact@v4 with: - name: rustfs.${{ matrix.variant.profile }}.${{ matrix.variant.target }}.${{ matrix.variant.glibc }} - path: ./release-package/rustfs.${{ matrix.variant.profile }}.${{ matrix.variant.target }}.${{ matrix.variant.glibc }}.zip + name: ${{ steps.package.outputs.artifact_name }} + path: ${{ steps.package.outputs.artifact_name }}.zip + retention-days: 7 merge: runs-on: ubuntu-latest @@ -108,5 +76,6 @@ jobs: steps: - uses: actions/upload-artifact/merge@v4 with: - name: rustfs + name: rustfs-packages + pattern: 'rustfs-*' delete-merged: true From 34dc49c2f5814335cd119c031da90bda878f747a Mon Sep 17 00:00:00 2001 From: houseme Date: Sun, 2 Mar 2025 01:14:10 +0800 Subject: [PATCH 11/15] ci: confirm static directory placement in artifact package Ensure the static directory is copied as a sibling to the rustfs binary in the artifact package, maintaining the proper directory structure for the application to locate its resources. --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7d4e1697d..244be5425 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -60,7 +60,7 @@ jobs: # Create package mkdir -p ${ARTIFACT_NAME} cp "$bin_path" ${ARTIFACT_NAME}/rustfs - cp -r static/* ${ARTIFACT_NAME}/ + cp -r static ${ARTIFACT_NAME}/ zip -r ${ARTIFACT_NAME}.zip ${ARTIFACT_NAME} ls -la From 6dbf7d8d6564dea5fbd0cf6fa6b2816272ef4745 Mon Sep 17 00:00:00 2001 From: Nugine Date: Sun, 2 Mar 2025 02:14:41 +0800 Subject: [PATCH 12/15] ci: reduce setup time --- .github/workflows/ci.yml | 95 +++++----------------------------------- scripts/e2e-run.sh | 15 ++++++- 2 files changed, 23 insertions(+), 87 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3c43685dd..783f20ff3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,13 +37,6 @@ jobs: steps: - uses: actions/checkout@v4 - uses: ./.github/actions/setup - with: - cache-shared-key: "develop" - - - name: Install s3s-e2e - run: | - cargo install s3s-e2e --git https://github.com/Nugine/s3s.git - s3s-e2e --version - name: Format run: cargo fmt --all --check @@ -52,40 +45,24 @@ jobs: run: cargo check --all-targets # TODO: cargo clippy + - name: Test + run: cargo test --all --exclude e2e_test + - name: Build debug run: | touch rustfs/build.rs cargo build -p rustfs --bins - - # - name: Build release - # run: | - # touch rustfs/build.rs - # cargo build -p rustfs --bins --release - - run: | + - name: Pack artifacts + run: | mkdir -p ./target/artifacts cp target/debug/rustfs ./target/artifacts/rustfs-debug - # cp target/release/rustfs ./target/artifacts/rustfs-release - uses: actions/upload-artifact@v4 with: name: rustfs path: ./target/artifacts/* - test: - name: Test - needs: - - skip-check - - develop - if: needs.skip-check.outputs.should_skip != 'true' - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/setup - with: - cache-shared-key: "test" - - run: cargo test --all --exclude e2e_test - s3s-e2e: name: E2E (s3s-e2e) needs: @@ -95,10 +72,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: ./.github/actions/setup + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@v2 with: - cache-shared-key: "develop" - cache-save-if: false + cache-on-failure: true + cache-all-crates: true - name: Install s3s-e2e run: | @@ -110,65 +88,12 @@ jobs: name: rustfs path: ./target/artifacts - - name: Run rustfs - run: | - ./scripts/e2e-run.sh ./target/artifacts/rustfs-debug /data/rustfs - sleep 10 - - name: Run s3s-e2e timeout-minutes: 10 run: | - export AWS_ACCESS_KEY_ID=rustfsadmin - export AWS_SECRET_ACCESS_KEY=rustfsadmin - export AWS_REGION=us-east-1 - export AWS_ENDPOINT_URL=http://localhost:9000 - export RUST_LOG="s3s_e2e=debug,s3s_test=info,s3s=debug" - export RUST_BACKTRACE=full - s3s-e2e - sudo killall rustfs-debug + ./scripts/e2e-run.sh ./target/artifacts/rustfs-debug /tmp/rustfs - uses: actions/upload-artifact@v4 with: name: s3s-e2e.logs path: /tmp/rustfs.log - - # mint: - # name: E2E (mint) - # needs: - # - skip-check - # - develop - # if: needs.skip-check.outputs.should_skip != 'true' - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v4 - # - uses: ./.github/actions/setup - # with: - # cache-shared-key: "develop" - # cache-save-if: false - - # - uses: actions/download-artifact@v4 - # with: - # name: rustfs - # path: ./target/artifacts - - # - name: Run rustfs - # run: | - # ./scripts/e2e-run.sh ./target/artifacts/rustfs-release /data/rustfs - # sleep 10 - - # - name: Run mint - # timeout-minutes: 10 - # run: | - # docker run \ - # -e "SERVER_ENDPOINT=localhost:9000" \ - # -e "ACCESS_KEY=rustfsadmin" \ - # -e "SECRET_KEY=rustfsadmin" \ - # -e "ENABLE_HTTPS=0" \ - # --network host \ - # minio/mint:edge - # sudo killall rustfs-release - - # - uses: actions/upload-artifact@v4 - # with: - # name: mint.logs - # path: /tmp/rustfs.log diff --git a/scripts/e2e-run.sh b/scripts/e2e-run.sh index 26e3d9c69..9b4392e85 100755 --- a/scripts/e2e-run.sh +++ b/scripts/e2e-run.sh @@ -3,9 +3,20 @@ BIN=$1 VOLUME=$2 chmod +x $BIN -sudo mkdir -p $VOLUME +mkdir -p $VOLUME export RUST_LOG="rustfs=debug,ecstore=debug,s3s=debug,iam=debug" export RUST_BACKTRACE=full +$BIN $VOLUME > /tmp/rustfs.log 2>&1 & -sudo nohup $BIN $VOLUME > /tmp/rustfs.log 2>&1 & +sleep 10 + +export AWS_ACCESS_KEY_ID=rustfsadmin +export AWS_SECRET_ACCESS_KEY=rustfsadmin +export AWS_REGION=us-east-1 +export AWS_ENDPOINT_URL=http://localhost:9000 +export RUST_LOG="s3s_e2e=debug,s3s_test=info,s3s=debug" +export RUST_BACKTRACE=full +s3s-e2e + +killall $BIN From be910f65be43f464e9c7e6dc214f1aabf0411e3d Mon Sep 17 00:00:00 2001 From: Nugine Date: Sun, 2 Mar 2025 03:48:53 +0800 Subject: [PATCH 13/15] build: use lld --- .cargo/config.toml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .cargo/config.toml diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 000000000..624d27249 --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,2 @@ +[target.x86_64-unknown-linux-gnu] +rustflags = ["-Clink-arg=-fuse-ld=lld"] From 09b855a3a9de1878ef54e3dbcb6b959a6bac200e Mon Sep 17 00:00:00 2001 From: Nugine Date: Sun, 2 Mar 2025 04:08:40 +0800 Subject: [PATCH 14/15] ci: fix setup --- .github/actions/setup/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index ae177cb9b..4c7afb30e 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -21,6 +21,7 @@ runs: run: | sudo apt update sudo apt install -y \ + lld \ libdbus-1-dev \ libwayland-dev \ libwebkit2gtk-4.1-dev \ From 03c3d4abfe1ffaf48b415a21cba7caa7f1697733 Mon Sep 17 00:00:00 2001 From: houseme Date: Sun, 2 Mar 2025 16:51:44 +0800 Subject: [PATCH 15/15] improve build yml --- .github/workflows/build.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 244be5425..b830105f4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,6 +25,15 @@ jobs: with: cache-shared-key: rustfs.${{ matrix.variant.profile }}.${{ matrix.variant.target }}.${{ matrix.variant.glibc }} + - name: Download and Extract Static Assets + run: | + url="https://dl.rustfs.com/console/rustfs-console-latest.zip" + mkdir -p static + curl -L -o static_assets.zip "$url" + unzip -o static_assets.zip -d ./rustfs/static + rm static_assets.zip + ls -la ./rustfs/static + - name: Build run: | ./scripts/build.py \ @@ -32,15 +41,6 @@ jobs: --target ${{ matrix.variant.target }} \ --glibc ${{ matrix.variant.glibc }} - - name: Download and Extract Static Assets - run: | - url="https://dl.rustfs.com/console/rustfs-console-latest.zip" - mkdir -p static - curl -L -o static_assets.zip "$url" - unzip -o static_assets.zip -d static - rm static_assets.zip - ls -la static - - name: Package Binary and Static Assets id: package run: | @@ -60,7 +60,7 @@ jobs: # Create package mkdir -p ${ARTIFACT_NAME} cp "$bin_path" ${ARTIFACT_NAME}/rustfs - cp -r static ${ARTIFACT_NAME}/ + # cp -r static ${ARTIFACT_NAME}/ zip -r ${ARTIFACT_NAME}.zip ${ARTIFACT_NAME} ls -la