<commit_before>#!/bin/bash


set -e

# Set the ulimits for this container. Must be run with the --privileged option
#ulimit -l unlimited
#ulimit -s unlimited

# Get system specs
export CORES=$(grep -c '^processor' /proc/cpuinfo)
export HOSTNAME=$(hostname)
export USER=$(whoami)

# Fix some basic system and Grid Engine files
echo "domain ${HOSTNAME}" >> /etc/resolv.conf
echo "${HOSTNAME}" > ${SGE_ROOT}/default/common/act_qmaster

# Restart Grid Engine
service sgemaster restart
service sge_execd restart

# Replace all of the config files with the template files
cp $SGE_CONFIG_DIR/batch.conf.tmpl $SGE_CONFIG_DIR/batch.conf
cp $SGE_CONFIG_DIR/host.conf.tmpl $SGE_CONFIG_DIR/host.conf
cp $SGE_CONFIG_DIR/queue.conf.tmpl $SGE_CONFIG_DIR/queue.conf
cp $SGE_CONFIG_DIR/user.conf.tmpl $SGE_CONFIG_DIR/user.conf

# Path the config files with system details as needed
sed -i -r "s/localhost/${HOSTNAME}/" $SGE_CONFIG_DIR/host.conf
sed -i -r "s/localhost/${HOSTNAME}/" $SGE_CONFIG_DIR/queue.conf
sed -i -r "s/UNDEFINED/${CORES}/" $SGE_CONFIG_DIR/queue.conf
sed -i -r "s/template/${USER}/" $SGE_CONFIG_DIR/user.conf

# Clean all existing settings.
qconf -suserl | xargs -r -I {} qconf -du {} arusers<commit_msg>docker/entrypoint.sh: Set `$CORES` based on how many processors it finds unless it is already set.<commit_after>#!/bin/bash


set -e

# Set the ulimits for this container. Must be run with the --privileged option
#ulimit -l unlimited
#ulimit -s unlimited

# Get system specs
export CORES=$([[ -z "${CORES+x}" ]] && echo $(grep -c '^processor' /proc/cpuinfo) || echo "${CORES}")
export HOSTNAME=$(hostname)
export USER=$(whoami)

# Fix some basic system and Grid Engine files
echo "domain ${HOSTNAME}" >> /etc/resolv.conf
echo "${HOSTNAME}" > ${SGE_ROOT}/default/common/act_qmaster

# Restart Grid Engine
service sgemaster restart
service sge_execd restart

# Replace all of the config files with the template files
cp $SGE_CONFIG_DIR/batch.conf.tmpl $SGE_CONFIG_DIR/batch.conf
cp $SGE_CONFIG_DIR/host.conf.tmpl $SGE_CONFIG_DIR/host.conf
cp $SGE_CONFIG_DIR/queue.conf.tmpl $SGE_CONFIG_DIR/queue.conf
cp $SGE_CONFIG_DIR/user.conf.tmpl $SGE_CONFIG_DIR/user.conf

# Path the config files with system details as needed
sed -i -r "s/localhost/${HOSTNAME}/" $SGE_CONFIG_DIR/host.conf
sed -i -r "s/localhost/${HOSTNAME}/" $SGE_CONFIG_DIR/queue.conf
sed -i -r "s/UNDEFINED/${CORES}/" $SGE_CONFIG_DIR/queue.conf
sed -i -r "s/template/${USER}/" $SGE_CONFIG_DIR/user.conf

# Clean all existing settings.
qconf -suserl | xargs -r -I {} qconf -du {} arusers
{'fraction_non_alphanumeric': 0.13103177716751668, 'fraction_numerical': 0.0, 'mean_word_length': 4.666666666666667, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '7017055', 'n_tokens_mistral': 926, 'n_tokens_neox': 919, 'n_words': 261}