diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000000..469ec572bf9 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,26 @@ +name: Release + +on: + push: + tags: + - v[0-9]+.[0-9]+.[0-9]+ + +env: + CARGO_TERM_COLOR: always + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Publish + run: | + sudo apt-get update && sudo apt-get install --yes sed + VERSION=$(sed --regexp-extended --silent 's/^version = \"(.*)"$/\1/p' Cargo.toml) + [ "$GITHUB_REF_NAME" == "v$VERSION" ] + cargo publish --token ${{ secrets.CRATES_IO_TOKEN }} + - name: Release + uses: softprops/action-gh-release@v1 + with: + generate_release_notes: true diff --git a/Cargo.toml b/Cargo.toml index ffd73d5a280..62b5df90d7e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,10 +1,16 @@ [package] -name = "snapshot" -version = "0.1.0" -authors = ["Amazon Firecracker team "] +name = "dbs-snapshot" +version = "1.5.0" +authors = [ + "Amazon Firecracker team ", + "Kata Containers Developers", +] edition = "2021" autobenches = false license = "Apache-2.0" +readme = "README.md" +repository = "https://github.com/kata-containers/dbs-snapshot" +homepage = "https://github.com/kata-containers/dbs-snapshot" [lib] bench = false diff --git a/README.md b/README.md new file mode 100644 index 00000000000..d13b9e31e85 --- /dev/null +++ b/README.md @@ -0,0 +1,11 @@ +# dbs-snapshot + +`dbs-snapshot` is a fork of [Firecracker microvmm's](https://github.com/firecracker-microvm/firecracker) `snapshot` crate. It was done so because the Firecracker maintainers [have no plan to publish the crate on crates.io](https://github.com/firecracker-microvm/firecracker/issues/4162). + +`dbs-snapshot` provides a version tolerant serialization and deserialization facilities and implements a persistent storage format for saving rust struct states. It can form a basis of many useful functionalities such as VM snapshot for rust-based VMMs, as well as user space program live upgrade for other projects like [Nydus](https://github.com/dragonflyoss/image-service/). + +# Disclaimer + +Please note that the crate is released from v1.5.0 because that is the initial Firecracker release version the crate was taken from. + +We will use sematic versioning. The API backward-compatibilites will always be reserved across patch version updates. The backward-compatibilities across minor version updates will be preserved in a best effort manner. Whenever API backward-compatibility is broken on purpose, we will bump the major version. diff --git a/benches/version_map.rs b/benches/version_map.rs index ea3c38b86d7..b46e8f8910e 100644 --- a/benches/version_map.rs +++ b/benches/version_map.rs @@ -1,7 +1,7 @@ // Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 use criterion::{black_box, criterion_group, criterion_main, Criterion}; -use snapshot::Snapshot; +use dbs_snapshot::Snapshot; use versionize::{VersionMap, Versionize, VersionizeResult}; use versionize_derive::Versionize; diff --git a/tests/test.rs b/tests/test.rs index 37d552eed12..da438b5b246 100644 --- a/tests/test.rs +++ b/tests/test.rs @@ -1,6 +1,6 @@ // Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 -use snapshot::{Error, Snapshot}; +use dbs_snapshot::{Error, Snapshot}; use versionize::{VersionMap, Versionize, VersionizeError, VersionizeResult}; use versionize_derive::Versionize;