mirror of
https://github.com/serai-dex/serai.git
synced 2024-12-22 11:39:35 +00:00
Only use Alpine when not using RocksDB
This commit is contained in:
parent
e3a789fc9f
commit
a3345ed194
3 changed files with 30 additions and 13 deletions
|
@ -14,19 +14,27 @@ pub fn coordinator(
|
|||
serai_key: Zeroizing<<Ristretto as Ciphersuite>::F>,
|
||||
) {
|
||||
let db = network.db();
|
||||
let os_to_use = if db == "parity-db" { Os::Alpine } else { Os::Debian };
|
||||
let longer_reattempts = if network == Network::Dev { "longer-reattempts" } else { "" };
|
||||
let setup = mimalloc(Os::Alpine).to_string() +
|
||||
let setup = mimalloc(os_to_use).to_string() +
|
||||
&build_serai_service(
|
||||
Os::Alpine,
|
||||
os_to_use,
|
||||
network.release(),
|
||||
&format!("{db} {longer_reattempts}"),
|
||||
"serai-coordinator",
|
||||
);
|
||||
|
||||
const ADDITIONAL_ROOT: &str = r#"
|
||||
let additional_root = if os_to_use == Os::Alpine {
|
||||
r#"
|
||||
# Install ca-certificates
|
||||
RUN apk add ca-certificates
|
||||
"#;
|
||||
"#
|
||||
} else {
|
||||
r#"
|
||||
# Install ca-certificates
|
||||
RUN apt install -y ca-certificates
|
||||
"#
|
||||
};
|
||||
|
||||
let env_vars = [
|
||||
("MESSAGE_QUEUE_RPC", format!("serai-{}-message-queue", network.label())),
|
||||
|
@ -52,7 +60,7 @@ CMD {env_vars_str} serai-coordinator
|
|||
"#
|
||||
);
|
||||
|
||||
let run = os(Os::Alpine, ADDITIONAL_ROOT, "coordinator") + &run_coordinator;
|
||||
let run = os(os_to_use, additional_root, "coordinator") + &run_coordinator;
|
||||
let res = setup + &run;
|
||||
|
||||
let mut coordinator_path = orchestration_path.to_path_buf();
|
||||
|
|
|
@ -12,8 +12,9 @@ pub fn message_queue(
|
|||
ethereum_key: <Ristretto as Ciphersuite>::G,
|
||||
monero_key: <Ristretto as Ciphersuite>::G,
|
||||
) {
|
||||
let setup = mimalloc(Os::Alpine).to_string() +
|
||||
&build_serai_service(Os::Alpine, network.release(), network.db(), "serai-message-queue");
|
||||
let os_to_use = if network.db() == "parity-db" { Os::Alpine } else { Os::Debian };
|
||||
let setup = mimalloc(os_to_use).to_string() +
|
||||
&build_serai_service(os_to_use, network.release(), network.db(), "serai-message-queue");
|
||||
|
||||
let env_vars = [
|
||||
("COORDINATOR_KEY", hex::encode(coordinator_key.to_bytes())),
|
||||
|
@ -40,7 +41,7 @@ CMD {env_vars_str} serai-message-queue
|
|||
"#
|
||||
);
|
||||
|
||||
let run = os(Os::Alpine, "", "messagequeue") + &run_message_queue;
|
||||
let run = os(os_to_use, "", "messagequeue") + &run_message_queue;
|
||||
let res = setup + &run;
|
||||
|
||||
let mut message_queue_path = orchestration_path.to_path_buf();
|
||||
|
|
|
@ -15,18 +15,26 @@ pub fn processor(
|
|||
coin_key: Zeroizing<<Ristretto as Ciphersuite>::F>,
|
||||
entropy: Zeroizing<[u8; 32]>,
|
||||
) {
|
||||
let setup = mimalloc(Os::Alpine).to_string() +
|
||||
let os_to_use = if network.db() == "parity-db" { Os::Alpine } else { Os::Debian };
|
||||
let setup = mimalloc(os_to_use).to_string() +
|
||||
&build_serai_service(
|
||||
Os::Alpine,
|
||||
os_to_use,
|
||||
network.release(),
|
||||
&format!("binaries {} {coin}", network.db()),
|
||||
"serai-processor",
|
||||
);
|
||||
|
||||
const ADDITIONAL_ROOT: &str = r#"
|
||||
let additional_root = if os_to_use == Os::Alpine {
|
||||
r#"
|
||||
# Install ca-certificates
|
||||
RUN apk add ca-certificates
|
||||
"#;
|
||||
"#
|
||||
} else {
|
||||
r#"
|
||||
# Install ca-certificates
|
||||
RUN apt install -y ca-certificates
|
||||
"#
|
||||
};
|
||||
|
||||
// TODO: Randomly generate these
|
||||
const RPC_USER: &str = "serai";
|
||||
|
@ -67,7 +75,7 @@ CMD {env_vars_str} serai-processor
|
|||
"#
|
||||
);
|
||||
|
||||
let run = os(Os::Alpine, ADDITIONAL_ROOT, "processor") + &run_processor;
|
||||
let run = os(os_to_use, additional_root, "processor") + &run_processor;
|
||||
let res = setup + &run;
|
||||
|
||||
let mut processor_path = orchestration_path.to_path_buf();
|
||||
|
|
Loading…
Reference in a new issue