Skip to content

Commit

Permalink
Split common library parts into a separate workspace (#39)
Browse files Browse the repository at this point in the history
Create a new workspace `libazureinit`, split common library parts into
the separate lib.

Add package metadata fields in `Cargo.toml` for publishing to
[crates.io](https://crates.io).

## Testing done

local tests pass
  • Loading branch information
dongsupark committed Feb 28, 2024
1 parent 02ade86 commit 1f877ff
Show file tree
Hide file tree
Showing 12 changed files with 50 additions and 27 deletions.
31 changes: 14 additions & 17 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,31 @@
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"

[[bin]]
name = "functional_tests"
path = "tests/functional_tests.rs"

[workspace]
members = [
"libazureinit",
]
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion SUPPORT.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
26 changes: 26 additions & 0 deletions libazureinit/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -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() {
Expand Down
6 changes: 3 additions & 3 deletions tests/functional_tests.rs
Original file line number Diff line number Diff line change
@@ -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;

Expand Down

0 comments on commit 1f877ff

Please sign in to comment.