From 053b76a8768844fab2a7bd602673a038b38a836e Mon Sep 17 00:00:00 2001 From: Yashodhan Joshi Date: Tue, 6 Dec 2022 11:26:00 +0530 Subject: [PATCH 1/6] 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 327c6e3ca..d98b0356c 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 4f393797d..bdf806698 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 8b9af4104..6c4a31679 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 a41be9d3e..5a15faefa 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 6cbf284ad..3780e6a52 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 e44bcf493..53b6873b4 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 e7a0117cb..1aef2d208 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 cfe6cb956..54d5787c4 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 3e007a7d2..2ac41a84e 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 6bead642a..eaeadec8e 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 ae2f3dbbf..64b1939d8 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 8e1ec9026..4f19e7e37 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 From 78fec6a5ce5d4edd068ed919e28d8c53152e1b0d Mon Sep 17 00:00:00 2001 From: Yashodhan Joshi Date: Tue, 13 Dec 2022 11:37:37 +0530 Subject: [PATCH 2/6] Commit for testing the CI --- .github/workflows/release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d98b0356c..e2a437d20 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -53,7 +53,7 @@ jobs: path: output/* release: - name: Publish Release + name: Create Draft Release runs-on: ubuntu-latest needs: - upload @@ -95,7 +95,7 @@ jobs: with: name: ${{ steps.info.outputs.version }} Release draft: true - token: ${{ secrets.GITHUB_TOKEN }} + # token: ${{ secrets.GITHUB_TOKEN }} files: ./${{ env.OUTPUTDIR }}.tar.gz publish: @@ -103,7 +103,7 @@ jobs: needs: check runs-on: ubuntu-latest env: - CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} + CARGO_REGISTRY_TOKEN: 'DUMMY Token' #${{ secrets.CARGO_REGISTRY_TOKEN }} steps: - uses: actions/checkout@v3 - name: Set up cargo From 3bb3ee90fdbddc85e53566f93c16ec49404f2eca Mon Sep 17 00:00:00 2001 From: Yashodhan Joshi Date: Tue, 13 Dec 2022 11:57:24 +0530 Subject: [PATCH 3/6] Temp commit --- .github/workflows/release.yml | 80 +++++++++++++++++------------------ 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e98c0819f..b275875c5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,28 +5,28 @@ on: tags: ["v[0-9]+.[0-9]+.[0-9]+*"] jobs: - check: - name: Check - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v3 - with: - submodules: recursive - - run: sudo apt-get -y update - - run: sudo apt-get install -y pkg-config libsystemd-dev libdbus-glib-1-dev libelf-dev libseccomp-dev - - name: Set up cargo - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - name: Build - run: make youki-release - - name: test - run: make test-all + # check: + # name: Check + # runs-on: ubuntu-20.04 + # steps: + # - uses: actions/checkout@v3 + # with: + # submodules: recursive + # - run: sudo apt-get -y update + # - run: sudo apt-get install -y pkg-config libsystemd-dev libdbus-glib-1-dev libelf-dev libseccomp-dev + # - name: Set up cargo + # uses: actions-rs/toolchain@v1 + # with: + # toolchain: stable + # override: true + # - name: Build + # run: make youki-release + # - name: test + # run: make test-all upload: name: Upload - needs: check + # needs: check runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v3 @@ -98,24 +98,24 @@ jobs: # token: ${{ secrets.GITHUB_TOKEN }} files: ./${{ env.OUTPUTDIR }}.tar.gz - publish: - name: Publish Packages - needs: check - runs-on: ubuntu-20.04 - env: - CARGO_REGISTRY_TOKEN: 'DUMMY Token' #${{ secrets.CARGO_REGISTRY_TOKEN }} - steps: - - uses: actions/checkout@v3 - - name: Set up cargo - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - name: Publish libcgroups - run: cargo publish -p libcgroups --no-verify - - name: Publish libcontainer - 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 + # publish: + # name: Publish Packages + # needs: check + # runs-on: ubuntu-20.04 + # env: + # CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} + # steps: + # - uses: actions/checkout@v3 + # - name: Set up cargo + # uses: actions-rs/toolchain@v1 + # with: + # toolchain: stable + # override: true + # - name: Publish libcgroups + # run: cargo publish -p libcgroups --no-verify + # - name: Publish libcontainer + # 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 From 0a663e5f39898da86da9c8b68a556a28029f70a7 Mon Sep 17 00:00:00 2001 From: Yashodhan Joshi Date: Tue, 13 Dec 2022 12:23:27 +0530 Subject: [PATCH 4/6] Fix output --- .github/workflows/release.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b275875c5..2aa23b8d2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -57,8 +57,6 @@ jobs: runs-on: ubuntu-20.04 needs: - upload - outputs: - version: ${{ steps.info.outputs.version }} steps: - uses: actions/checkout@v3 @@ -93,7 +91,7 @@ jobs: - name: Create Release Draft uses: softprops/action-gh-release@v1 with: - name: ${{ steps.info.outputs.version }} Release + name: ${{ env.VERSION }} Release draft: true # token: ${{ secrets.GITHUB_TOKEN }} files: ./${{ env.OUTPUTDIR }}.tar.gz From 733d8f1bf95d282c6d06ac3f23478451c9570f5e Mon Sep 17 00:00:00 2001 From: Yashodhan Joshi Date: Tue, 13 Dec 2022 13:11:27 +0530 Subject: [PATCH 5/6] See if tests still fail --- .github/workflows/release.yml | 82 +++++++++++++++++------------------ 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2aa23b8d2..5df6fa940 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,28 +5,28 @@ on: tags: ["v[0-9]+.[0-9]+.[0-9]+*"] jobs: - # check: - # name: Check - # runs-on: ubuntu-20.04 - # steps: - # - uses: actions/checkout@v3 - # with: - # submodules: recursive - # - run: sudo apt-get -y update - # - run: sudo apt-get install -y pkg-config libsystemd-dev libdbus-glib-1-dev libelf-dev libseccomp-dev - # - name: Set up cargo - # uses: actions-rs/toolchain@v1 - # with: - # toolchain: stable - # override: true - # - name: Build - # run: make youki-release - # - name: test - # run: make test-all + check: + name: Check + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + - run: sudo apt-get -y update + - run: sudo apt-get install -y pkg-config libsystemd-dev libdbus-glib-1-dev libelf-dev libseccomp-dev libclang-dev + - name: Set up cargo + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + - name: Build + run: make youki-release + - name: test + run: make test-all upload: name: Upload - # needs: check + needs: check runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v3 @@ -93,27 +93,27 @@ jobs: with: name: ${{ env.VERSION }} Release draft: true - # token: ${{ secrets.GITHUB_TOKEN }} + token: ${{ secrets.GITHUB_TOKEN }} files: ./${{ env.OUTPUTDIR }}.tar.gz - # publish: - # name: Publish Packages - # needs: check - # runs-on: ubuntu-20.04 - # env: - # CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} - # steps: - # - uses: actions/checkout@v3 - # - name: Set up cargo - # uses: actions-rs/toolchain@v1 - # with: - # toolchain: stable - # override: true - # - name: Publish libcgroups - # run: cargo publish -p libcgroups --no-verify - # - name: Publish libcontainer - # 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 + publish: + name: Publish Packages + needs: check + runs-on: ubuntu-20.04 + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} + steps: + - uses: actions/checkout@v3 + - name: Set up cargo + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + - name: Publish libcgroups + run: cargo publish -p libcgroups --no-verify + - name: Publish libcontainer + 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 From 7b7e4680599b3e903031da319d855a0305f0370e Mon Sep 17 00:00:00 2001 From: Yashodhan Joshi Date: Tue, 13 Dec 2022 14:09:50 +0530 Subject: [PATCH 6/6] fix makefile script --- .github/workflows/release.yml | 2 +- Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5df6fa940..70f950e29 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,7 +22,7 @@ jobs: - name: Build run: make youki-release - name: test - run: make test-all + run: make unittest featuretest oci-tests upload: name: Upload diff --git a/Makefile b/Makefile index 6c4a31679..92668f2bd 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,7 @@ all: youki-release rust-oci-tests-bin runtimetest # Tests unittest: - LD_LIBRARY_PATH=$HOME/.wasmedge/lib cd ./crates && cargo test --all --all-targets --all-features + cd ./crates && LD_LIBRARY_PATH=${HOME}/.wasmedge/lib cargo test --all --all-targets --all-features featuretest: ./scripts/features_test.sh