<commit_before>#!/bin/bash

# Install GTM on top of the Hybrid Multi-region topology at GCP

# This scripts assumes previously successfully installed dual region Hybrid

# example usage:
#  time ./install-gtm.sh |& tee mc-install-`date -u +"%Y-%m-%dT%H:%M:%SZ"`.log
#
BASEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

set -e

check_envvars "AHR_HOME PROJECT HYBRID_HOME CLUSTER"
check_commands "gcloud kubectl jq yq"

# gcp
gcloud config set project $PROJECT

#
# Project-level Setup
#

# Source Configuration and make the $R1_CLUSTER active for Region 1

source $HYBRID_HOME/source.env

source $HYBRID_HOME/mr-r1-gke-cluster.env
kubectl config  use-context $CLUSTER

# Extract cluster node tags

export R1_CLUSTER_TAG=$(gcloud compute instances describe "$(kubectl --context $R1_CLUSTER get nodes -o jsonpath='{.items[0].metadata.name}')" --zone $R1_CLUSTER_ZONE  --format="value(tags.items[0])")

export R2_CLUSTER_TAG=$(gcloud compute instances describe "$(kubectl --context $R2_CLUSTER get nodes -o jsonpath='{.items[0].metadata.name}')" --zone $R2_CLUSTER_ZONE  --format="value(tags.items[0])")

export CLUSTER_NETWORK_TAGS=$R1_CLUSTER_TAG,$R2_CLUSTER_TAG

set +e

#  firewall for Google Health probers
gcloud compute firewall-rules create fw-allow-health-check-and-proxy-hybrid \
  --network=$NETWORK \<commit_msg>mr-gtm: fixed sourcing of ahr-lib.sh<commit_after>#!/bin/bash

# Install GTM on top of the Hybrid Multi-region topology at GCP

# This scripts assumes previously successfully installed dual region Hybrid

# example usage:
#  time ./install-gtm.sh |& tee mc-install-`date -u +"%Y-%m-%dT%H:%M:%SZ"`.log
#
BASEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

set -e

source $AHR_HOME/bin/ahr-lib.sh

check_envvars "AHR_HOME PROJECT HYBRID_HOME CLUSTER"
check_commands "gcloud kubectl jq yq"

# gcp
gcloud config set project $PROJECT

#
# Project-level Setup
#

# Source Configuration and make the $R1_CLUSTER active for Region 1

source $HYBRID_HOME/source.env

source $HYBRID_HOME/mr-r1-gke-cluster.env
kubectl config  use-context $CLUSTER

# Extract cluster node tags

export R1_CLUSTER_TAG=$(gcloud compute instances describe "$(kubectl --context $R1_CLUSTER get nodes -o jsonpath='{.items[0].metadata.name}')" --zone $R1_CLUSTER_ZONE  --format="value(tags.items[0])")

export R2_CLUSTER_TAG=$(gcloud compute instances describe "$(kubectl --context $R2_CLUSTER get nodes -o jsonpath='{.items[0].metadata.name}')" --zone $R2_CLUSTER_ZONE  --format="value(tags.items[0])")

export CLUSTER_NETWORK_TAGS=$R1_CLUSTER_TAG,$R2_CLUSTER_TAG

set +e

#  firewall for Google Health probers
gcloud compute firewall-rules create fw-allow-health-check-and-proxy-hybrid \
  --network=$NETWORK \
{'fraction_non_alphanumeric': 0.13208241353936717, 'fraction_numerical': 0.01177336276674025, 'mean_word_length': 5.028824833702883, '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': '7200111', 'n_tokens_mistral': 1031, 'n_tokens_neox': 993, 'n_words': 248}