Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update doc developer #205

Merged
merged 5 commits into from
Jul 29, 2021
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
4 changes: 2 additions & 2 deletions doc/src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ The documentation keeps track of libmicrovmi's [integration status](https://wenz

## Documentation

Our documentation is available in `doc/` as an [`mdbook`](https://rust-lang.github.io/mdBook/) 📖
Our documentation is hosted online at [![online_docs](https://img.shields.io/badge/Online-Documentation-green)](https://wenzel.github.io/libmicrovmi/)

[![online_docs](https://img.shields.io/badge/Online-Documentation-green)](https://wenzel.github.io/libmicrovmi/)
You can find it at `doc/` as an [`mdbook`](https://rust-lang.github.io/mdBook/) 📖

To build the docs locally:
~~~
Expand Down
3 changes: 3 additions & 0 deletions doc/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,7 @@

# Developer

- [libmicrovmi](./developer/libmicrovmi.md)
- [Python](./developer/python.md)
- [Tests](./developer/tests.md)
- [Release](./developer/release.md)
36 changes: 36 additions & 0 deletions doc/src/developer/libmicrovmi.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# libmicrovmi

## Compiling the crate

Compiling the crate without any driver:
~~~
cargo build
~~~

## Enabling drivers

Enabling Xen and KVM drivers:
~~~
cargo build --features xen,kvm
~~~

Please look at the [drivers](https://wenzel.github.io/libmicrovmi/reference/drivers.html) section
for each driver's requirements.

## Running the examples

Specifing no example will list all available examples:
~~~
cargo run --example
~~~

To run the `mem-dump` example, and include the Xen driver:
~~~
cargo run --features xen --example mem-dump
~~~

To pass arbitrary arguments to an example:
~~~
cargo run --example mem-dump -- --help
cargo run --features kvm --example mem-dump -- --vm_name win10 ----kvm_unix_socket /tmp/introspector
~~~
25 changes: 25 additions & 0 deletions doc/src/developer/release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Release Management

libmicrovmi project release is handled in the [CI](https://github.com/Wenzel/libmicrovmi/blob/master/.github/workflows/ci.yml), on Github Actions.

If a commit is pushed with a tag matching `v*`, the `release` job of the CI is executed,
as well as all jobs depending on it.

Release CI related jobs

- `release`: create a Github release
- `release_debian`: add a Debian package to the Github release
- `release_book`: build and publish the book
- `publish`: publish the crate on crates.io
- `publis_pypi`: publish the Python bindings on PyPI

## How to make a new release

Release and tags are managed using the [cargo-release](https://github.com/sunng87/cargo-release) tool.

~~~
$ cargo release --no-dev-version --workspace <patch / minor / major> # will publish both libmicrovmi and the python bindings
~~~

Note: `cargo-release` can handle the publication on crates.io, but we prefer to manage everything in one place, using the CI.
Therefore, publishing has been explicitely disabled in `Cargo.toml` for this tool, so no mistakes can happen.
24 changes: 24 additions & 0 deletions doc/src/developer/tests.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Integration tests

Instructions for all tests:
- Update the values in `tests/common/config.rs` according to your environment
- `cargo test -- --nocapture`: displays the `log` output, useful for debugging

## KVM

**Requirements**
- virtual machine already configured to be introspected by KVM-VMI
- VM snapshot with live state
- [libkvmi](https://github.com/bitdefender/libkvmi)
- [`virsh`](https://libvirt.org/manpages/virsh.html) tool: (`libvirt-clients` package)


The VM state between each test is handled by the following commands:
- setup: `virsh snapshot-revert <vm_name> --current --running`
- teardown: `virsh destroy <vm_name>`

**Execution**

~~~
cargo test --feature kvm
~~~
4 changes: 1 addition & 3 deletions doc/src/reference/integration_status.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,5 @@ volatility3 could inspect and run its forensics plugins on live memory by
adding a new URL handler.

- [project](https://github.com/volatilityfoundation/volatility3)
- [issue](https://github.com/Wenzel/libmicrovmi/issues/161)
- [fork](https://github.com/Wenzel/volatility3/tree/vm_introspection_handler) (Note: use the `vm_introspection_handler` branch)
- compatibility: ✅

- [tutorial](https://wenzel.github.io/libmicrovmi/tutorial/integration/volatility3.html)
4 changes: 4 additions & 0 deletions python/release.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# cargo-release config file

# don't create pymicrovmi-vxxx tag
disable-tag = true
23 changes: 1 addition & 22 deletions tests/README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,3 @@
# Integration Tests

Instructions for all tests:
- Update the values in `tests/common/config.rs` according to your environment
- `cargo test -- --nocapture`: displays the `log` output, useful for debugging

## KVM

**Requirements**
- virtual machine already configured to be introspected by KVM-VMI
- VM snapshot with live state
- [libkvmi](https://github.com/bitdefender/libkvmi)
- [`virsh`](https://libvirt.org/manpages/virsh.html) tool: (`libvirt-clients` package)


The VM state between each test is handled by the following commands:
- setup: `virsh snapshot-revert <vm_name> --current --running`
- teardown: `virsh destroy <vm_name>`

**Execution**

~~~
cargo test --feature kvm
~~~
[documentation](https://wenzel.github.io/libmicrovmi/developer/tests.html)
4 changes: 4 additions & 0 deletions utilities/release.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# cargo-release config file

# internal crate, skip release process
disable-release = true