You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2020/04/24 23:35:49 UTC

[GitHub] [trafficcontrol] rawlinp opened a new pull request #4663: Add readiness container to ciab

rawlinp opened a new pull request #4663:
URL: https://github.com/apache/trafficcontrol/pull/4663


   ## What does this PR (Pull Request) do?
   Today, there's not really a great way to tell when ciab is "ready", i.e.
   all services have started up successfully, so that you can start using
   it. Or, maybe you only care to know whether ciab started up successfully
   or not, and that's it.
   
   Traditionally, ciab being "successful" means that you can curl the
   delivery service, so that's what the readiness container does. This way,
   you can start up the "main" services in the background and start up the
   "readiness" service in the foreground. When ciab is ready, the readiness
   service will exit, and you can start using ciab. You no longer manually
   have to watch the log output for things that _probably_ indicate ciab
   started up successfully, or manually curl the delivery service in a
   loop until it responds.
   
   - [x] This PR is not related to any Issue
   
   
   ## Which Traffic Control components are affected by this PR?
   <!-- Please delete all components from this list that are NOT affected by this
   Pull Request. Also, feel free to add the name of a tool or script that is
   affected but not on the list.
   
   Additionally, if this Pull Request does NOT affect documentation, please
   explain why documentation is not required. -->
   
   - CDN in a Box
   
   ## What is the best way to verify this PR?
   ```
   cd infrastructure/cdn-in-a-box
   docker-compose up -d
   docker-compose -f docker-compose.readiness.yml up
   # wait until readiness container exits successfully, logging that
   # it has successfully curled all the DS example URLs
   ```
   
   ## The following criteria are ALL met by this PR
   
   - [x] ciab is a test
   - [x] ciab enhancement doesn't require new docs
   - [x] This PR includes an update to CHANGELOG.md
   - [x] This PR includes any and all required license headers
   - [x] This PR ensures that database migration sequence is correct OR this PR does not include a database migration
   - [x] This PR **DOES NOT FIX A SERIOUS SECURITY VULNERABILITY** (see [the Apache Software Foundation's security guidelines](https://www.apache.org/security/) for details)
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] rawlinp commented on pull request #4663: Add readiness container to ciab

Posted by GitBox <gi...@apache.org>.
rawlinp commented on pull request #4663:
URL: https://github.com/apache/trafficcontrol/pull/4663#issuecomment-620754783


   Hold up, need to address a side-effect of `set -e` before this can be merged.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] rawlinp commented on a change in pull request #4663: Add readiness container to ciab

Posted by GitBox <gi...@apache.org>.
rawlinp commented on a change in pull request #4663:
URL: https://github.com/apache/trafficcontrol/pull/4663#discussion_r416904925



##########
File path: infrastructure/cdn-in-a-box/readiness/run.sh
##########
@@ -0,0 +1,61 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+set -eu
+
+start_time=$(date +%s)
+
+source to-access.sh
+
+set-dns.sh
+insert-self-into-dns.sh
+
+while ! to-ping 2>/dev/null; do

Review comment:
       I stole this from a different run script -- I'll stop hiding it.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] rawlinp commented on a change in pull request #4663: Add readiness container to ciab

Posted by GitBox <gi...@apache.org>.
rawlinp commented on a change in pull request #4663:
URL: https://github.com/apache/trafficcontrol/pull/4663#discussion_r416757127



##########
File path: infrastructure/cdn-in-a-box/readiness/run.sh
##########
@@ -0,0 +1,59 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+start_time=$(date +%s)
+
+source to-access.sh
+
+set-dns.sh
+insert-self-into-dns.sh
+
+while ! to-ping 2>/dev/null; do
+   echo waiting for trafficops
+   sleep 3
+done
+
+while true; do
+    sleep 3
+    exampleURLs=($(to-get /api/${TO_API_VERSION}/deliveryservices | jq -r '.response[].exampleURLs[]'))
+    if [[ "${#exampleURLs[@]}" -eq 0 ]]; then
+        echo waiting for delivery service example URLs
+        continue
+    else
+        echo "example URLs: '${exampleURLs[@]}'"
+        success="true"
+        for u in "${exampleURLs[@]}"; do
+            status=$(curl -Lkvs --connect-timeout 2 -m5 -o /dev/null -w "%{http_code}" "$u")
+            if [[ "$status" -ne 200 ]]; then
+                echo "failed to curl delivery service example URL '$u' got status code '$status'"
+                success="false"
+                break
+            else
+                echo "successfully curled delivery service example URL '$u'"
+            fi
+        done
+        if [[ "$success" == "true" ]]; then
+            echo "successfully curled all delivery service example URLs '${exampleURLs[@]}'"
+            break
+        fi
+    fi

Review comment:
       You can't catch me, copper!




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #4663: Add readiness container to ciab

Posted by GitBox <gi...@apache.org>.
ocket8888 commented on a change in pull request #4663:
URL: https://github.com/apache/trafficcontrol/pull/4663#discussion_r416278916



##########
File path: infrastructure/cdn-in-a-box/readiness/run.sh
##########
@@ -0,0 +1,59 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+start_time=$(date +%s)
+
+source to-access.sh
+
+set-dns.sh
+insert-self-into-dns.sh

Review comment:
       This is intended to be a short-lived container that other components don't make requests to, right? So why does it need to insert itself into the DNS records of the dns container?

##########
File path: infrastructure/cdn-in-a-box/readiness/run.sh
##########
@@ -0,0 +1,59 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+

Review comment:
       This should `set -x` so it stops if e.g. `set-dns.sh` fails.

##########
File path: infrastructure/cdn-in-a-box/docker-compose.readiness.yml
##########
@@ -0,0 +1,51 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# This docker-compose file starts a readiness service that will exit
+# successfully when it is able to successfully curl all delivery
+# service example URLs.
+#
+# For example:
+#
+#     docker-compose -f docker-compose.yml -f docker-compose.readiness.yml up
+#
+# Or, start up the main services in the background and run the readiness
+# service in the foreground:
+#
+#     docker-compose up -d
+#     docker-compose -f docker-compose.readiness.yml up
+
+---
+version: '2.1'
+
+services:
+  readiness:
+    build:
+      context: ../..
+      dockerfile: infrastructure/cdn-in-a-box/readiness/Dockerfile
+    env_file:
+      - variables.env
+    hostname: readiness
+    domainname: infra.ciab.test
+    volumes:
+      - shared:/shared

Review comment:
       Does it need the shared volume? Maybe for certs? I'm not sure, just wondering if you know.

##########
File path: infrastructure/cdn-in-a-box/readiness/run.sh
##########
@@ -0,0 +1,59 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+start_time=$(date +%s)
+
+source to-access.sh
+
+set-dns.sh
+insert-self-into-dns.sh
+
+while ! to-ping 2>/dev/null; do
+   echo waiting for trafficops
+   sleep 3
+done
+
+while true; do
+    sleep 3
+    exampleURLs=($(to-get /api/${TO_API_VERSION}/deliveryservices | jq -r '.response[].exampleURLs[]'))
+    if [[ "${#exampleURLs[@]}" -eq 0 ]]; then
+        echo waiting for delivery service example URLs
+        continue
+    else
+        echo "example URLs: '${exampleURLs[@]}'"
+        success="true"
+        for u in "${exampleURLs[@]}"; do
+            status=$(curl -Lkvs --connect-timeout 2 -m5 -o /dev/null -w "%{http_code}" "$u")
+            if [[ "$status" -ne 200 ]]; then
+                echo "failed to curl delivery service example URL '$u' got status code '$status'"
+                success="false"
+                break
+            else
+                echo "successfully curled delivery service example URL '$u'"
+            fi
+        done
+        if [[ "$success" == "true" ]]; then
+            echo "successfully curled all delivery service example URLs '${exampleURLs[@]}'"
+            break
+        fi
+    fi

Review comment:
       Yeah, see, this is why I gotta stop you here. You were going <kbd>&nbsp;</kbd> in a <kbd>⭾</kbd> zone. That's gonna be a $80 fine or you can take it up with the 3<sup>rd</sup> Circuit Court of Best Practices. Take care now, and watch your indentation.

##########
File path: infrastructure/cdn-in-a-box/readiness/Dockerfile
##########
@@ -0,0 +1,34 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+FROM alpine:3.11
+
+RUN apk add --no-cache --update \
+  curl \
+  bind-tools \
+  net-tools \
+  jq \
+  bash
+
+# MANIFEST
+# to-access.sh (sourced, get to-get and env vars)
+# run.sh       (wait on TO, then to-get deliveryservices, then curl the exampleURLs)
+COPY ./infrastructure/cdn-in-a-box/traffic_ops/to-access.sh /opt/readiness/
+COPY ./infrastructure/cdn-in-a-box/readiness/run.sh /opt/readiness/

Review comment:
       You can do this in one line to save a cache layer: `COPY file [files...] destination`




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] ocket8888 commented on pull request #4663: Add readiness container to ciab

Posted by GitBox <gi...@apache.org>.
ocket8888 commented on pull request #4663:
URL: https://github.com/apache/trafficcontrol/pull/4663#issuecomment-621493567


   ah, much better


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #4663: Add readiness container to ciab

Posted by GitBox <gi...@apache.org>.
zrhoffman commented on a change in pull request #4663:
URL: https://github.com/apache/trafficcontrol/pull/4663#discussion_r416866148



##########
File path: infrastructure/cdn-in-a-box/readiness/run.sh
##########
@@ -41,7 +41,7 @@ while true; do
 
     success="true"
     for u in "${exampleURLs[@]}"; do
-        status=$(curl -Lkvs --connect-timeout 2 -m5 -o /dev/null -w "%{http_code}" "$u")
+        status=$(curl -Lkvs --connect-timeout 2 -m5 -o /dev/null -w "%{http_code}" "$u" || true)

Review comment:
       To avoid the `|| true`, this can be
   ```bash
   if ! status=$(curl -Lkvs --connect-timeout 2 -m5 -o /dev/null -w "%{http_code}" "$u") || [[ "$status" -ne 200 ]]; then
   ```

##########
File path: infrastructure/cdn-in-a-box/readiness/run.sh
##########
@@ -32,7 +32,7 @@ done
 
 while true; do
     sleep 3
-    exampleURLs=($(to-get /api/${TO_API_VERSION}/deliveryservices | jq -r '.response[].exampleURLs[]'))
+    exampleURLs=($(to-get /api/${TO_API_VERSION}/deliveryservices | jq -r '.response[].exampleURLs[]' || true))

Review comment:
       To avoid the `|| true`, this can be
   ```bash
   if ! exampleURLs=($(to-get "/api/${TO_API_VERSION}/deliveryservices" | jq -r '.response[].exampleURLs[]')) || [[ "${#exampleURLs[@]}" -eq 0 ]]; then
   ```

##########
File path: infrastructure/cdn-in-a-box/readiness/run.sh
##########
@@ -0,0 +1,61 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+set -eu
+
+start_time=$(date +%s)
+
+source to-access.sh
+
+set-dns.sh
+insert-self-into-dns.sh
+
+while ! to-ping 2>/dev/null; do
+    echo waiting for trafficops
+    sleep 3
+done
+
+while true; do
+    sleep 3
+    exampleURLs=($(to-get /api/${TO_API_VERSION}/deliveryservices | jq -r '.response[].exampleURLs[]' || true))
+    if [[ "${#exampleURLs[@]}" -eq 0 ]]; then
+        echo waiting for delivery service example URLs
+        continue
+    fi
+    echo "example URLs: '${exampleURLs[@]}'"
+
+    success="true"
+    for u in "${exampleURLs[@]}"; do
+        status=$(curl -Lkvs --connect-timeout 2 -m5 -o /dev/null -w "%{http_code}" "$u" || true)
+        if [[ "$status" -ne 200 ]]; then
+            echo "failed to curl delivery service example URL '$u' got status code '$status'"
+            success="false"
+            break
+        else
+            echo "successfully curled delivery service example URL '$u'"
+        fi
+    done
+    if [[ "$success" == "true" ]]; then
+        echo "successfully curled all delivery service example URLs '${exampleURLs[@]}'"

Review comment:
       This should be `${exampleURLs[*]}` to avoid mixing a string with an array.

##########
File path: infrastructure/cdn-in-a-box/readiness/run.sh
##########
@@ -0,0 +1,61 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+set -eu
+
+start_time=$(date +%s)
+
+source to-access.sh
+
+set-dns.sh
+insert-self-into-dns.sh
+
+while ! to-ping 2>/dev/null; do
+    echo waiting for trafficops
+    sleep 3
+done
+
+while true; do
+    sleep 3
+    exampleURLs=($(to-get /api/${TO_API_VERSION}/deliveryservices | jq -r '.response[].exampleURLs[]' || true))
+    if [[ "${#exampleURLs[@]}" -eq 0 ]]; then
+        echo waiting for delivery service example URLs
+        continue
+    fi
+    echo "example URLs: '${exampleURLs[@]}'"

Review comment:
       This should be `${exampleURLs[*]}` to avoid mixing a string with an array.

##########
File path: infrastructure/cdn-in-a-box/readiness/run.sh
##########
@@ -0,0 +1,61 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+set -eu
+
+start_time=$(date +%s)
+
+source to-access.sh
+
+set-dns.sh
+insert-self-into-dns.sh
+
+while ! to-ping 2>/dev/null; do

Review comment:
       Why hide /dev/stderr here?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] rawlinp commented on pull request #4663: Add readiness container to ciab

Posted by GitBox <gi...@apache.org>.
rawlinp commented on pull request #4663:
URL: https://github.com/apache/trafficcontrol/pull/4663#issuecomment-621493013


   💩 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #4663: Add readiness container to ciab

Posted by GitBox <gi...@apache.org>.
ocket8888 commented on a change in pull request #4663:
URL: https://github.com/apache/trafficcontrol/pull/4663#discussion_r416760715



##########
File path: infrastructure/cdn-in-a-box/readiness/run.sh
##########
@@ -0,0 +1,59 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+

Review comment:
       Yes, that. I always get those mixed up.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #4663: Add readiness container to ciab

Posted by GitBox <gi...@apache.org>.
ocket8888 commented on a change in pull request #4663:
URL: https://github.com/apache/trafficcontrol/pull/4663#discussion_r416761497



##########
File path: infrastructure/cdn-in-a-box/docker-compose.readiness.yml
##########
@@ -0,0 +1,51 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# This docker-compose file starts a readiness service that will exit
+# successfully when it is able to successfully curl all delivery
+# service example URLs.
+#
+# For example:
+#
+#     docker-compose -f docker-compose.yml -f docker-compose.readiness.yml up
+#
+# Or, start up the main services in the background and run the readiness
+# service in the foreground:
+#
+#     docker-compose up -d
+#     docker-compose -f docker-compose.readiness.yml up
+
+---
+version: '2.1'
+
+services:
+  readiness:
+    build:
+      context: ../..
+      dockerfile: infrastructure/cdn-in-a-box/readiness/Dockerfile
+    env_file:
+      - variables.env
+    hostname: readiness
+    domainname: infra.ciab.test
+    volumes:
+      - shared:/shared

Review comment:
       In that case this is answered above.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] rawlinp commented on a change in pull request #4663: Add readiness container to ciab

Posted by GitBox <gi...@apache.org>.
rawlinp commented on a change in pull request #4663:
URL: https://github.com/apache/trafficcontrol/pull/4663#discussion_r416757668



##########
File path: infrastructure/cdn-in-a-box/docker-compose.readiness.yml
##########
@@ -0,0 +1,51 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# This docker-compose file starts a readiness service that will exit
+# successfully when it is able to successfully curl all delivery
+# service example URLs.
+#
+# For example:
+#
+#     docker-compose -f docker-compose.yml -f docker-compose.readiness.yml up
+#
+# Or, start up the main services in the background and run the readiness
+# service in the foreground:
+#
+#     docker-compose up -d
+#     docker-compose -f docker-compose.readiness.yml up
+
+---
+version: '2.1'
+
+services:
+  readiness:
+    build:
+      context: ../..
+      dockerfile: infrastructure/cdn-in-a-box/readiness/Dockerfile
+    env_file:
+      - variables.env
+    hostname: readiness
+    domainname: infra.ciab.test
+    volumes:
+      - shared:/shared

Review comment:
       I believe it's necessary for `insert-self-into-dns.sh`




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] rawlinp commented on a change in pull request #4663: Add readiness container to ciab

Posted by GitBox <gi...@apache.org>.
rawlinp commented on a change in pull request #4663:
URL: https://github.com/apache/trafficcontrol/pull/4663#discussion_r416754158



##########
File path: infrastructure/cdn-in-a-box/readiness/run.sh
##########
@@ -0,0 +1,59 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+

Review comment:
       I believe you mean `set -e` which I'll add.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] rawlinp commented on pull request #4663: Add readiness container to ciab

Posted by GitBox <gi...@apache.org>.
rawlinp commented on pull request #4663:
URL: https://github.com/apache/trafficcontrol/pull/4663#issuecomment-620326919


   I suppose I could!


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #4663: Add readiness container to ciab

Posted by GitBox <gi...@apache.org>.
ocket8888 commented on a change in pull request #4663:
URL: https://github.com/apache/trafficcontrol/pull/4663#discussion_r416761025



##########
File path: infrastructure/cdn-in-a-box/readiness/run.sh
##########
@@ -0,0 +1,59 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+start_time=$(date +%s)
+
+source to-access.sh
+
+set-dns.sh
+insert-self-into-dns.sh

Review comment:
       I guess not.
   
   What component was that?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] rawlinp commented on a change in pull request #4663: Add readiness container to ciab

Posted by GitBox <gi...@apache.org>.
rawlinp commented on a change in pull request #4663:
URL: https://github.com/apache/trafficcontrol/pull/4663#discussion_r416756283



##########
File path: infrastructure/cdn-in-a-box/readiness/run.sh
##########
@@ -0,0 +1,59 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+start_time=$(date +%s)
+
+source to-access.sh
+
+set-dns.sh
+insert-self-into-dns.sh

Review comment:
       Monkey see monkey do. The component I was looking at was doing this with no specific reason to be in DNS. I don't think it really hurts anything to have all the components be found in DNS for consistency.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] rawlinp commented on pull request #4663: Add readiness container to ciab

Posted by GitBox <gi...@apache.org>.
rawlinp commented on pull request #4663:
URL: https://github.com/apache/trafficcontrol/pull/4663#issuecomment-620801268


   Should be good now.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] rawlinp commented on a change in pull request #4663: Add readiness container to ciab

Posted by GitBox <gi...@apache.org>.
rawlinp commented on a change in pull request #4663:
URL: https://github.com/apache/trafficcontrol/pull/4663#discussion_r416785542



##########
File path: infrastructure/cdn-in-a-box/readiness/run.sh
##########
@@ -0,0 +1,59 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+start_time=$(date +%s)
+
+source to-access.sh
+
+set-dns.sh
+insert-self-into-dns.sh

Review comment:
       The TO API integration tests




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] ocket8888 commented on pull request #4663: Add readiness container to ciab

Posted by GitBox <gi...@apache.org>.
ocket8888 commented on pull request #4663:
URL: https://github.com/apache/trafficcontrol/pull/4663#issuecomment-621481621


   I'll probably merge this today, but I wanna see it action for myself first


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] rawlinp commented on pull request #4663: Add readiness container to ciab

Posted by GitBox <gi...@apache.org>.
rawlinp commented on pull request #4663:
URL: https://github.com/apache/trafficcontrol/pull/4663#issuecomment-621483971


   You won't believe your eyes


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] mitchell852 commented on pull request #4663: Add readiness container to ciab

Posted by GitBox <gi...@apache.org>.
mitchell852 commented on pull request #4663:
URL: https://github.com/apache/trafficcontrol/pull/4663#issuecomment-620325864


   @rawlinp - do you want to make a note about this here? https://traffic-control-cdn.readthedocs.io/en/latest/admin/quick_howto/ciab.html


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org