<commit_before>#!/bin/bash
set -eufo pipefail

function check {
    for var in "$@"; do
        if ! hash $var 2>/dev/null; then
            echo "$var not found, quitting"
            exit
        fi
    done
}

# Check if we have all the tools we need
check actool curl deb2aci git go tar

# Install confd
if ! [-x "confd"]; then
    curl -o confd https://github.com/kelseyhightower/confd/releases/download/v0.10.0/confd-0.10.0-linux-amd64
    chmod +x confd
fi

# Base image
deb2aci -pkg dash -pkg nginx -image kubernetes-proxy.aci \
    -manifest kubernetes-proxy.manifest.json
mkdir aci
tar -xf kubernetes-proxy.aci -C aci/
rm -rf kubernetes-proxy.aci

# Setup Confd
mkdir -p aci/rootfs/etc/confd/
mv confd aci/rootfs/usr/bin/confd
cp -a conf.d aci/rootfs/etc/confd/conf.d
cp -a templates aci/rootfs/etc/confd/templates

# Setup Nginx
rm -rf aci/rootfs/etc/nginx/conf.d/*
cp -a nginx/* aci/rootfs/etc/nginx/

# Setup Boot script
cp -a scripts/boot.sh aci/rootfs/usr/bin/boot.sh

# Pack ACI
actool build aci/ kubernetes-proxy.aci

# Clean up
rm -rf aci<commit_msg>Fixed buildscript<commit_after>#!/bin/bash
set -eufo pipefail

function check {
    for var in "$@"; do
        if ! hash $var 2>/dev/null; then
            echo "$var not found, quitting"
            exit
        fi
    done
}

# Check if we have all the tools we need
check actool curl deb2aci git go tar

# Install confd
if ! [-x "confd"]; then
    curl -o confd https://github.com/kelseyhightower/confd/releases/download/v0.10.0/confd-0.10.0-linux-amd64
    chmod +x confd
fi

# Base image
deb2aci -pkg dash -pkg nginx -image kubernetes-proxy.aci \
    -manifest kubernetes-proxy.manifest.json
mkdir aci
tar -xvf kubernetes-proxy.aci -C aci/
rm -rvf kubernetes-proxy.aci

# Setup Confd
mkdir -p aci/rootfs/etc/confd/
mv -v confd aci/rootfs/usr/bin/confd
cp -av conf.d aci/rootfs/etc/confd/conf.d
cp -av templates aci/rootfs/etc/confd/templates

# Setup Nginx
rm -rvf aci/rootfs/etc/nginx/conf.d/*
cp -av nginx/nginx.conf aci/rootfs/etc/nginx/nginx.conf

# Setup Boot script
cp -av scripts/boot.sh aci/rootfs/usr/bin/boot.sh

# Pack ACI
actool build aci/ kubernetes-proxy.aci

# Clean up
rm -rvf aci
echo "finished"
{'fraction_non_alphanumeric': 0.1161939615736505, 'fraction_numerical': 0.011893870082342177, 'mean_word_length': 2.7706896551724136, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3411541', 'n_tokens_mistral': 870, 'n_tokens_neox': 837, 'n_words': 237}