Skip to content

Commit

Permalink
refactor: re-implement the slight shim with libcontainer instance (#125)
Browse files Browse the repository at this point in the history
* refactor: re-implement the slight shim with libcontainer instance
* split python setup and tearmdown scripts to bash scripts

this allows the CI and makefile to have more configurations

Signed-off-by: jiaxiao zhou <[email protected]>
  • Loading branch information
Mossaka authored Aug 22, 2023
1 parent df29600 commit f9c70f2
Show file tree
Hide file tree
Showing 17 changed files with 804 additions and 446 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ jobs:
- name: build
run: |
VERBOSE=1 make build
- name: unit tests
run: |
VERBOSE=1 make unit-tests
- name: lowercase the runner OS name
shell: bash
run: |
Expand Down
19 changes: 7 additions & 12 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,27 +26,22 @@ jobs:
build:
uses: ./.github/workflows/build.yaml
test:
needs: build
runs-on: ubuntu-latest
env:
ARCH: x86_64
steps:
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
with:
workspaces: |
"containerd-shim-*-v1 -> target"
- name: "Install Rust Wasm targets"
- uses: actions/download-artifact@v3
- name: Extract containerd-wasm-shims-v1-linux-${{ env.ARCH }}
run: |
make install-rust-targets
- name: "Install dependencies"
run: |
sudo apt-get update
sudo apt-get install protobuf-compiler -y
mkdir -p ./bin
tar -xzf containerd-wasm-shims-v1-linux-${{ env.ARCH }}/containerd-wasm-shims-v1-linux-${{ env.ARCH }}.tar.gz -C ./bin
- name: install k3d
run: make install-k3d
working-directory: ./deployments/k3d
- name: run integration tests
run: make test
run: BIN_DIR="./bin" make integration-tests
- name: clean up k3d
if: always()
run: make test/clean
run: make test/clean
27 changes: 24 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,42 @@ else
VERBOSE_FLAG := -vvv
endif

BIN_DIR ?=

.PHONY: test
test: unit-tests integration-tests

.PHONY: unit-tests
unit-tests: build
$(foreach shim,$(SHIMS),cross test --release --manifest-path=containerd-shim-$(shim)-v1/Cargo.toml --target $(TARGET);)

.PHONY: check-bins
check-bins:
./scripts/check-bins.sh

./PHONY: move-bins
move-bins:
./scripts/move-bins.sh $(BIN_DIR)

./PHONY: up
up:
./scripts/up.sh

./PHONY: pod-status-check
pod-status-check:
./scripts/pod-status-check.sh

./PHONY: workloads
workloads:
./scripts/workloads.sh

.PHONY: integration-tests
integration-tests: build
$(PYTHON) tests/setup.py $(TARGET)
integration-tests: install-cross check-bins move-bins up pod-status-check workloads
cargo test -- --nocapture

.PHONY: tests/clean
test/clean:
$(PYTHON) tests/teardown.py
./scripts/down.sh

.PHONY: fmt
fmt:
Expand Down
Loading

0 comments on commit f9c70f2

Please sign in to comment.