You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by oc...@apache.org on 2020/08/20 02:05:24 UTC
[trafficcontrol] branch master updated: CDN-in-a-Box readiness CI
test (#4972)
This is an automated email from the ASF dual-hosted git repository.
ocket8888 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git
The following commit(s) were added to refs/heads/master by this push:
new e69094c CDN-in-a-Box readiness CI test (#4972)
e69094c is described below
commit e69094c542720c88bbeb17973db26895300c844d
Author: Zach Hoffman <za...@zrhoffman.net>
AuthorDate: Thu Aug 20 02:05:13 2020 +0000
CDN-in-a-Box readiness CI test (#4972)
* Added workflow for building RPMs
* fixed docker install command
* install lsb-release package
* call lsb_release instead of lsb-release
* Switch to official docker image
* Make entrypoint executable
* Need to install bash
* Fix bad interpreter used for entrypoint
* Add debug output
* bind stderr to stdout; remove debug output
* There's now no way for output to escape
* Force setting -ex in pkg
* explicit project list
* Fixed typo
* Attempt to fix path to docker-compose file
* Attempt to fix my problems by manually installing docker-compose
* cleanup
* Added CDN-in-a-Box action and workflow step
* Switch from using 'pkg' to direct rpm builds
* Switched container from docker to go
* Added git
* go doesn't support GNU-standard args parsing..............
* added go to PATH
* Added some GOPATH trickery
* Added go get
* Prove that the thing can be built
* try building without links
* added rsync
* Wrap docker command to build Traffic Ops in JavaScript action
* Slight refactor and now builds all RPMs
* Fixed a typo
* Added license header
* Added timing info to logs
* Removed bash-isms
* Added git
* Specify only the necessary containers to build and start
* Cleanup and renaming
* Added running the integration tests
* Added logs on failure
* Get RPMs to build
- Run in workspace workdir
- Use Apache org images with master tag
- Build Traffic Ops ORT
- Output stderr
- CDN-in-a-Box make copies all RPMs, do not specify which ones
* Build the CDN-in-a-Box images images faster using docker-compose build
--parallel and enabling Docker BuildKit
* Copy set-dns.sh and insert-self-into-dns.sh into images instead of
mounting them
* Copy set-self-dns.sh and set-dns-update.sh into dns image instead of
mounting them
* Copy set-to-ips-from-dns.sh into the trafficops-perl image
* Split cache docker image into edge and mid cache image to avoid mounting
/opt/init.d/99-run.sh
* - Remove unused variable STARTING_POINT
- Do not run API tests, the traffic ops workflow does that
- Refactor readiness check
- Check readiness container exit code
* Upload RPMs as artifacts
* Move CDN-in-a-Box to second job after RPMs are built
* Use docker-compose to build ATC components instead of using Docker
directly
* Build ATC component RPMs in parallel jobs
* Add origin content to origin image instead of mounting a volume
* Add CI tests to list of components in PR template
* Changelog entry
* More workflow triggers
* Newline at the end of file
* Add leading ./
* Fix whitespace
* Wait on `docker-compose logs`, not `docker wait`
* Do not build docs or source tarball
* use strict
* Store CDN-in-a-Box logs as artifacts if the readiness check failed
* Remove reference to nonexistent variable container_exit_code
* Follow logs since we're waiting
* Consistent whitespace
* Do not bother triggering the workflow for some paths
Co-authored-by: ocket8888 <oc...@apache.org>
---
.github/actions/build-rpms/README.md | 35 ++++
.../actions/build-rpms/action.yaml | 23 +--
.github/actions/build-rpms/main.js | 35 ++++
.../actions/run-ciab/Dockerfile | 21 +--
.github/actions/run-ciab/README.md | 35 ++++
.../actions/run-ciab/action.yaml | 23 +--
.github/actions/run-ciab/entrypoint.sh | 58 ++++++
.github/workflows/ciab.yaml | 194 +++++++++++++++++++++
CHANGELOG.md | 1 +
PULL_REQUEST_TEMPLATE.md | 1 +
infrastructure/cdn-in-a-box/dns/Dockerfile | 4 +
.../cdn-in-a-box/docker-compose.readiness.yml | 2 -
.../docker-compose.traffic-ops-test.yml | 2 -
.../docker-compose.traffic-portal-test.yml | 2 -
infrastructure/cdn-in-a-box/docker-compose.yml | 38 +---
.../cdn-in-a-box/{cache => edge}/Dockerfile | 10 +-
.../cdn-in-a-box/edge/{run.sh => init.d/99-run.sh} | 0
infrastructure/cdn-in-a-box/enroller/Dockerfile | 4 +
.../cdn-in-a-box/{cache => mid}/Dockerfile | 10 +-
.../cdn-in-a-box/mid/{run.sh => init.d/99-run.sh} | 0
.../optional/docker-compose.grafana.yml | 2 -
.../optional/docker-compose.socksproxy.yml | 2 -
.../cdn-in-a-box/optional/docker-compose.vnc.yml | 2 -
.../cdn-in-a-box/optional/docker-compose.vpn.yml | 2 -
.../cdn-in-a-box/optional/grafana/Dockerfile | 4 +
.../cdn-in-a-box/optional/socksproxy/Dockerfile | 4 +
.../cdn-in-a-box/optional/vnc/Dockerfile | 4 +
.../cdn-in-a-box/optional/vpn/Dockerfile | 5 +
infrastructure/cdn-in-a-box/origin/Dockerfile | 7 +-
infrastructure/cdn-in-a-box/readiness/Dockerfile | 3 +
infrastructure/cdn-in-a-box/smtp/Dockerfile | 4 +
.../cdn-in-a-box/traffic_monitor/Dockerfile | 4 +
infrastructure/cdn-in-a-box/traffic_ops/Dockerfile | 5 +
.../cdn-in-a-box/traffic_ops/Dockerfile-db | 5 +
.../cdn-in-a-box/traffic_ops/Dockerfile-go | 4 +
.../traffic_ops/Dockerfile-go.dockerignore | 2 +
.../traffic_ops_integration_test/Dockerfile | 4 +
.../cdn-in-a-box/traffic_portal/Dockerfile | 4 +
.../traffic_portal_integration_test/Dockerfile | 2 +
.../cdn-in-a-box/traffic_router/Dockerfile | 4 +
.../cdn-in-a-box/traffic_stats/Dockerfile | 4 +
.../cdn-in-a-box/traffic_stats/Dockerfile-influxdb | 4 +
.../cdn-in-a-box/traffic_vault/Dockerfile | 4 +
43 files changed, 479 insertions(+), 104 deletions(-)
diff --git a/.github/actions/build-rpms/README.md b/.github/actions/build-rpms/README.md
new file mode 100644
index 0000000..40a3195
--- /dev/null
+++ b/.github/actions/build-rpms/README.md
@@ -0,0 +1,35 @@
+<!--
+ 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.
+-->
+
+# build-rpms JavaScript action
+
+This action runs the builds RPMs for the various Traffic Control components.
+
+## Inputs
+None
+
+## Outputs
+### `exit-code`
+
+0 on success, non-zero otherwise
+
+## Example usage
+```yaml
+uses: .github/actions/build-rpms
+```
diff --git a/infrastructure/cdn-in-a-box/traffic_stats/Dockerfile-influxdb b/.github/actions/build-rpms/action.yaml
similarity index 69%
copy from infrastructure/cdn-in-a-box/traffic_stats/Dockerfile-influxdb
copy to .github/actions/build-rpms/action.yaml
index b3fef58..982531e 100644
--- a/infrastructure/cdn-in-a-box/traffic_stats/Dockerfile-influxdb
+++ b/.github/actions/build-rpms/action.yaml
@@ -15,21 +15,8 @@
# specific language governing permissions and limitations
# under the License.
-FROM influxdb:1.7.3
-
-RUN apt-get update && \
- apt-get install -y \
- dnsutils \
- gettext-base \
- # server enrollment uses jq
- jq \
- netcat \
- net-tools && \
- rm -rf /var/lib/apt/lists/*
-
-ADD enroller/server_template.json \
- traffic_ops/to-access.sh \
- traffic_stats/run-influxdb.sh \
- /
-
-ENTRYPOINT ["/run-influxdb.sh"]
+name: 'build-rpms'
+description: 'Builds RPMs for a single ATC component'
+runs:
+ using: 'node12'
+ main: 'main.js'
diff --git a/.github/actions/build-rpms/main.js b/.github/actions/build-rpms/main.js
new file mode 100644
index 0000000..a80b34b
--- /dev/null
+++ b/.github/actions/build-rpms/main.js
@@ -0,0 +1,35 @@
+/*
+* Licensed 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.
+*/
+
+"use strict";
+const child_process = require("child_process");
+const spawnArgs = {
+ stdio: "inherit",
+ stderr: "inherit",
+};
+
+let atcComponent = process.env.ATC_COMPONENT;
+const dockerComposeArgs = ["-f", `${process.env.GITHUB_WORKSPACE}/infrastructure/docker/build/docker-compose.yml`, "run", "--rm"];
+if (typeof atcComponent !== "string" || atcComponent.length === 0) {
+ console.error("Missing environment variable ATC_COMPONENT");
+ process.exit(1);
+}
+atcComponent += "_build";
+dockerComposeArgs.push(atcComponent);
+const proc = child_process.spawnSync(
+ "docker-compose",
+ dockerComposeArgs,
+ spawnArgs
+);
+process.exit(proc.status);
diff --git a/infrastructure/cdn-in-a-box/traffic_stats/Dockerfile-influxdb b/.github/actions/run-ciab/Dockerfile
similarity index 70%
copy from infrastructure/cdn-in-a-box/traffic_stats/Dockerfile-influxdb
copy to .github/actions/run-ciab/Dockerfile
index b3fef58..e7f7d3d 100644
--- a/infrastructure/cdn-in-a-box/traffic_stats/Dockerfile-influxdb
+++ b/.github/actions/run-ciab/Dockerfile
@@ -15,21 +15,12 @@
# specific language governing permissions and limitations
# under the License.
-FROM influxdb:1.7.3
+FROM docker:stable
-RUN apt-get update && \
- apt-get install -y \
- dnsutils \
- gettext-base \
- # server enrollment uses jq
- jq \
- netcat \
- net-tools && \
- rm -rf /var/lib/apt/lists/*
+VOLUME /var/run/docker.sock:/var/run/docker.sock
+RUN apk add make docker-compose git
-ADD enroller/server_template.json \
- traffic_ops/to-access.sh \
- traffic_stats/run-influxdb.sh \
- /
+COPY entrypoint.sh /
+RUN chmod a+x /entrypoint.sh
-ENTRYPOINT ["/run-influxdb.sh"]
+ENTRYPOINT /entrypoint.sh
diff --git a/.github/actions/run-ciab/README.md b/.github/actions/run-ciab/README.md
new file mode 100644
index 0000000..b4e479a
--- /dev/null
+++ b/.github/actions/run-ciab/README.md
@@ -0,0 +1,35 @@
+<!--
+ 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.
+-->
+
+# run-ciab Docker action
+
+This action runs the CDN-in-a-Box and exits with the exit code from the `readiness` service.
+
+## Inputs
+None
+
+## Outputs
+### `exit-code`
+
+Exit code of the script
+
+## Example usage
+```yaml
+uses: .github/actions/run-ciab
+```
diff --git a/infrastructure/cdn-in-a-box/traffic_stats/Dockerfile-influxdb b/.github/actions/run-ciab/action.yaml
similarity index 69%
copy from infrastructure/cdn-in-a-box/traffic_stats/Dockerfile-influxdb
copy to .github/actions/run-ciab/action.yaml
index b3fef58..527a331 100644
--- a/infrastructure/cdn-in-a-box/traffic_stats/Dockerfile-influxdb
+++ b/.github/actions/run-ciab/action.yaml
@@ -15,21 +15,8 @@
# specific language governing permissions and limitations
# under the License.
-FROM influxdb:1.7.3
-
-RUN apt-get update && \
- apt-get install -y \
- dnsutils \
- gettext-base \
- # server enrollment uses jq
- jq \
- netcat \
- net-tools && \
- rm -rf /var/lib/apt/lists/*
-
-ADD enroller/server_template.json \
- traffic_ops/to-access.sh \
- traffic_stats/run-influxdb.sh \
- /
-
-ENTRYPOINT ["/run-influxdb.sh"]
+name: 'run-ciab'
+description: 'Runs CDN-in-a-Box'
+runs:
+ using: 'docker'
+ image: 'Dockerfile'
diff --git a/.github/actions/run-ciab/entrypoint.sh b/.github/actions/run-ciab/entrypoint.sh
new file mode 100755
index 0000000..8051436
--- /dev/null
+++ b/.github/actions/run-ciab/entrypoint.sh
@@ -0,0 +1,58 @@
+#!/bin/sh -l
+# 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 -ex;
+
+store_ciab_logs() {
+ echo 'Storing CDN-in-a-Box logs...';
+ mkdir logs;
+ for service in $($docker_compose ps --services); do
+ $docker_compose logs --no-color --timestamps "$service" >"logs/${service}.log";
+ done;
+}
+
+export COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 # use Docker BuildKit for better image building performance
+(
+cd dist;
+mv -- */*.rpm .;
+);
+
+docker-compose --version;
+cd infrastructure/cdn-in-a-box;
+make; # All RPMs should have already been built
+
+docker images;
+logged_services='trafficrouter readiness';
+other_services='dns edge enroller mid origin trafficmonitor trafficops trafficops-perl trafficstats trafficvault';
+docker_compose='docker-compose -f ./docker-compose.yml -f ./docker-compose.readiness.yml';
+time $docker_compose build --parallel $logged_services $other_services;
+$docker_compose up -d $logged_services $other_services;
+$docker_compose logs -f $logged_services &
+
+echo 'Waiting for the readiness container to exit...';
+if ! timeout 10m $docker_compose logs -f readiness >/dev/null; then
+ echo "CDN-in-a-Box didn't become ready within 10 minutes - exiting" >&2;
+ exit_code=1;
+ store_ciab_logs;
+elif exit_code="$(docker inspect --format='{{.State.ExitCode}}' "$($docker_compose ps -q readiness)")"; [ "$exit_code" -ne 0 ]; then
+ echo 'Readiness container exited with an error' >&2;
+ store_ciab_logs;
+fi;
+
+$docker_compose down -v --remove-orphans;
+exit "$exit_code";
diff --git a/.github/workflows/ciab.yaml b/.github/workflows/ciab.yaml
new file mode 100644
index 0000000..95db077
--- /dev/null
+++ b/.github/workflows/ciab.yaml
@@ -0,0 +1,194 @@
+# 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.
+
+name: CDN-in-a-Box CI
+
+on:
+ push:
+ paths-ignore:
+ - '*.*'
+ - '**/.gitignore'
+ - '**/*.md'
+ - '**/test/**'
+ - 'blueprints/**'
+ - 'docs/**'
+ - 'experimental/**'
+ - 'licenses/**'
+ - 'misc/**'
+ - 'NOTICE'
+ - 'traffic_control/java'
+ create:
+ paths-ignore:
+ - '*.*'
+ - '**/.gitignore'
+ - '**/*.md'
+ - '**/test/**'
+ - 'blueprints/**'
+ - 'docs/**'
+ - 'experimental/**'
+ - 'licenses/**'
+ - 'misc/**'
+ - 'NOTICE'
+ - 'traffic_control/java'
+ pull_request:
+ types: [opened, reopened, edited, synchronize]
+
+jobs:
+ traffic_monitor:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@master
+ - name: Build RPM
+ uses: ./.github/actions/build-rpms
+ env:
+ ATC_COMPONENT: ${{ github.job }}
+ - name: Upload RPM
+ uses: actions/upload-artifact@v2
+ with:
+ name: ${{ github.job }}
+ path: ${{ github.workspace }}/dist/${{ github.job }}-*.rpm
+
+ traffic_ops:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@master
+ - name: Build RPM
+ uses: ./.github/actions/build-rpms
+ env:
+ ATC_COMPONENT: ${{ github.job }}
+ - name: Upload RPM
+ uses: actions/upload-artifact@v2
+ with:
+ name: ${{ github.job }}
+ path: ${{ github.workspace }}/dist/${{ github.job }}-*.rpm
+
+ traffic_ops_ort:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@master
+ - name: Build RPM
+ uses: ./.github/actions/build-rpms
+ env:
+ ATC_COMPONENT: ${{ github.job }}
+ - name: Upload RPM
+ uses: actions/upload-artifact@v2
+ with:
+ name: ${{ github.job }}
+ path: ${{ github.workspace }}/dist/${{ github.job }}-*.rpm
+
+ traffic_portal:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@master
+ - name: Build RPM
+ uses: ./.github/actions/build-rpms
+ env:
+ ATC_COMPONENT: ${{ github.job }}
+ - name: Upload RPM
+ uses: actions/upload-artifact@v2
+ with:
+ name: ${{ github.job }}
+ path: ${{ github.workspace }}/dist/${{ github.job }}-*.rpm
+
+ traffic_router:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@master
+ - name: Build RPM
+ uses: ./.github/actions/build-rpms
+ env:
+ ATC_COMPONENT: ${{ github.job }}
+ - name: Upload RPM
+ uses: actions/upload-artifact@v2
+ with:
+ name: ${{ github.job }}
+ path: ${{ github.workspace }}/dist/*.rpm
+
+ traffic_stats:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@master
+ - name: Build RPM
+ uses: ./.github/actions/build-rpms
+ env:
+ ATC_COMPONENT: ${{ github.job }}
+ - name: Upload RPM
+ uses: actions/upload-artifact@v2
+ with:
+ name: ${{ github.job }}
+ path: ${{ github.workspace }}/dist/${{ github.job }}-*.rpm
+
+ grove:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@master
+ - name: Build RPM
+ uses: ./.github/actions/build-rpms
+ env:
+ ATC_COMPONENT: ${{ github.job }}
+ - name: Upload RPM
+ uses: actions/upload-artifact@v2
+ with:
+ name: ${{ github.job }}
+ path: ${{ github.workspace }}/dist/${{ github.job }}-*.rpm
+
+ grovetccfg:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@master
+ - name: Build RPM
+ uses: ./.github/actions/build-rpms
+ env:
+ ATC_COMPONENT: ${{ github.job }}
+ - name: Upload RPM
+ uses: actions/upload-artifact@v2
+ with:
+ name: ${{ github.job }}
+ path: ${{ github.workspace }}/dist/${{ github.job }}-*.rpm
+
+ ciab-build:
+ runs-on: ubuntu-latest
+ needs:
+ - traffic_monitor
+ - traffic_ops
+ - traffic_ops_ort
+ - traffic_portal
+ - traffic_router
+ - traffic_stats
+ steps:
+ - name: Checkout
+ uses: actions/checkout@master
+ - name: Download RPMs
+ uses: actions/download-artifact@v2
+ with:
+ path: ${{ github.workspace }}/dist/
+ - name: Start CDN-in-a-Box
+ uses: ./.github/actions/run-ciab
+ - name: Upload CDN-in-a-Box logs
+ uses: actions/upload-artifact@v2
+ with:
+ name: ciab-logs
+ path: infrastructure/cdn-in-a-box/logs/*.log
+ if: ${{ failure() }}
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5220b70..e9ab0ec 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -34,6 +34,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Added the ability to view Hash ID field (aka xmppID) on Traffic Portals' server summary page
- Added an indiciator to the Traffic Monitor UI when using a disk backup of Traffic ops.
- Added debugging functionality to CDN-in-a-Box for Traffic Stats.
+- Added GitHub Actions workflow for building RPMs and running the CDN-in-a-Box readiness check
### Fixed
- Fixed #3400 - Allow "0" as a TTL value for Static DNS entries
diff --git a/PULL_REQUEST_TEMPLATE.md b/PULL_REQUEST_TEMPLATE.md
index a9c59fc..cb6578d 100644
--- a/PULL_REQUEST_TEMPLATE.md
+++ b/PULL_REQUEST_TEMPLATE.md
@@ -39,6 +39,7 @@ explain why documentation is not required. -->
- Traffic Router
- Traffic Stats
- Traffic Vault
+- CI tests
## What is the best way to verify this PR?
<!-- Please include here ALL the steps necessary to test your Pull Request. If
diff --git a/infrastructure/cdn-in-a-box/dns/Dockerfile b/infrastructure/cdn-in-a-box/dns/Dockerfile
index 804a89b..d633573 100644
--- a/infrastructure/cdn-in-a-box/dns/Dockerfile
+++ b/infrastructure/cdn-in-a-box/dns/Dockerfile
@@ -41,6 +41,10 @@ COPY dns/zone.ip6.arpa /etc/bind
COPY traffic_ops/to-access.sh /
COPY enroller/server_template.json /
+COPY dns/set-self-dns.sh \
+ dns/set-dns-update.sh \
+ /usr/local/sbin/
+
RUN chmod 755 /sbin/entrypoint.sh
EXPOSE 53/udp 53/tcp
diff --git a/infrastructure/cdn-in-a-box/docker-compose.readiness.yml b/infrastructure/cdn-in-a-box/docker-compose.readiness.yml
index dd5f1b9..ddd2b79 100644
--- a/infrastructure/cdn-in-a-box/docker-compose.readiness.yml
+++ b/infrastructure/cdn-in-a-box/docker-compose.readiness.yml
@@ -43,8 +43,6 @@ services:
domainname: infra.ciab.test
volumes:
- shared:/shared
- - ./dns/set-dns.sh:/usr/local/sbin/set-dns.sh
- - ./dns/insert-self-into-dns.sh:/usr/local/sbin/insert-self-into-dns.sh
volumes:
shared:
diff --git a/infrastructure/cdn-in-a-box/docker-compose.traffic-ops-test.yml b/infrastructure/cdn-in-a-box/docker-compose.traffic-ops-test.yml
index 8bd57de..520df5f 100644
--- a/infrastructure/cdn-in-a-box/docker-compose.traffic-ops-test.yml
+++ b/infrastructure/cdn-in-a-box/docker-compose.traffic-ops-test.yml
@@ -37,8 +37,6 @@ services:
domainname: infra.ciab.test
volumes:
- shared:/shared
- - ./dns/set-dns.sh:/usr/local/sbin/set-dns.sh
- - ./dns/insert-self-into-dns.sh:/usr/local/sbin/insert-self-into-dns.sh
- ../../junit:/junit
volumes:
junit:
diff --git a/infrastructure/cdn-in-a-box/docker-compose.traffic-portal-test.yml b/infrastructure/cdn-in-a-box/docker-compose.traffic-portal-test.yml
index 1de361b..89b0c03 100644
--- a/infrastructure/cdn-in-a-box/docker-compose.traffic-portal-test.yml
+++ b/infrastructure/cdn-in-a-box/docker-compose.traffic-portal-test.yml
@@ -37,8 +37,6 @@ services:
domainname: infra.ciab.test
volumes:
- shared:/shared
- - ./dns/set-dns.sh:/usr/local/sbin/set-dns.sh
- - ./dns/insert-self-into-dns.sh:/usr/local/sbin/insert-self-into-dns.sh
- ../../junit:/junit
volumes:
diff --git a/infrastructure/cdn-in-a-box/docker-compose.yml b/infrastructure/cdn-in-a-box/docker-compose.yml
index 05123d8..9ef16c1 100644
--- a/infrastructure/cdn-in-a-box/docker-compose.yml
+++ b/infrastructure/cdn-in-a-box/docker-compose.yml
@@ -47,8 +47,6 @@ services:
volumes:
- /var/lib/postgresql/data
- shared:/shared
- - ./dns/set-dns.sh:/usr/local/sbin/set-dns.sh
- - ./dns/insert-self-into-dns.sh:/usr/local/sbin/insert-self-into-dns.sh
env_file:
- variables.env
# TODO: change to expose: "5432" to limit to containers
@@ -73,8 +71,6 @@ services:
hostname: trafficops
image: trafficops-go
volumes:
- - ./dns/set-dns.sh:/usr/local/sbin/set-dns.sh
- - ./dns/insert-self-into-dns.sh:/usr/local/sbin/insert-self-into-dns.sh
- shared:/shared
# trafficops-perl runs the legacy Traffic Ops in Perl using the Mojolicious framework. This remains
@@ -96,9 +92,6 @@ services:
# TODO: change to expose: "60443" to limit to containers
volumes:
- ./traffic_ops/ca:/ca
- - ./dns/set-dns.sh:/usr/local/sbin/set-dns.sh
- - ./dns/insert-self-into-dns.sh:/usr/local/sbin/insert-self-into-dns.sh
- - ./traffic_ops/set-to-ips-from-dns.sh:/usr/local/sbin/set-to-ips-from-dns.sh
- shared:/shared
# trafficportal defines the web interface for Traffic Ops. It uses only the API exposed by Traffic Ops
@@ -117,8 +110,6 @@ services:
hostname: trafficportal
image: trafficportal
volumes:
- - ./dns/set-dns.sh:/usr/local/sbin/set-dns.sh
- - ./dns/insert-self-into-dns.sh:/usr/local/sbin/insert-self-into-dns.sh
- shared:/shared
# trafficmonitor is an HTTP service that monitors the caches in a CDN for a variety of metrics
@@ -131,8 +122,6 @@ services:
depends_on:
- enroller
volumes:
- - ./dns/set-dns.sh:/usr/local/sbin/set-dns.sh
- - ./dns/insert-self-into-dns.sh:/usr/local/sbin/insert-self-into-dns.sh
- shared:/shared
domainname: infra.ciab.test
env_file:
@@ -155,8 +144,6 @@ services:
- variables.env
hostname: trafficrouter
volumes:
- - ./dns/set-dns.sh:/usr/local/sbin/set-dns.sh
- - ./dns/insert-self-into-dns.sh:/usr/local/sbin/insert-self-into-dns.sh
- shared:/shared
# trafficstats collect traffic information
@@ -173,8 +160,6 @@ services:
- variables.env
hostname: trafficstats
volumes:
- - ./dns/set-dns.sh:/usr/local/sbin/set-dns.sh
- - ./dns/insert-self-into-dns.sh:/usr/local/sbin/insert-self-into-dns.sh
- shared:/shared
influxdb:
@@ -188,8 +173,6 @@ services:
env_file:
- variables.env
volumes:
- - ./dns/set-dns.sh:/usr/local/sbin/set-dns.sh
- - ./dns/insert-self-into-dns.sh:/usr/local/sbin/insert-self-into-dns.sh
- shared:/shared
# trafficvault runs a riak container to store private keys
@@ -204,8 +187,6 @@ services:
labels:
- "com.basho.riak.cluster.name=trafficvault"
volumes:
- - ./dns/set-dns.sh:/usr/local/sbin/set-dns.sh
- - ./dns/insert-self-into-dns.sh:/usr/local/sbin/insert-self-into-dns.sh
- schemas:/etc/riak/schemas
- shared:/shared
domainname: infra.ciab.test
@@ -218,15 +199,12 @@ services:
privileged: True
build:
context: ../..
- dockerfile: infrastructure/cdn-in-a-box/cache/Dockerfile
+ dockerfile: infrastructure/cdn-in-a-box/edge/Dockerfile
domainname: infra.ciab.test
env_file:
- variables.env
hostname: edge
volumes:
- - ./dns/set-dns.sh:/usr/local/sbin/set-dns.sh
- - ./dns/insert-self-into-dns.sh:/usr/local/sbin/insert-self-into-dns.sh
- - ./edge/run.sh:/opt/init.d/99-run.sh
- shared:/shared
# mid cache
@@ -234,15 +212,12 @@ services:
privileged: True
build:
context: ../..
- dockerfile: infrastructure/cdn-in-a-box/cache/Dockerfile
+ dockerfile: infrastructure/cdn-in-a-box/mid/Dockerfile
domainname: infra.ciab.test
env_file:
- variables.env
hostname: mid
volumes:
- - ./dns/set-dns.sh:/usr/local/sbin/set-dns.sh
- - ./dns/insert-self-into-dns.sh:/usr/local/sbin/insert-self-into-dns.sh
- - ./mid/run.sh:/opt/init.d/99-run.sh
- shared:/shared
# origin provides the content to be distributed through the CDN caches
@@ -257,10 +232,7 @@ services:
- variables.env
hostname: origin
volumes:
- - ./dns/set-dns.sh:/usr/local/sbin/set-dns.sh
- - ./dns/insert-self-into-dns.sh:/usr/local/sbin/insert-self-into-dns.sh
- shared:/shared
- - ./origin/content:/var/www/html
# enroller provides a way to register component instances with traffic_ops
@@ -274,8 +246,6 @@ services:
- variables.env
hostname: enroller
volumes:
- - ./dns/set-dns.sh:/usr/local/sbin/set-dns.sh
- - ./dns/insert-self-into-dns.sh:/usr/local/sbin/insert-self-into-dns.sh
- shared:/shared
# Bind9 DNS services work in combination with the traffic router to route clients to the optimal cache
@@ -286,8 +256,6 @@ services:
env_file:
- variables.env
volumes:
- - ./dns/set-self-dns.sh:/usr/local/sbin/set-self-dns.sh
- - ./dns/set-dns-update.sh:/usr/local/sbin/set-dns-update.sh
- shared:/shared
hostname: dns
domainname: infra.ciab.test
@@ -303,8 +271,6 @@ services:
- variables.env
volumes:
- shared:/shared
- - ./dns/set-dns.sh:/usr/local/sbin/set-dns.sh
- - ./dns/insert-self-into-dns.sh:/usr/local/sbin/insert-self-into-dns.sh
domainname: infra.ciab.test
volumes:
diff --git a/infrastructure/cdn-in-a-box/cache/Dockerfile b/infrastructure/cdn-in-a-box/edge/Dockerfile
similarity index 92%
copy from infrastructure/cdn-in-a-box/cache/Dockerfile
copy to infrastructure/cdn-in-a-box/edge/Dockerfile
index 027d391..fc0f798 100644
--- a/infrastructure/cdn-in-a-box/cache/Dockerfile
+++ b/infrastructure/cdn-in-a-box/edge/Dockerfile
@@ -21,7 +21,7 @@
# Based on CentOS 7.2
############################################################
-FROM centos:7
+FROM centos:7 AS common-cache-server-layers
EXPOSE 80
@@ -65,9 +65,17 @@ RUN touch /var/log/ort.log && \
ADD infrastructure/cdn-in-a-box/cache/run.sh infrastructure/cdn-in-a-box/traffic_ops/to-access.sh infrastructure/cdn-in-a-box/enroller/server_template.json /
+COPY infrastructure/cdn-in-a-box/dns/set-dns.sh \
+ infrastructure/cdn-in-a-box/dns/insert-self-into-dns.sh \
+ /usr/local/sbin/
+
ARG ORT_RPM=infrastructure/cdn-in-a-box/cache/traffic_ops_ort.rpm
ADD $ORT_RPM /
RUN rpm -Uvh --nodeps /$(basename $ORT_RPM) &&\
rm /$(basename $ORT_RPM)
+FROM common-cache-server-layers AS edge
+
+COPY infrastructure/cdn-in-a-box/edge/init.d/ /opt/init.d/
+
CMD /run.sh
diff --git a/infrastructure/cdn-in-a-box/edge/run.sh b/infrastructure/cdn-in-a-box/edge/init.d/99-run.sh
similarity index 100%
rename from infrastructure/cdn-in-a-box/edge/run.sh
rename to infrastructure/cdn-in-a-box/edge/init.d/99-run.sh
diff --git a/infrastructure/cdn-in-a-box/enroller/Dockerfile b/infrastructure/cdn-in-a-box/enroller/Dockerfile
index 0fc2755..8ed5bae 100644
--- a/infrastructure/cdn-in-a-box/enroller/Dockerfile
+++ b/infrastructure/cdn-in-a-box/enroller/Dockerfile
@@ -43,5 +43,9 @@ COPY --from=enroller-builder \
/go/src/github.com/apache/trafficcontrol/infrastructure/cdn-in-a-box/traffic_ops/to-access.sh \
/
+COPY infrastructure/cdn-in-a-box/dns/set-dns.sh \
+ infrastructure/cdn-in-a-box/dns/insert-self-into-dns.sh \
+ /usr/local/sbin/
+
WORKDIR /shared/enroller
CMD /run.sh
diff --git a/infrastructure/cdn-in-a-box/cache/Dockerfile b/infrastructure/cdn-in-a-box/mid/Dockerfile
similarity index 92%
rename from infrastructure/cdn-in-a-box/cache/Dockerfile
rename to infrastructure/cdn-in-a-box/mid/Dockerfile
index 027d391..046321a 100644
--- a/infrastructure/cdn-in-a-box/cache/Dockerfile
+++ b/infrastructure/cdn-in-a-box/mid/Dockerfile
@@ -21,7 +21,7 @@
# Based on CentOS 7.2
############################################################
-FROM centos:7
+FROM centos:7 AS common-cache-server-layers
EXPOSE 80
@@ -65,9 +65,17 @@ RUN touch /var/log/ort.log && \
ADD infrastructure/cdn-in-a-box/cache/run.sh infrastructure/cdn-in-a-box/traffic_ops/to-access.sh infrastructure/cdn-in-a-box/enroller/server_template.json /
+COPY infrastructure/cdn-in-a-box/dns/set-dns.sh \
+ infrastructure/cdn-in-a-box/dns/insert-self-into-dns.sh \
+ /usr/local/sbin/
+
ARG ORT_RPM=infrastructure/cdn-in-a-box/cache/traffic_ops_ort.rpm
ADD $ORT_RPM /
RUN rpm -Uvh --nodeps /$(basename $ORT_RPM) &&\
rm /$(basename $ORT_RPM)
+FROM common-cache-server-layers AS mid
+
+COPY infrastructure/cdn-in-a-box/mid/init.d/ /opt/init.d/
+
CMD /run.sh
diff --git a/infrastructure/cdn-in-a-box/mid/run.sh b/infrastructure/cdn-in-a-box/mid/init.d/99-run.sh
similarity index 100%
rename from infrastructure/cdn-in-a-box/mid/run.sh
rename to infrastructure/cdn-in-a-box/mid/init.d/99-run.sh
diff --git a/infrastructure/cdn-in-a-box/optional/docker-compose.grafana.yml b/infrastructure/cdn-in-a-box/optional/docker-compose.grafana.yml
index f9b3b1f..54682a6 100644
--- a/infrastructure/cdn-in-a-box/optional/docker-compose.grafana.yml
+++ b/infrastructure/cdn-in-a-box/optional/docker-compose.grafana.yml
@@ -49,8 +49,6 @@ services:
env_file:
- variables.env
volumes:
- - ./dns/set-dns.sh:/usr/local/sbin/set-dns.sh
- - ./dns/insert-self-into-dns.sh:/usr/local/sbin/insert-self-into-dns.sh
- shared:/shared
volumes:
diff --git a/infrastructure/cdn-in-a-box/optional/docker-compose.socksproxy.yml b/infrastructure/cdn-in-a-box/optional/docker-compose.socksproxy.yml
index 6e9d80f..f98a04b 100644
--- a/infrastructure/cdn-in-a-box/optional/docker-compose.socksproxy.yml
+++ b/infrastructure/cdn-in-a-box/optional/docker-compose.socksproxy.yml
@@ -47,8 +47,6 @@ services:
hostname: socksproxy
domainname: infra.ciab.test
volumes:
- - ./dns/set-dns.sh:/usr/local/sbin/set-dns.sh
- - ./dns/insert-self-into-dns.sh:/usr/local/sbin/insert-self-into-dns.sh
- shared:/shared
volumes:
diff --git a/infrastructure/cdn-in-a-box/optional/docker-compose.vnc.yml b/infrastructure/cdn-in-a-box/optional/docker-compose.vnc.yml
index fee97f2..5bc395f 100644
--- a/infrastructure/cdn-in-a-box/optional/docker-compose.vnc.yml
+++ b/infrastructure/cdn-in-a-box/optional/docker-compose.vnc.yml
@@ -60,8 +60,6 @@ services:
hostname: vnc
domainname: infra.ciab.test
volumes:
- - ./dns/set-dns.sh:/usr/local/sbin/set-dns.sh
- - ./dns/insert-self-into-dns.sh:/usr/local/sbin/insert-self-into-dns.sh
- shared:/shared
volumes:
diff --git a/infrastructure/cdn-in-a-box/optional/docker-compose.vpn.yml b/infrastructure/cdn-in-a-box/optional/docker-compose.vpn.yml
index 0b88ad0..699ff70 100644
--- a/infrastructure/cdn-in-a-box/optional/docker-compose.vpn.yml
+++ b/infrastructure/cdn-in-a-box/optional/docker-compose.vpn.yml
@@ -51,8 +51,6 @@ services:
env_file:
- variables.env
volumes:
- - ./dns/set-dns.sh:/usr/local/sbin/set-dns.sh
- - ./dns/insert-self-into-dns.sh:/usr/local/sbin/insert-self-into-dns.sh
- ./optional/vpn/vpnca:/vpnca
- shared:/shared
diff --git a/infrastructure/cdn-in-a-box/optional/grafana/Dockerfile b/infrastructure/cdn-in-a-box/optional/grafana/Dockerfile
index a7fc121..4133534 100644
--- a/infrastructure/cdn-in-a-box/optional/grafana/Dockerfile
+++ b/infrastructure/cdn-in-a-box/optional/grafana/Dockerfile
@@ -38,5 +38,9 @@ RUN cd ~ \
&& rm /traffic_stats.rpm \
&& rm ~/traffic_stats-*.cpio
+COPY dns/set-dns.sh \
+ dns/insert-self-into-dns.sh \
+ /usr/local/sbin/
+
ENTRYPOINT [ "/run-grafana.sh" ]
EXPOSE 443
diff --git a/infrastructure/cdn-in-a-box/optional/socksproxy/Dockerfile b/infrastructure/cdn-in-a-box/optional/socksproxy/Dockerfile
index 87f40e9..e0d91e8 100644
--- a/infrastructure/cdn-in-a-box/optional/socksproxy/Dockerfile
+++ b/infrastructure/cdn-in-a-box/optional/socksproxy/Dockerfile
@@ -39,6 +39,10 @@ RUN yum install -y net-tools bind-utils iproute wget curl automake autoconf gcc
COPY optional/socksproxy/sockd.conf /etc
COPY optional/socksproxy/run.sh /
+COPY dns/set-dns.sh \
+ dns/insert-self-into-dns.sh \
+ /usr/local/sbin/
+
EXPOSE 1080
CMD ["/run.sh"]
diff --git a/infrastructure/cdn-in-a-box/optional/vnc/Dockerfile b/infrastructure/cdn-in-a-box/optional/vnc/Dockerfile
index b57483c..fa294d0 100644
--- a/infrastructure/cdn-in-a-box/optional/vnc/Dockerfile
+++ b/infrastructure/cdn-in-a-box/optional/vnc/Dockerfile
@@ -47,6 +47,10 @@ RUN systemd-machine-id-setup && \
ADD optional/vnc/run.sh /
+COPY dns/set-dns.sh \
+ dns/insert-self-into-dns.sh \
+ /usr/local/sbin/
+
EXPOSE 5909/tcp
CMD /run.sh
diff --git a/infrastructure/cdn-in-a-box/optional/vpn/Dockerfile b/infrastructure/cdn-in-a-box/optional/vpn/Dockerfile
index 82b82b7..7e2f3153 100644
--- a/infrastructure/cdn-in-a-box/optional/vpn/Dockerfile
+++ b/infrastructure/cdn-in-a-box/optional/vpn/Dockerfile
@@ -25,5 +25,10 @@ RUN cd /root && \
mkdir /vpnca
ADD ./optional/vpn/server.conf /etc/openvpn/server.conf
ADD ./optional/vpn/run.sh ./optional/vpn/vars /
+
+COPY dns/set-dns.sh \
+ dns/insert-self-into-dns.sh \
+ /usr/local/sbin/
+
ENTRYPOINT /run.sh
EXPOSE 443
diff --git a/infrastructure/cdn-in-a-box/origin/Dockerfile b/infrastructure/cdn-in-a-box/origin/Dockerfile
index 60c29d2..38672e0 100644
--- a/infrastructure/cdn-in-a-box/origin/Dockerfile
+++ b/infrastructure/cdn-in-a-box/origin/Dockerfile
@@ -27,11 +27,16 @@ RUN apk add --no-cache lighttpd bash curl bind-tools
RUN rm /etc/lighttpd/lighttpd.conf
RUN rm -rf /var/www/localhost/
-RUN mkdir -p /var/www/html/
+
+ADD origin/content /var/www/html/
ADD origin/lighttpd.conf /etc/lighttpd/lighttpd.conf
ADD origin/run.sh traffic_ops/to-access.sh /
+COPY dns/set-dns.sh \
+ dns/insert-self-into-dns.sh \
+ /usr/local/sbin/
+
EXPOSE 80
CMD /run.sh
diff --git a/infrastructure/cdn-in-a-box/readiness/Dockerfile b/infrastructure/cdn-in-a-box/readiness/Dockerfile
index 8267322..4e2bdd1 100644
--- a/infrastructure/cdn-in-a-box/readiness/Dockerfile
+++ b/infrastructure/cdn-in-a-box/readiness/Dockerfile
@@ -28,6 +28,9 @@ RUN apk add --no-cache --update \
# to-access.sh (sourced, get to-get and env vars)
# run.sh (wait on TO, then to-get deliveryservices, then curl the exampleURLs)
COPY readiness/run.sh traffic_ops/to-access.sh /opt/readiness/
+COPY dns/set-dns.sh \
+ dns/insert-self-into-dns.sh \
+ /usr/local/sbin/
WORKDIR /opt/readiness
CMD ./run.sh
diff --git a/infrastructure/cdn-in-a-box/smtp/Dockerfile b/infrastructure/cdn-in-a-box/smtp/Dockerfile
index cfeb41c..fe3e477 100644
--- a/infrastructure/cdn-in-a-box/smtp/Dockerfile
+++ b/infrastructure/cdn-in-a-box/smtp/Dockerfile
@@ -25,6 +25,10 @@ RUN apk add --no-cache \
COPY traffic_ops/to-access.sh /
COPY smtp/run.sh /usr/bin/
+COPY dns/set-dns.sh \
+ dns/insert-self-into-dns.sh \
+ /usr/local/sbin/
+
# Unset entrypoint
ENTRYPOINT []
CMD ["/usr/bin/env", "run.sh"]
diff --git a/infrastructure/cdn-in-a-box/traffic_monitor/Dockerfile b/infrastructure/cdn-in-a-box/traffic_monitor/Dockerfile
index 5c16c6a..93f43e1 100644
--- a/infrastructure/cdn-in-a-box/traffic_monitor/Dockerfile
+++ b/infrastructure/cdn-in-a-box/traffic_monitor/Dockerfile
@@ -47,6 +47,10 @@ ADD enroller/server_template.json \
traffic_ops/to-access.sh \
/
+COPY dns/set-dns.sh \
+ dns/insert-self-into-dns.sh \
+ /usr/local/sbin/
+
EXPOSE 80
ADD traffic_monitor/run.sh /
CMD /run.sh
diff --git a/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile b/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile
index c7fcc72..6485182 100644
--- a/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile
+++ b/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile
@@ -107,6 +107,11 @@ ADD infrastructure/cdn-in-a-box/enroller/server_template.json \
infrastructure/cdn-in-a-box/variables.env \
/
+COPY infrastructure/cdn-in-a-box/dns/set-dns.sh \
+ infrastructure/cdn-in-a-box/dns/insert-self-into-dns.sh \
+ infrastructure/cdn-in-a-box/traffic_ops/set-to-ips-from-dns.sh \
+ /usr/local/sbin/
+
ADD infrastructure/cdn-in-a-box/traffic_ops_data /traffic_ops_data
CMD /run.sh
diff --git a/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile-db b/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile-db
index 040a9ed..3dd73a1 100644
--- a/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile-db
+++ b/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile-db
@@ -29,5 +29,10 @@ COPY traffic_ops/initdb.d /docker-entrypoint-initdb.d
COPY traffic_ops/run-db.sh /
COPY traffic_ops/to-access.sh /
COPY enroller/server_template.json /
+
+COPY dns/set-dns.sh \
+ dns/insert-self-into-dns.sh \
+ /usr/local/sbin/
+
RUN chmod -R a+rx /run-db.sh /docker-entrypoint-initdb.d
ENTRYPOINT /run-db.sh
diff --git a/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile-go b/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile-go
index 2098b86..4003cf3 100644
--- a/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile-go
+++ b/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile-go
@@ -58,6 +58,10 @@ COPY enroller/server_template.json \
traffic_ops/to-access.sh \
/
+COPY dns/set-dns.sh \
+ dns/insert-self-into-dns.sh \
+ /usr/local/sbin/
+
WORKDIR /opt/traffic_ops/app
EXPOSE 443
CMD /run-go.sh
diff --git a/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile-go.dockerignore b/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile-go.dockerignore
index 5b1659f..522f63d 100644
--- a/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile-go.dockerignore
+++ b/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile-go.dockerignore
@@ -23,5 +23,7 @@
# - https://github.com/docker/compose/pull/6865
# - https://docs.docker.com/develop/develop-images/build_enhancements/
*
+!dns/set-dns.sh
+!dns/insert-self-into-dns.sh
!enroller/
!traffic_ops/
diff --git a/infrastructure/cdn-in-a-box/traffic_ops_integration_test/Dockerfile b/infrastructure/cdn-in-a-box/traffic_ops_integration_test/Dockerfile
index ee98c9b..ddf1aeb 100644
--- a/infrastructure/cdn-in-a-box/traffic_ops_integration_test/Dockerfile
+++ b/infrastructure/cdn-in-a-box/traffic_ops_integration_test/Dockerfile
@@ -76,6 +76,10 @@ COPY --from=integration-builder \
/go/bin/go-junit-report \
/opt/integration/app/
+COPY infrastructure/cdn-in-a-box/dns/set-dns.sh \
+ infrastructure/cdn-in-a-box/dns/insert-self-into-dns.sh \
+ /usr/local/sbin/
+
VOLUME ["/junit"]
WORKDIR /opt/integration/app
diff --git a/infrastructure/cdn-in-a-box/traffic_portal/Dockerfile b/infrastructure/cdn-in-a-box/traffic_portal/Dockerfile
index 92435ea..b44c035 100644
--- a/infrastructure/cdn-in-a-box/traffic_portal/Dockerfile
+++ b/infrastructure/cdn-in-a-box/traffic_portal/Dockerfile
@@ -50,6 +50,10 @@ ADD enroller/server_template.json \
traffic_portal/run.sh \
traffic_ops/to-access.sh /
+COPY dns/set-dns.sh \
+ dns/insert-self-into-dns.sh \
+ /usr/local/sbin/
+
EXPOSE 443
CMD /run.sh
diff --git a/infrastructure/cdn-in-a-box/traffic_portal_integration_test/Dockerfile b/infrastructure/cdn-in-a-box/traffic_portal_integration_test/Dockerfile
index 69b1396..1910f6f 100644
--- a/infrastructure/cdn-in-a-box/traffic_portal_integration_test/Dockerfile
+++ b/infrastructure/cdn-in-a-box/traffic_portal_integration_test/Dockerfile
@@ -69,6 +69,8 @@ RUN webdriver-manager clean && \
COPY infrastructure/cdn-in-a-box/traffic_ops/to-access.sh \
infrastructure/cdn-in-a-box/traffic_portal_integration_test/run.sh \
+ infrastructure/cdn-in-a-box/dns/set-dns.sh \
+ infrastructure/cdn-in-a-box/dns/insert-self-into-dns.sh \
/usr/local/sbin/
CMD run.sh
diff --git a/infrastructure/cdn-in-a-box/traffic_router/Dockerfile b/infrastructure/cdn-in-a-box/traffic_router/Dockerfile
index ab411f8..0eff38b 100644
--- a/infrastructure/cdn-in-a-box/traffic_router/Dockerfile
+++ b/infrastructure/cdn-in-a-box/traffic_router/Dockerfile
@@ -45,6 +45,10 @@ ADD enroller/server_template.json \
traffic_ops/to-access.sh \
/
+COPY dns/set-dns.sh \
+ dns/insert-self-into-dns.sh \
+ /usr/local/sbin/
+
EXPOSE 53 80 3333 3443
CMD /run.sh
diff --git a/infrastructure/cdn-in-a-box/traffic_stats/Dockerfile b/infrastructure/cdn-in-a-box/traffic_stats/Dockerfile
index 011cbd1..60a4622 100644
--- a/infrastructure/cdn-in-a-box/traffic_stats/Dockerfile
+++ b/infrastructure/cdn-in-a-box/traffic_stats/Dockerfile
@@ -43,4 +43,8 @@ ADD enroller/server_template.json \
traffic_stats/run.sh \
/
+COPY dns/set-dns.sh \
+ dns/insert-self-into-dns.sh \
+ /usr/local/sbin/
+
ENTRYPOINT /run.sh
diff --git a/infrastructure/cdn-in-a-box/traffic_stats/Dockerfile-influxdb b/infrastructure/cdn-in-a-box/traffic_stats/Dockerfile-influxdb
index b3fef58..3f266d0 100644
--- a/infrastructure/cdn-in-a-box/traffic_stats/Dockerfile-influxdb
+++ b/infrastructure/cdn-in-a-box/traffic_stats/Dockerfile-influxdb
@@ -32,4 +32,8 @@ ADD enroller/server_template.json \
traffic_stats/run-influxdb.sh \
/
+COPY dns/set-dns.sh \
+ dns/insert-self-into-dns.sh \
+ /usr/local/sbin/
+
ENTRYPOINT ["/run-influxdb.sh"]
diff --git a/infrastructure/cdn-in-a-box/traffic_vault/Dockerfile b/infrastructure/cdn-in-a-box/traffic_vault/Dockerfile
index c3444c0..4172554 100644
--- a/infrastructure/cdn-in-a-box/traffic_vault/Dockerfile
+++ b/infrastructure/cdn-in-a-box/traffic_vault/Dockerfile
@@ -34,4 +34,8 @@ ADD enroller/server_template.json \
traffic_ops/to-access.sh \
/
+COPY dns/set-dns.sh \
+ dns/insert-self-into-dns.sh \
+ /usr/local/sbin/
+
CMD /run.sh