<commit_before>#!/bin/bash

echo "Getting rid of old logs and data files"
rm -r ~/tmp/*

echo "Starting NSQ"
cd ~/go/src/github.com/APTrust/bagman/nsq
go run service.go -config ~/go/src/github.com/APTrust/bagman/nsq/nsqd.apd4n.config &>/dev/null &
NSQ_PID=$!
sleep 3

# Wait for this one to finish
echo "Starting bucket reader"
cd ~/go/src/github.com/APTrust/bagman/bucket_reader
go run bucket_reader.go -config apd4n

echo "Starting bag_processor"
cd ~/go/src/github.com/APTrust/bagman/bag_processor
go run bag_processor.go -config apd4n &
PROCESSOR_PID=$!

echo "Starting metarecord"
cd ~/go/src/github.com/APTrust/bagman/metarecord
go run metarecord.go -config apd4n &
METARECORD_PID=$!

echo "Starting trouble processor"
cd ~/go/src/github.com/APTrust/bagman/trouble
go run trouble.go -config apd4n &
TROUBLE_PID=$!

# This one exits on its own
echo "Starting cleanup reader"<commit_msg>Don't start metarecord until queue topic exists<commit_after>#!/bin/bash

echo "Getting rid of old logs and data files"
rm -r ~/tmp/*

echo "Starting NSQ"
cd ~/go/src/github.com/APTrust/bagman/nsq
go run service.go -config ~/go/src/github.com/APTrust/bagman/nsq/nsqd.apd4n.config &>/dev/null &
NSQ_PID=$!
sleep 3

# Wait for this one to finish
echo "Starting bucket reader"
cd ~/go/src/github.com/APTrust/bagman/bucket_reader
go run bucket_reader.go -config apd4n

echo "Starting bag_processor"
cd ~/go/src/github.com/APTrust/bagman/bag_processor
go run bag_processor.go -config apd4n &
PROCESSOR_PID=$!

echo "Waiting 20 seconds to start metarecord"
sleep 20

echo "Starting metarecord"
cd ~/go/src/github.com/APTrust/bagman/metarecord
go run metarecord.go -config apd4n &
METARECORD_PID=$!

echo "Starting trouble processor"
cd ~/go/src/github.com/APTrust/bagman/trouble
go run trouble.go -config apd4n &
TROUBLE_PID=$!

# This one exits on its own
echo "Starting cleanup reader"
{'fraction_non_alphanumeric': 0.11805555555555555, 'fraction_numerical': 0.008547008547008548, 'mean_word_length': 4.492668621700879, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '3916225', 'n_tokens_mistral': 750, 'n_tokens_neox': 700, 'n_words': 190}