<commit_before>#!/bin/bash

set -o pipefail
set -e

script_dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)
. $script_dir/common.sh

echo -e "${cyan}Building base proxy image, if necessary...${NC}"
image_exists=$(docker images | grep "proxy-base-image") || true
if [ -z "$image_exists" ]; then
    echo -e "${blue}Building image${no_color}"
    docker build -t="proxy-base-image" --force-rm $proxy_base_dir
else
    echo -e "${blue}Base image already exists${no_color}"
fi<commit_msg>Use SHA-1 digest of base proxy image Dockerfile<commit_after>#!/bin/bash

set -o pipefail
set -e

script_dir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)
. $script_dir/common.sh

# use sha-1 digest of base image Dockerfle as its Docker image tag, so we build a new base image whenever it changes
dockerfile_sha1=$(cat $proxy_base_dir/Dockerfile | openssl sha1)
echo -e "${cyan}Required Dockerfile SHA1:${no_color} $dockerfile_sha1"

echo -e "${cyan}Building base proxy image, if necessary...${no_color}"
image_exists=$(docker images | grep "proxy-base-image\s*$dockerfile_sha1") || true

if [ -z "$image_exists" ]; then
    echo -e "${blue}Building image${no_color}"
    docker build -t="proxy-base-image:$dockerfile_sha1" --force-rm $proxy_base_dir
else
    echo -e "${blue}Base image already exists${no_color}"
fi
{'fraction_non_alphanumeric': 0.15837796480489671, 'fraction_numerical': 0.0076511094108645756, 'mean_word_length': 4.711790393013101, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5304361', 'n_tokens_mistral': 470, 'n_tokens_neox': 441, 'n_words': 130}