diff --git a/Cargo.toml b/Cargo.toml index 187aef1..8672b10 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,30 +2,22 @@ name = "azure-init" version = "0.1.1" edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +repository = "https://github.com/Azure/azure-init/" +homepage = "https://github.com/Azure/azure-init/" +license = "MIT" +readme = "README.md" +description = "A reference implementation for provisioning Linux VMs on Azure." [dependencies] -reqwest = { version = "0.11.18", default-features = false, features = ["blocking", "json"] } -serde = {version = "1.0.163", features = ["derive"]} -serde_xml = "0.9.1" -serde_derive = "1.0" tokio = { version = "1", features = ["full"] } -serde-xml-rs = "0.6.0" -xml-rs = "0.8.13" -serde_json = "1.0.96" -rustfmt = "0.10.0" -nix = "0.26.2" -libc = "0.2.146" -fmt = "0.1.0" + +[dependencies.libazureinit] +path = "libazureinit" +version = "0.1.0" [profile.dev] incremental = true -[lib] -name = "lib" -path = "src/lib.rs" - [[bin]] name = "azure-init" path = "src/main.rs" @@ -33,3 +25,8 @@ path = "src/main.rs" [[bin]] name = "functional_tests" path = "tests/functional_tests.rs" + +[workspace] +members = [ + "libazureinit", +] diff --git a/README.md b/README.md index acbab56..53d9bb9 100644 --- a/README.md +++ b/README.md @@ -2,13 +2,13 @@ [![Github CI](https://github.com/Azure/azure-init/actions/workflows/ci.yaml/badge.svg)](https://github.com/Azure/azure-init/actions) -A minimal guest agent implementation for provisioning Linux VMs on Azure. +A reference implementation for provisioning Linux VMs on Azure. -The agent configures Linux guests from provisioning metadata. -Contrary to complex guest configuration and customisation systems like e.g. cloud-init, Azure-Init aims to be minimal. +Azure-init configures Linux guests from provisioning metadata. +Contrary to complex guest configuration and customisation systems like e.g. cloud-init, azure-init aims to be minimal. It strictly focuses on basic instance initialisation from Azure metadata. -Azure-Init has very few requirements on its environment, so it may run in a very early stage of the boot process. +Azure-init has very few requirements on its environment, so it may run in a very early stage of the boot process. ## Installing Rust diff --git a/SUPPORT.md b/SUPPORT.md index ef03337..bb68b0f 100644 --- a/SUPPORT.md +++ b/SUPPORT.md @@ -15,4 +15,4 @@ Feel free to [start a new discussion](https://github.com/Azure/azure-init/discus ## Microsoft Support Policy -Support for the Azure-Init is limited to the resources listed above. +Support for the azure-init is limited to the resources listed above. diff --git a/libazureinit/Cargo.toml b/libazureinit/Cargo.toml new file mode 100644 index 0000000..4926215 --- /dev/null +++ b/libazureinit/Cargo.toml @@ -0,0 +1,26 @@ +[package] +name = "libazureinit" +version = "0.1.1" +edition = "2021" +repository = "https://github.com/Azure/azure-init/" +homepage = "https://github.com/Azure/azure-init/" +license = "MIT" +description = "A common library for provisioning Linux VMs on Azure." + +[dependencies] +reqwest = { version = "0.11.18", default-features = false, features = ["blocking", "json"] } +serde = {version = "1.0.163", features = ["derive"]} +serde_xml = "0.9.1" +serde_derive = "1.0" +tokio = { version = "1", features = ["full"] } +serde-xml-rs = "0.6.0" +xml-rs = "0.8.13" +serde_json = "1.0.96" +rustfmt = "0.10.0" +nix = "0.26.2" +libc = "0.2.146" + +[lib] +name = "libazureinit" +path = "src/lib.rs" + diff --git a/src/distro.rs b/libazureinit/src/distro.rs similarity index 100% rename from src/distro.rs rename to libazureinit/src/distro.rs diff --git a/src/goalstate.rs b/libazureinit/src/goalstate.rs similarity index 100% rename from src/goalstate.rs rename to libazureinit/src/goalstate.rs diff --git a/src/imds.rs b/libazureinit/src/imds.rs similarity index 100% rename from src/imds.rs rename to libazureinit/src/imds.rs diff --git a/src/lib.rs b/libazureinit/src/lib.rs similarity index 100% rename from src/lib.rs rename to libazureinit/src/lib.rs diff --git a/src/media.rs b/libazureinit/src/media.rs similarity index 100% rename from src/media.rs rename to libazureinit/src/media.rs diff --git a/src/user.rs b/libazureinit/src/user.rs similarity index 100% rename from src/user.rs rename to libazureinit/src/user.rs diff --git a/src/main.rs b/src/main.rs index 391aaaf..e8b9c6c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -use lib::distro::{Distribution, Distributions}; -use lib::{goalstate, imds, media, user}; +use libazureinit::distro::{Distribution, Distributions}; +use libazureinit::{goalstate, imds, media, user}; #[tokio::main] async fn main() { diff --git a/tests/functional_tests.rs b/tests/functional_tests.rs index 62fd07b..cebd55b 100644 --- a/tests/functional_tests.rs +++ b/tests/functional_tests.rs @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -use lib::distro::{Distribution, Distributions}; -use lib::imds::PublicKeys; -use lib::{goalstate, user}; +use libazureinit::distro::{Distribution, Distributions}; +use libazureinit::imds::PublicKeys; +use libazureinit::{goalstate, user}; use std::env;