mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-05 21:07:43 +00:00
refactor(replication): route app storage through ecstore (#4251)
This commit is contained in:
@@ -210,6 +210,7 @@ REPLICATION_FACADE_WILDCARD_EXPORT_HITS_FILE="${TMP_DIR}/replication_facade_wild
|
||||
ECSTORE_REPLICATION_BOUNDARY_BYPASS_HITS_FILE="${TMP_DIR}/ecstore_replication_boundary_bypass_hits.txt"
|
||||
SCANNER_REPLICATION_FACADE_BYPASS_HITS_FILE="${TMP_DIR}/scanner_replication_facade_bypass_hits.txt"
|
||||
RUSTFS_REPLICATION_FACADE_BYPASS_HITS_FILE="${TMP_DIR}/rustfs_replication_facade_bypass_hits.txt"
|
||||
RUNTIME_REPLICATION_DEPENDENCY_BYPASS_HITS_FILE="${TMP_DIR}/runtime_replication_dependency_bypass_hits.txt"
|
||||
REPLICATION_CRATE_FILEMETA_BYPASS_HITS_FILE="${TMP_DIR}/replication_crate_filemeta_bypass_hits.txt"
|
||||
REPLICATION_CRATE_STORAGE_API_BYPASS_HITS_FILE="${TMP_DIR}/replication_crate_storage_api_bypass_hits.txt"
|
||||
REPLICATION_CONFIG_RULE_CONTRACT_BACKSLIDE_HITS_FILE="${TMP_DIR}/replication_config_rule_contract_backslide_hits.txt"
|
||||
@@ -2643,12 +2644,22 @@ fi
|
||||
cd "$ROOT_DIR"
|
||||
rg -n --with-filename 'rustfs_replication::|use\s+rustfs_replication\b' \
|
||||
rustfs/src \
|
||||
--glob '*.rs' |
|
||||
rg -v '^rustfs/src/app/storage_api\.rs:' || true
|
||||
--glob '*.rs' || true
|
||||
) >"$RUSTFS_REPLICATION_FACADE_BYPASS_HITS_FILE"
|
||||
|
||||
if [[ -s "$RUSTFS_REPLICATION_FACADE_BYPASS_HITS_FILE" ]]; then
|
||||
report_failure "RustFS runtime replication contracts must stay behind storage API facades: $(paste -sd '; ' "$RUSTFS_REPLICATION_FACADE_BYPASS_HITS_FILE")"
|
||||
report_failure "RustFS runtime replication contracts must come through storage API / ECStore replication facades: $(paste -sd '; ' "$RUSTFS_REPLICATION_FACADE_BYPASS_HITS_FILE")"
|
||||
fi
|
||||
|
||||
(
|
||||
cd "$ROOT_DIR"
|
||||
rg -n --with-filename '^rustfs-replication\b' \
|
||||
rustfs/Cargo.toml \
|
||||
crates/scanner/Cargo.toml || true
|
||||
) >"$RUNTIME_REPLICATION_DEPENDENCY_BYPASS_HITS_FILE"
|
||||
|
||||
if [[ -s "$RUNTIME_REPLICATION_DEPENDENCY_BYPASS_HITS_FILE" ]]; then
|
||||
report_failure "RustFS runtime and scanner crates must not depend on rustfs-replication directly: $(paste -sd '; ' "$RUNTIME_REPLICATION_DEPENDENCY_BYPASS_HITS_FILE")"
|
||||
fi
|
||||
|
||||
(
|
||||
|
||||
@@ -744,6 +744,29 @@ envsubst < "${TEMPLATE_PATH}" > "${CONF_OUTPUT_PATH}" || {
|
||||
log_info "Provisioning s3-tests alt user..."
|
||||
|
||||
# Helper function to install Python packages with fallback for externally-managed environments
|
||||
ensure_python_pip() {
|
||||
if python3 -m pip --version >/dev/null 2>&1; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
log_info "Installing pip for Python package setup..."
|
||||
if python3 -m ensurepip --upgrade >/dev/null 2>&1; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
if command -v apt-get >/dev/null 2>&1; then
|
||||
sudo apt-get update && sudo apt-get install -y python3-pip || {
|
||||
log_warn "Failed to install python3-pip via apt-get"
|
||||
}
|
||||
elif command -v brew >/dev/null 2>&1; then
|
||||
brew install python || {
|
||||
log_warn "Failed to install Python via brew"
|
||||
}
|
||||
fi
|
||||
|
||||
python3 -m pip --version >/dev/null 2>&1
|
||||
}
|
||||
|
||||
install_python_package() {
|
||||
local package=$1
|
||||
local error_output
|
||||
@@ -759,6 +782,11 @@ install_python_package() {
|
||||
log_warn "Failed to install ${package} with uv, falling back to python3 -m pip"
|
||||
fi
|
||||
|
||||
ensure_python_pip || {
|
||||
log_error "python3 -m pip is unavailable"
|
||||
return 1
|
||||
}
|
||||
|
||||
# Try --user first (works on most Linux systems)
|
||||
error_output=$(python3 -m pip install --user --upgrade pip "${package}" 2>&1)
|
||||
if [ $? -eq 0 ]; then
|
||||
|
||||
Reference in New Issue
Block a user