mirror of
https://github.com/PaddlePaddle/FastDeploy.git
synced 2026-04-23 00:17:25 +08:00
[BugFix] Storage backend gets env params (#5892)
* Storage backend gets env params * up * up * up
This commit is contained in:
+1
-1
@@ -4,6 +4,6 @@
|
|||||||
"global_segment_size":8589934592,
|
"global_segment_size":8589934592,
|
||||||
"local_buffer_size":134217728,
|
"local_buffer_size":134217728,
|
||||||
"protocol":"rdma",
|
"protocol":"rdma",
|
||||||
"rdma_devices": "mlx5_1,mlx5_2,mlx5_3,mlx5_4",
|
"rdma_devices": "",
|
||||||
"master_server_addr":"0.0.0.0:15001"
|
"master_server_addr":"0.0.0.0:15001"
|
||||||
}
|
}
|
||||||
@@ -17,7 +17,6 @@ S1_PORT=52800
|
|||||||
ports=(
|
ports=(
|
||||||
$S0_PORT $((S0_PORT + 1)) $((S0_PORT + 2)) $((S0_PORT + 3))
|
$S0_PORT $((S0_PORT + 1)) $((S0_PORT + 2)) $((S0_PORT + 3))
|
||||||
$S1_PORT $((S1_PORT + 1)) $((S1_PORT + 2)) $((S1_PORT + 3))
|
$S1_PORT $((S1_PORT + 1)) $((S1_PORT + 2)) $((S1_PORT + 3))
|
||||||
$ROUTER_PORT
|
|
||||||
)
|
)
|
||||||
check_ports "${ports[@]}" || {
|
check_ports "${ports[@]}" || {
|
||||||
echo "❌ Some ports are in use. Please release them."
|
echo "❌ Some ports are in use. Please release them."
|
||||||
@@ -50,10 +50,10 @@ class MooncakeStoreConfig:
|
|||||||
file_path = os.getenv("MOONCAKE_CONFIG_PATH")
|
file_path = os.getenv("MOONCAKE_CONFIG_PATH")
|
||||||
|
|
||||||
if file_path is None:
|
if file_path is None:
|
||||||
local_hostname = os.environ.get("MOONCAKE_LOCAL_HOSTNAME")
|
local_hostname = os.environ.get("MOONCAKE_LOCAL_HOSTNAME", "localhost")
|
||||||
metadata_server = os.environ.get("MOONCAKE_METADATA_SERVER")
|
metadata_server = os.environ.get("MOONCAKE_METADATA_SERVER")
|
||||||
global_segment_size = os.environ.get("MOONCAKE_GLOBAL_SEGMENT_SIZE", DEFAULT_GLOBAL_SEGMENT_SIZE)
|
global_segment_size = int(os.environ.get("MOONCAKE_GLOBAL_SEGMENT_SIZE", DEFAULT_GLOBAL_SEGMENT_SIZE))
|
||||||
local_buffer_size = os.environ.get("MOONCAKE_LOCAL_BUFFER_SIZE", DEFAULT_LOCAL_BUFFER_SIZE)
|
local_buffer_size = int(os.environ.get("MOONCAKE_LOCAL_BUFFER_SIZE", DEFAULT_LOCAL_BUFFER_SIZE))
|
||||||
protocol = os.environ.get("MOONCAKE_PROTOCOL", "rdma")
|
protocol = os.environ.get("MOONCAKE_PROTOCOL", "rdma")
|
||||||
rdma_devices = os.environ.get("MOONCAKE_RDMA_DEVICES", "")
|
rdma_devices = os.environ.get("MOONCAKE_RDMA_DEVICES", "")
|
||||||
master_server_addr = os.environ.get("MOONCAKE_MASTER_SERVER_ADDR")
|
master_server_addr = os.environ.get("MOONCAKE_MASTER_SERVER_ADDR")
|
||||||
@@ -63,10 +63,10 @@ class MooncakeStoreConfig:
|
|||||||
with open(file_path) as fin:
|
with open(file_path) as fin:
|
||||||
config = json.load(fin)
|
config = json.load(fin)
|
||||||
|
|
||||||
local_hostname = config.get("local_hostname")
|
local_hostname = config.get("local_hostname", "localhost")
|
||||||
metadata_server = config.get("metadata_server")
|
metadata_server = config.get("metadata_server")
|
||||||
global_segment_size = config.get("global_segment_size", DEFAULT_GLOBAL_SEGMENT_SIZE)
|
global_segment_size = int(config.get("global_segment_size", DEFAULT_GLOBAL_SEGMENT_SIZE))
|
||||||
local_buffer_size = config.get("local_buffer_size", DEFAULT_LOCAL_BUFFER_SIZE)
|
local_buffer_size = int(config.get("local_buffer_size", DEFAULT_LOCAL_BUFFER_SIZE))
|
||||||
protocol = config.get("protocol", "rdma")
|
protocol = config.get("protocol", "rdma")
|
||||||
rdma_devices = config.get("rdma_devices", "")
|
rdma_devices = config.get("rdma_devices", "")
|
||||||
master_server_addr = config.get("master_server_addr")
|
master_server_addr = config.get("master_server_addr")
|
||||||
@@ -75,6 +75,8 @@ class MooncakeStoreConfig:
|
|||||||
# FIXME: use auto-select NICs in MooncakeStore will raise error and roll back to using TCP
|
# FIXME: use auto-select NICs in MooncakeStore will raise error and roll back to using TCP
|
||||||
rdma_devices = get_rdma_nics()
|
rdma_devices = get_rdma_nics()
|
||||||
logger.info(f"No RDMA devices specified, defaulting to all available devices: {rdma_devices}")
|
logger.info(f"No RDMA devices specified, defaulting to all available devices: {rdma_devices}")
|
||||||
|
if metadata_server is None or master_server_addr is None:
|
||||||
|
raise ValueError("Both MOONCAKE_METADATA_SERVER and MOONCAKE_MASTER_SERVER_ADDR must be provided.")
|
||||||
|
|
||||||
return MooncakeStoreConfig(
|
return MooncakeStoreConfig(
|
||||||
local_hostname=local_hostname,
|
local_hostname=local_hostname,
|
||||||
|
|||||||
Reference in New Issue
Block a user