From 9c2d3ae9c246478582ce063d721752c1ae0771d6 Mon Sep 17 00:00:00 2001 From: Hyo-Kyung Lee Date: Fri, 28 Apr 2023 14:27:00 -0500 Subject: [PATCH] ci(spack): test the right development code (#64) --- .github/workflows/ior.yml | 87 ++++++++++++++++++++++++++++ .github/workflows/ior2.yml | 85 +++++++++++++++++++++++++++ .github/workflows/spack.yml | 2 +- .github/workflows/spack_bedrock.yml | 2 +- README.md | 8 ++- ci.sh | 34 +++++++++++ prepare_gh.sh | 6 ++ tests/config_gh.json | 89 +++++++++++++++++++++++++++++ tests/mobject-test-util-gh.sh | 42 ++++++++++++++ 9 files changed, 350 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/ior.yml create mode 100644 .github/workflows/ior2.yml create mode 100755 ci.sh create mode 100755 prepare_gh.sh create mode 100644 tests/config_gh.json create mode 100755 tests/mobject-test-util-gh.sh diff --git a/.github/workflows/ior.yml b/.github/workflows/ior.yml new file mode 100644 index 0000000..a7256a6 --- /dev/null +++ b/.github/workflows/ior.yml @@ -0,0 +1,87 @@ +name: ior+mobject@develop + +on: + push: + branches: [ main ] + paths-ignore: + - 'doc/**' + pull_request: + branches: [ main ] + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Install APT Dependencies + run: | + sudo apt update + sudo apt-get install -y autoconf + sudo apt-get install -y automake + sudo apt-get install -y cmake + sudo apt-get install -y libtool + sudo apt-get install -y libtool-bin + sudo apt-get install -y mpich + sudo apt-get install -y zlib1g-dev + sudo apt-get install -y diffutils + sudo apt-get install -y libdb-dev + sudo apt-get install -y libedit-dev + sudo apt-get install -y libncurses6 + sudo apt-get install -y libxml2-dev + sudo apt-get install -y openssl + - name: Get Sources + uses: actions/checkout@v3 + - name: Checkout Spack + uses: actions/checkout@v3 + with: + repository: spack/spack + path: ./spack + - name: Checkout mochi-spack-packages + uses: actions/checkout@v3 + with: + repository: mochi-hpc/mochi-spack-packages + path: ./mochi-spack-packages + - name: Run spack install ior + run: | + . ./spack/share/spack/setup-env.sh + spack compiler find + spack compilers + spack external find autoconf + spack external find automake + spack external find berkeley-db + spack external find boost + spack external find cmake + spack external find diffutils + spack external find libedit + spack external find libtool + spack external find libiconv + spack external find libxml2 + spack external find m4 + spack external find mpich + spack external find ncurses + spack external find openssl + spack external find perl + spack external find pkgconf + spack external find zlib + spack external find xz + spack repo add ./mochi-spack-packages + spack install mobject@develop+bedrock + spack load mobject + spack install ior@develop+mobject + spack load ior + spack view --verbose symlink install ior@develop+mobject -i + export LD_LIBRARY_PATH=$PWD/install/lib:$PWD/install/lib64 + echo $LD_LIBRARY_PATH + ls + ./prepare.sh + ./prepare_gh.sh + ./configure --enable-bedrock + make + sudo ./ci.sh + + - name: Upload + if: always() + uses: actions/upload-artifact@v2 + with: + name: test-suite.log + path: ${{ runner.workspace }}/mobject/test-suite.log diff --git a/.github/workflows/ior2.yml b/.github/workflows/ior2.yml new file mode 100644 index 0000000..b563b16 --- /dev/null +++ b/.github/workflows/ior2.yml @@ -0,0 +1,85 @@ +name: ior+mobject@develop ^ + +on: + push: + branches: [ main ] + paths-ignore: + - 'doc/**' + pull_request: + branches: [ main ] + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Install APT Dependencies + run: | + sudo apt update + sudo apt-get install -y autoconf + sudo apt-get install -y automake + sudo apt-get install -y cmake + sudo apt-get install -y libtool + sudo apt-get install -y libtool-bin + sudo apt-get install -y mpich + sudo apt-get install -y zlib1g-dev + sudo apt-get install -y diffutils + sudo apt-get install -y libdb-dev + sudo apt-get install -y libedit-dev + sudo apt-get install -y libncurses6 + sudo apt-get install -y libxml2-dev + sudo apt-get install -y openssl + - name: Get Sources + uses: actions/checkout@v3 + - name: Checkout Spack + uses: actions/checkout@v3 + with: + repository: spack/spack + path: ./spack + - name: Checkout mochi-spack-packages + uses: actions/checkout@v3 + with: + repository: mochi-hpc/mochi-spack-packages + path: ./mochi-spack-packages + - name: Run spack install ior + run: | + . ./spack/share/spack/setup-env.sh + spack compiler find + spack compilers + spack external find autoconf + spack external find automake + spack external find berkeley-db + spack external find boost + spack external find cmake + spack external find diffutils + spack external find libedit + spack external find libtool + spack external find libiconv + spack external find libxml2 + spack external find m4 + spack external find mpich + spack external find ncurses + spack external find openssl + spack external find perl + spack external find pkgconf + spack external find zlib + spack external find xz + spack repo add ./mochi-spack-packages + spack install ior@develop+mobject ^mobject@develop+bedrock ^mercury@master~boostsys + spack load ior + spack view --verbose symlink install ior@develop+mobject -i + export LD_LIBRARY_PATH=$PWD/install/lib:$PWD/install/lib64 + echo $LD_LIBRARY_PATH + ls + ./prepare.sh + ./prepare_gh.sh + ./configure --enable-bedrock + make + sudo ./ci.sh + + - name: Upload + if: always() + uses: actions/upload-artifact@v2 + with: + name: test-suite.log + path: ${{ runner.workspace }}/mobject/test-suite.log diff --git a/.github/workflows/spack.yml b/.github/workflows/spack.yml index 078044a..47d2879 100644 --- a/.github/workflows/spack.yml +++ b/.github/workflows/spack.yml @@ -63,4 +63,4 @@ jobs: spack external find zlib spack external find xz spack repo add ./mochi-spack-packages - spack install mobject + spack install mobject@main diff --git a/.github/workflows/spack_bedrock.yml b/.github/workflows/spack_bedrock.yml index aae77a4..2c0c2f6 100644 --- a/.github/workflows/spack_bedrock.yml +++ b/.github/workflows/spack_bedrock.yml @@ -31,4 +31,4 @@ jobs: run: | . ./spack/share/spack/setup-env.sh spack repo add ./mochi-spack-packages - spack install mobject+bedrock + spack install mobject@main+bedrock diff --git a/README.md b/README.md index c970b35..4324abe 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,10 @@ ![logo](mobject_logo.png) # Mobject -[![check spelling](https://github.com/mochi-hpc/mobject/actions/workflows/spell.yml/badge.svg)](https://github.com/mochi-hpc/mobject/actions/workflows/spell.yml) -[![spack mobject](https://github.com/mochi-hpc/mobject/actions/workflows/spack.yml/badge.svg)](https://github.com/mochi-hpc/mobject/actions/workflows/spack.yml) -[![spack mobject+bedrock](https://github.com/mochi-hpc/mobject/actions/workflows/spack_bedrock.yml/badge.svg)](https://github.com/mochi-hpc/mobject/actions/workflows/spack_bedrock.yml) + +[![check spelling](https://github.com/hyoklee/mobject/actions/workflows/spell.yml/badge.svg)](https://github.com/hyoklee/mobject/actions/workflows/spell.yml) +[![ior+mobject@develop](https://github.com/hyoklee/mobject/actions/workflows/ior.yml/badge.svg)](https://github.com/hyoklee/mobject/actions/workflows/ior.yml) +[![spack mobject](https://github.com/hyoklee/mobject/actions/workflows/spack.yml/badge.svg)](https://github.com/hyoklee/mobject/actions/workflows/spack.yml) +[![spack mobject+bedrock](https://github.com/hyoklee/mobject/actions/workflows/spack_bedrock.yml/badge.svg)](https://github.com/hyoklee/mobject/actions/workflows/spack_bedrock.yml) Mobject is a distributed object storage system built using a composition of [Mochi](https://mochi.readthedocs.io) components: diff --git a/ci.sh b/ci.sh new file mode 100755 index 0000000..e4582fa --- /dev/null +++ b/ci.sh @@ -0,0 +1,34 @@ +#!/bin/sh +# +# Test Mobject using GitHub Action. +# +# This script assumes that Spack installed dependencies under $PWD/install. +# +# Author: Hyokyung Lee (hyoklee@hdfgroup.org) +# Last Update: 2022-11-17 + + +echo "Checking cwd" +echo $PWD + +export LD_LIBRARY_PATH=$PWD/install/lib:$PWD/install/lib64 +echo "Checking LD_LIBRARY_PATH" +echo $LD_LIBRARY_PATH + +export PATH=$PWD/install/bin:$PATH +echo "Checking PATH" +echo $PATH + +echo "Creating /usr/local/tmp to check root permission" +mkdir /usr/local/tmp + +echo "Running sysctl" +/usr/sbin/sysctl kernel.yama.ptrace_scope=0 + +echo "Testing using make check" +make check +grep -r \\[error\\] tests/*.sh.log +ls /tmp/ +export MOBJECT_CLUSTER_FILE=$PWD/mobject.ssg +bedrock na+sm -c $PWD/tests/config.json -v trace & +ior -g -a RADOS -t 64k -b 128k --rados.user=foo --rados.pool=bar --rados.conf $MOBJECT_CLUSTER_FILE diff --git a/prepare_gh.sh b/prepare_gh.sh new file mode 100755 index 0000000..35e456f --- /dev/null +++ b/prepare_gh.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +echo "Copying GitHub CI files..." +cp tests/config_gh.json tests/config.json +cp tests/mobject-test-util-gh.sh tests/mobject-test-util.sh + diff --git a/tests/config_gh.json b/tests/config_gh.json new file mode 100644 index 0000000..4f2ec0c --- /dev/null +++ b/tests/config_gh.json @@ -0,0 +1,89 @@ +{ + "ssg" : [ + { + "name" : "mobject", + "bootstrap" : "init", + "group_file" : "mobject.ssg" + } + ], + "libraries" : { + "yokan" : "libyokan-bedrock-module.so", + "bake" : "libbake-bedrock.so", + "mobject" : "lib/.libs/libmobject-bedrock.so" + }, + "abt_io" : [ + { + "name" : "bake_abt_io", + "pool" : "__primary__" + } + ], + "providers" : [ + { + "name" : "metadata", + "type" : "yokan", + "provider_id" : 0, + "config" : { + "databases" : [ + { + "name" : "mobject_oid_map", + "type" : "map", + "config" : { + "comparator" : "lib/.libs/libmobject-comparators.so:mobject_oid_map_compare" + } + }, + { + "name" : "mobject_name_map", + "type" : "map", + "config" : { + "comparator" : "lib/.libs/libmobject-comparators.so:mobject_name_map_compare" + } + }, + { + "name" : "mobject_seg_map", + "type" : "map", + "config" : { + "comparator" : "lib/.libs/libmobject-comparators.so:mobject_seg_map_compare" + } + }, + { + "name" : "mobject_omap_map", + "type" : "map", + "config" : { + "comparator" : "lib/.libs/libmobject-comparators.so:mobject_omap_map_compare" + } + } + ] + } + }, + { + "name" : "storage", + "type" : "bake", + "provider_id" : 0, + "config" : { + "pipeline_enable" : true, + "pipeline_npools" : 4, + "pipeline_nbuffers_per_pool" : 32, + "pipeline_first_buffer_size" : 65536, + "pipeline_multiplier" : 4, + "file_backend": { + "targets": [ + "/tmp/mobject.dat" + ] + } + }, + "dependencies" : { + "abt_io" : "bake_abt_io" + } + }, + { + "name" : "coordinator", + "type" : "mobject", + "provider_id" : 1, + "config" : {}, + "dependencies" : { + "bake_provider_handle" : "storage@local", + "yokan_provider_handle" : "metadata@local" + } + } + ] +} diff --git a/tests/mobject-test-util-gh.sh b/tests/mobject-test-util-gh.sh new file mode 100755 index 0000000..2f48b21 --- /dev/null +++ b/tests/mobject-test-util-gh.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# +# General test script utilities +# + +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" + +if [ -z "$TIMEOUT" ] ; then + echo expected TIMEOUT variable defined to its respective command + exit 1 +fi + +function run_to() +{ + maxtime=${1}s + shift + $TIMEOUT --signal=9 $maxtime "$@" +} + +function mobject_test_start_servers() +{ + startwait=${1:-15} + maxtime=${2:-120} + # storage=${3:-/dev/shm/mobject.dat} + storage=${3:-/tmp/mobject.dat} + + rm -rf ${storage} + # bake-mkpool -s 50M /dev/shm/mobject.dat + bake-mkpool -s 50M /tmp/mobject.dat + + run_to $maxtime bedrock na+sm -c $SCRIPT_DIR/config.json -v trace & + if [ $? -ne 0 ]; then + # TODO: this doesn't actually work; can't check return code of + # something executing in background. We have to rely on the + # return codes of the actual client side tests to tell if + # everything started properly + exit 1 + fi + + # wait for servers to start + sleep ${startwait} +}