<commit_before>#!/bin/bash
SCRIPTDIR=`dirname $0`

oc cluster down #for the case that cluster is already running

oc get status
if [ ! $? -ne 0 ]; then
    echo "ERROR: shutting down of openshift cluster failed, tests won't be executed"
    exit 1
fi

sudo rm -rf /var/lib/origin/openshift.local.pv
sudo rm -rf /var/log/containers/*
sudo rm -rf /var/log/pods/*

oc cluster up $OC_CLUSTER_ARGS
oc login -u system:admin

TIMEOUT=300
NOW=$(date +%s)
END=$(($NOW + $TIMEOUT))
echo "Now: $(date -d@${NOW} -u +%F:%H:%M:%S)"
echo "Waiting ${TIMEOUT} seconds until: $(date -d@${END} -u +%F:%H:%M:%S)"

oc cluster status
while [ $? -gt 0 ]
do
    NOW=$(date +%s)
    if [ ${NOW} -gt ${END} ]; then
        echo "ERROR: Timed out waiting for openshift cluster to come up!"
        exit 1
    fi
    sleep 5
    oc cluster status<commit_msg>FIX setup-openshift - restart openshift cluster if didn't start properly<commit_after>#!/bin/bash
SCRIPTDIR=`dirname $0`

oc cluster down #for the case that cluster is already running

oc get status
if [ ! $? -ne 0 ]; then
    echo "ERROR: shutting down of openshift cluster failed, tests won't be executed"
    exit 1
fi

sudo rm -rf /var/lib/origin/openshift.local.pv
sudo rm -rf /var/log/containers/*
sudo rm -rf /var/log/pods/*

oc cluster up $OC_CLUSTER_ARGS
if [ ! $? -ne 0 ]; then
    echo "WARN: openshift cluster didn't start properly, trying to restart..."
    oc cluster down
    oc cluster up ${OC_CLUSTER_ARGS}
fi
oc login -u system:admin

TIMEOUT=300
NOW=$(date +%s)
END=$(($NOW + $TIMEOUT))
echo "Now: $(date -d@${NOW} -u +%F:%H:%M:%S)"
echo "Waiting ${TIMEOUT} seconds until: $(date -d@${END} -u +%F:%H:%M:%S)"

oc cluster status
while [ $? -gt 0 ]
do
    NOW=$(date +%s)
    if [ ${NOW} -gt ${END} ]; then
        echo "ERROR: Timed out waiting for openshift cluster to come up!"
        exit 1
    fi
    sleep 5
    oc cluster status
{'fraction_non_alphanumeric': 0.14930924548352817, 'fraction_numerical': 0.010095642933049946, 'mean_word_length': 3.240990990990991, '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': '4317920', 'n_tokens_mistral': 709, 'n_tokens_neox': 664, 'n_words': 247}