Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
579 changes: 402 additions & 177 deletions Cargo.lock

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ env_logger = "0"
itertools = "0"
libc = "0"
log = { version = "0", features = ["std"] }
prost = "0.13"
protobuf = { git = "https://github.com/thinkparq/protobuf", rev = "24f942a79ffa8a879b84dc014384c9f06780d2b7" }
prost = "0.14"
protobuf = { git = "https://github.com/thinkparq/protobuf", rev = "e2e774e7db7e3d4474d6e7232bb06bbdffc5610c" }
regex = "1"
ring = "0"
rusqlite = { version = "0", features = ["bundled", "vtab", "array"] }
rusqlite = { version = "0", features = ["bundled", "vtab", "array", "fallible_uint"] }
Comment thread
rustybee42 marked this conversation as resolved.
serde = "1"
thiserror = "~2"
tokio = { version = "1", features = ["rt", "sync", "macros"] }
tokio-stream = { version = "0" }
tonic = { version = "0.13", features = ["tls-ring"] }
tonic = { version = "0.14", features = ["tls-ring"] }
uuid = { version = "1", features = ["v4"] }
8 changes: 4 additions & 4 deletions LICENSE.md
Comment thread
iamjoemccormick marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# BeeGFS END USER LICENSE AGREEMENT
# BeeGFS LICENSE AGREEMENT

Copyright (c) 2024 ThinkParQ GmbH
Copyright (c) 2026 ThinkParQ GmbH

Use of the provided software and libraries is governed by the BeeGFS End User License Agreement
found at https://www.beegfs.io/docs/BeeGFS_EULA.txt
Use of the provided software and libraries is governed by the BeeGFS LICENSE AGREEMENT
found at https://www.beegfs.io/docs/BeeGFS_License_Agreement.txt
40 changes: 29 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,18 @@ PACKAGE_DIR := target/package
TARGET_DIR := target/$(CARGO_TARGET)/release

# Define the command to build the release binaries based on configuration
ifneq ($(CARGO_TARGET),)
ifneq ($(GLIBC_VERSION),)
RELEASE_BUILD_CMD := cargo zigbuild --target=$(CARGO_TARGET).$(GLIBC_VERSION)
else
RELEASE_BUILD_CMD := cargo build --target=$(CARGO_TARGET)
endif
else
RELEASE_BUILD_CMD := cargo build

RELEASE_BUILD_CMD := cargo build $(TARGET_FLAG)

# If glibc version is given, use zigbuild to link against specific libc
ifneq ($(GLIBC_VERSION),)
# Zigbuild requires a specified target
ifeq ($(CARGO_TARGET),)
$(error GLIBC_VERSION requires CARGO_TARGET which was not provided)
endif
RELEASE_BUILD_CMD := cargo zigbuild --target=$(CARGO_TARGET).$(GLIBC_VERSION)
endif

# We want to include the full debug info so it can be split off
RELEASE_BUILD_CMD := VERSION="$(VERSION)" $(RELEASE_BUILD_CMD) \
--release --locked --config='profile.release.debug = "full"'
Expand All @@ -95,6 +98,24 @@ RELEASE_BUILD_CMD := VERSION="$(VERSION)" $(RELEASE_BUILD_CMD) \
# and the zig compiler to be installed and available.
.PHONY: package
package:
# Patch mgmtds Cargo.toml to depend on linked libc version if specified
if [ "$(GLIBC_VERSION)" != "" ]; then
# We don't want to auto modify files in a devs repo, so restore the original file on exit
# (even works on erroring out).
function clean_up() {
mv mgmtd/Cargo.toml.orig mgmtd/Cargo.toml 2> /dev/null
}
trap clean_up EXIT
cp mgmtd/Cargo.toml mgmtd/Cargo.toml.orig

# Patch deb specs
sed -i 's/depends = "libbeegfs-license/depends = "libc6 (>= $(GLIBC_VERSION)), libbeegfs-license/' mgmtd/Cargo.toml
grep -q 'libc6 (>=' mgmtd/Cargo.toml || { echo "ERROR: DEB libc6 patch failed"; exit 1; }
# Patch rpm specs
sed -i 's/libbeegfs-license = ">=/glibc = ">= $(GLIBC_VERSION)"\nlibbeegfs-license = ">=/' mgmtd/Cargo.toml
Comment thread
iamjoemccormick marked this conversation as resolved.
grep -q 'glibc = ">=' mgmtd/Cargo.toml || { echo "ERROR: RPM glibc patch failed"; exit 1; }
fi

# Build thirdparty license summary
mkdir -p $(TARGET_DIR)
cargo about generate about.hbs --all-features -o $(TARGET_DIR)/thirdparty-licenses.html
Expand All @@ -119,16 +140,13 @@ package:
# We don't want the epoch in the file names
find $(PACKAGE_DIR) -name "*_20:*.deb" -exec bash -c 'mv "$$1" $$(echo "$$1" | sed "s/_20:/_/g")' bash {} \;

# We add a license field since generate-rpm fails if it is not there (even if license-file is given)
cargo generate-rpm $(TARGET_FLAG) -p mgmtd -o $(PACKAGE_DIR)/ \
--set-metadata='version="$(VERSION_TRIMMED)"' \
--set-metadata='epoch=20' \
--set-metadata='license="BeeGFS EULA"' \
--set-metadata='provides={"beegfs-mgmtd" = "= $(VERSION_TRIMMED)"}'
cargo generate-rpm $(TARGET_FLAG) -p mgmtd -o $(PACKAGE_DIR)/ --variant=debug \
--set-metadata='version="$(VERSION_TRIMMED)"' \
--set-metadata='epoch=20' \
--set-metadata='license="BeeGFS EULA"' \
--set-metadata='provides={"beegfs-mgmtd" = "= $(VERSION_TRIMMED)"}'

# Replace tilde in package filename with hypens.
Expand Down
17 changes: 8 additions & 9 deletions mgmtd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "mgmtd"
description = "The BeeGFS management service"
readme = "README.md"
version = "0.0.0"
license-file = "LICENSE.md"
license-file = "../LICENSE.md"
edition.workspace = true
authors.workspace = true
documentation.workspace = true
Expand Down Expand Up @@ -58,11 +58,8 @@ undocumented_unsafe_blocks = "deny"
[package.metadata.generate-rpm]
name = "beegfs-mgmtd"
extended-description = "The BeeGFS management service"
# We do not specify any dependencies for now as we might be linked against an older glibc than the
# hosts and auto detect would put it as a requirement into the package. This allows the package to
# be installed even if the systems glibc is too old, however, this is acceptable until we find a
# better solution
auto-req = "disabled"
license = "BeeGFS LICENSE AGREEMENT"
assets = [
# We use the binary generated and postprocessed from the Makefile
{ source = "target/release/beegfs-mgmtd", dest = "/opt/beegfs/sbin/", mode = "755" },
Expand All @@ -73,6 +70,9 @@ assets = [
]

[package.metadata.generate-rpm.requires]
# We do not specify any libc requirement by default as the version linked against depends on the
# build command. If a specific version is given, the dependency on the correct version will be added
# temporarily below.
libbeegfs-license = ">= 8.3"

[package.metadata.generate-rpm.variants.debug]
Expand All @@ -90,10 +90,9 @@ beegfs-mgmtd = "*"
[package.metadata.deb]
name = "beegfs-mgmtd"
extended-description = "The BeeGFS management service"
# We do not specify any glibc dependencies for now as we might be linked against an older glibc than
# the hosts and auto detect would put it as a requirement into the package. This allows the package
# to be installed even if the systems glibc is too old, however, this is acceptable until we find a
# better solution
# We do not specify any libc requirement by default as the version linked against depends on the
# build command. If a specific version is given, the following line will be patched temporarily
# to contain the dependency on the correct version.
depends = "libbeegfs-license (>= 8.3)"
suggests = ""
assets = [
Expand Down
6 changes: 0 additions & 6 deletions mgmtd/LICENSE.md

This file was deleted.

4 changes: 2 additions & 2 deletions mgmtd/assets/copyright
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Source: https://github.com/ThinkParQ/beegfs-rs
Files: *
Copyright: ThinkParQ GmbH
License:BeeGFS EULA
License:BeeGFS LICENSE AGREEMENT
The complete text of this license can be found at
https://www.beegfs.io/docs/BeeGFS_EULA.txt
https://www.beegfs.io/docs/BeeGFS_License_Agreement.txt
19 changes: 8 additions & 11 deletions mgmtd/src/grpc/get_targets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,10 @@ pub(crate) async fn get_targets(
.iter_mut()
.filter(|t| t.node_type() == pb::NodeType::Meta)
{
if t.free_space_bytes.is_some() && t.free_inodes.is_some() {
t.cap_pool = pb::CapacityPool::from(
cap_pool_meta_calc.cap_pool(t.free_space_bytes.unwrap(), t.free_inodes.unwrap()),
)
.into();
if let Some(fs) = t.free_space_bytes
&& let Some(fi) = t.free_inodes
{
t.cap_pool = pb::CapacityPool::from(cap_pool_meta_calc.cap_pool(fs, fi)).into();
}
}

Expand All @@ -158,12 +157,10 @@ pub(crate) async fn get_targets(
.as_ref()
.is_some_and(|e| e.uid == Some(sp_uid))
}) {
if t.free_space_bytes.is_some() && t.free_inodes.is_some() {
t.cap_pool = pb::CapacityPool::from(
cap_pool_storage_calc
.cap_pool(t.free_space_bytes.unwrap(), t.free_inodes.unwrap()),
)
.into();
if let Some(fs) = t.free_space_bytes
&& let Some(fi) = t.free_inodes
{
t.cap_pool = pb::CapacityPool::from(cap_pool_storage_calc.cap_pool(fs, fi)).into();
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "1.91"
channel = "1.94"
profile = "default"
Loading