<commit_before>#!/bin/bash

source consts.sh
set -x -e

redis-cli FLUSHALL

dd of=disk.raw seek=$((1024*1024*1024*5)) count=0 bs=1
parted -s disk.raw mklabel msdos
parted -s disk.raw mkpart primary ext4 1 $((1024*5))
PART=$(sudo kpartx -av disk.raw | sed -e 's/add map \(\S*\) .*/\1/g' )
sudo mkfs.ext4 /dev/mapper/$PART
sudo mkdir -p /tmp/mps
sudo mount /dev/mapper/$PART /tmp/mps
read
sudo su -c 'echo filecontents > /tmp/mps/testfile'
sudo umount /tmp/mps
sudo rm -rf /tmp/mps
sudo kpartx -dv disk.raw

pathadd() {
  [ -d "$1" ] && [[ ":$PATH:" != *":$1:"* ]] && PATH="${PATH:+"$PATH:"}$1"
}
pathadd $HOME/repos/gammaray-android/bin
pathadd $HOME/repos/gammaray-android/bin/test

pkill gray || true

gray-crawler disk.raw disk.bson &> crawler.log
gray-inferencer disk.bson $REDIS_DB disk_test_instance &> inferencer.log &

sudo mkdir -p /tmp/gray-fs
gray-fs /tmp/gray-fs -d -s disk.raw & &> gray-fs.log

nbd-queuer-test test_ba disk.raw $REDIS_SERVER $REDIS_PORT $REDIS_DB \
                5368709120 $NBD_SERVER $NBD_PORT y &> queuer-test.log &

sudo nbd-client localhost 30000 /dev/nbd0<commit_msg>Pass on demo script.<commit_after>#!/bin/bash

source consts.sh
set -x -e

redis-cli FLUSHALL

dd of=disk.raw seek=$((1024*1024*1024*5)) count=0 bs=1
parted -s disk.raw mklabel msdos
parted -s disk.raw mkpart primary ext4 1 $((1024*5))
PART=$(sudo kpartx -av disk.raw | sed -e 's/add map \(\S*\) .*/\1/g' )
sudo mkfs.ext4 -F /dev/mapper/$PART
sudo mkdir -p /tmp/mps
sudo mount /dev/mapper/$PART /tmp/mps
read
sudo su -c 'echo filecontents > /tmp/mps/testfile'
sudo umount /tmp/mps
sudo rm -rf /tmp/mps
sudo kpartx -dv disk.raw

pathadd() {
  [ -d "$1" ] && [[ ":$PATH:" != *":$1:"* ]] && PATH="${PATH:+"$PATH:"}$1"
}
pathadd $HOME/repos/gammaray-android/bin
pathadd $HOME/repos/gammaray-android/bin/test

sudo pkill gray nbd-queuer-test || true

gray-crawler disk.raw disk.bson &> crawler.log
gray-inferencer disk.bson $REDIS_DB disk_test_instance &> inferencer.log &
sleep 1

nbd-queuer-test test_ba disk.raw $REDIS_SERVER $REDIS_PORT $REDIS_DB \
                5368709120 $NBD_SERVER $NBD_PORT y &> queuer-test.log &

#mkdir -p /tmp/gray-fs
#gray-fs /tmp/gray-fs -d -s disk.raw & &> gray-fs.log

sleep 1
sudo nbd-client localhost 30000 /dev/nbd0 &> nbd-client-1.log &
sleep 2
read
{'fraction_non_alphanumeric': 0.16965456930476608, 'fraction_numerical': 0.03935286401399213, 'mean_word_length': 3.477495107632094, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6094676', 'n_tokens_mistral': 1040, 'n_tokens_neox': 953, 'n_words': 238}