<commit_before>#!/usr/bin/env bash

set -eux

CRONDIR=$(pwd)/crondir
mkdir -p $CRONDIR
source aws.sh

echo "Running stackage-server-cron..."
echo "('tail -f $CRONDIR/stackage-server-cron.log' to watch)"
docker run --rm \
    -v $CRONDIR:/home/ubuntu \
    -w /home/ubuntu \
    fpco/stackage-server-prod:latest \
    bash -c "useradd $(whoami) -u $(id -u); sudo -u $(whoami) env HOME=/home/ubuntu AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY bash -c '/usr/local/bin/stackage-server-cron 2>&1 | tee -a /home/ubuntu/stackage-server-cron.log'"<commit_msg>cron.sh: pull the image<commit_after>#!/usr/bin/env bash

set -eux

CRONDIR=$(pwd)/crondir
mkdir -p $CRONDIR
source aws.sh

IMAGE=fpco/stackage-server-prod:latest
docker pull $IMAGE

echo "Running stackage-server-cron..."
echo "('tail -f $CRONDIR/stackage-server-cron.log' to watch)"
docker run --rm \
    -v $CRONDIR:/home/ubuntu \
    -w /home/ubuntu \
    $IMAGE \
    bash -c "useradd $(whoami) -u $(id -u); sudo -u $(whoami) env HOME=/home/ubuntu AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY bash -c '/usr/local/bin/stackage-server-cron 2>&1 | tee -a /home/ubuntu/stackage-server-cron.log'"
{'fraction_non_alphanumeric': 0.16134316134316135, 'fraction_numerical': 0.003276003276003276, 'mean_word_length': 3.7734375, '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': '4762761', 'n_tokens_mistral': 528, 'n_tokens_neox': 488, 'n_words': 102}