Skip to content

Commit

Permalink
added CI for testing DYAD
Browse files Browse the repository at this point in the history
  • Loading branch information
hariharan-devarajan committed Sep 20, 2023
1 parent c021c67 commit bd293f3
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 35 deletions.
60 changes: 25 additions & 35 deletions .github/workflows/compile_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,16 @@ jobs:
DYAD_INSTALL_PREFIX: "/home/runner/work/dyad/install"
DYAD_KVS_NAMESPACE: "test"
DYAD_DTL_MODE: "FLUX_RPC"
DYAD_TEST_DIR: "/home/runner/work/dyad/dyad/docs/demos/ecp_feb_2023"
DYAD_PATH: "/home/runner/work/dyad/temp"
steps:
- uses: actions/checkout@v3
- name: Cache install modules
id: cache-modules
uses: actions/cache@v2
- name: Push checkout
if: github.event_name == 'push'
uses: actions/checkout@v3
- name: PR checkout
if: github.event_name == 'pull_request'
uses: actions/checkout@v3
with:
path: ${{ env.SPACK_DIR }}
key: ${{env.SPACK_DIR }}-${{matrix.flux}}
ref: ${{ github.event.pull_request.head.sha }}
- name: Install system deps
run: |
sudo apt-get install -y --no-install-recommends \
Expand All @@ -51,7 +52,6 @@ jobs:
sqlite
sudo pip install jsonschema cffi ply pyyaml
- name: Install Spack
if: steps.cache-modules.outputs.cache-hit != 'true'
run: |
git clone https://github.com/spack/spack.git ${SPACK_DIR}
- name: Load existing dependencies
Expand Down Expand Up @@ -178,50 +178,40 @@ jobs:
spack external find
spack spec flux-core@${FLUX_VERSION} [email protected]
- name: Install dependencies
if: steps.cache-modules.outputs.cache-hit != 'true'
run: |
. ${SPACK_DIR}/share/spack/setup-env.sh
spack install flux-core@${FLUX_VERSION}
spack install [email protected]
spack install -j4 flux-core@${FLUX_VERSION} [email protected]
mkdir -p ${DYAD_INSTALL_PREFIX}
spack view --verbose symlink ${DYAD_INSTALL_PREFIX} flux-core@${FLUX_VERSION} [email protected]
- name: Compile DYAD
run: |
echo "Activating spack"
. ${SPACK_DIR}/share/spack/setup-env.sh
echo "Load spack modules"
spack load flux-core@${FLUX_VERSION}
spack load [email protected]
echo "Set INSTALL DIRS"
FLUX_CORE_INSTALL=`spack location -i flux-core@${FLUX_VERSION}`
UCX_INSTALL=`spack location -i [email protected]`
echo "Install DYAD"
cd /home/runner/work/dyad/dyad
cd ${GITHUB_WORKSPACE}
ls
pwd
./autogen.sh
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${DYAD_INSTALL_PREFIX}/lib/pkgconfig
./configure --enable-dyad-debug --prefix=${DYAD_INSTALL_PREFIX} \
CFLAGS="-I${FLUX_CORE_INSTALL}/include -I${UCX_INSTALL}/include" \
CXXFLAGS="-I${FLUX_CORE_INSTALL}/include -I${UCX_INSTALL}/include" \
LDFLAGS="-L${FLUX_CORE_INSTALL}/lib -L${UCX_INSTALL}/lib"
CFLAGS="-I${DYAD_INSTALL_PREFIX}/include" \
CXXFLAGS="-I${DYAD_INSTALL_PREFIX}/include" \
LDFLAGS="-L${DYAD_INSTALL_PREFIX}/lib"
make install -j
- name: Install Test
run: |
. ${SPACK_DIR}/share/spack/setup-env.sh
spack load flux-core@${FLUX_VERSION}
spack load [email protected]
cd ${DYAD_TEST_DIR}
export CFLAGS="-I${DYAD_INSTALL_PREFIX}/include"
export CXXFLAGS="-I${DYAD_INSTALL_PREFIX}/include"
export LDFLAGS="-L${DYAD_INSTALL_PREFIX}/lib"
cd ${GITHUB_WORKSPACE}/docs/demos/ecp_feb_2023
make all
- name: Test DYAD
run: |
DYAD_PATH=/home/runner/work/dyad/temp
mkdir $DYAD_PATH
. ${SPACK_DIR}/share/spack/setup-env.sh
spack load flux-core@${FLUX_VERSION}
spack load [email protected]
export PATH=${PATH}:${DYAD_INSTALL_PREFIX}/bin:${DYAD_INSTALL_PREFIX}/sbin
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${DYAD_INSTALL_PREFIX}/lib
flux start --test-size=2
flux kvs namespace create ${DYAD_KVS_NAMESPACE}
flux exec -r all flux module load ${DYAD_INSTALL_PREFIX}/lib/dyad.so $DYAD_PATH $DYAD_DTL_MODE
export DYAD_PATH_CONSUMER=$DYAD_PATH
export DYAD_PATH_PRODUCER=$DYAD_PATH
cons_id=`flux submit -N 1 --env=DYAD_KVS_NAMESPACE=${DYAD_DTL_MODE} --env=DYAD_DTL_MODE=${DYAD_KVS_NAMESPACE} --env=DYAD_PATH_CONSUMER=$DYAD_PATH ${DYAD_TEST_DIR}/cpp_cons 10 $DYAD_PATH`
prod_id=`flux submit -N 1 --env=DYAD_KVS_NAMESPACE=${DYAD_DTL_MODE} --env=DYAD_DTL_MODE=${DYAD_KVS_NAMESPACE} --env=DYAD_PATH_PRODUCER=$DYAD_PATH ${DYAD_TEST_DIR}/cpp_prod 10 $DYAD_PATH`
flux job attach ${cons_id}
echo "Starting flux brokers"
flux start --test-size=2 /bin/bash ${GITHUB_WORKSPACE}/.github/workflows/dyad_pc_test.sh
30 changes: 30 additions & 0 deletions .github/workflows/dyad_pc_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash
echo "Creating namespace for DYAD"
flux kvs namespace create ${DYAD_KVS_NAMESPACE}
echo "Loading DYAD module"
flux exec -r all flux module load ${DYAD_INSTALL_PREFIX}/lib/dyad.so $DYAD_PATH $DYAD_DTL_MODE

export DYAD_PATH_CONSUMER=$DYAD_PATH
export DYAD_PATH_PRODUCER=$DYAD_PATH

flux resource list

#echo "Running Consumer job"
#${GITHUB_WORKSPACE}/docs/demos/ecp_feb_2023/cpp_cons 10 $DYAD_PATH > cons.log &
#CONS_PID=$!
## Will block terminal until done
#echo "Running Producer job"
#${GITHUB_WORKSPACE}/docs/demos/ecp_feb_2023/cpp_prod 10 $DYAD_PATH
#wait $CONS_PID
#cat cons.log

echo "Running Consumer job"
flux submit --cores 1 --env=DYAD_KVS_NAMESPACE=${DYAD_DTL_MODE} --env=DYAD_DTL_MODE=${DYAD_KVS_NAMESPACE} --env=DYAD_PATH_CONSUMER=$DYAD_PATH ${GITHUB_WORKSPACE}/docs/demos/ecp_feb_2023/cpp_cons 10 $DYAD_PATH
CONS_PID=$(flux job last)
# Will block terminal until done
echo "Running Producer job"
flux submit --cores 1 --env=DYAD_KVS_NAMESPACE=${DYAD_DTL_MODE} --env=DYAD_DTL_MODE=${DYAD_KVS_NAMESPACE} --env=DYAD_PATH_PRODUCER=$DYAD_PATH ${GITHUB_WORKSPACE}/docs/demos/ecp_feb_2023/cpp_prod 10 $DYAD_PATH
PROD_PID=$(flux job last)
flux jobs -a
flux job attach $PROD_PID
flux job attach $CONS_PID

0 comments on commit bd293f3

Please sign in to comment.