|
|
@@ -14,7 +14,7 @@ use crate::{
|
|
|
use anyhow::{Context, Result};
|
|
|
use std::borrow::Cow;
|
|
|
use tokio::time::{Duration, sleep};
|
|
|
-use tracing::info;
|
|
|
+use tracing::{info, warn};
|
|
|
/// Options for the serve operation.
|
|
|
#[derive(Clone, Debug)]
|
|
|
pub struct ServeOpts {
|
|
|
@@ -81,6 +81,18 @@ pub async fn serve(
|
|
|
opts.dry_run,
|
|
|
)
|
|
|
.await?;
|
|
|
+
|
|
|
+ // Drop page cache on all nodes before starting.
|
|
|
+ if config.drop_caches && !opts.dry_run {
|
|
|
+ info!("Dropping page cache on all nodes...");
|
|
|
+ for node in &cluster.nodes {
|
|
|
+ let cmd = "echo 3 | sudo tee /proc/sys/vm/drop_caches".to_string();
|
|
|
+ if let Err(e) = run_ssh(config, node, cmd, false).await {
|
|
|
+ warn!("drop_caches on {} failed: {}", node.name, e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
use self::sync::sync_image_to_nodes;
|
|
|
|
|
|
// Build image on specified node if not found on any cluster node.
|