Integration Test #202
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Integration Test | |
on: | |
schedule: | |
# Do conversion every day at 00:03 clock UTC | |
- cron: "3 0 * * *" | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
arch: [amd64] | |
fs_version: [5, 6] | |
branch: [master, stable/v2.1] | |
steps: | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.18 | |
- name: Setup pytest | |
run: | | |
sudo apt install --no-install-recommends -y attr libattr1-dev fio pkg-config libssl-dev python3 | |
sudo python3 -m pip install --upgrade pip | |
sudo pip3 install pytest xattr requests psutil requests_unixsocket libconf py-splice fallocate pytest-repeat PyYAML six docker toml | |
- name: containerd runc and crictl | |
run: | | |
sudo wget https://github.com/kubernetes-sigs/cri-tools/releases/download/v1.17.0/crictl-v1.17.0-linux-amd64.tar.gz | |
sudo tar zxvf ./crictl-v1.17.0-linux-amd64.tar.gz -C /usr/local/bin | |
sudo wget https://github.com/containerd/containerd/releases/download/v1.4.3/containerd-1.4.3-linux-amd64.tar.gz | |
mkdir containerd | |
sudo tar -zxf ./containerd-1.4.3-linux-amd64.tar.gz -C ./containerd | |
sudo mv ./containerd/bin/* /usr/bin/ | |
sudo wget https://github.com/opencontainers/runc/releases/download/v1.1.2/runc.amd64 -O /usr/bin/runc | |
sudo chmod +x /usr/bin/runc | |
- name: Set up ossutils | |
run: | | |
sudo wget https://gosspublic.alicdn.com/ossutil/1.7.13/ossutil64 -O /usr/bin/ossutil64 | |
sudo chmod +x /usr/bin/ossutil64 | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ matrix.branch }} | |
- name: Cache cargo | |
uses: Swatinem/[email protected] | |
with: | |
cache-on-failure: true | |
key: ${{ runner.os }}-cargo-${{ matrix.arch }} | |
- name: Build nydus-rs | |
run: | | |
declare -A rust_target_map=( ["amd64"]="x86_64-unknown-linux-musl" ["arm64"]="aarch64-unknown-linux-musl") | |
RUST_TARGET=${rust_target_map[${{ matrix.arch }}]} | |
cargo install --version 0.2.1 cross | |
rustup component add rustfmt clippy | |
make -e RUST_TARGET=$RUST_TARGET -e CARGO=cross static-release | |
make release -C contrib/nydus-backend-proxy/ | |
sudo cp -r misc/configs . | |
sudo chown -R $(id -un):$(id -gn) . ~/.cargo/ | |
pwd | |
ls -lh target/$RUST_TARGET/release | |
- name: Set up anchor file | |
env: | |
OSS_AK_ID: ${{ secrets.OSS_TEST_AK_ID }} | |
OSS_AK_SEC: ${{ secrets.OSS_TEST_AK_SECRET }} | |
FS_VERSION: ${{ matrix.fs_version }} | |
run: | | |
sudo mkdir -p /home/runner/nydus-test-workspace | |
sudo mkdir -p /home/runner/nydus-test-workspace/proxy_blobs | |
sudo cat > /home/runner/work/image-service/image-service/contrib/nydus-test/anchor_conf.json << EOF | |
{ | |
"workspace": "/home/runner/nydus-test-workspace", | |
"nydus_project": "/home/runner/work/image-service/image-service", | |
"nydus_runtime_conf": { | |
"profile": "release", | |
"log_level": "info" | |
}, | |
"registry": { | |
"registry_url": "localhost:5000", | |
"registry_namespace": "", | |
"registry_auth": "YOURAUTH==", | |
"backend_proxy_url": "127.0.0.1:8000", | |
"backend_proxy_blobs_dir": "/home/runner/nydus-test-workspace/proxy_blobs" | |
}, | |
"oss": { | |
"endpoint": "oss-cn-beijing.aliyuncs.com", | |
"ak_id": "$OSS_AK_ID", | |
"ak_secret": "$OSS_AK_SEC", | |
"bucket": "nydus-ci" | |
}, | |
"images": { | |
"images_array": [ | |
"busybox:latest" | |
] | |
}, | |
"artifacts": { | |
"containerd": "/usr/bin/containerd", | |
"ossutil_bin": "/usr/bin/ossutil64" | |
}, | |
"fs_version": "$FS_VERSION", | |
"logging_file": "stderr", | |
"target": "musl" | |
} | |
EOF | |
- name: run e2e tests | |
run: | | |
cd /home/runner/work/image-service/image-service/contrib/nydus-test | |
sudo mkdir -p /blobdir | |
sudo python3 nydus_test_config.py --dist fs_structure.yaml | |
sudo pytest -vs -x --durations=0 functional-test/test_api.py functional-test/test_nydus.py functional-test/test_layered_image.py |