<commit_before>#!/bin/bash

IMAGE_NAME="bdastur/prometheus:2.21.0"
CONTAINER_NAME="prometheus"
VOLUME_NAME="prometheus_data"
volume=$(docker volume list | grep ${VOLUME_NAME})
echo "Volume present: $volume"                                                  

# If volume does not exists yet. Create it
if [[ -z $volume ]]; then
    echo "Volume does not exist. Creating"
    docker volume create ${VOLUME_NAME}
fi

# Check if prometheus container is already present.
container_exited=$(docker ps -a | grep ${CONTAINER_NAME} | grep Exited)
echo "Container: $container_exited"
if [[ ! -z $container_exited ]]; then
    echo "Container exited.. yes"
    docker rm -f ${CONTAINER_NAME}
fi


docker run -p 9090:9090 \
    --volume ${VOLUME_NAME}:/data \
    --name prometheus \
    ${IMAGE_NAME} \
    /usr/local/bin/prometheus \
    --config.file /etc/prometheus/prometheus.yml \
    --storage.tsdb.path /prometheus_data/ \
    --web.console.libraries /etc/prometheus/console_libraries/ \
    --web.console.templates /etc/prometheus/consoles

<commit_msg>Minor fix to prometheus run script<commit_after>#!/bin/bash

IMAGE_NAME="bdastur/prometheus:2.21.0"
CONTAINER_NAME="prometheus"
VOLUME_NAME="prometheus_data"
volume=$(docker volume list | grep ${VOLUME_NAME})
echo "Volume present: $volume"                                                  

# If volume does not exists yet. Create it
if [[ -z $volume ]]; then
    echo "Volume does not exist. Creating"
    docker volume create ${VOLUME_NAME}
fi

# Check if prometheus container is already present.
container_exited=$(docker ps -a | grep ${CONTAINER_NAME} | grep Exited)
echo "Container: $container_exited"
if [[ ! -z $container_exited ]]; then
    echo "Container exited. Cleanup"
    docker rm -f ${CONTAINER_NAME}
fi


docker run -p 9090:9090 \
    --volume ${VOLUME_NAME}:/data \
    --name prometheus \
    ${IMAGE_NAME} \
    /usr/local/bin/prometheus \
    --config.file /etc/prometheus/prometheus.yml \
    --storage.tsdb.path /prometheus_data/ \
    --web.console.libraries /etc/prometheus/console_libraries/ \
    --web.console.templates /etc/prometheus/consoles &


{'fraction_non_alphanumeric': 0.1251175917215428, 'fraction_numerical': 0.011288805268109126, 'mean_word_length': 2.953531598513011, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2107051', 'n_tokens_mistral': 751, 'n_tokens_neox': 678, 'n_words': 173}