From 053b76a8768844fab2a7bd602673a038b38a836e Mon Sep 17 00:00:00 2001 From: Yashodhan Joshi Date: Tue, 6 Dec 2022 11:26:00 +0530 Subject: [PATCH] Fix release script and prepare for release --- .github/workflows/release.yml | 46 ++++++++----------- Cargo.lock | 8 ++-- Makefile | 2 +- README.md | 6 ++- crates/libcgroups/Cargo.toml | 2 +- crates/libcontainer/Cargo.toml | 6 +-- crates/liboci-cli/Cargo.toml | 2 +- crates/youki/Cargo.toml | 8 ++-- docs/src/user/basic_setup.md | 6 ++- .../integration_test/src/main.rs | 2 +- .../integration_test/src/tests/mod.rs | 2 +- .../runtimetest/src/tests.rs | 2 +- 12 files changed, 43 insertions(+), 49 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 327c6e3c..d98b0356 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -38,7 +38,7 @@ jobs: toolchain: stable override: true - name: Release build - run: make release-build + run: make youki-release - name: Create output directory run: mkdir output - name: Copy files to output @@ -47,7 +47,7 @@ jobs: cp README.md output/README.md cp LICENSE output/LICENSE - name: Upload artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: output path: output/* @@ -72,43 +72,31 @@ jobs: MINOR=${VERSION%.*} MINOR=${MINOR#*.} PATCH=${VERSION##*.} - echo "::set-output name=version::${VERSION}" - echo "::set-output name=outputdir::youki_${MAJOR}_${MINOR}_${PATCH}_linux" - echo "::set-output name=innerdir::youki-${VERSION}" - - name: Create Release Draft - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ github.ref }} - release_name: ${{ steps.info.outputs.version }} Release - draft: true + echo "VERSION=${VERSION}" >> $GITHUB_ENV + echo "OUTPUTDIR=youki_${MAJOR}_${MINOR}_${PATCH}_linux" >> $GITHUB_ENV + echo "INNERDIR=youki-${VERSION}" >> $GITHUB_ENV - name: Create Output Directory - run: mkdir -p ${{ steps.info.outputs.outputdir }}/${{ steps.info.outputs.innerdir }} + run: mkdir -p ${{ env.OUTPUTDIR }}/${{ env.INNERDIR }} - name: Download Linux Artifacts - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: output - path: ${{ steps.info.outputs.outputdir }}/${{ steps.info.outputs.innerdir }} + path: ${{ env.OUTPUTDIR }}/${{ env.INNERDIR }} - name: Restore File Modes run: | - chmod 755 ${{ steps.info.outputs.outputdir }}/${{ steps.info.outputs.innerdir }}/youki + chmod 755 ${{ env.OUTPUTDIR }}/${{ env.INNERDIR }}/youki - name: Create tarball - run: tar -zcvf ${{ steps.info.outputs.outputdir }}.tar.gz ${{ steps.info.outputs.outputdir }} - - - name: Upload Artifact - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: tar -zcvf ${{ env.OUTPUTDIR }}.tar.gz ${{ env.OUTPUTDIR }} + - name: Create Release Draft + uses: softprops/action-gh-release@v1 with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./${{ steps.info.outputs.outputdir }}.tar.gz - asset_name: ${{ steps.info.outputs.outputdir }}.tar.gz - asset_content_type: application/gzip + name: ${{ steps.info.outputs.version }} Release + draft: true + token: ${{ secrets.GITHUB_TOKEN }} + files: ./${{ env.OUTPUTDIR }}.tar.gz publish: name: Publish Packages @@ -129,3 +117,5 @@ jobs: run: cargo publish -p libcontainer --no-verify - name: Publish liboci-cli run: cargo publish -p liboci-cli --no-verify + - name: Publish youki + run: cargo publish -p youki --no-verify diff --git a/Cargo.lock b/Cargo.lock index 4f393797..bdf80669 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1207,7 +1207,7 @@ checksum = "c0f80d65747a3e43d1596c7c5492d95d5edddaabd45a7fcdb02b95f644164966" [[package]] name = "libcgroups" -version = "0.0.3" +version = "0.0.4" dependencies = [ "anyhow", "clap", @@ -1231,7 +1231,7 @@ dependencies = [ [[package]] name = "libcontainer" -version = "0.0.3" +version = "0.0.4" dependencies = [ "anyhow", "bitflags", @@ -1295,7 +1295,7 @@ dependencies = [ [[package]] name = "liboci-cli" -version = "0.0.3" +version = "0.0.4" dependencies = [ "clap", ] @@ -3274,7 +3274,7 @@ dependencies = [ [[package]] name = "youki" -version = "0.0.3" +version = "0.0.4" dependencies = [ "anyhow", "chrono", diff --git a/Makefile b/Makefile index 8b9af410..6c4a3167 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,7 @@ all: youki-release rust-oci-tests-bin runtimetest # Tests unittest: - cd ./crates && cargo test --all-targets --all-features + LD_LIBRARY_PATH=$HOME/.wasmedge/lib cd ./crates && cargo test --all --all-targets --all-features featuretest: ./scripts/features_test.sh diff --git a/README.md b/README.md index a41be9d3..5a15faef 100644 --- a/README.md +++ b/README.md @@ -151,7 +151,8 @@ $ sudo apt-get install \ libdbus-glib-1-dev \ build-essential \ libelf-dev \ - libseccomp-dev + libseccomp-dev \ + libclang-dev ``` ### Fedora, Centos, RHEL and related distributions @@ -162,7 +163,8 @@ $ sudo dnf install \ systemd-devel \ dbus-devel \ elfutils-libelf-devel \ - libseccomp-devel + libseccomp-devel \ + libclang-dev ``` ## Build diff --git a/crates/libcgroups/Cargo.toml b/crates/libcgroups/Cargo.toml index 6cbf284a..3780e6a5 100644 --- a/crates/libcgroups/Cargo.toml +++ b/crates/libcgroups/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "libcgroups" -version = "0.0.3" +version = "0.0.4" description = "Library for cgroup" license-file = "../../LICENSE" repository = "https://github.com/containers/youki" diff --git a/crates/libcontainer/Cargo.toml b/crates/libcontainer/Cargo.toml index e44bcf49..53b6873b 100644 --- a/crates/libcontainer/Cargo.toml +++ b/crates/libcontainer/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "libcontainer" -version = "0.0.3" +version = "0.0.4" description = "Library for container control" license-file = "../../LICENSE" repository = "https://github.com/containers/youki" @@ -36,7 +36,7 @@ oci-spec = { version = "0.5.8", features = ["runtime"] } path-clean = "0.1.0" procfs = "0.14.1" prctl = "1.0.0" -libcgroups = { version = "0.0.3", path = "../libcgroups", default-features = false } +libcgroups = { version = "0.0.4", path = "../libcgroups", default-features = false } libseccomp = { version = "0.3.0" } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" @@ -44,7 +44,7 @@ syscalls = "0.6.7" rust-criu = "0.2.0" wasmer = { version = "2.2.0", optional = true } wasmer-wasi = { version = "2.3.0", optional = true } -wasmedge-sdk = { version = "0.7.1", optional = true } +wasmedge-sdk = { version = "0.7.1", optional = true} [dev-dependencies] oci-spec = { version = "0.5.8", features = ["proptests", "runtime"] } diff --git a/crates/liboci-cli/Cargo.toml b/crates/liboci-cli/Cargo.toml index e7a0117c..1aef2d20 100644 --- a/crates/liboci-cli/Cargo.toml +++ b/crates/liboci-cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "liboci-cli" -version = "0.0.3" +version = "0.0.4" description = "Parse command line arguments for OCI container runtimes" license-file = "../../LICENSE" repository = "https://github.com/containers/youki" diff --git a/crates/youki/Cargo.toml b/crates/youki/Cargo.toml index cfe6cb95..54d5787c 100644 --- a/crates/youki/Cargo.toml +++ b/crates/youki/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "youki" -version = "0.0.3" +version = "0.0.4" description = "A container runtime written in Rust" license-file = "../../LICENSE" repository = "https://github.com/containers/youki" @@ -25,9 +25,9 @@ features = ["std", "suggestions", "derive", "cargo"] [dependencies] anyhow = "1.0.65" chrono = { version = "0.4", features = ["serde"] } -libcgroups = { version = "0.0.3", path = "../libcgroups", default-features = false } -libcontainer = { version = "0.0.3", path = "../libcontainer", default-features = false } -liboci-cli = { version = "0.0.3", path = "../liboci-cli" } +libcgroups = { version = "0.0.4", path = "../libcgroups", default-features = false } +libcontainer = { version = "0.0.4", path = "../libcontainer", default-features = false } +liboci-cli = { version = "0.0.4", path = "../liboci-cli" } log = { version = "0.4", features = ["std"] } nix = "0.25.0" oci-spec = { version = "0.5.8", features = ["runtime"] } diff --git a/docs/src/user/basic_setup.md b/docs/src/user/basic_setup.md index 3e007a7d..2ac41a84 100644 --- a/docs/src/user/basic_setup.md +++ b/docs/src/user/basic_setup.md @@ -23,7 +23,8 @@ $ sudo apt-get install \ libdbus-glib-1-dev \ build-essential \ libelf-dev \ - libseccomp-dev + libseccomp-dev \ + libclang-dev ``` #### Fedora, Centos, RHEL and related distributions @@ -34,7 +35,8 @@ $ sudo dnf install \ systemd-devel \ dbus-devel \ elfutils-libelf-devel \ - libseccomp-devel + libseccomp-devel \ + libclang-dev ``` --- diff --git a/tests/rust-integration-tests/integration_test/src/main.rs b/tests/rust-integration-tests/integration_test/src/main.rs index 6bead642..eaeadec8 100644 --- a/tests/rust-integration-tests/integration_test/src/main.rs +++ b/tests/rust-integration-tests/integration_test/src/main.rs @@ -2,13 +2,13 @@ mod tests; mod utils; use crate::tests::hooks::get_hooks_tests; +use crate::tests::hostname::get_hostname_test; use crate::tests::lifecycle::{ContainerCreate, ContainerLifecycle}; use crate::tests::linux_ns_itype::get_ns_itype_tests; use crate::tests::pidfile::get_pidfile_test; use crate::tests::readonly_paths::get_ro_paths_test; use crate::tests::seccomp_notify::get_seccomp_notify_test; use crate::tests::tlb::get_tlb_test; -use crate::tests::hostname::get_hostname_test; use crate::utils::support::{set_runtime_path, set_runtimetest_path}; use anyhow::{Context, Result}; use clap::Parser; diff --git a/tests/rust-integration-tests/integration_test/src/tests/mod.rs b/tests/rust-integration-tests/integration_test/src/tests/mod.rs index ae2f3dbb..64b1939d 100644 --- a/tests/rust-integration-tests/integration_test/src/tests/mod.rs +++ b/tests/rust-integration-tests/integration_test/src/tests/mod.rs @@ -1,9 +1,9 @@ pub mod cgroups; pub mod hooks; +pub mod hostname; pub mod lifecycle; pub mod linux_ns_itype; pub mod pidfile; pub mod readonly_paths; pub mod seccomp_notify; pub mod tlb; -pub mod hostname; diff --git a/tests/rust-integration-tests/runtimetest/src/tests.rs b/tests/rust-integration-tests/runtimetest/src/tests.rs index 8e1ec902..4f19e7e3 100644 --- a/tests/rust-integration-tests/runtimetest/src/tests.rs +++ b/tests/rust-integration-tests/runtimetest/src/tests.rs @@ -68,7 +68,7 @@ pub fn validate_hostname(spec: &Spec) { } let actual_hostname = nix::unistd::gethostname().expect("failed to get current hostname"); let actual_hostname = actual_hostname.to_str().unwrap(); - if &actual_hostname != expected_hostname { + if actual_hostname != expected_hostname { eprintln!( "Unexpected hostname, expected: {:?} found: {:?}", expected_hostname, actual_hostname