Skip to content

Commit

Permalink
ci(spack): test the right development code (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
hyoklee authored and jhendersonHDF committed Aug 24, 2023
1 parent fef480d commit 9c2d3ae
Show file tree
Hide file tree
Showing 9 changed files with 350 additions and 5 deletions.
87 changes: 87 additions & 0 deletions .github/workflows/ior.yml
Original file line number Diff line number Diff line change
@@ -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
85 changes: 85 additions & 0 deletions .github/workflows/ior2.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion .github/workflows/spack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion .github/workflows/spack_bedrock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
34 changes: 34 additions & 0 deletions ci.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/sh
#
# Test Mobject using GitHub Action.
#
# This script assumes that Spack installed dependencies under $PWD/install.
#
# Author: Hyokyung Lee ([email protected])
# 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
6 changes: 6 additions & 0 deletions prepare_gh.sh
Original file line number Diff line number Diff line change
@@ -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

89 changes: 89 additions & 0 deletions tests/config_gh.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
]
}
42 changes: 42 additions & 0 deletions tests/mobject-test-util-gh.sh
Original file line number Diff line number Diff line change
@@ -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}
}

0 comments on commit 9c2d3ae

Please sign in to comment.