<commit_before>#!/bin/bash

set -e
set -o nounset

IP="${1:?"Need the IP of a machine to install"}"
ENVIRONMENT="${2:?"Need the Chef environment to use"}"

echo "initial configuration of $IP"

if [[ -f ./proxy_setup.sh ]]; then
  . ./proxy_setup.sh
fi

load_binary_server_info $ENVIRONMENT
load_chef_server_ip

SCPCMD="./nodescp    $ENVIRONMENT $IP"
SSHCMD="./nodessh.sh $ENVIRONMENT $IP"

echo "copy files..."
for f in install-chef.sh finish-worker.sh finish-head.sh; do
  $SCPCMD $f ubuntu@$IP:/home/ubuntu || (echo "copying $f failed" > /dev/stderr; exit 1)
done

if [[ -n "$(source proxy_setup.sh >/dev/null; echo ${PROXY-})" ]]; then
  PROXY=$(source proxy_setup.sh >/dev/null; echo $PROXY)
  echo "setting up .wgetrc's to $PROXY"
  $SSHCMD "echo \"http_proxy = http://$PROXY\" > .wgetrc"
fi

# remove deb-src lines (we do not mirror them and should not need them)
$SSHCMD "sed -i 's/^deb-src/\#deb-src/g' /etc/apt/sources.list" sudo

echo "setup chef"
$SSHCMD "/home/ubuntu/install-chef.sh $binary_server_host $binary_server_url $chef_server_ip `hostname`" sudo

echo "temporarily adjust system time to avoid time skew related failures"
GOODDATE=`date`
$SSHCMD "date -s '$GOODDATE'" sudo

echo "done."
<commit_msg>Do not sync time between bootstrap and cluster nodes<commit_after>#!/bin/bash

set -e
set -o nounset

IP="${1:?"Need the IP of a machine to install"}"
ENVIRONMENT="${2:?"Need the Chef environment to use"}"

echo "initial configuration of $IP"

if [[ -f ./proxy_setup.sh ]]; then
  . ./proxy_setup.sh
fi

load_binary_server_info $ENVIRONMENT
load_chef_server_ip

SCPCMD="./nodescp    $ENVIRONMENT $IP"
SSHCMD="./nodessh.sh $ENVIRONMENT $IP"

echo "copy files..."
for f in install-chef.sh finish-worker.sh finish-head.sh; do
  $SCPCMD $f ubuntu@$IP:/home/ubuntu || (echo "copying $f failed" > /dev/stderr; exit 1)
done

if [[ -n "$(source proxy_setup.sh >/dev/null; echo ${PROXY-})" ]]; then
  PROXY=$(source proxy_setup.sh >/dev/null; echo $PROXY)
  echo "setting up .wgetrc's to $PROXY"
  $SSHCMD "echo \"http_proxy = http://$PROXY\" > .wgetrc"
fi

# remove deb-src lines (we do not mirror them and should not need them)
$SSHCMD "sed -i 's/^deb-src/\#deb-src/g' /etc/apt/sources.list" sudo

echo "setup chef"
$SSHCMD "/home/ubuntu/install-chef.sh $binary_server_host $binary_server_url $chef_server_ip `hostname`" sudo

echo "done."
{'fraction_non_alphanumeric': 0.15816326530612246, 'fraction_numerical': 0.002551020408163265, 'mean_word_length': 4.194260485651214, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '4567299', 'n_tokens_mistral': 931, 'n_tokens_neox': 902, 'n_words': 259}