Skip to content

control/discovery: add discovery controller #315

control/discovery: add discovery controller

control/discovery: add discovery controller #315

Workflow file for this run

name: "CI"
on:
push:
pull_request:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
# git submodule update --init --recursive
submodules: recursive
- name: Build container images
run: make build SVC="spdk nvmeof nvmeof-cli ceph"
- name: Save container images
run: |
. .env
docker save quay.io/ceph/nvmeof:$NVMEOF_VERSION > nvmeof.tar
docker save quay.io/ceph/nvmeof-cli:$NVMEOF_VERSION > nvmeof-cli.tar
docker save quay.io/ceph/vstart-cluster:$CEPH_VERSION > vstart-cluster.tar
- name: Upload container images
uses: actions/upload-artifact@v3
with:
name: images
path: |
nvmeof.tar
nvmeof-cli.tar
vstart-cluster.tar
- name: Build stand-alone packages (RPMs and Python wheel)
id: build-standalone-packages
run: |
export EXPORT_DIR=$(mktemp -d)
make export-rpms
make export-python
echo "EXPORT_DIR=$EXPORT_DIR" >> "$GITHUB_ENV"
- name: Upload stand-alone packages
uses: actions/upload-artifact@v3
with:
name: ceph_nvmeof-${{ github.run_number }}
path: |
${{ env.EXPORT_DIR }}/**
pytest:
needs: build
strategy:
fail-fast: false
matrix:
test: ["cli", "state", "multi_gateway"]
runs-on: ubuntu-latest
env:
HUGEPAGES: 512 # for multi gateway test, approx 256 per gateway instance
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup huge pages
run: |
make setup HUGEPAGES=$HUGEPAGES
- name: Download container images
uses: actions/download-artifact@v3
with:
name: images
- name: Load container images
run: |
docker load < nvmeof.tar
docker load < vstart-cluster.tar
- name: Start ceph cluster
run: |
make up SVC=ceph OPTS="--detach"
- name: Wait for the ceph cluster container to become healthy
run: |
while true; do
container_status=$(docker inspect --format='{{.State.Health.Status}}' ceph)
if [[ $container_status == "healthy" ]]; then
break
else
# Wait for a specific time before checking again
sleep 1
echo -n .
fi
done
echo
- name: Create RBD image
run: |
echo "💁 ceph list pools:"
make exec SVC=ceph OPTS="-T" CMD="ceph osd lspools"
echo "💁 rbd create:"
make exec SVC=ceph OPTS="-T" CMD="rbd create rbd/mytestdevimage --size 16"
echo "💁 ls rbd:"
make exec SVC=ceph OPTS="-T" CMD="rbd ls rbd"
- name: Run ${{ matrix.test }} test
run: |
# Run tests code in current dir
# Managing pytest’s output: https://docs.pytest.org/en/7.1.x/how-to/output.html
make run SVC="nvmeof-devel" OPTS="--volume=$(pwd)/tests:/src/tests --entrypoint=python3" CMD="-m pytest --full-trace -vv -ra -s tests/test_${{ matrix.test }}.py"
- name: Display Logs
run: |
make logs OPTS=""
- name: Compose Down
run: make down
- name: Compose Clean
run: make clean
demo:
needs: build
runs-on: ubuntu-latest
env:
HUGEPAGES: 256
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup huge-pages
run: make setup HUGEPAGES=$HUGEPAGES
- name: Download container images
uses: actions/download-artifact@v3
with:
name: images
- name: Load container images
run: |
docker load < nvmeof.tar
docker load < nvmeof-cli.tar
docker load < vstart-cluster.tar
- name: Start containers
run: |
make up OPTS=--detach || (make logs OPTS=''; exit 1)
- name: Wait for the Gateway to be listening
timeout-minutes: 1
run: |
. .env
echo using gateway $NVMEOF_IP_ADDRESS port $NVMEOF_GW_PORT
until nc -z $NVMEOF_IP_ADDRESS $NVMEOF_GW_PORT; do
echo -n .
sleep 1
done
echo
- name: List containers
run: make ps
- name: List processes
run: make top
- name: Test
run: |
make demo OPTS=-T || (make logs OPTS=''; exit 1)
- name: Get subsystems
run: |
# https://github.com/actions/toolkit/issues/766
shopt -s expand_aliases
eval $(make alias)
nvmeof-cli get_subsystems
#- name: Test mounting nvmeof device locally
# run: |
# . .env
# sudo modprobe nvme-fabrics
# sudo nvme list
# sudo nvme discover -t tcp -a $NVMEOF_IP_ADDRESS -s $NVMEOF_IO_PORT
# sudo nvme connect -t tcp --traddr $NVMEOF_IP_ADDRESS -s $NVMEOF_IO_PORT -n nqn.2016-06.io.spdk:cnode1
# sudo nvme list
# NVMEOF_DEVICE=$(sudo nvme list -o json | jq '.Devices[] | select(.ModelNumber=="SPDK bdev Controller").DevicePath')
# sudo mkfs $NVMEOF_DEVICE
# MOUNT_POINT=$(mktemp -d)
# sudo mount $NVMEOF_DEVICE $MOUNT_POINT
# cd $MOUNT_POINT
# touch test
# For debugging purposes (provides an SSH connection to the runner)
#- name: Setup tmate session
# uses: mxschmitt/action-tmate@v3
# with:
# limit-access-to-actor: true
- name: Display logs
run: make logs OPTS=''
- name: Shut containers down
run: make down
- name: Clean up environment
run: make clean