From d1ed5f8268b41efd44322212a6121381f8b420f6 Mon Sep 17 00:00:00 2001 From: ocket8888 Date: Thu, 2 Jan 2020 12:46:45 -0700 Subject: [PATCH 1/2] Fixed CiaB build issue --- infrastructure/cdn-in-a-box/traffic_ops/Dockerfile | 5 +++-- .../cdn-in-a-box/traffic_ops/trafficops-init.sh | 14 +++++++------- .../traffic_ops_data/profiles/000-GLOBAL.json | 4 ++-- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile b/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile index 5c4b756edf..fe0cf4d31b 100644 --- a/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile +++ b/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile @@ -70,11 +70,12 @@ RUN rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 && \ postgresql96-devel \ postgresql96-libs \ tar &&\ - yum -y clean all + yum -y clean all && mkdir -p /opt/traffic_ops/app/public -ADD https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz / +ADD traffic_router/core/src/test/resources/geo/GeoLite2-City.mmdb.gz /opt/traffic_ops/app/public/ WORKDIR /opt/traffic_ops/app + ADD traffic_ops/app/cpanfile traffic_ops/install/bin/install_goose.sh ./ RUN cpanm -l ./local Carton && \ POSTGRES_HOME=/usr/pgsql-9.6 PERL5LIB=$(pwd)/local/lib/perl5 ./local/bin/carton && \ diff --git a/infrastructure/cdn-in-a-box/traffic_ops/trafficops-init.sh b/infrastructure/cdn-in-a-box/traffic_ops/trafficops-init.sh index 711f3bac48..dbce2f3476 100755 --- a/infrastructure/cdn-in-a-box/traffic_ops/trafficops-init.sh +++ b/infrastructure/cdn-in-a-box/traffic_ops/trafficops-init.sh @@ -81,11 +81,11 @@ load_data_from() { for d in $endpoints; do [[ -d $d ]] || continue # Let containers know to write out server.json - if [[ "$d" = "deliveryservice_servers" ]] ; then + if [[ "$d" = "deliveryservice_servers" ]] ; then touch "$ENROLLER_DIR/initial-load-done" sync - fi - for f in "$d"/*.json; do + fi + for f in "$d"/*.json; do echo "Loading $f" delayfor "$f" envsubst "$vars" <$f > "$ENROLLER_DIR"/$f @@ -102,7 +102,7 @@ load_data_from() { load_data_from /traffic_ops_data # Copy the free MaxMind GeoLite DB to TrafficOps public directory -tar -C /var/tmp -zxpvf /GeoLite2-City.tar.gz -geo_dir=$(find /var/tmp -maxdepth 1 -type d -name GeoLite2-City\*) -gzip -c "$geo_dir/GeoLite2-City.mmdb" > "$TO_DIR/public/GeoLite2-City.mmdb.gz" -chown trafops:trafops "$TO_DIR/public/GeoLite2-City.mmdb.gz" +# tar -C /var/tmp -zxpvf /GeoLite2-City.tar.gz +# geo_dir=$(find /var/tmp -maxdepth 1 -type d -name GeoLite2-City\*) +# gzip -c "$geo_dir/GeoLite2-City.mmdb" > "$TO_DIR/public/GeoLite2-City.mmdb.gz" +# chown trafops:trafops "$TO_DIR/public/GeoLite2-City.mmdb.gz" diff --git a/infrastructure/cdn-in-a-box/traffic_ops_data/profiles/000-GLOBAL.json b/infrastructure/cdn-in-a-box/traffic_ops_data/profiles/000-GLOBAL.json index 13cb340ea8..ab37c5bb3c 100644 --- a/infrastructure/cdn-in-a-box/traffic_ops_data/profiles/000-GLOBAL.json +++ b/infrastructure/cdn-in-a-box/traffic_ops_data/profiles/000-GLOBAL.json @@ -20,14 +20,14 @@ "value": "CDN-In-A-Box" }, { - "value": "https://trafficops.infra.ciab.test/GeoLiteCity.dat.gz", + "value": "https://trafficops.infra.ciab.test/GeoLite2-City.mmdb.gz", "configFile": "CRConfig.json", "name": "geolocation.polling.url" }, { "name": "geolocation6.polling.url", "configFile": "CRConfig.json", - "value": "https://trafficops.infra.ciab.test/GeoLiteCity.dat.gz" + "value": "https://trafficops.infra.ciab.test/GeoLite2-City.mmdb.gz" }, { "value": "Traffic Ops", From a811f4d25fa17794adcb94c9c0d95c612ddd30da Mon Sep 17 00:00:00 2001 From: ocket8888 Date: Thu, 2 Jan 2020 15:26:30 -0700 Subject: [PATCH 2/2] Removed commented-out lines --- infrastructure/cdn-in-a-box/traffic_ops/trafficops-init.sh | 6 ------ 1 file changed, 6 deletions(-) diff --git a/infrastructure/cdn-in-a-box/traffic_ops/trafficops-init.sh b/infrastructure/cdn-in-a-box/traffic_ops/trafficops-init.sh index dbce2f3476..d03944525b 100755 --- a/infrastructure/cdn-in-a-box/traffic_ops/trafficops-init.sh +++ b/infrastructure/cdn-in-a-box/traffic_ops/trafficops-init.sh @@ -100,9 +100,3 @@ load_data_from() { # First, load required data at the top level load_data_from /traffic_ops_data - -# Copy the free MaxMind GeoLite DB to TrafficOps public directory -# tar -C /var/tmp -zxpvf /GeoLite2-City.tar.gz -# geo_dir=$(find /var/tmp -maxdepth 1 -type d -name GeoLite2-City\*) -# gzip -c "$geo_dir/GeoLite2-City.mmdb" > "$TO_DIR/public/GeoLite2-City.mmdb.gz" -# chown trafops:trafops "$TO_DIR/public/GeoLite2-City.mmdb.gz"