diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml new file mode 100644 index 0000000..b7846a5 --- /dev/null +++ b/.github/workflows/nightly.yml @@ -0,0 +1,18 @@ +name: nightly +on: + schedule: + - cron: "0 4 * * *" +jobs: + build: + name: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - run: ./scripts/ci/install-deps.sh + - run: ./scripts/ci/nightly.sh + - uses: actions/upload-artifact@v4 + with: + name: krata-nightly + path: krata.tgz + compression-level: 0 diff --git a/Cargo.toml b/Cargo.toml index 3e76a32..f60a243 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -41,7 +41,6 @@ tar = "0.4.40" zstd = "0.13.0" termion = "3.0.0" path-clean = "1.0.1" -ureq = "2.9.1" url = "2.5.0" cli-tables = "0.2.1" rand = "0.8.5" diff --git a/controller/Cargo.toml b/controller/Cargo.toml index 216c8c4..65221bf 100644 --- a/controller/Cargo.toml +++ b/controller/Cargo.toml @@ -8,49 +8,17 @@ resolver = "2" anyhow = { workspace = true } log = { workspace = true } env_logger = { workspace = true } -zstd = { workspace = true } -flate2 = { workspace = true } -tar = { workspace = true } -directories = { workspace = true } -walkdir = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } -sha256 = { workspace = true } -url = { workspace = true } -ureq = { workspace = true } -reqwest = { workspace = true } -path-clean = { workspace = true } termion = { workspace = true } cli-tables = { workspace = true } clap = { workspace = true } -oci-spec = { workspace = true } -backhand = { workspace = true } -uuid = { workspace = true } -ipnetwork = { workspace = true } tokio = { workspace = true } -futures = { workspace = true } -bytes = { workspace = true } tokio-stream = { workspace = true } [dependencies.krata] path = "../shared" -[dependencies.nix] -workspace = true -features = ["process"] - -[dependencies.advmac] -path = "../libs/advmac" - -[dependencies.loopdev] -path = "../libs/loopdev" - -[dependencies.xenclient] -path = "../libs/xen/xenclient" - -[dependencies.xenstore] -path = "../libs/xen/xenstore" - [lib] path = "src/lib.rs" diff --git a/daemon/Cargo.toml b/daemon/Cargo.toml index 46b1bfd..b7811b8 100644 --- a/daemon/Cargo.toml +++ b/daemon/Cargo.toml @@ -17,7 +17,6 @@ serde = { workspace = true } serde_json = { workspace = true } sha256 = { workspace = true } url = { workspace = true } -ureq = { workspace = true } reqwest = { workspace = true } path-clean = { workspace = true } termion = { workspace = true } diff --git a/initrd/build.sh b/initrd/build.sh index 481b3e5..36edc61 100755 --- a/initrd/build.sh +++ b/initrd/build.sh @@ -5,12 +5,12 @@ TARGET="x86_64-unknown-linux-gnu" export RUSTFLAGS="-Ctarget-feature=+crt-static" cd "$(dirname "${0}")/.." -krata_DIR="${PWD}" +KRATA_DIR="${PWD}" cargo build -q --bin krataguest --release --target "${TARGET}" INITRD_DIR="$(mktemp -d /tmp/krata-initrd.XXXXXXXXXXXXX)" cp "target/${TARGET}/release/krataguest" "${INITRD_DIR}/init" chmod +x "${INITRD_DIR}/init" cd "${INITRD_DIR}" -mkdir -p "${krata_DIR}/target/initrd" -find . | cpio -R 0:0 --reproducible -o -H newc --quiet > "${krata_DIR}/target/initrd/initrd" +mkdir -p "${KRATA_DIR}/initrd/target" +find . | cpio -R 0:0 --reproducible -o -H newc --quiet > "${KRATA_DIR}/initrd/target/initrd" rm -rf "${INITRD_DIR}" diff --git a/scripts/ci/install-deps.sh b/scripts/ci/install-deps.sh new file mode 100755 index 0000000..f50a951 --- /dev/null +++ b/scripts/ci/install-deps.sh @@ -0,0 +1,5 @@ +#!/bin/sh +set -e + +sudo apt-get update +sudo apt-get install -y build-essential libssl-dev libelf-dev flex bison bc diff --git a/scripts/ci/nightly.sh b/scripts/ci/nightly.sh new file mode 100755 index 0000000..4d50e50 --- /dev/null +++ b/scripts/ci/nightly.sh @@ -0,0 +1,22 @@ +#!/bin/sh +set -e + +REAL_SCRIPT="$(realpath "${0}")" +cd "$(dirname "${REAL_SCRIPT}")/../.." +KRATA_DIR="${PWD}" +NIGHTLY_TAR="${KRATA_DIR}/krata.tgz" +NIGHTLY_DIR="$(mktemp -d /tmp/krata-release.XXXXXXXXXXXXX)" +for X in kratad kratanet kratactl +do + cargo build --release --target x86_64-unknown-linux-gnu --bin "${X}" + cp "${KRATA_DIR}/target/x86_64-unknown-linux-gnu/release/${X}" "${NIGHTLY_DIR}/${X}" + +done +./initrd/build.sh +./kernel/build.sh +cd "${NIGHTLY_DIR}" +cp "${KRATA_DIR}/initrd/target/initrd" initrd +cp "${KRATA_DIR}/kernel/target/kernel" kernel +tar czf "${NIGHTLY_TAR}" . +cd "${KRATA_DIR}" +rm -rf "${NIGHTLY_DIR}"