<commit_before>#!/bin/bash

# Input: uuid runner
# Available runners: ruby python python3 nodejs

exec 2> /dev/null

ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
STORE="${ROOT}/store"
MACHINE="${STORE}/${1}"
CODE="${STORE}/code/${1}"

mkdir ${MACHINE} && cp ${STORE}/default/* ${MACHINE}
cp ${CODE} ${MACHINE}/code
chmod 777 -R ${MACHINE}

MACHINE_ID=$(docker run -d --memory=40m --cpus=0.25 -it -v ${MACHINE}:/code compiler_machine /code/run.sh ${2} code)

if [ $(timeout 5s docker wait ${MACHINE_ID}) ]; then
    cat ${MACHINE}/time
else
    echo "-1"
fi

echo "*****"
cat ${MACHINE}/log
echo "*****"
cat ${MACHINE}/errors

exec 1> /dev/null
docker rm -f ${MACHINE_ID}
rm -rf ${MACHINE} ${CODE}<commit_msg>Disable interactive mode on docker containers<commit_after>#!/bin/bash

# Input: uuid runner
# Available runners: ruby python python3 nodejs

exec 2> /dev/null

ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
STORE="${ROOT}/store"
MACHINE="${STORE}/${1}"
CODE="${STORE}/code/${1}"

mkdir ${MACHINE} && cp ${STORE}/default/* ${MACHINE}
cp ${CODE} ${MACHINE}/code
chmod 777 -R ${MACHINE}

MACHINE_ID=$(docker run -d --memory=40m --cpus=0.25 -v ${MACHINE}:/code compiler_machine /code/run.sh ${2} code)

if [ $(timeout 5s docker wait ${MACHINE_ID}) ]; then
    cat ${MACHINE}/time
else
    echo "-1"
fi

echo "*****"
cat ${MACHINE}/log
echo "*****"
cat ${MACHINE}/errors

exec 1> /dev/null
docker rm -f ${MACHINE_ID}
rm -rf ${MACHINE} ${CODE}
{'fraction_non_alphanumeric': 0.2259158751696065, 'fraction_numerical': 0.023066485753052916, 'mean_word_length': 4.344202898550725, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '5060313', 'n_tokens_mistral': 611, 'n_tokens_neox': 572, 'n_words': 153}