Skip to content
This repository has been archived by the owner on Dec 17, 2024. It is now read-only.

Store workspace volumes in Gevulot data directory #50

Merged
merged 1 commit into from
Jan 23, 2024
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
8 changes: 6 additions & 2 deletions crates/node/src/nanos/volume.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
use std::{path::PathBuf, process::Command};
use std::{
path::{Path, PathBuf},
process::Command,
};

use eyre::Result;
use thiserror::Error;
Expand All @@ -13,8 +16,9 @@ pub enum NanosVolumeError {
ParseError(String),
}

pub fn create(label: &str, size: &str) -> Result<PathBuf> {
pub fn create(data_dir: &Path, label: &str, size: &str) -> Result<PathBuf> {
let output = Command::new("ops")
.env("HOME", data_dir)
.arg("volume")
.arg("create")
.arg(label)
Expand Down
6 changes: 5 additions & 1 deletion crates/node/src/vmm/qemu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,12 @@ impl Provider for Qemu {
.to_lowercase();

// XXX: This isn't async and will call out to `ops` for now.
let workspace_file = nanos::volume::create(&workspace_volume_label, "2g")?.into_os_string();
tracing::debug!("creating workspace volume for the VM");
let workspace_file =
nanos::volume::create(&self.config.data_directory, &workspace_volume_label, "2g")?
.into_os_string();
let workspace_file = workspace_file.to_str().expect("workspace volume path");
tracing::debug!("workspace volume created");

let cpus = req.cpus;
let mem_req = req.mem;
Expand Down
Loading