Skip to content

Commit

Permalink
Prepare for publishing nydus-2.1.0-alpha1
Browse files Browse the repository at this point in the history
Prepare for publishing nydus-2.1.0-alpha1.

Signed-off-by: Jiang Liu <gerry@linux.alibaba.com>
  • Loading branch information
jiangliu committed Jun 18, 2022
1 parent 21dabeb commit 7093e46
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 29 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 10 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
[package]
name = "nydus-rs"
version = "2.0.0"
version = "2.1.0-alpha1"
description = "Nydus Image Service"
authors = ["The Nydus Developers"]
edition = "2018"
license = "Apache-2.0 OR BSD-3-Clause"
homepage = "https://nydus.dev/"
repository = "https://github.com/dragonflyoss/image-service"
edition = "2018"

[profile.release]
panic = "abort"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[[bin]]
name = "nydusd"
path = "src/bin/nydusd/main.rs"
Expand Down Expand Up @@ -48,19 +49,19 @@ rand_core = "0.6.2"
tar = "0.4.38"
mio = { version = "0.8", features = ["os-poll", "os-ext"]}

fuse-backend-rs = { version = "0.9.0", optional = true }
fuse-backend-rs = { version = "0.9.0" }
vhost = { version = "0.3.0", features = ["vhost-user-slave"], optional = true }
vhost-user-backend = { version = "0.1.0", optional = true }
virtio-bindings = { version = "0.1", features = ["virtio-v5_0_0"], optional = true }
virtio-queue = { version = "0.1.0", optional = true }

nydus-api = { path = "api" }
nydus-app = { path = "app" }
nydus-error = { path = "error" }
nydus-api = { version = "0.1.0", path = "api" }
nydus-app = { version = "0.2.0", path = "app" }
nydus-error = { version = "0.2.1", path = "error" }
nydus-rafs = { version = "0.1.0", path = "rafs", features = ["backend-registry", "backend-oss"] }
nydus-storage = { version = "0.5.0", path = "storage" }
nydus-utils = { version = "0.3.0", path = "utils" }
nydus-blobfs = { path = "blobfs", features = ["virtiofs"], optional = true }
nydus-blobfs = { version = "0.1.0", path = "blobfs", features = ["virtiofs"], optional = true }

[dev-dependencies]
sendfd = "0.3.3"
Expand Down
36 changes: 17 additions & 19 deletions src/bin/nydusd/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,10 @@ use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::{Arc, Mutex};

use clap::{App, Arg, ArgMatches, SubCommand, Values};
use fuse_backend_rs::api::{Vfs, VfsOptions};
use mio::{Events, Poll, Token, Waker};
use nix::sys::signal;
use rlimit::Resource;

use nydus::FsBackendType;
use nydus_app::{dump_program_info, setup_logging, BuildTimeInfo};

use crate::api_server_glue::ApiServerController;
Expand Down Expand Up @@ -198,20 +196,19 @@ extern "C" fn sig_exit(_sig: std::os::raw::c_int) {
}

#[cfg(feature = "virtiofs")]
const SHARED_DIR_HELP_MESSAGE: &str = "Directory shared by host and guest for \
passthroughfs, which also enables passthroughfs mode";
const SHARED_DIR_HELP_MESSAGE: &str = "Directory to share between host and guest by virtiofs, which also enables `passthroughfs` mode";

#[cfg(feature = "fusedev")]
const SHARED_DIR_HELP_MESSAGE: &str = "A passthroughfs source for FUSE (the \
purpose of testing and demonstration), which also enables passthroughfs mode";
const SHARED_DIR_HELP_MESSAGE: &str =
"Directory to share by FUSE for testing, which also enables `passthroughfs` mode";

#[cfg(any(feature = "fusedev", feature = "virtiofs"))]
fn append_fs_options(app: App<'static, 'static>) -> App<'static, 'static> {
app.arg(
Arg::with_name("bootstrap")
.long("bootstrap")
.short("B")
.help("Bootstrap/metadata file for rafs filesystem, which also enables rafs mode")
.help("Bootstrap file of a rafs filesystem, which also enables `rafs` mode")
.takes_value(true)
.requires("config")
.conflicts_with("shared-dir"),
Expand All @@ -238,7 +235,7 @@ fn append_fs_options(app: App<'static, 'static>) -> App<'static, 'static> {
Arg::with_name("virtual-mountpoint")
.long("virtual-mountpoint")
.short("m")
.help("Path inside FUSE/virtiofs virtual filesystem to mount the rafs/passthroughfs instance")
.help("Path within the FUSE/virtiofs device to mount the filesystem")
.takes_value(true)
.default_value("/")
.required(false),
Expand Down Expand Up @@ -270,7 +267,7 @@ fn append_fuse_options(app: App<'static, 'static>) -> App<'static, 'static> {
.long("thread-num")
.short("T")
.default_value("1")
.help("Number of working threads to serve FUSE IO requests")
.help("Number of worker threads to serve IO requests")
.takes_value(true)
.required(false)
.validator(|v| {
Expand All @@ -289,7 +286,7 @@ fn append_fuse_options(app: App<'static, 'static>) -> App<'static, 'static> {
Arg::with_name("writable")
.long("writable")
.short("W")
.help("Mount FUSE filesystem in rw mode")
.help("Mounts FUSE filesystem in rw mode")
.takes_value(false),
)
}
Expand All @@ -308,7 +305,7 @@ fn append_virtiofs_options(app: App<'static, 'static>) -> App<'static, 'static>
Arg::with_name("hybrid-mode")
.long("hybrid-mode")
.short("H")
.help("Enable support for both rafs and passthroughfs modes")
.help("Enables both `rafs` and `passthroughfs` modes")
.required(false)
.takes_value(false),
)
Expand Down Expand Up @@ -337,13 +334,13 @@ fn append_services_subcmd_options(app: App<'static, 'static>) -> App<'static, 's
Arg::with_name("fscache")
.long("fscache")
.short("F")
.help("Working directory fscache driver to cache files")
.help("Working directory for Linux fscache driver to store cached files")
.takes_value(true),
)
.arg(
Arg::with_name("fscache-tag")
.long("fscache-tag")
.help("Fscache tag to identify the fs daemon instance")
.help("Tag to identify the fscache daemon instance")
.takes_value(true)
.requires("fscache"),
);
Expand Down Expand Up @@ -426,7 +423,7 @@ fn prepare_commandline_options() -> App<'static, 'static> {
Arg::with_name("upgrade")
.long("upgrade")
.short("U")
.help("Start in upgrade mode")
.help("Starts daemon in upgrade mode")
.takes_value(false)
.required(false)
.global(true),
Expand Down Expand Up @@ -562,10 +559,10 @@ fn process_default_fs_service(
// safe as virtual_mountpoint default to "/"
let virtual_mnt = args.value_of("virtual-mountpoint").unwrap();

let mut opts = VfsOptions::default();
let mut opts = fuse_backend_rs::api::VfsOptions::default();
let mount_cmd = if let Some(shared_dir) = shared_dir {
let cmd = FsBackendMountCmd {
fs_type: FsBackendType::PassthroughFs,
fs_type: nydus::FsBackendType::PassthroughFs,
source: shared_dir.to_string(),
config: "".to_string(),
mountpoint: virtual_mnt.to_string(),
Expand All @@ -587,7 +584,7 @@ fn process_default_fs_service(
.map(|files| files.map(|s| s.to_string()).collect());

let cmd = FsBackendMountCmd {
fs_type: FsBackendType::Rafs,
fs_type: nydus::FsBackendType::Rafs,
source: b.to_string(),
config: std::fs::read_to_string(config)?,
mountpoint: virtual_mnt.to_string(),
Expand All @@ -608,7 +605,7 @@ fn process_default_fs_service(
opts.killpriv_v2 = true;
}

let vfs = Vfs::new(opts);
let vfs = fuse_backend_rs::api::Vfs::new(opts);
let vfs = Arc::new(vfs);
// Basically, below two arguments are essential for live-upgrade/failover/ and external management.
let daemon_id = args.value_of("id").map(|id| id.to_string());
Expand Down Expand Up @@ -700,7 +697,6 @@ fn main() -> Result<()> {

setup_logging(logging_file, level)?;
dump_program_info(crate_version!());
handle_rlimit_nofile_option(&args, "rlimit-nofile")?;

match args.subcommand_name() {
Some("daemon") => {
Expand Down Expand Up @@ -730,6 +726,8 @@ fn main() -> Result<()> {
}
}

handle_rlimit_nofile_option(&args, "rlimit-nofile")?;

let daemon = DAEMON_CONTROLLER.get_daemon();
if let Some(fs) = daemon.get_default_fs_service() {
DAEMON_CONTROLLER.set_fs_service(fs);
Expand Down

0 comments on commit 7093e46

Please sign in to comment.