<commit_before>#!/bin/bash
set -e

sed -r "s/@CLUSTER@/${CLUSTER:-ceph}/g" \
    /etc/confd/conf.d/ceph.conf.toml.in > /etc/confd/conf.d/ceph.conf.toml

function get_mon_config {
  # Make sure root dirs are present for confd to work
  for dir in auth global mon mds osd client; do
    etcdctl $ETCDCTL_OPT ${KV_TLS} mkdir ${CLUSTER_PATH}/$dir > /dev/null 2>&1  || log "'$dir' key already exists"
  done

  log "Adding Mon Host - ${MON_NAME}."
  etcdctl $ETCDCTL_OPT ${KV_TLS} set ${CLUSTER_PATH}/mon_host/${MON_NAME} ${MON_IP}

  # Acquire lock to not run into race conditions with parallel bootstraps
  until etcdctl $ETCDCTL_OPT ${KV_TLS} mk ${CLUSTER_PATH}/lock $MON_NAME; do
    log "Configuration is locked by another host. Waiting..."
    sleep 1
  done

  # Update config after initial mon creation
  if etcdctl $ETCDCTL_OPT ${KV_TLS} get ${CLUSTER_PATH}/monSetupComplete; then
    log "Configuration found for cluster ${CLUSTER}. Writing to disk."

    get_config

    log "Adding mon/admin Keyrings."
    etcdctl $ETCDCTL_OPT ${KV_TLS} get ${CLUSTER_PATH}/adminKeyring > $ADMIN_KEYRING
    etcdctl $ETCDCTL_OPT ${KV_TLS} get ${CLUSTER_PATH}/monKeyring > $MON_KEYRING

    if [ ! -f $MONMAP ]; then
      log "Monmap is missing. Adding initial monmap..."
      etcdctl $ETCDCTL_OPT ${KV_TLS} get ${CLUSTER_PATH}/monmap | uudecode -o $MONMAP
    fi
<commit_msg>config.kv.etcd: Increasing timeout<commit_after>#!/bin/bash
set -e

sed -r "s/@CLUSTER@/${CLUSTER:-ceph}/g" \
    /etc/confd/conf.d/ceph.conf.toml.in > /etc/confd/conf.d/ceph.conf.toml

function get_mon_config {
  # Make sure root dirs are present for confd to work
  for dir in auth global mon mds osd client; do
    etcdctl $ETCDCTL_OPT ${KV_TLS} mkdir ${CLUSTER_PATH}/$dir > /dev/null 2>&1  || log "'$dir' key already exists"
  done

  log "Adding Mon Host - ${MON_NAME}."
  etcdctl $ETCDCTL_OPT ${KV_TLS} set ${CLUSTER_PATH}/mon_host/${MON_NAME} ${MON_IP}

  # Acquire lock to not run into race conditions with parallel bootstraps
  until etcdctl $ETCDCTL_OPT ${KV_TLS} mk ${CLUSTER_PATH}/lock $MON_NAME --ttl 60; do
    log "Configuration is locked by another host. Waiting..."
    sleep 1
  done

  # Update config after initial mon creation
  if etcdctl $ETCDCTL_OPT ${KV_TLS} get ${CLUSTER_PATH}/monSetupComplete; then
    log "Configuration found for cluster ${CLUSTER}. Writing to disk."

    get_config

    log "Adding mon/admin Keyrings."
    etcdctl $ETCDCTL_OPT ${KV_TLS} get ${CLUSTER_PATH}/adminKeyring > $ADMIN_KEYRING
    etcdctl $ETCDCTL_OPT ${KV_TLS} get ${CLUSTER_PATH}/monKeyring > $MON_KEYRING

    if [ ! -f $MONMAP ]; then
      log "Monmap is missing. Adding initial monmap..."
      etcdctl $ETCDCTL_OPT ${KV_TLS} get ${CLUSTER_PATH}/monmap | uudecode -o $MONMAP
    fi

{'fraction_non_alphanumeric': 0.12111352133044107, 'fraction_numerical': 0.0028922631959508315, 'mean_word_length': 3.650420168067227, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '3399528', 'n_tokens_mistral': 1046, 'n_tokens_neox': 1020, 'n_words': 290}