<commit_before>#!/bin/bash

set -Eeuo pipefail
DIR="$( cd "$( dirname "$( readlink -f "${BASH_SOURCE[0]}")" )" >/dev/null && pwd )/../.."
source "${DIR}/scripts/lib/config.sh"

if [ $# != 1 ]; then
    echo 'missing challenge name'
    exit 1
fi

CHALLENGE_NAME=$1

load_chal_dir

CHALLENGE_DIR=$(readlink -f "${CHAL_DIR}/${CHALLENGE_NAME}")

pushd "${CHALLENGE_DIR}"

source chal.conf

if [ ! "${DEPLOY}" = "true" ]; then
  echo "aborting: DEPLOY=${DEPLOY} in chal.conf"
  exit 1
fi

if [ "${PUBLIC}" = "true" ]; then
  make -C "${CHALLENGE_DIR}" expose
else
  make -C "${CHALLENGE_DIR}" deploy
  # if not marked as public, try to delete an existing load balancer
  delete_resource "service/${CHALLENGE_NAME}"
fi

if [ "${PUBLIC}" = "true" ]; then
  echo '== CHALLENGE IS PUBLIC =='
  if [ "${KCTF_DONT_WAIT_LB}" != "true" ]; then
    echo 'Waiting for load balancer to come up, Ctrl-C if you don'"'"'t care'
    LB_IP=$($DIR/scripts/challenge/ip.sh "${CHALLENGE_NAME}")
    echo "Running at ${LB_IP}"
  fi
fi<commit_msg>parallelize challenge deployment<commit_after>#!/bin/bash

set -Eeuo pipefail
DIR="$( cd "$( dirname "$( readlink -f "${BASH_SOURCE[0]}")" )" >/dev/null && pwd )/../.."
source "${DIR}/scripts/lib/config.sh"

if [ $# != 1 ]; then
    echo 'missing challenge name'
    exit 1
fi

CHALLENGE_NAME=$1

load_chal_dir

CHALLENGE_DIR=$(readlink -f "${CHAL_DIR}/${CHALLENGE_NAME}")

pushd "${CHALLENGE_DIR}"

source chal.conf

if [ ! "${DEPLOY}" = "true" ]; then
  echo "aborting: DEPLOY=${DEPLOY} in chal.conf"
  exit 1
fi

if [ "${PUBLIC}" = "true" ]; then
  make -C "${CHALLENGE_DIR}" -j expose
else
  make -C "${CHALLENGE_DIR}" -j deploy
  # if not marked as public, try to delete an existing load balancer
  delete_resource "service/${CHALLENGE_NAME}"
fi

if [ "${PUBLIC}" = "true" ]; then
  echo '== CHALLENGE IS PUBLIC =='
  if [ "${KCTF_DONT_WAIT_LB}" != "true" ]; then
    echo 'Waiting for load balancer to come up, Ctrl-C if you don'"'"'t care'
    LB_IP=$($DIR/scripts/challenge/ip.sh "${CHALLENGE_NAME}")
    echo "Running at ${LB_IP}"
  fi
fi
{'fraction_non_alphanumeric': 0.18559690671822135, 'fraction_numerical': 0.004833252779120348, 'mean_word_length': 3.940334128878282, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '6715562', 'n_tokens_mistral': 842, 'n_tokens_neox': 799, 'n_words': 215}