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 2022/01/31 23:21:57 UTC

[GitHub] [trafficcontrol] ocket8888 opened a new pull request #6532: CDN-in-a-Box for Developers

ocket8888 opened a new pull request #6532:
URL: https://github.com/apache/trafficcontrol/pull/6532


   This PR contains a new "CDN-in-a-Box" that's better suited to rapid changes. It will rebuild components when they change, supports debug connections by default, and uses lighter images than regular CiaB - based on Alpine. No rebuilding when making changes, no creating RPM packages only to unpack them a moment later.
   
   This new setup is **not** complete. There are a few problems. The `t3c`/cache server only runs `t3c` on-demand, which is not how that's typically done in production environments. Also only one `t3c` sub-command can be debugged at a time. Plus, Traffic Router just doesn't work at all. Currently, the stack builds TR and starts tomcat, but I can't get it to do anything meaningful.
   
   There is no documentation and there are no tests. I'm opening this because I was told it could be helpful, but it does not represent a completed body of work. I personally tend to use it for Traffic Ops development.
   
   <hr/>
   
   ## Which Traffic Control components are affected by this PR?
   - Traffic Portal (package-lock.json changes)
   
   ## What is the best way to verify this PR?
   To use it, from the repo's root: `source ./dev/atc.dev.sh` and then run `atc -h` to see usage.
   
   ## PR submission checklist
   - [ ] This PR has tests
   - [ ] This PR has documentation
   - [ ] This PR has a CHANGELOG.md entry
   - [x] This PR **DOES NOT FIX A SERIOUS SECURITY VULNERABILITY**


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_router/run.sh
##########
@@ -0,0 +1,39 @@
+#!/bin/sh
+# 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 -o errexit
+
+cd "$TC/traffic_router"
+
+mvn -Dmaven.test.skip=true compile -P \!rpm-build
+mvn -Dmaven.test.skip=true package -P \!rpm-build

Review comment:
       No need for `mvn package` now that db89b273d2 makes `webapps/ROOT` symlink to the build directory

##########
File path: dev/traffic_ops/seed.psql
##########
@@ -94,6 +99,10 @@ INSERT INTO parameter (
 	'rascal.properties',
 	'health.polling.format',
 	'stats_over_http'
+), (
+	'CRConfig.json',
+	'geolocation.polling.url',

Review comment:
       Still need `coveragezone.polling.url` in order for TR to accept and save the CRConfig

##########
File path: dev/traffic_router/Dockerfile
##########
@@ -15,12 +15,17 @@ FROM alpine:latest AS trafficrouter-dev
 
 ENV TC=/root/go/src/github.com/apache/trafficcontrol
 VOLUME /root/go/src/github.com/apache/trafficcontrol
-ENV JPDA_OPTS="-agentlib:jdwp=transport=dt_socket,address=*:5005,server=y,suspend=n" JAVA_HOME=/usr/lib/jvm/java-11-openjdk M2_HOME=/root/go/src/github.com/apache/trafficcontrol/.m2 CATALINA_BASE=/opt/traffic_router
+ENV JPDA_OPTS="-agentlib:jdwp=transport=dt_socket,address=*:5005,server=y,suspend=n" JAVA_HOME=/usr/lib/jvm/java-11-openjdk M2_HOME=/root/go/src/github.com/apache/trafficcontrol/.m2 CATALINA_BASE=/opt/traffic_router TRAFFIC_MONITOR_HOSTS=trafficmonitor
 EXPOSE 3053:53/tcp 3053:53/udp 3080:80 3443:443 3333:3333 2222:3443 5005:5005
 
-RUN apk add --no-cache openjdk11 inotify-tools maven && ln -s /usr/lib/jvm/java-11-openjdk/bin/jdb /bin/jdb
+RUN apk add --no-cache openjdk11 inotify-tools maven tomcat-native openssl && ln -s /usr/lib/jvm/java-11-openjdk/bin/jdb /bin/jdb
 
 ADD https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.43/bin/apache-tomcat-9.0.43.tar.gz /opt/tomcat.tgz
+
+ARG USER
+RUN adduser -H -D ${USER}
+RUN chown -R ${USER} /opt /usr/share/java/ /root
+USER ${USER}

Review comment:
       Oh wow, I didn't know setting `USER` and not `UID` would fix permissions

##########
File path: dev/traffic_router/conf/startup.properties
##########
@@ -1,30 +0,0 @@
-#
-# 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.
-
-# Any environment variables you define here will become part of the startup
-# environment for the 'traffic_router' service. It is a good place to set
-# command line arguments for the Java command line or any environment specific
-# setting you want available to the traffic_router process.
-# This file is not replaced by the update process when a new version of traffic
-# router is installed.
-CATALINA_OPTS="\
-	-server -Xms2g -Xmx8g \
-	-Dlog4j.configuration=file:///opt/tomcat/conf/log4j2.xml \
-	-Djava.library.path=/usr/lib \
-	-Dorg.apache.catalina.connector.Response.ENFORCE_ENCODING_IN_GET_WRITER=false \
-	-XX:+UseG1GC \
-	-XX:+UnlockExperimentalVMOptions \
-	-XX:InitiatingHeapOccupancyPercent=30"
-JAVA_OPTS="\
-	-Djava.awt.headless=true \
-	-Djava.security.egd=file:/dev/./urandom"

Review comment:
       Are `CATALINA_OPTS` and `JAVA_OPTS` still set somewhere?

##########
File path: dev/traffic_ops/seed.psql
##########
@@ -45,7 +45,7 @@ INSERT INTO snapshot (
 	monitoring
 ) VALUES (
 	'dev',
-	'{"config":{"dnssec.enabled":"false","domain_name":"ciab.test"},"contentServers":{"edge":{"cacheGroup":"dev","fqdn":"edge.dev.ciab.test","hashCount":999,"hashId":"edge","httpsPort":443,"interfaceName":"eth0","ip":"129.0.0.2","ip6":"","locationId":"dev","port":80,"profile":"EDGE_dev","status":"REPORTED","type":"EDGE","routingDisabled":0}},"deliveryServices":{"dev":{"anonymousBlockingEnabled":"false","coverageZoneOnly":"false","deepCachingType":"NEVER","dispersion":{"limit":1,"shuffled":"true"},"domains":["dev.ciab.test"],"ecsEnabled":"false","geolocationProvider":"maxmindGeolocationService","ip6RoutingEnabled":"false","matchsets":[{"protocol":"HTTP","matchlist":[{"regex":".*\\\\.dev\\\\..*","match-type":"HOST"}]}],"protocol":{"acceptHttps":"false","redirectToHttps":"false"},"regionalGeoBlocking":"false","routingName":"cdn","soa":{"admin":"traffic_ops","expire":"604800","minimum":"30","refresh":"28800","retry":"7200"},"sslEnabled":"false","ttls":{"A":"","AAAA":"","NS":"3600","SOA":"8
 6400"}}},"edgeLocations":{"dev":{"latitude":0,"longitude":0,"backupLocations":{"fallbackToClosest":"true"},"localizationMethods":["GEO","CZ","DEEP_CZ"]}},"monitors":{"trafficmonitor":{"fqdn":"trafficmonitor.dev.ciab.test","httpsPort":null,"ip":"129.0.0.1","ip6":"","location":"dev","port":80,"profile":"RASCAL_TM_dev","status":"ONLINE"}},"stats":{"CDN_name":"dev","date":1643833749,"tm_host":"","tm_user":"admin","tm_version":"development"}}',
+	'{"config":{"dnssec.enabled":"false","domain_name":"ciab.test"},"contentServers":{"edge":{"cacheGroup":"dev","fqdn":"edge.dev.ciab.test","hashCount":999,"hashId":"edge","httpsPort":443,"interfaceName":"eth0","ip":"129.0.0.2","ip6":"","locationId":"dev","port":80,"profile":"EDGE_dev","status":"REPORTED","type":"EDGE","routingDisabled":0}},"deliveryServices":{"dev":{"anonymousBlockingEnabled":"false","coverageZoneOnly":"false","deepCachingType":"NEVER","dispersion":{"limit":1,"shuffled":"true"},"domains":["dev.ciab.test"],"ecsEnabled":"false","geolocationProvider":"maxmindGeolocationService","ip6RoutingEnabled":"false","matchsets":[{"protocol":"HTTP","matchlist":[{"regex":".*\\\\.dev\\\\..*","match-type":"HOST"}]}],"protocol":{"acceptHttps":"false","redirectToHttps":"false"},"regionalGeoBlocking":"false","routingName":"cdn","soa":{"admin":"traffic_ops","expire":"604800","minimum":"30","refresh":"28800","retry":"7200"},"sslEnabled":"false","ttls":{"A":"","AAAA":"","NS":"3600","SOA":"8
 6400"}}},"edgeLocations":{"dev":{"latitude":0,"longitude":0,"backupLocations":{"fallbackToClosest":"true"},"localizationMethods":["GEO","CZ","DEEP_CZ"]}},"monitors":{"trafficmonitor":{"fqdn":"trafficmonitor.dev.ciab.test","httpsPort":null,"ip":"129.0.0.1","ip6":"","location":"dev","port":80,"profile":"RASCAL_TM_dev","status":"ONLINE"}},"stats":{"CDN_name":"dev","date":1643833749,"tm_host":"trafficops","tm_user":"admin","tm_version":"development"}}',

Review comment:
       The `tm_host` value is derived from the `tm.url` parameter in the global profile, setting it here does not do anything




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: .github/actions/pr-to-update-go/pr_to_update_go/go_pr_maker.py
##########
@@ -24,81 +24,190 @@
 import re
 import subprocess
 import sys
-from typing import Optional
+from typing import Optional, TypedDict, Any, Final

Review comment:
       Were these *pr-to-update-go* action changes meant for a different PR?




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/t3c/Dockerfile
##########
@@ -0,0 +1,48 @@
+# 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:latest AS traffic-server-builder
+
+RUN apk add --no-cache build-base perl libexecinfo-dev pcre-dev libressl-dev libtool linux-headers openssl-dev zlib-dev
+ADD https://downloads.apache.org/trafficserver/trafficserver-9.1.0.tar.bz2 /
+RUN tar -xf trafficserver-9.1.0.tar.bz2 && cd trafficserver-9.1.0 && mkdir /ats && ./configure --prefix / --enable-experimental-plugins && make && make install && ls -R /ats

Review comment:
       `-j6` can actually cause it to slow down on CPUs with fewer than 6 cores; I'll use `-j` with no argument to allow `make` to select the appropriate DoM for the host CPU.




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman commented on pull request #6532: CDN-in-a-Box for Developers

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


   >  CDN-in-a-Box CI / ciab-build (pull_request) Failing after 1m — ciab-build 
   
   The makefiles and the entire `dev` directory should be in the CDN in a Box GitHub Actions workflow's *paths-ignore* lists


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_router/run.sh
##########
@@ -18,7 +18,7 @@
 
 set -o errexit
 
-cd "$TC/traffic_router"
+cd "$TC/dev/traffic_router"
 
 mvn -Dmaven.test.skip=true compile package -P \!rpm-build

Review comment:
       The working directory should still be `$TC/traffic_router` for building TR




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_router/conf/startup.properties
##########
@@ -0,0 +1,30 @@
+#
+# 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.
+
+# Any environment variables you define here will become part of the startup
+# environment for the 'traffic_router' service. It is a good place to set
+# command line arguments for the Java command line or any environment specific
+# setting you want available to the traffic_router process.
+# This file is not replaced by the update process when a new version of traffic
+# router is installed.
+CATALINA_OPTS="\

Review comment:
       Added that one




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_ops/Dockerfile
##########
@@ -0,0 +1,38 @@
+#
+#  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.
+#
+FROM alpine:latest AS certbuilder
+RUN apk add --no-cache openssl
+RUN openssl genrsa -passout pass:x -out server.pass.key 2048 && \
+	openssl rsa -passin pass:x -in server.pass.key -out server.key && \
+	rm server.pass.key && \
+	openssl req -new -key server.key -out server.csr \
+		-subj "/C=US/ST=CO/L=Denver/O=Apache/OU=Traffic Control/CN=trafficops.dev.ciab.test" && \
+	openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt && \
+	openssl rand 32 | base64 > /aes.key
+
+FROM alpine:latest AS trafficops-dev
+
+ENV TC="/root/go/src/github.com/apache/trafficcontrol/"
+VOLUME /root/go/src/github.com/apache/trafficcontrol
+ENV ADMIN="$TC/traffic_ops/app/db/admin"
+EXPOSE 443 6444
+
+COPY --from=certbuilder /server.key /server.crt /aes.key /
+RUN apk add --no-cache make inotify-tools go postgresql-client && go install github.com/go-delve/delve/cmd/dlv@latest && ln -s /root/go/bin/dlv /usr/bin/dlv

Review comment:
       I didn't know you could use the docker ignore file to specifically include things, that makes the decision easy - I thought it'd need to be updated every time there was a structural change to the repo layout, not true it seems.




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: docker-compose.yml
##########
@@ -0,0 +1,116 @@
+# 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.
+
+---
+version: '3.5'
+
+services:
+    trafficops:
+        build:
+            context: dev/traffic_ops/
+        depends_on:
+            - db
+        domainname: dev.ciab.test

Review comment:
       Instead of specifying the domain, add the `trafficops` service to a network:
   ```yml
           networks:
             - ciab
   ```

##########
File path: docker-compose.yml
##########
@@ -0,0 +1,116 @@
+# 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.
+
+---
+version: '3.5'
+
+services:
+    trafficops:
+        build:
+            context: dev/traffic_ops/
+        depends_on:
+            - db
+        domainname: dev.ciab.test
+        hostname: trafficops
+        image: trafficops-dev
+        ports:
+            - 6443:443
+            - 6444:6444
+        volumes:
+            - .:/root/go/src/github.com/apache/trafficcontrol/
+
+    db:
+        image: postgres:13.2-alpine
+        ports:
+            - 5432:5432
+        environment:
+            - POSTGRES_PASSWORD=twelve12
+        hostname: db
+        domainname: dev.ciab.test
+
+    trafficportal:
+        build:
+            context: dev/traffic_portal
+        depends_on:
+            - trafficops
+        hostname: trafficportal
+        domainname: dev.ciab.test
+        image: trafficportal-dev
+        ports:
+            - 444:443
+        volumes:
+            - .:/root/go/src/github.com/apache/trafficcontrol
+
+    tpv2:
+        build:
+            context: dev/tpv2
+        depends_on:
+            - trafficops
+        hostname: tpv2
+        domainname: dev.ciab.test

Review comment:
       Instead of specifying the domain, add the `tpv2` service to a network:
   ```yml
           networks:
             - ciab
   ```




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: docker-compose.yml
##########
@@ -0,0 +1,116 @@
+# 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.
+
+---
+version: '3.5'
+
+services:
+    trafficops:
+        build:
+            context: dev/traffic_ops/
+        depends_on:
+            - db
+        domainname: dev.ciab.test
+        hostname: trafficops
+        image: trafficops-dev
+        ports:
+            - 6443:443
+            - 6444:6444
+        volumes:
+            - .:/root/go/src/github.com/apache/trafficcontrol/
+
+    db:
+        image: postgres:13.2-alpine
+        ports:
+            - 5432:5432
+        environment:
+            - POSTGRES_PASSWORD=twelve12
+        hostname: db
+        domainname: dev.ciab.test
+
+    trafficportal:
+        build:
+            context: dev/traffic_portal
+        depends_on:
+            - trafficops
+        hostname: trafficportal
+        domainname: dev.ciab.test

Review comment:
       Instead of specifying the domain, add the `trafficportal` service to a network:
   ```yml
           networks:
             - ciab
   ```




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] ocket8888 commented on pull request #6532: CDN-in-a-Box for Developers

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


   Experimental TP failure isn't related to these changes, will be fixed by #6571 


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_router/Dockerfile
##########
@@ -0,0 +1,28 @@
+#
+#  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.
+#
+FROM alpine:latest AS trafficrouter-dev
+
+ENV TC=/root/go/src/github.com/apache/trafficcontrol
+VOLUME /root/go/src/github.com/apache/trafficcontrol
+ENV JPDA_OPTS="-agentlib:jdwp=transport=dt_socket,address=5005,server=y,suspend=n" JAVA_HOME=/usr/lib/jvm/java-8-openjdk M2_HOME=/root/.m2/
+EXPOSE 3053:53/tcp 3053:53/udp 3080:80 3443:443 3333:3333 2222:3443 5005:5005
+
+RUN apk add --no-cache openjdk8 inotify-tools maven && ln -s /usr/lib/jvm/java-1.8-openjdk/bin/jdb /bin/jdb
+
+ADD https://dlcdn.apache.org/tomcat/tomcat-9/v9.0.54/bin/apache-tomcat-9.0.54.tar.gz /opt/tomcat.tgz

Review comment:
       Well I won't wait around for that, sounds like it could wind up being a pain.




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/t3c/Dockerfile
##########
@@ -0,0 +1,48 @@
+# 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:latest AS traffic-server-builder
+
+RUN apk add --no-cache build-base perl libexecinfo-dev pcre-dev libressl-dev libtool linux-headers openssl-dev zlib-dev
+ADD https://downloads.apache.org/trafficserver/trafficserver-9.1.0.tar.bz2 /
+RUN tar -xf trafficserver-9.1.0.tar.bz2 && cd trafficserver-9.1.0 && mkdir /ats && ./configure --prefix / --enable-experimental-plugins && make && make install && ls -R /ats

Review comment:
       `-j6` can actually cause it to slow down on CPUs with fewer than 6 cores; I'll use `-j` with no option-argument to allow `make` to select the appropriate DoM for the host CPU.




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman commented on pull request #6532: CDN-in-a-Box for Developers

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


   > I had done that, and it would start but it was not servicing any HTTP or DNS requests I threw at it.
   
   That is normal if it cannot fetch the CrConfig yet, it only serves HTTP and DNS responses *after* that point. Once the  comments I have made on #6532 are address, TR prints only this message repeatedly:
   
   ```java
   trafficcontrol-trafficrouter-1  | 17:43:00.361 [pool-3-thread-1] ERROR org.apache.traffic_control.traffic_router.core.secure.CertificatesClient - No traffic ops hostname yet!
   ```
   which makes sense, since TM does not serve a CrConfig.
   
   ```
   trafficrouter:/# curl -v trafficmonitor/publish/CrConfig;
   *   Trying 172.25.0.4:80...
   * Connected to trafficmonitor (172.25.0.4) port 80 (#0)
   > GET /publish/CrConfig HTTP/1.1
   > Host: trafficmonitor
   > User-Agent: curl/7.80.0
   > Accept: */*
   >
   * Mark bundle as not supporting multiuse
   < HTTP/1.1 503 Service Unavailable
   < Date: Tue, 01 Feb 2022 17:59:21 GMT
   < Content-Length: 19
   < Content-Type: text/plain; charset=utf-8
   <
   * Connection #0 to host trafficmonitor left intact
   Service Unavailable
   ```
   
   Corresponding message from Traffic Monitor logs:
   
   ```go
   trafficcontrol-trafficmonitor-1  | ERROR: datareq.go:161: 2022-02-01T18:00:21.366963347Z: Request Error: /publish/CrConfig: service still starting, some caches unpolled: map[]
   ```
   
   So, the key to getting TR to serve HTTP and DNS responses is to get Traffic Monitor to serve the CrConfig. The TR piece works fine with the suggested changes.


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_router/run.sh
##########
@@ -0,0 +1,39 @@
+#!/bin/sh
+# 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 -o errexit
+trap '[ $? -eq 0 ] && exit 0 || echo "Error on line ${LINENO} of ${0}"; exit 1' EXIT
+
+cd "$TC/traffic_router"
+
+mvn -Dmaven.test.skip=true compile -P \!rpm-build
+mvn -Dmaven.test.skip=true package -P \!rpm-build
+
+/opt/tomcat/bin/catalina.sh jpda run

Review comment:
       I had done that, and it would start but it was not servicing any HTTP or DNS requests I threw at it. At the time we weren't using Java 11 - originally I had it trying to do that but when it wasn't working I downgraded to our at-the-time-supported Java version. It can be upgraded to 11 safely now, but I remain skeptical that it will have any significant impact on TR running.




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_router/Dockerfile
##########
@@ -0,0 +1,28 @@
+#
+#  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.
+#
+FROM alpine:latest AS trafficrouter-dev
+
+ENV TC=/root/go/src/github.com/apache/trafficcontrol
+VOLUME /root/go/src/github.com/apache/trafficcontrol
+ENV JPDA_OPTS="-agentlib:jdwp=transport=dt_socket,address=5005,server=y,suspend=n" JAVA_HOME=/usr/lib/jvm/java-8-openjdk M2_HOME=/root/.m2/
+EXPOSE 3053:53/tcp 3053:53/udp 3080:80 3443:443 3333:3333 2222:3443 5005:5005
+
+RUN apk add --no-cache openjdk8 inotify-tools maven && ln -s /usr/lib/jvm/java-1.8-openjdk/bin/jdb /bin/jdb
+
+ADD https://dlcdn.apache.org/tomcat/tomcat-9/v9.0.54/bin/apache-tomcat-9.0.54.tar.gz /opt/tomcat.tgz

Review comment:
       > this should use https://archive.apache.org/ instead of dlcdn.apache.org.
   
   I was directed to the dlcdn.apache.org URL by [the Downloads page (version 9) on Tomcat's website](https://tomcat.apache.org/download-90.cgi) - I can change it to the archive for the historical Tomcat release so that this builds, but should Traffic Router update to a supported version of Tomcat? _Can_ Traffic Router update to a supported version of Tomcat?




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_router/Dockerfile
##########
@@ -0,0 +1,31 @@
+#
+#  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.
+#
+FROM alpine:latest AS trafficrouter-dev
+
+ENV TC=/root/go/src/github.com/apache/trafficcontrol
+VOLUME /root/go/src/github.com/apache/trafficcontrol
+ENV JPDA_OPTS="-agentlib:jdwp=transport=dt_socket,address=5005,server=y,suspend=n" JAVA_HOME=/usr/lib/jvm/java-11-openjdk M2_HOME=/root/.m2/
+EXPOSE 3053:53/tcp 3053:53/udp 3080:80 3443:443 3333:3333 2222:3443 5005:5005
+
+RUN apk add --no-cache openjdk11 inotify-tools maven && ln -s /usr/lib/jvm/java-1.11-openjdk/bin/jdb /bin/jdb

Review comment:
       huh, I wonder why that command isn't failing?




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] ocket8888 edited a comment on pull request #6532: CDN-in-a-Box for Developers

Posted by GitBox <gi...@apache.org>.
ocket8888 edited a comment on pull request #6532:
URL: https://github.com/apache/trafficcontrol/pull/6532#issuecomment-1029135839


   > maybe there's a way to abstract out similar pieces?
   
   The only truly similar parts are in the data-sets, and that similarity is honestly merely skin-deep. Other than that they don't run the same way, aren't packaged the same, and the service containers differ all the way down to the level of which OS they run on (distro, really). The way the CiaB "enroller" works is meant to be generic, it allows loading (somewhat) arbitrary data sets using the TO API - because of that, it has to wait for TO to be available and then each service that wants to exist is responsible for using it to "enroll" itself. The dev environment has some static data being inserted directly into the database, which allows each container to be started and stopped independently without creating any conflicting data, whereas CiaB needs to be entirely stopped and started together, but doesn't allow for arbitrary extension e.g. via the "optional" docker-compose files found in the CiaB directory.


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_router/run.sh
##########
@@ -0,0 +1,41 @@
+#!/bin/sh
+# 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 -o errexit
+
+cd "$TC/traffic_router"
+
+mvn -Dmaven.test.skip=true compile -P \!rpm-build
+mvn -Dmaven.test.skip=true package -P \!rpm-build
+
+cp core/target/ROOT.war /opt/tomcat/webapps/
+ln -s $TC/dev/traffic_router/conf/* /opt/tomcat/conf/
+
+/opt/tomcat/bin/catalina.sh jpda run

Review comment:
       TR exits immediately after starting. The contents of `/opt/tomcat/logs/catalina.2022-02-04.log`:
   ```java
   04-Feb-2022 00:41:39.532 SEVERE [main] org.apache.tomcat.util.digester.Digester.startElement Begin event threw exception
   	java.lang.ClassNotFoundException: org.apache.traffic_control.traffic_router.tomcat.TomcatLifecycleListener
   		at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:476)
   		at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589)
   		at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
   		at org.apache.tomcat.util.digester.ObjectCreateRule.begin(ObjectCreateRule.java:104)
   		at org.apache.catalina.startup.ListenerCreateRule.begin(ListenerCreateRule.java:70)
   		at org.apache.tomcat.util.digester.Digester.startElement(Digester.java:1293)
   		at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:510)
   		at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:183)
   		at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1377)
   		at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2710)
   		at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:605)
   		at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:534)
   		at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:888)
   		at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:824)
   		at java.xml/com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
   		at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1216)
   		at java.xml/com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:635)
   		at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1551)
   		at org.apache.catalina.startup.Catalina.parseServerXml(Catalina.java:617)
   		at org.apache.catalina.startup.Catalina.load(Catalina.java:709)
   		at org.apache.catalina.startup.Catalina.load(Catalina.java:746)
   		at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   		at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
   		at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   		at java.base/java.lang.reflect.Method.invoke(Method.java:566)
   		at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:302)
   		at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:472)
   ```
   So Tomcat cannot find `org.apache.traffic_control.traffic_router.tomcat.TomcatLifecycleListener`, which `server.xml` tells it to load: https://github.com/apache/trafficcontrol/blob/7b30bab1a6931927f092f78c74b5ad7b4f6ab8c0/dev/traffic_router/conf/server.xml#L21
   
   That is because, aside from `ROOT.war`, the Traffic Router RPM includes an entire `lib` directory (which duplicates the `lib` directory contained in `ROOT.war`, which contains `traffic_router_connector-6.2.0.jar`, which contains `TomcatLifecycleListener.class`. https://github.com/apache/trafficcontrol/blob/abfbb3483afbb3deedb488e872d21d8c0ba6c94a/traffic_router/build/pom.xml#L188
   
   In order for Tomcat to find `traffic_router_connector-6.2.0.jar` (and assuming the `CATALINA_BASE` environment variable is `${TC}/dev/traffic_router`), `${TC}/dev/traffic_router/lib` can be a relative symlink to `traffic_router/core/target/ROOT/WEB-INF/lib`, generated by `mvn compile`.
   
   




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] ocket8888 commented on pull request #6532: CDN-in-a-Box for Developers

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


   When I first started working on the Docker version of CDN-in-a-Box, this is much more what I had in mind than what we currently know as "CiaB" (although I can't speak for Dan who was working on it in some form or another before I knew what ATC was) - probably because as a developer I only had a developer's needs in mind. And that's likely why the decision was made to do things the way they currently are, with RPMs and running on CentOS and installing everything under `/opt/` etc. It's "prod-like" and that's highly valued for testing, which is a primary use-case of our current CiaB.


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_router/conf/startup.properties
##########
@@ -0,0 +1,30 @@
+#
+# 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.
+
+# Any environment variables you define here will become part of the startup
+# environment for the 'traffic_router' service. It is a good place to set
+# command line arguments for the Java command line or any environment specific
+# setting you want available to the traffic_router process.
+# This file is not replaced by the update process when a new version of traffic
+# router is installed.
+CATALINA_OPTS="\
+	-server -Xms2g -Xmx8g \
+	-Dlog4j.configuration=file:///opt/tomcat/conf/log4j2.xml \

Review comment:
       Not necessary, but `///opt` can just be `/opt




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_router/conf/startup.properties
##########
@@ -0,0 +1,30 @@
+#
+# 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.
+
+# Any environment variables you define here will become part of the startup
+# environment for the 'traffic_router' service. It is a good place to set
+# command line arguments for the Java command line or any environment specific
+# setting you want available to the traffic_router process.
+# This file is not replaced by the update process when a new version of traffic
+# router is installed.
+CATALINA_OPTS="\
+	-server -Xms2g -Xmx8g \
+	-Dlog4j.configuration=file:///opt/tomcat/conf/log4j2.xml \

Review comment:
       Not necessary, but `///opt` can just be `/opt`




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_ops/seed.psql
##########
@@ -0,0 +1,290 @@
+/* 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.
+*/
+
+INSERT INTO tm_user (
+	username,
+	tenant_id,
+	"role",
+	local_passwd,
+	confirm_local_passwd,
+	email,
+	full_name
+) VALUES (
+	'admin',
+	(SELECT id FROM tenant WHERE "name" = 'root'),
+	(SELECT id FROM "role" WHERE "name" = 'admin'),
+	-- 'twelve12' encrypted with SCRYPT
+	'SCRYPT:16384:8:1:p0Bppp/6IBeYxSwdLuYddsdMLBU/BNSlLY6fSIF7H1XW4eTbNVeMPVm7TuTEG4FM8PbqLlVwi8sPy8ZJznAlaQ==:sRcHWGe43mm/uEmXTIw37GcLEQZTlWAdf4vJqK8f0MDh8P+8gXoNx+nxWyb3r/0Bh+yyg0g/dUvti/ePZJL+Jw==',
+	'SCRYPT:16384:8:1:p0Bppp/6IBeYxSwdLuYddsdMLBU/BNSlLY6fSIF7H1XW4eTbNVeMPVm7TuTEG4FM8PbqLlVwi8sPy8ZJznAlaQ==:sRcHWGe43mm/uEmXTIw37GcLEQZTlWAdf4vJqK8f0MDh8P+8gXoNx+nxWyb3r/0Bh+yyg0g/dUvti/ePZJL+Jw==',
+	'admin@no-reply.atc.test',
+	'Development Admin User'
+)
+ON CONFLICT (username) DO NOTHING;
+
+INSERT INTO cdn (
+	"name",
+	domain_name
+) VALUES (
+	'dev',
+	'ciab.test'
+);
+
+INSERT INTO snapshot (
+	cdn,
+	crconfig,
+	monitoring
+) VALUES (
+	'dev',
+	'{"config":{"coveragezone.polling.url":"file:///root/go/src/github.com/apache/trafficcontrol/traffic_router/core/src/test/resources/czmap.json","dnssec.enabled":"false","domain_name":"ciab.test","geolocation.polling.url":"file:///root/go/src/github.com/apache/trafficcontrol/traffic_router/core/src/test/resources/geo/GeoLite2-City.mmdb.gz"},"contentServers":{"edge":{"cacheGroup":"dev","fqdn":"edge.dev.ciab.test","hashCount":999,"hashId":"edge","httpsPort":443,"interfaceName":"eth0","ip":"129.0.0.2","ip6":"","locationId":"dev","port":80,"profile":"EDGE_dev","status":"REPORTED","type":"EDGE","routingDisabled":0}},"deliveryServices":{"dev":{"anonymousBlockingEnabled":"false","coverageZoneOnly":"false","deepCachingType":"NEVER","dispersion":{"limit":1,"shuffled":"true"},"domains":["dev.ciab.test"],"ecsEnabled":"false","geolocationProvider":"maxmindGeolocationService","ip6RoutingEnabled":"false","matchsets":[{"protocol":"HTTP","matchlist":[{"regex":".*\\\\.dev\\\\..*","match-type":"HOST"
 }]}],"protocol":{"acceptHttps":"false","redirectToHttps":"false"},"regionalGeoBlocking":"false","routingName":"cdn","soa":{"admin":"traffic_ops","expire":"604800","minimum":"30","refresh":"28800","retry":"7200"},"sslEnabled":"false","ttls":{"A":"","AAAA":"","NS":"3600","SOA":"86400"}}},"edgeLocations":{"dev":{"latitude":0,"longitude":0,"backupLocations":{"fallbackToClosest":"true"},"localizationMethods":["GEO","CZ","DEEP_CZ"]}},"monitors":{"trafficmonitor":{"fqdn":"trafficmonitor.dev.ciab.test","httpsPort":null,"ip":"129.0.0.1","ip6":"","location":"dev","port":80,"profile":"RASCAL_TM_dev","status":"ONLINE"}},"stats":{"CDN_name":"dev","date":1643833749,"tm_host":"trafficops","tm_user":"admin","tm_version":"development"}}',

Review comment:
       In order for `coveragezone.polling.url` and `geolocation.polling.url` to show up in a live CRConfig,
   * The parameters need to be assigned to a Traffic Router profile for config file `CRConfig.json`
   * The Traffic Router profile should have an `ONLINE`-status Traffic Router assigned to it
   
   As a result of doing this, a `contentRouters` section is also added to the CRConfig. Since this snapshot in the `snapshot` table does not that `contentRouters` section, Traffic Router rejects the CRConfig. Logged at `org.apache.traffic_control.traffic_router.core.monitor.TrafficMonitorWatcher:119`:
   ```
   Failed querying JSON for key: contentRouters
   ```

##########
File path: dev/traffic_ops/seed.psql
##########
@@ -0,0 +1,290 @@
+/* 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.
+*/
+
+INSERT INTO tm_user (
+	username,
+	tenant_id,
+	"role",
+	local_passwd,
+	confirm_local_passwd,
+	email,
+	full_name
+) VALUES (
+	'admin',
+	(SELECT id FROM tenant WHERE "name" = 'root'),
+	(SELECT id FROM "role" WHERE "name" = 'admin'),
+	-- 'twelve12' encrypted with SCRYPT
+	'SCRYPT:16384:8:1:p0Bppp/6IBeYxSwdLuYddsdMLBU/BNSlLY6fSIF7H1XW4eTbNVeMPVm7TuTEG4FM8PbqLlVwi8sPy8ZJznAlaQ==:sRcHWGe43mm/uEmXTIw37GcLEQZTlWAdf4vJqK8f0MDh8P+8gXoNx+nxWyb3r/0Bh+yyg0g/dUvti/ePZJL+Jw==',
+	'SCRYPT:16384:8:1:p0Bppp/6IBeYxSwdLuYddsdMLBU/BNSlLY6fSIF7H1XW4eTbNVeMPVm7TuTEG4FM8PbqLlVwi8sPy8ZJznAlaQ==:sRcHWGe43mm/uEmXTIw37GcLEQZTlWAdf4vJqK8f0MDh8P+8gXoNx+nxWyb3r/0Bh+yyg0g/dUvti/ePZJL+Jw==',
+	'admin@no-reply.atc.test',
+	'Development Admin User'
+)
+ON CONFLICT (username) DO NOTHING;
+
+INSERT INTO cdn (
+	"name",
+	domain_name
+) VALUES (
+	'dev',
+	'ciab.test'
+);
+
+INSERT INTO snapshot (
+	cdn,
+	crconfig,
+	monitoring
+) VALUES (
+	'dev',
+	'{"config":{"coveragezone.polling.url":"file:///root/go/src/github.com/apache/trafficcontrol/traffic_router/core/src/test/resources/czmap.json","dnssec.enabled":"false","domain_name":"ciab.test","geolocation.polling.url":"file:///root/go/src/github.com/apache/trafficcontrol/traffic_router/core/src/test/resources/geo/GeoLite2-City.mmdb.gz"},"contentServers":{"edge":{"cacheGroup":"dev","fqdn":"edge.dev.ciab.test","hashCount":999,"hashId":"edge","httpsPort":443,"interfaceName":"eth0","ip":"129.0.0.2","ip6":"","locationId":"dev","port":80,"profile":"EDGE_dev","status":"REPORTED","type":"EDGE","routingDisabled":0}},"deliveryServices":{"dev":{"anonymousBlockingEnabled":"false","coverageZoneOnly":"false","deepCachingType":"NEVER","dispersion":{"limit":1,"shuffled":"true"},"domains":["dev.ciab.test"],"ecsEnabled":"false","geolocationProvider":"maxmindGeolocationService","ip6RoutingEnabled":"false","matchsets":[{"protocol":"HTTP","matchlist":[{"regex":".*\\\\.dev\\\\..*","match-type":"HOST"
 }]}],"protocol":{"acceptHttps":"false","redirectToHttps":"false"},"regionalGeoBlocking":"false","routingName":"cdn","soa":{"admin":"traffic_ops","expire":"604800","minimum":"30","refresh":"28800","retry":"7200"},"sslEnabled":"false","ttls":{"A":"","AAAA":"","NS":"3600","SOA":"86400"}}},"edgeLocations":{"dev":{"latitude":0,"longitude":0,"backupLocations":{"fallbackToClosest":"true"},"localizationMethods":["GEO","CZ","DEEP_CZ"]}},"monitors":{"trafficmonitor":{"fqdn":"trafficmonitor.dev.ciab.test","httpsPort":null,"ip":"129.0.0.1","ip6":"","location":"dev","port":80,"profile":"RASCAL_TM_dev","status":"ONLINE"}},"stats":{"CDN_name":"dev","date":1643833749,"tm_host":"trafficops","tm_user":"admin","tm_version":"development"}}',

Review comment:
       In order for `coveragezone.polling.url` and `geolocation.polling.url` to show up in a snapshotted CRConfig,
   * The parameters need to be assigned to a Traffic Router profile for config file `CRConfig.json`
   * The Traffic Router profile should have an `ONLINE`-status Traffic Router assigned to it
   
   As a result of doing this, a `contentRouters` section is also added to the CRConfig. Since this snapshot in the `snapshot` table does not that `contentRouters` section, Traffic Router rejects the CRConfig. Logged at `org.apache.traffic_control.traffic_router.core.monitor.TrafficMonitorWatcher:119`:
   ```
   Failed querying JSON for key: contentRouters
   ```




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_router/conf/startup.properties
##########
@@ -1,30 +0,0 @@
-#
-# 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.
-
-# Any environment variables you define here will become part of the startup
-# environment for the 'traffic_router' service. It is a good place to set
-# command line arguments for the Java command line or any environment specific
-# setting you want available to the traffic_router process.
-# This file is not replaced by the update process when a new version of traffic
-# router is installed.
-CATALINA_OPTS="\
-	-server -Xms2g -Xmx8g \
-	-Dlog4j.configuration=file:///opt/tomcat/conf/log4j2.xml \
-	-Djava.library.path=/usr/lib \
-	-Dorg.apache.catalina.connector.Response.ENFORCE_ENCODING_IN_GET_WRITER=false \
-	-XX:+UseG1GC \
-	-XX:+UnlockExperimentalVMOptions \
-	-XX:InitiatingHeapOccupancyPercent=30"
-JAVA_OPTS="\
-	-Djava.awt.headless=true \
-	-Djava.security.egd=file:/dev/./urandom"

Review comment:
       They aren't but I don't consider that an issue since TR seems to be working just fine without 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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman commented on pull request #6532: CDN-in-a-Box for Developers

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


   (The host regexp should show up in TP as `.*\.dev\..*`)


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_router/Dockerfile
##########
@@ -15,12 +15,17 @@ FROM alpine:latest AS trafficrouter-dev
 
 ENV TC=/root/go/src/github.com/apache/trafficcontrol
 VOLUME /root/go/src/github.com/apache/trafficcontrol
-ENV JPDA_OPTS="-agentlib:jdwp=transport=dt_socket,address=*:5005,server=y,suspend=n" JAVA_HOME=/usr/lib/jvm/java-11-openjdk M2_HOME=/root/go/src/github.com/apache/trafficcontrol/.m2 CATALINA_BASE=/opt/traffic_router
+ENV JPDA_OPTS="-agentlib:jdwp=transport=dt_socket,address=*:5005,server=y,suspend=n" JAVA_HOME=/usr/lib/jvm/java-11-openjdk M2_HOME=/root/go/src/github.com/apache/trafficcontrol/.m2 CATALINA_BASE=/opt/traffic_router TRAFFIC_MONITOR_HOSTS=trafficmonitor
 EXPOSE 3053:53/tcp 3053:53/udp 3080:80 3443:443 3333:3333 2222:3443 5005:5005
 
-RUN apk add --no-cache openjdk11 inotify-tools maven && ln -s /usr/lib/jvm/java-11-openjdk/bin/jdb /bin/jdb
+RUN apk add --no-cache openjdk11 inotify-tools maven tomcat-native openssl && ln -s /usr/lib/jvm/java-11-openjdk/bin/jdb /bin/jdb
 
 ADD https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.43/bin/apache-tomcat-9.0.43.tar.gz /opt/tomcat.tgz
+
+ARG USER
+RUN adduser -H -D ${USER}
+RUN chown -R ${USER} /opt /usr/share/java/ /root
+USER ${USER}

Review comment:
       I did it that way to avoid collisions in the UID from `adduser`. I think I just totally forgot that usernames are essentially syntactic sugar and that this won't mean anything. I'll try to get it working based on UID - but also be aware that not all shell/system combinations set the environment variable `UID` (or `USER` for that matter) and idk what to do about those systems.




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_router/run.sh
##########
@@ -0,0 +1,41 @@
+#!/bin/sh
+# 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 -o errexit
+
+cd "$TC/traffic_router"
+
+mvn -Dmaven.test.skip=true compile -P \!rpm-build
+mvn -Dmaven.test.skip=true package -P \!rpm-build
+
+cp core/target/ROOT.war /opt/tomcat/webapps/
+ln -s $TC/dev/traffic_router/conf/* /opt/tomcat/conf/
+
+/opt/tomcat/bin/catalina.sh jpda run

Review comment:
       TR exits immediately after starting. The contents of `/opt/tomcat/logs/catalina.2022-02-04.log`:
   ```java
   04-Feb-2022 00:41:39.532 SEVERE [main] org.apache.tomcat.util.digester.Digester.startElement Begin event threw exception
   	java.lang.ClassNotFoundException: org.apache.traffic_control.traffic_router.tomcat.TomcatLifecycleListener
   		at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:476)
   		at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589)
   		at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
   		at org.apache.tomcat.util.digester.ObjectCreateRule.begin(ObjectCreateRule.java:104)
   		at org.apache.catalina.startup.ListenerCreateRule.begin(ListenerCreateRule.java:70)
   		at org.apache.tomcat.util.digester.Digester.startElement(Digester.java:1293)
   		at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:510)
   		at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:183)
   		at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1377)
   		at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2710)
   		at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:605)
   		at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:534)
   		at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:888)
   		at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:824)
   		at java.xml/com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
   		at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1216)
   		at java.xml/com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:635)
   		at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1551)
   		at org.apache.catalina.startup.Catalina.parseServerXml(Catalina.java:617)
   		at org.apache.catalina.startup.Catalina.load(Catalina.java:709)
   		at org.apache.catalina.startup.Catalina.load(Catalina.java:746)
   		at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   		at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
   		at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   		at java.base/java.lang.reflect.Method.invoke(Method.java:566)
   		at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:302)
   		at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:472)
   ```
   So Tomcat cannot find `org.apache.traffic_control.traffic_router.tomcat.TomcatLifecycleListener`, which `server.xml` tells it to load: https://github.com/apache/trafficcontrol/blob/7b30bab1a6931927f092f78c74b5ad7b4f6ab8c0/dev/traffic_router/conf/server.xml#L21
   
   That is because, aside from `ROOT.war`, the Traffic Router RPM includes an entire `lib` directory (which duplicates the `lib` directory contained in `ROOT.war`), which contains `traffic_router_connector-6.2.0.jar`, which contains `TomcatLifecycleListener.class`. https://github.com/apache/trafficcontrol/blob/abfbb3483afbb3deedb488e872d21d8c0ba6c94a/traffic_router/build/pom.xml#L188
   
   In order for Tomcat to find `traffic_router_connector-6.2.0.jar` (and assuming the `CATALINA_BASE` environment variable is `${TC}/dev/traffic_router`), `${TC}/dev/traffic_router/lib` can be a relative symlink to `traffic_router/core/target/ROOT/WEB-INF/lib`, generated by `mvn compile`.
   
   




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_router/run.sh
##########
@@ -0,0 +1,39 @@
+#!/bin/sh
+# 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 -o errexit
+trap '[ $? -eq 0 ] && exit 0 || echo "Error on line ${LINENO} of ${0}"; exit 1' EXIT
+
+cd "$TC/traffic_router"
+
+mvn -Dmaven.test.skip=true compile -P \!rpm-build
+mvn -Dmaven.test.skip=true package -P \!rpm-build
+
+/opt/tomcat/bin/catalina.sh jpda run

Review comment:
       It does work if you upgrade to OpenJDK 11, remove the demo webapps, and put `ROOT.war` in the webapps directory




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/t3c/Dockerfile
##########
@@ -0,0 +1,48 @@
+# 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:latest AS traffic-server-builder
+
+RUN apk add --no-cache build-base perl libexecinfo-dev pcre-dev libressl-dev libtool linux-headers openssl-dev zlib-dev
+ADD https://downloads.apache.org/trafficserver/trafficserver-9.1.0.tar.bz2 /
+RUN tar -xf trafficserver-9.1.0.tar.bz2 && cd trafficserver-9.1.0 && mkdir /ats && ./configure --prefix / --enable-experimental-plugins && make && make install && ls -R /ats

Review comment:
       Yeah, probably




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] ocket8888 commented on pull request #6532: CDN-in-a-Box for Developers

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


   > maybe there's a way to abstract out similar pieces?
   The only truly similar parts are in the data-sets, and that similarity is honestly merely skin-deep. Other than that they don't run the same way, aren't packaged the same, and the service containers differ all the way down to the level of which OS they run on (distro, really). The way the CiaB "enroller" works is meant to be generic, it allows loading (somewhat) arbitrary data sets using the TO API - because of that, it has to wait for TO to be available and then each service that wants to exist is responsible for using it to "enroll" itself. The dev environment has some static data being inserted directly into the database, which allows each container to be started and stopped independently without creating any conflicting data, whereas CiaB needs to be entirely stopped and started together, but doesn't allow for arbitrary extension e.g. via the "optional" docker-compose files found in the CiaB directory.


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_ops/Dockerfile
##########
@@ -0,0 +1,38 @@
+#
+#  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.
+#
+FROM alpine:latest AS certbuilder
+RUN apk add --no-cache openssl
+RUN openssl genrsa -passout pass:x -out server.pass.key 2048 && \
+	openssl rsa -passin pass:x -in server.pass.key -out server.key && \
+	rm server.pass.key && \
+	openssl req -new -key server.key -out server.csr \
+		-subj "/C=US/ST=CO/L=Denver/O=Apache/OU=Traffic Control/CN=trafficops.dev.ciab.test" && \
+	openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt && \
+	openssl rand 32 | base64 > /aes.key
+
+FROM alpine:latest AS trafficops-dev
+
+ENV TC="/root/go/src/github.com/apache/trafficcontrol/"
+VOLUME /root/go/src/github.com/apache/trafficcontrol
+ENV ADMIN="$TC/traffic_ops/app/db/admin"
+EXPOSE 443 6444
+
+COPY --from=certbuilder /server.key /server.crt /aes.key /
+RUN apk add --no-cache make inotify-tools go postgresql-client && go install github.com/go-delve/delve/cmd/dlv@latest && ln -s /root/go/bin/dlv /usr/bin/dlv

Review comment:
       > That means either expanding the build scope to include the entire ATC repo or deferring the installation of Go to run-time in at least 3 containers. I'd rather not do either of those things, and if you update the cached layer where Go is installed, you should get 1.17.6.
   
   Expanding the build scope does not need to be a performance hit if you ignore everything in a dockerignore, excepting files/directories that you want the image to include: https://docs.docker.com/engine/reference/builder/#usage




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_ops/Dockerfile
##########
@@ -0,0 +1,38 @@
+#
+#  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.
+#
+FROM alpine:latest AS certbuilder
+RUN apk add --no-cache openssl
+RUN openssl genrsa -passout pass:x -out server.pass.key 2048 && \
+	openssl rsa -passin pass:x -in server.pass.key -out server.key && \
+	rm server.pass.key && \
+	openssl req -new -key server.key -out server.csr \
+		-subj "/C=US/ST=CO/L=Denver/O=Apache/OU=Traffic Control/CN=trafficops.dev.ciab.test" && \
+	openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt && \
+	openssl rand 32 | base64 > /aes.key
+
+FROM alpine:latest AS trafficops-dev
+
+ENV TC="/root/go/src/github.com/apache/trafficcontrol/"
+VOLUME /root/go/src/github.com/apache/trafficcontrol
+ENV ADMIN="$TC/traffic_ops/app/db/admin"
+EXPOSE 443 6444
+
+COPY --from=certbuilder /server.key /server.crt /aes.key /
+RUN apk add --no-cache make inotify-tools go postgresql-client && go install github.com/go-delve/delve/cmd/dlv@latest && ln -s /root/go/bin/dlv /usr/bin/dlv

Review comment:
       Alpine currently downloads Go version 1.17.4. In order for debugging to work properly, the TO image should use the Go version specified in the `GO_VERSION` file.
   https://github.com/apache/trafficcontrol/blob/abfbb3483afbb3deedb488e872d21d8c0ba6c94a/GO_VERSION#L1

##########
File path: dev/traffic_monitor/Dockerfile
##########
@@ -0,0 +1,23 @@
+#
+#  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.
+#
+FROM alpine:latest AS trafficmonitor-dev
+
+ENV TC=/root/go/src/github.com/apache/trafficcontrol
+VOLUME /root/go/src/github.com/apache/trafficcontrol
+EXPOSE 80 81
+
+RUN apk add --no-cache inotify-tools go && go install github.com/go-delve/delve/cmd/dlv@latest && ln -s /root/go/bin/dlv /usr/bin/dlv

Review comment:
       Alpine currently downloads Go version 1.17.4. In order for debugging to work properly, the TM image should use the Go version specified in the `GO_VERSION` file.
   https://github.com/apache/trafficcontrol/blob/abfbb3483afbb3deedb488e872d21d8c0ba6c94a/GO_VERSION#L1

##########
File path: dev/traffic_router/run.sh
##########
@@ -0,0 +1,41 @@
+#!/bin/sh
+# 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 -o errexit
+
+cd "$TC/traffic_router"
+
+mvn -Dmaven.test.skip=true compile -P \!rpm-build
+mvn -Dmaven.test.skip=true package -P \!rpm-build
+
+cp core/target/ROOT.war /opt/tomcat/webapps/
+ln -s $TC/dev/traffic_router/conf/* /opt/tomcat/conf/

Review comment:
       Modifying `/opt/tomcat` beyond removing demo stuff is not ideal. Once the `CATALINA_BASE` environment variable is set to `/opt/traffic_router` and `/opt/traffic_router` is symlinked to `${TC}/dev/traffic_router`, Tomcat can load `server.xml` (and the other config files) from the `${TC}/dev/traffic_router/conf` directory.

##########
File path: dev/traffic_router/run.sh
##########
@@ -0,0 +1,41 @@
+#!/bin/sh
+# 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 -o errexit
+
+cd "$TC/traffic_router"
+
+mvn -Dmaven.test.skip=true compile -P \!rpm-build
+mvn -Dmaven.test.skip=true package -P \!rpm-build
+
+cp core/target/ROOT.war /opt/tomcat/webapps/
+ln -s $TC/dev/traffic_router/conf/* /opt/tomcat/conf/
+
+/opt/tomcat/bin/catalina.sh jpda run

Review comment:
       > <pre>Using CATALINA_BASE:   /opt/tomcat
   > Using CATALINA_HOME:   /opt/tomcat
   > Using CATALINA_TMPDIR: /opt/tomcat/temp
   > Using JRE_HOME:        /usr/lib/jvm/java-11-openjdk
   > Using CLASSPATH:       /opt/tomcat/bin/bootstrap.jar:/opt/tomcat/bin/tomcat-juli.jar
   > Using CATALINA_OPTS:</pre></quote>
   
   The way Traffic Router is set up, `CATALINA_BASE` is supposed to be `/opt/traffic_router`: https://github.com/apache/trafficcontrol/blob/abfbb3483afbb3deedb488e872d21d8c0ba6c94a/traffic_router/core/src/main/lib/systemd/system/traffic_router.service#L24-L25
   
   `CATALINA_BASE` should be equal to the `deploy.dir` system property. It is defined here: https://github.com/apache/trafficcontrol/blob/abfbb3483afbb3deedb488e872d21d8c0ba6c94a/traffic_router/pom.xml#L34
   
   Among other things, `deploy.dir` is used to find the property files. https://github.com/apache/trafficcontrol/blob/abfbb3483afbb3deedb488e872d21d8c0ba6c94a/traffic_router/core/src/main/resources/applicationProperties.xml#L28-L32
   If you can find a way to change `deploy.dir` to `${TC}/dev/traffic_router`, that would be idea. Otherwise, `CATALINA_BASE` should be set to `/opt/traffic_router`, with `/opt/traffic_router` being a symlink to `${TC}/dev/traffic_router`.

##########
File path: dev/traffic_router/run.sh
##########
@@ -0,0 +1,41 @@
+#!/bin/sh
+# 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 -o errexit
+
+cd "$TC/traffic_router"
+
+mvn -Dmaven.test.skip=true compile -P \!rpm-build
+mvn -Dmaven.test.skip=true package -P \!rpm-build
+
+cp core/target/ROOT.war /opt/tomcat/webapps/

Review comment:
       1. We don't need a `.war` file
   2. Once the `CATALINA_BASE` environment variable is set to `/opt/traffic_router` and `/opt/traffic_router` is symlinked to `${TC}/dev/traffic_router`, Tomcat will read webapps from `${TC}/dev/traffic_router/webapps`. If it finds in there a relative symlink to `traffic_router/core/target/ROOT`, it can load TR without bothering with a `.war`.

##########
File path: dev/traffic_router/Dockerfile
##########
@@ -0,0 +1,31 @@
+#
+#  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.
+#
+FROM alpine:latest AS trafficrouter-dev
+
+ENV TC=/root/go/src/github.com/apache/trafficcontrol
+VOLUME /root/go/src/github.com/apache/trafficcontrol
+ENV JPDA_OPTS="-agentlib:jdwp=transport=dt_socket,address=5005,server=y,suspend=n" JAVA_HOME=/usr/lib/jvm/java-11-openjdk M2_HOME=/root/.m2/

Review comment:
       M2_HOME should be a bind mount to the gitignored `.m2` directory used by the TR builder image
   https://github.com/apache/trafficcontrol/blob/abfbb3483afbb3deedb488e872d21d8c0ba6c94a/infrastructure/docker/build/docker-compose.yml#L111

##########
File path: dev/t3c/Dockerfile
##########
@@ -0,0 +1,49 @@
+# 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:latest AS traffic-server-builder
+
+RUN apk add --no-cache build-base perl libexecinfo-dev pcre-dev libressl-dev libtool linux-headers openssl-dev zlib-dev
+ADD https://downloads.apache.org/trafficserver/trafficserver-9.1.1.tar.bz2 /
+RUN tar -xf trafficserver-9.1.1.tar.bz2 && cd trafficserver-9.1.1 && mkdir /ats && ./configure --prefix / --enable-experimental-plugins && make -j && make install && ls -R /ats
+
+FROM alpine:latest AS t3c-dev
+
+ENV TC="/root/go/src/github.com/apache/trafficcontrol/"
+VOLUME /root/go/src/github.com/apache/trafficcontrol
+EXPOSE 80 8081
+
+COPY --from=traffic-server-builder /bin/traffic_cache_tool /bin/traffic_crashlog /bin/traffic_ctl /bin/traffic_layout /bin/traffic_logcat /bin/traffic_logstats /bin/traffic_manager /bin/traffic_server /bin/traffic_via /bin/trafficserver /bin/tspush /bin/tsxs /bin/
+COPY --from=traffic-server-builder /etc/trafficserver /etc/trafficserver
+COPY --from=traffic-server-builder /include/ts /include/ts
+COPY --from=traffic-server-builder /include/tscpp /include/tscpp
+COPY --from=traffic-server-builder /lib/perl5 /lib/perl5
+COPY --from=traffic-server-builder /lib/pkgconfig/trafficserver.pc /lib/pkgconfig/trafficserver.pc
+COPY --from=traffic-server-builder /lib/libtscore.la /lib/libtscore.so /lib/libtscore.so.9 /lib/libtscore.so.9.1.1 /lib/libtscppapi.la /lib/libtscppapi.so /lib/libtscppapi.so.9 /lib/libtscppapi.so.9.1.1 /lib/libtscpputil.la /lib/libtscpputil.so /lib/libtscpputil.so.9 /lib/libtscpputil.so.9.1.1 /lib/libtsmgmt.la /lib/libtsmgmt.so /lib/libtsmgmt.so.9 /lib/libtsmgmt.so.9.1.1 /lib/plugin_init_fail.la /lib/plugin_init_fail.so /lib/plugin_instinit_fail.la /lib/plugin_instinit_fail.so /lib/plugin_missing_deleteinstance.la /lib/plugin_missing_deleteinstance.so /lib/plugin_missing_doremap.la /lib/plugin_missing_doremap.so /lib/plugin_missing_init.la /lib/plugin_missing_init.so /lib/plugin_missing_newinstance.la /lib/plugin_missing_newinstance.so /lib/plugin_required_cb.la /lib/plugin_required_cb.so /lib/plugin_testing_calls.la /lib/plugin_testing_calls.so /lib/plugin_v1.la /lib/plugin_v1.so /lib/plugin_v2.la /lib/plugin_v2.so /lib/
+COPY --from=traffic-server-builder /libexec/trafficserver /libexec/trafficserver
+COPY --from=traffic-server-builder /share/man /share/man
+RUN mkdir /share/trafficserver && mkdir -p /var/log/trafficserver && mkdir /var/trafficserver
+
+RUN apk add --no-cache make inotify-tools go pcre libexecinfo && \

Review comment:
       Alpine currently downloads Go version 1.17.4. In order for debugging to work properly, the t3c image should use the Go version specified in the `GO_VERSION` file.
   https://github.com/apache/trafficcontrol/blob/abfbb3483afbb3deedb488e872d21d8c0ba6c94a/GO_VERSION#L1

##########
File path: dev/traffic_router/Dockerfile
##########
@@ -0,0 +1,31 @@
+#
+#  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.
+#
+FROM alpine:latest AS trafficrouter-dev
+
+ENV TC=/root/go/src/github.com/apache/trafficcontrol
+VOLUME /root/go/src/github.com/apache/trafficcontrol
+ENV JPDA_OPTS="-agentlib:jdwp=transport=dt_socket,address=5005,server=y,suspend=n" JAVA_HOME=/usr/lib/jvm/java-11-openjdk M2_HOME=/root/.m2/
+EXPOSE 3053:53/tcp 3053:53/udp 3080:80 3443:443 3333:3333 2222:3443 5005:5005
+
+RUN apk add --no-cache openjdk11 inotify-tools maven && ln -s /usr/lib/jvm/java-11-openjdk/bin/jdb /bin/jdb
+
+ADD https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.43/bin/apache-tomcat-9.0.43.tar.gz /opt/tomcat.tgz
+RUN cd /opt && \
+	tar -xf tomcat.tgz && \
+	mv apache-tomcat-* tomcat && \
+	rm -rf tomcat.tgz tomcat/webapps/* tomcat/conf/web.xml tomcat/conf/server.xml tomcat/conf/logging.properties /usr/share/java/maven-3/conf/settings.xml

Review comment:
       The `-rf` should be just `-r` so as not to mask attempts to delete nonexistent files and directories

##########
File path: dev/traffic_router/run.sh
##########
@@ -0,0 +1,41 @@
+#!/bin/sh
+# 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 -o errexit
+
+cd "$TC/traffic_router"
+
+mvn -Dmaven.test.skip=true compile -P \!rpm-build
+mvn -Dmaven.test.skip=true package -P \!rpm-build
+
+cp core/target/ROOT.war /opt/tomcat/webapps/
+ln -s $TC/dev/traffic_router/conf/* /opt/tomcat/conf/
+
+/opt/tomcat/bin/catalina.sh jpda run

Review comment:
       TR exits immediately after starting. The contents of `/opt/tomcat/logs/catalina.2022-02-04.log`:
   ```java
   04-Feb-2022 00:41:39.532 SEVERE [main] org.apache.tomcat.util.digester.Digester.startElement Begin event threw exception
   	java.lang.ClassNotFoundException: org.apache.traffic_control.traffic_router.tomcat.TomcatLifecycleListener
   		at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:476)
   		at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589)
   		at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
   		at org.apache.tomcat.util.digester.ObjectCreateRule.begin(ObjectCreateRule.java:104)
   		at org.apache.catalina.startup.ListenerCreateRule.begin(ListenerCreateRule.java:70)
   		at org.apache.tomcat.util.digester.Digester.startElement(Digester.java:1293)
   		at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:510)
   		at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:183)
   		at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1377)
   		at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2710)
   		at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:605)
   		at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:534)
   		at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:888)
   		at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:824)
   		at java.xml/com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
   		at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1216)
   		at java.xml/com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:635)
   		at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1551)
   		at org.apache.catalina.startup.Catalina.parseServerXml(Catalina.java:617)
   		at org.apache.catalina.startup.Catalina.load(Catalina.java:709)
   		at org.apache.catalina.startup.Catalina.load(Catalina.java:746)
   		at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   		at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
   		at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   		at java.base/java.lang.reflect.Method.invoke(Method.java:566)
   		at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:302)
   		at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:472)
   ```
   So Tomcat cannot find `org.apache.traffic_control.traffic_router.tomcat.TomcatLifecycleListener`, which `server.xml` tells it to load: https://github.com/apache/trafficcontrol/blob/7b30bab1a6931927f092f78c74b5ad7b4f6ab8c0/dev/traffic_router/conf/server.xml#L21
   
   That is because, aside from `ROOT.war`, the Traffic Router RPM includes an entire `lib` directory (which duplicates the `lib` directory contained in `ROOT.war`, which contains `traffic_router_connector-6.2.0.jar`, which contains `TomcatLifecycleListener.class`. In order for Tomcat to find `traffic_router_connector-6.2.0.jar` (and assuming the `CATALINA_BASE` environment variable is `${TC}/dev/traffic_router`, `${TC}/dev/traffic_router/lib` can be a relative symlink to `traffic_router/core/target/ROOT/WEB-INF/lib`, generated by `mvn compile`.
   
   




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_router/Dockerfile
##########
@@ -0,0 +1,31 @@
+#
+#  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.
+#
+FROM alpine:latest AS trafficrouter-dev
+
+ENV TC=/root/go/src/github.com/apache/trafficcontrol
+VOLUME /root/go/src/github.com/apache/trafficcontrol
+ENV JPDA_OPTS="-agentlib:jdwp=transport=dt_socket,address=5005,server=y,suspend=n" JAVA_HOME=/usr/lib/jvm/java-11-openjdk M2_HOME=/root/.m2/
+EXPOSE 3053:53/tcp 3053:53/udp 3080:80 3443:443 3333:3333 2222:3443 5005:5005
+
+RUN apk add --no-cache openjdk11 inotify-tools maven && ln -s /usr/lib/jvm/java-11-openjdk/bin/jdb /bin/jdb
+
+ADD https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.43/bin/apache-tomcat-9.0.43.tar.gz /opt/tomcat.tgz
+RUN cd /opt && \
+	tar -xf tomcat.tgz && \
+	mv apache-tomcat-* tomcat && \
+	rm -rf tomcat.tgz tomcat/webapps/* tomcat/conf/web.xml tomcat/conf/server.xml tomcat/conf/logging.properties /usr/share/java/maven-3/conf/settings.xml

Review comment:
       Nit: The `-rf` should be just `-r` so as not to mask attempts to delete nonexistent files and directories




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_router/run.sh
##########
@@ -0,0 +1,39 @@
+#!/bin/sh
+# 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 -o errexit
+trap '[ $? -eq 0 ] && exit 0 || echo "Error on line ${LINENO} of ${0}"; exit 1' EXIT
+
+cd "$TC/traffic_router"
+
+mvn -Dmaven.test.skip=true compile -P \!rpm-build
+mvn -Dmaven.test.skip=true package -P \!rpm-build
+
+/opt/tomcat/bin/catalina.sh jpda run

Review comment:
       I removed them before they existed, and since I used `-f` it wasn't failing or warning me




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_router/Dockerfile
##########
@@ -0,0 +1,28 @@
+#
+#  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.
+#
+FROM alpine:latest AS trafficrouter-dev
+
+ENV TC=/root/go/src/github.com/apache/trafficcontrol
+VOLUME /root/go/src/github.com/apache/trafficcontrol
+ENV JPDA_OPTS="-agentlib:jdwp=transport=dt_socket,address=5005,server=y,suspend=n" JAVA_HOME=/usr/lib/jvm/java-8-openjdk M2_HOME=/root/.m2/
+EXPOSE 3053:53/tcp 3053:53/udp 3080:80 3443:443 3333:3333 2222:3443 5005:5005
+
+RUN apk add --no-cache openjdk8 inotify-tools maven && ln -s /usr/lib/jvm/java-1.8-openjdk/bin/jdb /bin/jdb
+
+ADD https://dlcdn.apache.org/tomcat/tomcat-9/v9.0.54/bin/apache-tomcat-9.0.54.tar.gz /opt/tomcat.tgz

Review comment:
       > _Can_ Traffic Router update to a supported version of Tomcat?
   
   Usually, but sometimes it takes additional effort like #5013, so it always needs to be tested.
   
   > should Traffic Router update to a supported version of Tomcat?
   
   Yes. On that note, now that spring-projects/spring-boot#28645 is fixed, we can upgrade to Tomcat 10, but only after migrating from Spring Framework to Spring Boot, which we should also do.




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/atc.dev.sh
##########
@@ -0,0 +1,160 @@
+# 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.
+
+alias atc-start="docker-compose up -d --build";
+alias atc-build="docker-compose build";
+alias atc-stop="docker-compose down -v --remove-orphans";

Review comment:
       Doing `docker-compose kill` before `docker-compose down` makes it stop faster

##########
File path: dev/traffic_router/Dockerfile
##########
@@ -0,0 +1,28 @@
+#
+#  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.
+#
+FROM alpine:latest AS trafficrouter-dev
+
+ENV TC=/root/go/src/github.com/apache/trafficcontrol
+VOLUME /root/go/src/github.com/apache/trafficcontrol
+ENV JPDA_OPTS="-agentlib:jdwp=transport=dt_socket,address=5005,server=y,suspend=n" JAVA_HOME=/usr/lib/jvm/java-8-openjdk M2_HOME=/root/.m2/
+EXPOSE 3053:53/tcp 3053:53/udp 3080:80 3443:443 3333:3333 2222:3443 5005:5005
+
+RUN apk add --no-cache openjdk8 inotify-tools maven && ln -s /usr/lib/jvm/java-1.8-openjdk/bin/jdb /bin/jdb
+
+ADD https://dlcdn.apache.org/tomcat/tomcat-9/v9.0.54/bin/apache-tomcat-9.0.54.tar.gz /opt/tomcat.tgz

Review comment:
       Getting a 404
   ```dockerfile
   > [trafficrouter-dev] https://dlcdn.apache.org/tomcat/tomcat-9/v9.0.54/bin/apache-tomcat-9.0.54.tar.gz:
   ------
   failed to solve: rpc error: code = Unknown desc = failed to load cache key: invalid response status 404
   ```
   
   Since the expected Tomcat version is 9.0.43 according to https://github.com/apache/trafficcontrol/blob/85f1073154a8cf3754fb454984b1e50a7a4e636c/traffic_router/build/build_rpm.sh#L83-L84 and not the latest Tomcat 9.0.x version, this should use https://archive.apache.org/ instead of dlcdn.apache.org.

##########
File path: dev/traffic_monitor/Dockerfile
##########
@@ -0,0 +1,23 @@
+#
+#  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.
+#
+FROM alpine:latest AS trafficmonitor-dev
+
+ENV TC=/root/go/src/github.com/apache/trafficcontrol
+VOLUME /root/go/src/github.com/apache/trafficcontrol
+EXPOSE 80 81
+
+RUN apk add --no-cache inotify-tools go && go install github.com/go-delve/delve/cmd/dlv@latest && ln -s /root/go/bin/dlv /usr/bin/dlv
+RUN mkdir /lib64 && ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2
+
+ENTRYPOINT /root/go/src/github.com/apache/trafficcontrol/dev/traffic_monitor/run.sh

Review comment:
       `ENTRYPOINT` should be replaced with `CMD`

##########
File path: dev/traffic_router/conf/log4j.properties
##########
@@ -0,0 +1,28 @@
+# 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.
+log4j.appender.ACCESS=org.apache.log4j.RollingFileAppender
+log4j.appender.ACCESS.File=/root/go/src/github.com/apache/trafficcontrol/dev/traffic_router/access.log
+log4j.appender.ACCESS.MaxFileSize=200MB
+log4j.appender.ACCESS.MaxBackupIndex=10
+log4j.appender.ACCESS.layout=org.apache.log4j.PatternLayout
+log4j.appender.ACCESS.layout.ConversionPattern=%m%n
+log4j.appender.ACCESS.threshold=INFO
+log4j.appender.A1=org.apache.log4j.RollingFileAppender
+log4j.appender.A1.file=/root/go/src/github.com/apache/trafficcontrol/dev/traffic_router/traffic_router.log
+log4j.appender.A1.maxFileSize=100MB
+log4j.appender.A1.layout=org.apache.log4j.PatternLayout
+log4j.appender.A1.layout.ConversionPattern=%-5p %d{yyyy-MM-dd'T'HH:mm:ss.SSS} [%t] %c - %m%n
+log4j.appender.A1.threshold=ALL
+log4j.rootLogger=ALL, A1
+log4j.logger.org.apache.traffic_control.traffic_router=ALL
+log4j.logger.org.apache.traffic_control.traffic_router.core.access=ALL
+log4j.additivity.org.apache.traffic_control.traffic_router.core.access=false

Review comment:
       Since Log4J was updated to version 2 in #6390, instead of `log4j.properties`, we need `log4j2.xml`: https://github.com/apache/trafficcontrol/blob/85f1073154a8cf3754fb454984b1e50a7a4e636c/traffic_router/core/src/main/conf/log4j2.xml#L1

##########
File path: dev/traffic_portal/Dockerfile
##########
@@ -0,0 +1,34 @@
+#
+#  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.
+#
+FROM alpine:latest AS certbuilder
+RUN apk add --no-cache openssl
+RUN openssl genrsa -passout pass:x -out server.pass.key 2048 && \
+	openssl rsa -passin pass:x -in server.pass.key -out server.key && \
+	rm server.pass.key && \
+	openssl req -new -key server.key -out server.csr \
+		-subj "/C=US/ST=CO/L=Denver/O=Apache/OU=Traffic Control/CN=trafficops.dev.ciab.test" && \
+	openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt && \
+	openssl rand 32 | base64 > /aes.key
+
+FROM node:alpine AS trafficportal-dev
+
+ENV TC="/root/go/src/github.com/apache/trafficcontrol/"
+VOLUME /root/go/src/github.com/apache/trafficcontrol
+EXPOSE 443
+ENV TP_SERVER_CONFIG_FILE="$TC/dev/traffic_portal/config.js"
+
+RUN apk add --no-cache ruby ruby-dev gcc musl-dev make && gem update --system && gem install sass compass
+COPY --from=certbuilder /server.key /server.crt /
+
+ENTRYPOINT /root/go/src/github.com/apache/trafficcontrol/dev/traffic_portal/run.sh

Review comment:
       `ENTRYPOINT` should be replaced with `CMD`

##########
File path: docker-compose.yml
##########
@@ -0,0 +1,116 @@
+# 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.
+
+---
+version: '3.5'
+
+services:
+    trafficops:
+        build:
+            context: dev/traffic_ops/
+        depends_on:
+            - db
+        domainname: dev.ciab.test
+        hostname: trafficops
+        image: trafficops-dev
+        ports:
+            - 6443:443
+            - 6444:6444
+        volumes:
+            - .:/root/go/src/github.com/apache/trafficcontrol/
+
+    db:
+        image: postgres:13.2-alpine
+        ports:
+            - 5432:5432
+        environment:
+            - POSTGRES_PASSWORD=twelve12
+        hostname: db
+        domainname: dev.ciab.test
+
+    trafficportal:
+        build:
+            context: dev/traffic_portal
+        depends_on:
+            - trafficops
+        hostname: trafficportal
+        domainname: dev.ciab.test
+        image: trafficportal-dev
+        ports:
+            - 444:443

Review comment:
       Why not `443:443`?

##########
File path: dev/t3c/Dockerfile
##########
@@ -0,0 +1,48 @@
+# 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:latest AS traffic-server-builder
+
+RUN apk add --no-cache build-base perl libexecinfo-dev pcre-dev libressl-dev libtool linux-headers openssl-dev zlib-dev
+ADD https://downloads.apache.org/trafficserver/trafficserver-9.1.0.tar.bz2 /
+RUN tar -xf trafficserver-9.1.0.tar.bz2 && cd trafficserver-9.1.0 && mkdir /ats && ./configure --prefix / --enable-experimental-plugins && make && make install && ls -R /ats

Review comment:
       Using `make -j6` instead of `make` on this line made this layer complete 8m53s faster (5m11s with `-j6` vs 14m4s without)

##########
File path: dev/traffic_router/run.sh
##########
@@ -0,0 +1,39 @@
+#!/bin/sh
+# 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 -o errexit
+trap '[ $? -eq 0 ] && exit 0 || echo "Error on line ${LINENO} of ${0}"; exit 1' EXIT
+
+cd "$TC/traffic_router"
+
+mvn -Dmaven.test.skip=true compile -P \!rpm-build
+mvn -Dmaven.test.skip=true package -P \!rpm-build
+
+/opt/tomcat/bin/catalina.sh jpda run

Review comment:
       Also before running `catalina.sh`, the compiled `ROOT.war` TR webapp (compiled to `traffic_router/core/target/ROOT.war`) should be copied to the tomcat `webapps` directory

##########
File path: dev/traffic_router/conf/trafficrouter.dev.ciab.test.crt
##########
@@ -0,0 +1,23 @@
+-----BEGIN CERTIFICATE-----

Review comment:
       `trafficrouter.dev.ciab.test.crt` can have the Apache License 2.0 header, right?

##########
File path: dev/traffic_router/Dockerfile
##########
@@ -0,0 +1,28 @@
+#
+#  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.
+#
+FROM alpine:latest AS trafficrouter-dev
+
+ENV TC=/root/go/src/github.com/apache/trafficcontrol
+VOLUME /root/go/src/github.com/apache/trafficcontrol
+ENV JPDA_OPTS="-agentlib:jdwp=transport=dt_socket,address=5005,server=y,suspend=n" JAVA_HOME=/usr/lib/jvm/java-8-openjdk M2_HOME=/root/.m2/

Review comment:
       JAVA_HOME should be `[...]/java-11-openjdk`

##########
File path: dev/traffic_router/conf/startup.properties
##########
@@ -0,0 +1,30 @@
+#
+# 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.
+
+# Any environment variables you define here will become part of the startup
+# environment for the 'traffic_router' service. It is a good place to set
+# command line arguments for the Java command line or any environment specific
+# setting you want available to the traffic_router process.
+# This file is not replaced by the update process when a new version of traffic
+# router is installed.
+CATALINA_OPTS="\
+	-server -Xms2g -Xmx8g \
+	-Dlog4j.configuration=file:///opt/tomcat/conf/log4j.properties \
+	-Djava.library.path=/usr/lib \

Review comment:
       `java.library.path` should also include `$CATALINA_BASE/lib` and `$CATALINA_HOME/lib` (`/opt/tomcat/lib`)

##########
File path: dev/traffic_router/Dockerfile
##########
@@ -0,0 +1,28 @@
+#
+#  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.
+#
+FROM alpine:latest AS trafficrouter-dev
+
+ENV TC=/root/go/src/github.com/apache/trafficcontrol
+VOLUME /root/go/src/github.com/apache/trafficcontrol
+ENV JPDA_OPTS="-agentlib:jdwp=transport=dt_socket,address=5005,server=y,suspend=n" JAVA_HOME=/usr/lib/jvm/java-8-openjdk M2_HOME=/root/.m2/
+EXPOSE 3053:53/tcp 3053:53/udp 3080:80 3443:443 3333:3333 2222:3443 5005:5005
+
+RUN apk add --no-cache openjdk8 inotify-tools maven && ln -s /usr/lib/jvm/java-1.8-openjdk/bin/jdb /bin/jdb

Review comment:
       Traffic Router uses OpenJDK 11 now

##########
File path: dev/traffic_router/conf/traffic_ops.properties
##########
@@ -0,0 +1,13 @@
+# 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.
+traffic_ops.username=admin
+traffic_ops.password=twelve12

Review comment:
       IMO the password should just be `"twelve"`. I know the TO API itself does not allow a user to set passwords to `"twelve"`, but because of that, there is no risk of re-using `"twelve"` as an insecure password. However, the same cannot be said for `"twelve12"`: Since TO validates it, it is in danger of making its way into prod environments.
   
   Also, `"twelve"` is the standard dev project everywhere except CDN in a Box.

##########
File path: dev/t3c/Dockerfile
##########
@@ -0,0 +1,48 @@
+# 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:latest AS traffic-server-builder
+
+RUN apk add --no-cache build-base perl libexecinfo-dev pcre-dev libressl-dev libtool linux-headers openssl-dev zlib-dev
+ADD https://downloads.apache.org/trafficserver/trafficserver-9.1.0.tar.bz2 /
+RUN tar -xf trafficserver-9.1.0.tar.bz2 && cd trafficserver-9.1.0 && mkdir /ats && ./configure --prefix / --enable-experimental-plugins && make && make install && ls -R /ats
+
+FROM alpine:latest AS t3c-dev
+
+ENV TC="/root/go/src/github.com/apache/trafficcontrol/"
+VOLUME /root/go/src/github.com/apache/trafficcontrol
+EXPOSE 80 8081
+
+COPY --from=traffic-server-builder /bin/traffic_cache_tool /bin/traffic_crashlog /bin/traffic_ctl /bin/traffic_layout /bin/traffic_logcat /bin/traffic_logstats /bin/traffic_manager /bin/traffic_server /bin/traffic_via /bin/trafficserver /bin/tspush /bin/tsxs /bin/
+COPY --from=traffic-server-builder /etc/trafficserver /etc/trafficserver
+COPY --from=traffic-server-builder /include/ts /include/ts
+COPY --from=traffic-server-builder /include/tscpp /include/tscpp
+COPY --from=traffic-server-builder /lib/perl5 /lib/perl5
+COPY --from=traffic-server-builder /lib/pkgconfig/trafficserver.pc /lib/pkgconfig/trafficserver.pc
+COPY --from=traffic-server-builder /lib/libtscore.la /lib/libtscore.so /lib/libtscore.so.9 /lib/libtscore.so.9.1.1 /lib/libtscppapi.la /lib/libtscppapi.so /lib/libtscppapi.so.9 /lib/libtscppapi.so.9.1.1 /lib/libtscpputil.la /lib/libtscpputil.so /lib/libtscpputil.so.9 /lib/libtscpputil.so.9.1.1 /lib/libtsmgmt.la /lib/libtsmgmt.so /lib/libtsmgmt.so.9 /lib/libtsmgmt.so.9.1.1 /lib/plugin_init_fail.la /lib/plugin_init_fail.so /lib/plugin_instinit_fail.la /lib/plugin_instinit_fail.so /lib/plugin_missing_deleteinstance.la /lib/plugin_missing_deleteinstance.so /lib/plugin_missing_doremap.la /lib/plugin_missing_doremap.so /lib/plugin_missing_init.la /lib/plugin_missing_init.so /lib/plugin_missing_newinstance.la /lib/plugin_missing_newinstance.so /lib/plugin_required_cb.la /lib/plugin_required_cb.so /lib/plugin_testing_calls.la /lib/plugin_testing_calls.so /lib/plugin_v1.la /lib/plugin_v1.so /lib/plugin_v2.la /lib/plugin_v2.so /lib/
+COPY --from=traffic-server-builder /libexec/trafficserver /libexec/trafficserver
+COPY --from=traffic-server-builder /share/man /share/man
+RUN mkdir /share/trafficserver && mkdir -p /var/log/trafficserver && mkdir /var/trafficserver
+
+RUN apk add --no-cache make inotify-tools go pcre libexecinfo && \
+	go install github.com/go-delve/delve/cmd/dlv@latest && \
+	ln -s /root/go/bin/dlv /usr/bin/dlv && \
+	mkdir /lib64 && \
+	ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2
+
+RUN echo "stats_over_http.so" >> /etc/trafficserver/plugin.config && echo "system_stats.so" >> /etc/trafficserver/plugin.config
+
+ENTRYPOINT /root/go/src/github.com/apache/trafficcontrol/dev/t3c/run.sh

Review comment:
       `ENTRYPOINT` are meant to point to a shell, not to a specific shell script (`CMD` is for the path to the shell script). When `ENTRYPOINT` points to a shell script, it makes it harder to run a one-off container like
   
   ```shell
   docker-compose run --rm --no-deps trafficrouter sh
   ```
   because it tries to pass `sh` as an argument to the shell script. So this should be `CMD`, not `ENTRYPOINT`.

##########
File path: dev/traffic_router/conf/startup.properties
##########
@@ -0,0 +1,30 @@
+#
+# 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.
+
+# Any environment variables you define here will become part of the startup
+# environment for the 'traffic_router' service. It is a good place to set
+# command line arguments for the Java command line or any environment specific
+# setting you want available to the traffic_router process.
+# This file is not replaced by the update process when a new version of traffic
+# router is installed.
+CATALINA_OPTS="\
+	-server -Xms2g -Xmx8g \
+	-Dlog4j.configuration=file:///opt/tomcat/conf/log4j.properties \

Review comment:
       should be `-Dlog4j.configurationFile=file://${CATALINA_BASE}/conf/log4j2.xml `

##########
File path: dev/atc.dev.sh
##########
@@ -0,0 +1,160 @@
+# 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.
+
+alias atc-start="docker-compose up -d --build";
+alias atc-build="docker-compose build";
+alias atc-stop="docker-compose down -v --remove-orphans";
+alias atc-restart="atc-stop && atc-start";
+
+function atc-ready {
+	local url="https://localhost:6443/api/4.0/ping";
+	if [[ $# -gt 0 ]]; then
+		case "$1" in
+			-w|--wait)
+				while ! curl -skL "$url" >/dev/null 2>&1; do
+					sleep 1;
+				done
+				return 0;;
+			-h|--help)
+				echo "Usage: $0 [-h] [-w]";
+				echo "";
+				echo "-h, --help  print usage information and exit";
+				echo "-w, --wait  wait for ATC to be ready, instead of just checking if it is ready";
+				return 0;;
+			*)
+				echo "Usage: $0 [-h] [-w]" >&2;
+				echo "" >&2;
+				echo "-h, --help  print usage information and exit" >&2;
+				echo "-w, --wait  wait for ATC to be ready, instead of just checking if it is ready" >&2;
+				return 1;;
+		esac
+	fi
+	curl -skL "$url" >/dev/null 2>&1;
+	return $?;
+}
+
+function atc-exec {
+	if [[ $# -lt 2 ]]; then
+		echo "Usage: atc-exec SERVICE CMD" >&2;
+		return 1;
+	fi;
+	local service="trafficcontrol_$1_1";
+	shift;
+	docker exec "$service" $@;
+	return $?;
+}
+
+function atc-connect {
+	if [[ $# -ne 1 ]]; then
+		echo "Usage: atc-connect SERVICE" >&2;
+		return 1;
+	fi;
+	docker exec -it "trafficcontrol_$1_1" /bin/sh;
+	return $?;
+}
+
+function atc {
+	if [[ $# -lt 1 ]]; then
+		echo "Usage: atc OPERATION" >&2;
+		return 1;
+	fi
+	local arg="$1";
+	shift;
+	case "$arg" in
+		build)
+			atc-build $@;;
+		connect)
+			atc-connect $@;;
+		exec)
+			atc-exec $@;;
+		ready)
+			atc-ready $@;;
+		restart)
+			atc-restart $@;;
+		start)
+			atc-start $@;;
+		stop)
+			atc-stop $@;;
+		-h|--help|/\?)
+			echo "Usage: atc OPERATION";
+			echo "";
+			echo "Valid OPERATIONs:";
+			echo "  build   Build the images for the environment, but do not start it";
+			echo "  connect Connect to a shell session inside a dev container";
+			echo "  exec    Run a command in a dev container";
+			echo "  ready   Check if the development environment is ready";
+			echo "  restart Retart up the development environment";
+			echo "  start   Start up the development environment";
+			echo "  stop    Stop the development environment";
+			;;
+		*)
+			echo "Usage: atc OPERATION" >&2;
+			echo "" >&2;
+			echo "Valid OPERATIONs:" >&2;
+			echo "  build   Build the images for the environment, but do not start it" >&2;
+			echo "  connect Connect to a shell session inside a dev container" >&2;
+			echo "  exec    Run a command in a dev container" >&2;
+			echo "  ready   Check if the development environment is ready" >&2;
+			echo "  restart Retart up the development environment" >&2;
+			echo "  start   Start up the development environment" >&2;
+			echo "  stop    Stop the development environment" >&2;
+			return 2;;
+	esac
+	return "$?";
+}
+
+export t3cDir="/root/go/src/github.com/apache/trafficcontrol/cache-config";
+
+function t3c {
+	trap 'atc-exec t3c ps | grep dlv | tr -s " " | cut -d " " -f1 | xargs docker exec trafficcontrol_t3c_1 kill' INT;
+	local dExec=(docker exec);
+	local dlv=();
+	if [[ ! -z "$TC_WAIT" ]]; then
+		dlv=(dlv --accept-multiclient --listen=:8081 --headless --api-version=2 debug --);
+	else;

Review comment:
       The semicolon in `else;` is causing a syntax error:
   
   ```shellcheck
   atc.dev.sh|128 error| syntax error near unexpected token `;'
   atc.dev.sh|128 error| `	else;'
   ```
   

##########
File path: dev/tpv2/Dockerfile
##########
@@ -0,0 +1,33 @@
+#
+#  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.
+#
+FROM alpine:latest AS certbuilder
+
+RUN apk add --no-cache openssl
+RUN openssl genrsa -passout pass:x -out server.pass.key 2048 && \
+	openssl rsa -passin pass:x -in server.pass.key -out server.key && \
+	rm server.pass.key && \
+	openssl req -new -key server.key -out server.csr \
+		-subj "/C=US/ST=CO/L=Denver/O=Apache/OU=Traffic Control/CN=trafficops.dev.ciab.test" && \
+	openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt && \
+	openssl rand 32 | base64 > /aes.key
+
+FROM node:alpine AS tpv2-dev
+
+ENV TC="/root/go/src/github.com/apache/trafficcontrol/"
+VOLUME /root/go/src/github.com/apache/trafficcontrol
+EXPOSE 443
+
+COPY --from=certbuilder /server.key /server.crt /
+
+ENTRYPOINT /root/go/src/github.com/apache/trafficcontrol/dev/tpv2/run.sh

Review comment:
       `ENTRYPOINT` should be replaced with `CMD`

##########
File path: dev/traffic_router/conf/traffic_monitor.properties
##########
@@ -0,0 +1,15 @@
+# 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.
+traffic_monitor.bootstrap.hosts=trafficmonitor:80;
+traffic_monitor.bootstrap.local = false
+traffic_monitor.properties=file:/opt/tomcat/conf/traffic_monitor.properties

Review comment:
       `run.sh` needs a command copying `dev/traffic_router/conf/traffic_monitor.properties ` to `/opt/tomcat/conf/traffic_monitor.properties`, since the `traffic_monitor.properties` property says that's where to find it. Without that command, `TrafficMonitorWatcher` returns an error:
   
   ```java
   trafficcontrol-trafficrouter-1  | 14:15:16.784 [pool-4-thread-1] FATAL org.apache.traffic_control.traffic_router.core.monitor.TrafficMonitorWatcher - /root/go/src/github.com/apache/trafficcontrol/dev/traffic_router/conf/$[traffic_monitor.properties] does not exist and the environment variable 'TRAFFIC_MONITOR_HOSTS' was not found
   ```

##########
File path: traffic_portal/package-lock.json
##########
@@ -1,6210 +1,8 @@
 {

Review comment:
       d7bf3d759d (*bump Tomcat version to one that's supported*) removes Traffic Portal's `package-lock.json`

##########
File path: dev/traffic_router/run.sh
##########
@@ -0,0 +1,39 @@
+#!/bin/sh
+# 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 -o errexit
+trap '[ $? -eq 0 ] && exit 0 || echo "Error on line ${LINENO} of ${0}"; exit 1' EXIT
+
+cd "$TC/traffic_router"
+
+mvn -Dmaven.test.skip=true compile -P \!rpm-build
+mvn -Dmaven.test.skip=true package -P \!rpm-build
+
+/opt/tomcat/bin/catalina.sh jpda run

Review comment:
       Before running `catalina.sh`, the demo webapps should be removed: https://github.com/apache/trafficcontrol/blob/85f1073154a8cf3754fb454984b1e50a7a4e636c/traffic_router/tomcat-rpm/tomcat.spec#L46-L47

##########
File path: dev/traffic_ops/Dockerfile
##########
@@ -0,0 +1,38 @@
+#
+#  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.
+#
+FROM alpine:latest AS certbuilder
+RUN apk add --no-cache openssl
+RUN openssl genrsa -passout pass:x -out server.pass.key 2048 && \
+	openssl rsa -passin pass:x -in server.pass.key -out server.key && \
+	rm server.pass.key && \
+	openssl req -new -key server.key -out server.csr \
+		-subj "/C=US/ST=CO/L=Denver/O=Apache/OU=Traffic Control/CN=trafficops.dev.ciab.test" && \
+	openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt && \
+	openssl rand 32 | base64 > /aes.key
+
+FROM alpine:latest AS trafficops-dev
+
+ENV TC="/root/go/src/github.com/apache/trafficcontrol/"
+VOLUME /root/go/src/github.com/apache/trafficcontrol
+ENV ADMIN="$TC/traffic_ops/app/db/admin"
+EXPOSE 443 6444
+
+COPY --from=certbuilder /server.key /server.crt /aes.key /
+RUN apk add --no-cache make inotify-tools go postgresql-client && go install github.com/go-delve/delve/cmd/dlv@latest && ln -s /root/go/bin/dlv /usr/bin/dlv
+RUN mkdir /lib64 && ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2
+
+COPY .pgpass /root/.pgpass
+RUN chmod 0600 /root/.pgpass
+
+ENTRYPOINT /root/go/src/github.com/apache/trafficcontrol/dev/traffic_ops/run.sh

Review comment:
       `ENTRYPOINT` should be replaced with `CMD`




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_router/run.sh
##########
@@ -0,0 +1,39 @@
+#!/bin/sh
+# 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 -o errexit
+trap '[ $? -eq 0 ] && exit 0 || echo "Error on line ${LINENO} of ${0}"; exit 1' EXIT
+
+cd "$TC/traffic_router"
+
+mvn -Dmaven.test.skip=true compile -P \!rpm-build
+mvn -Dmaven.test.skip=true package -P \!rpm-build
+
+/opt/tomcat/bin/catalina.sh jpda run

Review comment:
       Possibly. Since it's not working I'm unclear what needs to be in that directory.




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_router/run.sh
##########
@@ -0,0 +1,39 @@
+#!/bin/sh
+# 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 -o errexit
+trap '[ $? -eq 0 ] && exit 0 || echo "Error on line ${LINENO} of ${0}"; exit 1' EXIT
+
+cd "$TC/traffic_router"
+
+mvn -Dmaven.test.skip=true compile -P \!rpm-build
+mvn -Dmaven.test.skip=true package -P \!rpm-build
+
+/opt/tomcat/bin/catalina.sh jpda run

Review comment:
       One would think so. I'm still trying to get that to work.




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: traffic_portal/package-lock.json
##########
@@ -1,6210 +1,8 @@
 {

Review comment:
       It doesn't remove it, just reduces the lockfile version from 2 to 1, which eliminates a large amount of text. According to our docs, Traffic Portal works with NodeJS versions 12 and up. NodeJS 12 ships with NPM version 6, which does not have support for lockfile format version 2, so it should never have been changed to v2 in the first place.




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] ocket8888 commented on pull request #6532: CDN-in-a-Box for Developers

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


   I don't have time in the coming weeks to figure out how to make the Traffic Router service work, so I'd rather not spend any time making adjustments to it since I know it's not going to work anyway.


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: traffic_portal/package-lock.json
##########
@@ -1,6210 +1,8 @@
 {

Review comment:
       It doesn't remove it, just reduces the lockfile version from 2 to 1, which eliminates a large amount of text. According to our docs, Traffic Portal works with NodeJS versions 12 and up. NodeJS 12 ships with NPM version 6.12, which does not have support for lockfile format version 2, so it should never have been changed to v2 in the first place.




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_router/run.sh
##########
@@ -0,0 +1,39 @@
+#!/bin/sh
+# 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 -o errexit
+trap '[ $? -eq 0 ] && exit 0 || echo "Error on line ${LINENO} of ${0}"; exit 1' EXIT
+
+cd "$TC/traffic_router"
+
+mvn -Dmaven.test.skip=true compile -P \!rpm-build
+mvn -Dmaven.test.skip=true package -P \!rpm-build
+
+/opt/tomcat/bin/catalina.sh jpda run

Review comment:
       The demo webapps are still there




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_router/conf/startup.properties
##########
@@ -0,0 +1,30 @@
+#
+# 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.
+
+# Any environment variables you define here will become part of the startup
+# environment for the 'traffic_router' service. It is a good place to set
+# command line arguments for the Java command line or any environment specific
+# setting you want available to the traffic_router process.
+# This file is not replaced by the update process when a new version of traffic
+# router is installed.
+CATALINA_OPTS="\
+	-server -Xms2g -Xmx8g \
+	-Dlog4j.configuration=file:///opt/tomcat/conf/log4j.properties \

Review comment:
       still should be `-Dlog4j.configurationFile=file://[a-path]/conf/log4j2.xml `




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: docker-compose.yml
##########
@@ -0,0 +1,116 @@
+# 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.
+
+---
+version: '3.5'
+
+services:
+    trafficops:
+        build:
+            context: dev/traffic_ops/
+        depends_on:
+            - db
+        domainname: dev.ciab.test
+        hostname: trafficops
+        image: trafficops-dev
+        ports:
+            - 6443:443
+            - 6444:6444
+        volumes:
+            - .:/root/go/src/github.com/apache/trafficcontrol/
+
+    db:
+        image: postgres:13.2-alpine
+        ports:
+            - 5432:5432
+        environment:
+            - POSTGRES_PASSWORD=twelve12
+        hostname: db
+        domainname: dev.ciab.test
+
+    trafficportal:
+        build:
+            context: dev/traffic_portal
+        depends_on:
+            - trafficops
+        hostname: trafficportal
+        domainname: dev.ciab.test
+        image: trafficportal-dev
+        ports:
+            - 444:443

Review comment:
       Because the new Traffic Portal is using 443

##########
File path: docker-compose.yml
##########
@@ -0,0 +1,116 @@
+# 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.
+
+---
+version: '3.5'
+
+services:
+    trafficops:
+        build:
+            context: dev/traffic_ops/
+        depends_on:
+            - db
+        domainname: dev.ciab.test
+        hostname: trafficops
+        image: trafficops-dev
+        ports:
+            - 6443:443
+            - 6444:6444
+        volumes:
+            - .:/root/go/src/github.com/apache/trafficcontrol/
+
+    db:
+        image: postgres:13.2-alpine
+        ports:
+            - 5432:5432
+        environment:
+            - POSTGRES_PASSWORD=twelve12
+        hostname: db
+        domainname: dev.ciab.test
+
+    trafficportal:
+        build:
+            context: dev/traffic_portal
+        depends_on:
+            - trafficops
+        hostname: trafficportal
+        domainname: dev.ciab.test
+        image: trafficportal-dev
+        ports:
+            - 444:443

Review comment:
       Because the new Traffic Portal ("TPv2") is using 443




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_router/run.sh
##########
@@ -0,0 +1,39 @@
+#!/bin/sh
+# 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 -o errexit
+trap '[ $? -eq 0 ] && exit 0 || echo "Error on line ${LINENO} of ${0}"; exit 1' EXIT
+
+cd "$TC/traffic_router"
+
+mvn -Dmaven.test.skip=true compile -P \!rpm-build
+mvn -Dmaven.test.skip=true package -P \!rpm-build
+
+/opt/tomcat/bin/catalina.sh jpda run

Review comment:
       I got it working and removing the demo webapps was a required step




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_router/conf/startup.properties
##########
@@ -0,0 +1,30 @@
+#
+# 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.
+
+# Any environment variables you define here will become part of the startup
+# environment for the 'traffic_router' service. It is a good place to set
+# command line arguments for the Java command line or any environment specific
+# setting you want available to the traffic_router process.
+# This file is not replaced by the update process when a new version of traffic
+# router is installed.
+CATALINA_OPTS="\
+	-server -Xms2g -Xmx8g \
+	-Dlog4j.configuration=file:///opt/tomcat/conf/log4j.properties \

Review comment:
       should be `-Dlog4j.configurationFile=file://[...]/conf/log4j2.xml `




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_router/conf/startup.properties
##########
@@ -0,0 +1,30 @@
+#
+# 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.
+
+# Any environment variables you define here will become part of the startup
+# environment for the 'traffic_router' service. It is a good place to set
+# command line arguments for the Java command line or any environment specific
+# setting you want available to the traffic_router process.
+# This file is not replaced by the update process when a new version of traffic
+# router is installed.
+CATALINA_OPTS="\

Review comment:
       Right now, TR is not picking up any log4j2 stuff. If it does, it logs a *lot* more than it's logging right 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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_ops/seed.psql
##########
@@ -45,7 +45,7 @@ INSERT INTO snapshot (
 	monitoring
 ) VALUES (
 	'dev',
-	'{"config":{"dnssec.enabled":"false","domain_name":"ciab.test"},"contentServers":{"edge":{"cacheGroup":"dev","fqdn":"edge.dev.ciab.test","hashCount":999,"hashId":"edge","httpsPort":443,"interfaceName":"eth0","ip":"129.0.0.2","ip6":"","locationId":"dev","port":80,"profile":"EDGE_dev","status":"REPORTED","type":"EDGE","routingDisabled":0}},"deliveryServices":{"dev":{"anonymousBlockingEnabled":"false","coverageZoneOnly":"false","deepCachingType":"NEVER","dispersion":{"limit":1,"shuffled":"true"},"domains":["dev.ciab.test"],"ecsEnabled":"false","geolocationProvider":"maxmindGeolocationService","ip6RoutingEnabled":"false","matchsets":[{"protocol":"HTTP","matchlist":[{"regex":".*\\\\.dev\\\\..*","match-type":"HOST"}]}],"protocol":{"acceptHttps":"false","redirectToHttps":"false"},"regionalGeoBlocking":"false","routingName":"cdn","soa":{"admin":"traffic_ops","expire":"604800","minimum":"30","refresh":"28800","retry":"7200"},"sslEnabled":"false","ttls":{"A":"","AAAA":"","NS":"3600","SOA":"8
 6400"}}},"edgeLocations":{"dev":{"latitude":0,"longitude":0,"backupLocations":{"fallbackToClosest":"true"},"localizationMethods":["GEO","CZ","DEEP_CZ"]}},"monitors":{"trafficmonitor":{"fqdn":"trafficmonitor.dev.ciab.test","httpsPort":null,"ip":"129.0.0.1","ip6":"","location":"dev","port":80,"profile":"RASCAL_TM_dev","status":"ONLINE"}},"stats":{"CDN_name":"dev","date":1643833749,"tm_host":"trafficops","tm_user":"admin","tm_version":"development"}}',
+	'{"config":{"dnssec.enabled":"false","domain_name":"ciab.test","geolocation.polling.url":"file:///root/go/src/apache/trafficcontrol/traffic_router/core/src/test/resources/geo/GeoLite2-City.mmdb.gz"},"contentServers":{"edge":{"cacheGroup":"dev","fqdn":"edge.dev.ciab.test","hashCount":999,"hashId":"edge","httpsPort":443,"interfaceName":"eth0","ip":"129.0.0.2","ip6":"","locationId":"dev","port":80,"profile":"EDGE_dev","status":"REPORTED","type":"EDGE","routingDisabled":0}},"deliveryServices":{"dev":{"anonymousBlockingEnabled":"false","coverageZoneOnly":"false","deepCachingType":"NEVER","dispersion":{"limit":1,"shuffled":"true"},"domains":["dev.ciab.test"],"ecsEnabled":"false","geolocationProvider":"maxmindGeolocationService","ip6RoutingEnabled":"false","matchsets":[{"protocol":"HTTP","matchlist":[{"regex":".*\\\\.dev\\\\..*","match-type":"HOST"}]}],"protocol":{"acceptHttps":"false","redirectToHttps":"false"},"regionalGeoBlocking":"false","routingName":"cdn","soa":{"admin":"traffic_ops
 ","expire":"604800","minimum":"30","refresh":"28800","retry":"7200"},"sslEnabled":"false","ttls":{"A":"","AAAA":"","NS":"3600","SOA":"86400"}}},"edgeLocations":{"dev":{"latitude":0,"longitude":0,"backupLocations":{"fallbackToClosest":"true"},"localizationMethods":["GEO","CZ","DEEP_CZ"]}},"monitors":{"trafficmonitor":{"fqdn":"trafficmonitor.dev.ciab.test","httpsPort":null,"ip":"129.0.0.1","ip6":"","location":"dev","port":80,"profile":"RASCAL_TM_dev","status":"ONLINE"}},"stats":{"CDN_name":"dev","date":1643833749,"tm_host":"trafficops","tm_user":"admin","tm_version":"development"}}',

Review comment:
       > `file:///root/go/src/apache/`
   
   should be `file:///root/go/src/github.com/apache/`




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_ops/seed.psql
##########
@@ -0,0 +1,290 @@
+/* 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.
+*/
+
+INSERT INTO tm_user (
+	username,
+	tenant_id,
+	"role",
+	local_passwd,
+	confirm_local_passwd,
+	email,
+	full_name
+) VALUES (
+	'admin',
+	(SELECT id FROM tenant WHERE "name" = 'root'),
+	(SELECT id FROM "role" WHERE "name" = 'admin'),
+	-- 'twelve12' encrypted with SCRYPT
+	'SCRYPT:16384:8:1:p0Bppp/6IBeYxSwdLuYddsdMLBU/BNSlLY6fSIF7H1XW4eTbNVeMPVm7TuTEG4FM8PbqLlVwi8sPy8ZJznAlaQ==:sRcHWGe43mm/uEmXTIw37GcLEQZTlWAdf4vJqK8f0MDh8P+8gXoNx+nxWyb3r/0Bh+yyg0g/dUvti/ePZJL+Jw==',
+	'SCRYPT:16384:8:1:p0Bppp/6IBeYxSwdLuYddsdMLBU/BNSlLY6fSIF7H1XW4eTbNVeMPVm7TuTEG4FM8PbqLlVwi8sPy8ZJznAlaQ==:sRcHWGe43mm/uEmXTIw37GcLEQZTlWAdf4vJqK8f0MDh8P+8gXoNx+nxWyb3r/0Bh+yyg0g/dUvti/ePZJL+Jw==',
+	'admin@no-reply.atc.test',
+	'Development Admin User'
+)
+ON CONFLICT (username) DO NOTHING;
+
+INSERT INTO cdn (
+	"name",
+	domain_name
+) VALUES (
+	'dev',
+	'ciab.test'
+);
+
+INSERT INTO snapshot (
+	cdn,
+	crconfig,
+	monitoring
+) VALUES (
+	'dev',
+	'{"config":{"coveragezone.polling.url":"file:///root/go/src/github.com/apache/trafficcontrol/traffic_router/core/src/test/resources/czmap.json","dnssec.enabled":"false","domain_name":"ciab.test","geolocation.polling.url":"file:///root/go/src/github.com/apache/trafficcontrol/traffic_router/core/src/test/resources/geo/GeoLite2-City.mmdb.gz"},"contentServers":{"edge":{"cacheGroup":"dev","fqdn":"edge.dev.ciab.test","hashCount":999,"hashId":"edge","httpsPort":443,"interfaceName":"eth0","ip":"129.0.0.2","ip6":"","locationId":"dev","port":80,"profile":"EDGE_dev","status":"REPORTED","type":"EDGE","routingDisabled":0}},"deliveryServices":{"dev":{"anonymousBlockingEnabled":"false","coverageZoneOnly":"false","deepCachingType":"NEVER","dispersion":{"limit":1,"shuffled":"true"},"domains":["dev.ciab.test"],"ecsEnabled":"false","geolocationProvider":"maxmindGeolocationService","ip6RoutingEnabled":"false","matchsets":[{"protocol":"HTTP","matchlist":[{"regex":".*\\\\.dev\\\\..*","match-type":"HOST"
 }]}],"protocol":{"acceptHttps":"false","redirectToHttps":"false"},"regionalGeoBlocking":"false","routingName":"cdn","soa":{"admin":"traffic_ops","expire":"604800","minimum":"30","refresh":"28800","retry":"7200"},"sslEnabled":"false","ttls":{"A":"","AAAA":"","NS":"3600","SOA":"86400"}}},"edgeLocations":{"dev":{"latitude":0,"longitude":0,"backupLocations":{"fallbackToClosest":"true"},"localizationMethods":["GEO","CZ","DEEP_CZ"]}},"monitors":{"trafficmonitor":{"fqdn":"trafficmonitor.dev.ciab.test","httpsPort":null,"ip":"129.0.0.1","ip6":"","location":"dev","port":80,"profile":"RASCAL_TM_dev","status":"ONLINE"}},"stats":{"CDN_name":"dev","date":1643833749,"tm_host":"trafficops","tm_user":"admin","tm_version":"development"}}',

Review comment:
       In order for `coveragezone.polling.url` and `geolocation.polling.url` to show up in a snapshotted CRConfig,
   * The parameters need to be assigned to a Traffic Router profile for config file `CRConfig.json`
   * The Traffic Router profile should have an `ONLINE`-status Traffic Router assigned to it
   
   As a result of doing this, a `contentRouters` section is also added to the CRConfig. Since this snapshot in the `snapshot` table does not have a `contentRouters` section, Traffic Router rejects the CRConfig. Logged at `org.apache.traffic_control.traffic_router.core.monitor.TrafficMonitorWatcher:119`:
   ```
   Failed querying JSON for key: contentRouters
   ```




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman commented on pull request #6532: CDN-in-a-Box for Developers

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


   Once these changes are made, TR responds on port 80 and port 3333:
   ```jsonc
   [zrhoffman@computer trafficcontrol]$ docker-compose exec -T trafficops wget -O- trafficrouter:3333/crs/stats 2>/dev/null | jq
   {
     "app": {
       "buildTimestamp": "2022-02-07",
       "name": "traffic_router",
       "deploy-dir": "/opt/traffic_router",
       "git-revision": "${buildNumber}",
       "version": "6.2.0"
     },
     "stats": {
       "dnsMap": {},
       "httpMap": {},
       "totalDnsCount": 0,
       "totalHttpCount": 0,
       "totalDsMissCount": 1,
       "appStartTime": 1644274479863,
       "averageDnsTime": 0,
       "averageHttpTime": 0,
       "updateTracker": {
         "lastHttpsCertificatesCheck": 1644274540167,
         "lastCacheStateCheck": 1644274653886,
         "lastCacheStateChange": 1644274480649,
         "lastLetsEncryptDnsChallengeWatcherCheck": 1644274600401,
         "lastHttpsCertificatesFetchSuccess": 1644274540346,
         "lastConfigCheck": 1644274540186,
         "lastConfigChange": 1644274540200,
         "lastSteeringWatcherCheck": 1644274651137,
         "lastNetworkUpdaterCheck": 1644274480509,
         "lastGeolocationDatabaseUpdaterCheck": 1644274480509,
         "lastHttpsCertificatesFetchAttempt": 1644274540167
       }
     }
   }
   ```


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman commented on pull request #6532: CDN-in-a-Box for Developers

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


   > With these changes, Traffic Router gets closer to serving over port 443 and port 3443. The exception they still run into:
   > [...]
   > Maybe it doesn't like the SSL cert?
   
   `certificateRegistry.getHandshakeData()` is empty at https://github.com/apache/trafficcontrol/blob/36829433dabcd7a169d7aaedc41b78b1d004ff7e/traffic_router/connector/src/main/java/org/apache/traffic_control/traffic_router/protocol/RouterNioEndpoint.java#L53 , so it looks like the cert is not getting imported successfully.


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_router/conf/startup.properties
##########
@@ -0,0 +1,30 @@
+#
+# 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.
+
+# Any environment variables you define here will become part of the startup
+# environment for the 'traffic_router' service. It is a good place to set
+# command line arguments for the Java command line or any environment specific
+# setting you want available to the traffic_router process.
+# This file is not replaced by the update process when a new version of traffic
+# router is installed.
+CATALINA_OPTS="\
+	-server -Xms2g -Xmx8g \
+	-Dlog4j.configuration=file:///opt/tomcat/conf/log4j.properties \
+	-Djava.library.path=/usr/lib \

Review comment:
       `java.library.path` should also include `$CATALINA_BASE/lib` and `$CATALINA_HOME/lib` (`/opt/tomcat/lib`)




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_router/conf/startup.properties
##########
@@ -0,0 +1,30 @@
+#
+# 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.
+
+# Any environment variables you define here will become part of the startup
+# environment for the 'traffic_router' service. It is a good place to set
+# command line arguments for the Java command line or any environment specific
+# setting you want available to the traffic_router process.
+# This file is not replaced by the update process when a new version of traffic
+# router is installed.
+CATALINA_OPTS="\
+	-server -Xms2g -Xmx8g \
+	-Dlog4j.configuration=file:///opt/tomcat/conf/log4j.properties \

Review comment:
       should be `-Dlog4j.configurationFile=file://[a-path]/conf/log4j2.xml `




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_router/run.sh
##########
@@ -0,0 +1,39 @@
+#!/bin/sh
+# 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 -o errexit
+trap '[ $? -eq 0 ] && exit 0 || echo "Error on line ${LINENO} of ${0}"; exit 1' EXIT
+
+cd "$TC/traffic_router"
+
+mvn -Dmaven.test.skip=true compile -P \!rpm-build
+mvn -Dmaven.test.skip=true package -P \!rpm-build
+
+/opt/tomcat/bin/catalina.sh jpda run

Review comment:
       Responded at <https://github.com/apache/trafficcontrol/pull/6532#issuecomment-1027131794>. The TR changes are sufficient for TR itself to work, the missing pieces are outside of TR.




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_router/run.sh
##########
@@ -18,7 +18,7 @@
 
 set -o errexit
 
-cd "$TC/traffic_router"
+cd "$TC/dev/traffic_router"
 
 mvn -Dmaven.test.skip=true compile package -P \!rpm-build

Review comment:
       :facepalm: 




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_router/conf/startup.properties
##########
@@ -0,0 +1,30 @@
+#
+# 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.
+
+# Any environment variables you define here will become part of the startup
+# environment for the 'traffic_router' service. It is a good place to set
+# command line arguments for the Java command line or any environment specific
+# setting you want available to the traffic_router process.
+# This file is not replaced by the update process when a new version of traffic
+# router is installed.
+CATALINA_OPTS="\

Review comment:
       > This is not resolved
   
   I thought it was - the file is gone, and Traffic Router seems to not need any of these settings to work so I don't think we need them anywhere else. The only one of these I actually understand is the library path, and I'm like 95% sure that only matters for Tomcat Native, which isn't being used in the dev environment. Not sure what the others mean but they can't be terribly important if it's working without them, can they?




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_router/conf/log4j2.xml
##########
@@ -0,0 +1,34 @@
+<?xml version='1.0' encoding='utf-8'?>
+<!--
+
+	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.
+ -->
+<Configuration>
+	<Appenders>
+		<Console name="stdout" target="SYSTEM_OUT">
+			<PatternLayout pattern="%-5p %d{yyyy-MM-dd'T'HH:mm:ss.SSS} [%t] %c - %m%n"/>
+			<ThresholdFilter level="ALL"/>
+		</Console>
+	</Appenders>
+	<Loggers>
+		<Logger name="org.apache.traffic_control.traffic_router" level="INFO" additivity="false">
+			<AppenderRef ref="stdout"/>
+		</Logger>
+		<Logger name="org.apache.traffic_control.traffic_router.core.access" level="INFO" additivity="false">
+			<AppenderRef ref="stdout"/>
+		</Logger>
+		<Root level="ALL" additivity="false">

Review comment:
       We could try debug... There's a lot of messages printed not from TR, but from dependencies, IMO we should just not have those




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_router/conf/log4j2.xml
##########
@@ -0,0 +1,34 @@
+<?xml version='1.0' encoding='utf-8'?>
+<!--
+
+	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.
+ -->
+<Configuration>
+	<Appenders>
+		<Console name="stdout" target="SYSTEM_OUT">
+			<PatternLayout pattern="%-5p %d{yyyy-MM-dd'T'HH:mm:ss.SSS} [%t] %c - %m%n"/>
+			<ThresholdFilter level="ALL"/>
+		</Console>
+	</Appenders>
+	<Loggers>
+		<Logger name="org.apache.traffic_control.traffic_router" level="INFO" additivity="false">
+			<AppenderRef ref="stdout"/>
+		</Logger>
+		<Logger name="org.apache.traffic_control.traffic_router.core.access" level="INFO" additivity="false">
+			<AppenderRef ref="stdout"/>
+		</Logger>
+		<Root level="ALL" additivity="false">

Review comment:
       I'll turn it down and check the class names I'm seeing in the logs




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: docker-compose.yml
##########
@@ -0,0 +1,116 @@
+# 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.
+
+---
+version: '3.5'
+
+services:
+    trafficops:
+        build:
+            context: dev/traffic_ops/
+        depends_on:
+            - db
+        domainname: dev.ciab.test

Review comment:
       Instead of specifying the domain, add it the `trafficops` service to a network:
   ```yml
           networks:
             - ciab
   ```

##########
File path: docker-compose.yml
##########
@@ -0,0 +1,116 @@
+# 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.
+
+---
+version: '3.5'
+
+services:
+    trafficops:
+        build:
+            context: dev/traffic_ops/
+        depends_on:
+            - db
+        domainname: dev.ciab.test
+        hostname: trafficops
+        image: trafficops-dev
+        ports:
+            - 6443:443
+            - 6444:6444
+        volumes:
+            - .:/root/go/src/github.com/apache/trafficcontrol/
+
+    db:
+        image: postgres:13.2-alpine
+        ports:
+            - 5432:5432
+        environment:
+            - POSTGRES_PASSWORD=twelve12
+        hostname: db
+        domainname: dev.ciab.test
+
+    trafficportal:
+        build:
+            context: dev/traffic_portal
+        depends_on:
+            - trafficops
+        hostname: trafficportal
+        domainname: dev.ciab.test
+        image: trafficportal-dev
+        ports:
+            - 444:443
+        volumes:
+            - .:/root/go/src/github.com/apache/trafficcontrol
+
+    tpv2:
+        build:
+            context: dev/tpv2
+        depends_on:
+            - trafficops
+        hostname: tpv2
+        domainname: dev.ciab.test

Review comment:
       Instead of specifying the domain, add it the `tpv2` service to a network:
   ```yml
           networks:
             - ciab
   ```

##########
File path: docker-compose.yml
##########
@@ -0,0 +1,116 @@
+# 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.
+
+---
+version: '3.5'
+
+services:
+    trafficops:
+        build:
+            context: dev/traffic_ops/
+        depends_on:
+            - db
+        domainname: dev.ciab.test
+        hostname: trafficops
+        image: trafficops-dev
+        ports:
+            - 6443:443
+            - 6444:6444
+        volumes:
+            - .:/root/go/src/github.com/apache/trafficcontrol/
+
+    db:
+        image: postgres:13.2-alpine
+        ports:
+            - 5432:5432
+        environment:
+            - POSTGRES_PASSWORD=twelve12
+        hostname: db
+        domainname: dev.ciab.test
+
+    trafficportal:
+        build:
+            context: dev/traffic_portal
+        depends_on:
+            - trafficops
+        hostname: trafficportal
+        domainname: dev.ciab.test
+        image: trafficportal-dev
+        ports:
+            - 444:443
+        volumes:
+            - .:/root/go/src/github.com/apache/trafficcontrol
+
+    tpv2:
+        build:
+            context: dev/tpv2
+        depends_on:
+            - trafficops
+        hostname: tpv2
+        domainname: dev.ciab.test
+        image: tpv2-dev
+        ports:
+            - 443:443
+        volumes:
+            - .:/root/go/src/github.com/apache/trafficcontrol
+
+    trafficmonitor:
+        build:
+            context: dev/traffic_monitor
+        depends_on:
+            - trafficops
+        hostname: trafficmonitor
+        domainname: dev.ciab.test

Review comment:
       Instead of specifying the domain, add it the `trafficmonitor` service to a network:
   ```yml
           networks:
             - ciab
   ```

##########
File path: docker-compose.yml
##########
@@ -0,0 +1,116 @@
+# 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.
+
+---
+version: '3.5'
+
+services:
+    trafficops:
+        build:
+            context: dev/traffic_ops/
+        depends_on:
+            - db
+        domainname: dev.ciab.test
+        hostname: trafficops
+        image: trafficops-dev
+        ports:
+            - 6443:443
+            - 6444:6444
+        volumes:
+            - .:/root/go/src/github.com/apache/trafficcontrol/
+
+    db:
+        image: postgres:13.2-alpine
+        ports:
+            - 5432:5432
+        environment:
+            - POSTGRES_PASSWORD=twelve12
+        hostname: db
+        domainname: dev.ciab.test
+
+    trafficportal:
+        build:
+            context: dev/traffic_portal
+        depends_on:
+            - trafficops
+        hostname: trafficportal
+        domainname: dev.ciab.test
+        image: trafficportal-dev
+        ports:
+            - 444:443
+        volumes:
+            - .:/root/go/src/github.com/apache/trafficcontrol
+
+    tpv2:
+        build:
+            context: dev/tpv2
+        depends_on:
+            - trafficops
+        hostname: tpv2
+        domainname: dev.ciab.test
+        image: tpv2-dev
+        ports:
+            - 443:443
+        volumes:
+            - .:/root/go/src/github.com/apache/trafficcontrol
+
+    trafficmonitor:
+        build:
+            context: dev/traffic_monitor
+        depends_on:
+            - trafficops
+        hostname: trafficmonitor
+        domainname: dev.ciab.test
+        image: trafficmonitor-dev
+        ports:
+            - 80:80
+            - 81:81
+        volumes:
+            - .:/root/go/src/github.com/apache/trafficcontrol
+
+    t3c:
+        build:
+            context: dev/t3c
+        depends_on:
+            - trafficops
+        hostname: edge
+        domainname: dev.ciab.test

Review comment:
       Instead of specifying the domain, add it the `t3c` service to a network:
   ```yml
           networks:
             - ciab
   ```

##########
File path: docker-compose.yml
##########
@@ -0,0 +1,116 @@
+# 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.
+
+---
+version: '3.5'
+
+services:
+    trafficops:
+        build:
+            context: dev/traffic_ops/
+        depends_on:
+            - db
+        domainname: dev.ciab.test
+        hostname: trafficops
+        image: trafficops-dev
+        ports:
+            - 6443:443
+            - 6444:6444
+        volumes:
+            - .:/root/go/src/github.com/apache/trafficcontrol/
+
+    db:
+        image: postgres:13.2-alpine
+        ports:
+            - 5432:5432
+        environment:
+            - POSTGRES_PASSWORD=twelve12
+        hostname: db
+        domainname: dev.ciab.test

Review comment:
       Instead of specifying the domain, add it the `db` service to a network:
   ```yml
           networks:
             - ciab
   ```

##########
File path: docker-compose.yml
##########
@@ -0,0 +1,116 @@
+# 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.
+
+---
+version: '3.5'
+
+services:
+    trafficops:
+        build:
+            context: dev/traffic_ops/
+        depends_on:
+            - db
+        domainname: dev.ciab.test
+        hostname: trafficops
+        image: trafficops-dev
+        ports:
+            - 6443:443
+            - 6444:6444
+        volumes:
+            - .:/root/go/src/github.com/apache/trafficcontrol/
+
+    db:
+        image: postgres:13.2-alpine
+        ports:
+            - 5432:5432
+        environment:
+            - POSTGRES_PASSWORD=twelve12
+        hostname: db
+        domainname: dev.ciab.test
+
+    trafficportal:
+        build:
+            context: dev/traffic_portal
+        depends_on:
+            - trafficops
+        hostname: trafficportal
+        domainname: dev.ciab.test

Review comment:
       Instead of specifying the domain, add it the `trafficportal` service to a network:
   ```yml
           networks:
             - ciab
   ```

##########
File path: docker-compose.yml
##########
@@ -0,0 +1,116 @@
+# 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.
+
+---
+version: '3.5'
+
+services:
+    trafficops:
+        build:
+            context: dev/traffic_ops/
+        depends_on:
+            - db
+        domainname: dev.ciab.test
+        hostname: trafficops
+        image: trafficops-dev
+        ports:
+            - 6443:443
+            - 6444:6444
+        volumes:
+            - .:/root/go/src/github.com/apache/trafficcontrol/
+
+    db:
+        image: postgres:13.2-alpine
+        ports:
+            - 5432:5432
+        environment:
+            - POSTGRES_PASSWORD=twelve12
+        hostname: db
+        domainname: dev.ciab.test
+
+    trafficportal:
+        build:
+            context: dev/traffic_portal
+        depends_on:
+            - trafficops
+        hostname: trafficportal
+        domainname: dev.ciab.test
+        image: trafficportal-dev
+        ports:
+            - 444:443
+        volumes:
+            - .:/root/go/src/github.com/apache/trafficcontrol
+
+    tpv2:
+        build:
+            context: dev/tpv2
+        depends_on:
+            - trafficops
+        hostname: tpv2
+        domainname: dev.ciab.test
+        image: tpv2-dev
+        ports:
+            - 443:443
+        volumes:
+            - .:/root/go/src/github.com/apache/trafficcontrol
+
+    trafficmonitor:
+        build:
+            context: dev/traffic_monitor
+        depends_on:
+            - trafficops
+        hostname: trafficmonitor
+        domainname: dev.ciab.test
+        image: trafficmonitor-dev
+        ports:
+            - 80:80
+            - 81:81
+        volumes:
+            - .:/root/go/src/github.com/apache/trafficcontrol
+
+    t3c:
+        build:
+            context: dev/t3c
+        depends_on:
+            - trafficops
+        hostname: edge
+        domainname: dev.ciab.test
+        image: t3c-dev
+        ports:
+            - 8080:80
+            - 8081:8081
+        volumes:
+            - .:/root/go/src/github.com/apache/trafficcontrol
+
+    trafficrouter:
+        build:
+            context: dev/traffic_router
+        depends_on:
+            - trafficmonitor
+        hostname: trafficrouter
+        domainname: dev.ciab.test

Review comment:
       Instead of specifying the domain, add it the `trafficrouter` service to a network:
   ```yml
           networks:
             - ciab
   ```

##########
File path: docker-compose.yml
##########
@@ -0,0 +1,116 @@
+# 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.
+
+---
+version: '3.5'
+
+services:
+    trafficops:
+        build:
+            context: dev/traffic_ops/
+        depends_on:
+            - db
+        domainname: dev.ciab.test
+        hostname: trafficops
+        image: trafficops-dev
+        ports:
+            - 6443:443
+            - 6444:6444
+        volumes:
+            - .:/root/go/src/github.com/apache/trafficcontrol/
+
+    db:
+        image: postgres:13.2-alpine
+        ports:
+            - 5432:5432
+        environment:
+            - POSTGRES_PASSWORD=twelve12
+        hostname: db
+        domainname: dev.ciab.test
+
+    trafficportal:
+        build:
+            context: dev/traffic_portal
+        depends_on:
+            - trafficops
+        hostname: trafficportal
+        domainname: dev.ciab.test
+        image: trafficportal-dev
+        ports:
+            - 444:443
+        volumes:
+            - .:/root/go/src/github.com/apache/trafficcontrol
+
+    tpv2:
+        build:
+            context: dev/tpv2
+        depends_on:
+            - trafficops
+        hostname: tpv2
+        domainname: dev.ciab.test
+        image: tpv2-dev
+        ports:
+            - 443:443
+        volumes:
+            - .:/root/go/src/github.com/apache/trafficcontrol
+
+    trafficmonitor:
+        build:
+            context: dev/traffic_monitor
+        depends_on:
+            - trafficops
+        hostname: trafficmonitor
+        domainname: dev.ciab.test
+        image: trafficmonitor-dev
+        ports:
+            - 80:80
+            - 81:81
+        volumes:
+            - .:/root/go/src/github.com/apache/trafficcontrol
+
+    t3c:
+        build:
+            context: dev/t3c
+        depends_on:
+            - trafficops
+        hostname: edge
+        domainname: dev.ciab.test
+        image: t3c-dev
+        ports:
+            - 8080:80
+            - 8081:8081
+        volumes:
+            - .:/root/go/src/github.com/apache/trafficcontrol
+
+    trafficrouter:
+        build:
+            context: dev/traffic_router
+        depends_on:
+            - trafficmonitor
+        hostname: trafficrouter
+        domainname: dev.ciab.test
+        image: trafficrouter-dev
+        ports:
+            - 3053:53/tcp
+            - 3053:53/udp
+            - 3080:80
+            - 3443:443
+            - 3333:3333
+            - 2222:3443
+            - 5005:5005
+        volumes:
+            - .:/root/go/src/github.com/apache/trafficcontrol

Review comment:
       There should be a `networks` section so you can specify the domain  name of your network:
   ```yml
   networks:
     ciab:
       name: dev.ciab.test
   ```




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_router/Dockerfile
##########
@@ -0,0 +1,31 @@
+#
+#  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.
+#
+FROM alpine:latest AS trafficrouter-dev
+
+ENV TC=/root/go/src/github.com/apache/trafficcontrol
+VOLUME /root/go/src/github.com/apache/trafficcontrol
+ENV JPDA_OPTS="-agentlib:jdwp=transport=dt_socket,address=5005,server=y,suspend=n" JAVA_HOME=/usr/lib/jvm/java-11-openjdk M2_HOME=/root/.m2/
+EXPOSE 3053:53/tcp 3053:53/udp 3080:80 3443:443 3333:3333 2222:3443 5005:5005
+
+RUN apk add --no-cache openjdk11 inotify-tools maven && ln -s /usr/lib/jvm/java-11-openjdk/bin/jdb /bin/jdb

Review comment:
       Need to get `tomcat-native` and `openssl` in order for SSL to work. Once added, you should see these lines in `/opt/tomcat/logs/catalina.2022-02-07.log`:
   
   ```java
   07-Feb-2022 23:46:54.401 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded Apache Tomcat Native library [1.2.31] using APR version [1.7.0].
   ```
   
   and
   
   ```java
   07-Feb-2022 23:46:54.403 INFO [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized [OpenSSL 1.1.1l  24 Aug 2021]
   ```

##########
File path: dev/traffic_router/conf/startup.properties
##########
@@ -0,0 +1,30 @@
+#
+# 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.
+
+# Any environment variables you define here will become part of the startup
+# environment for the 'traffic_router' service. It is a good place to set
+# command line arguments for the Java command line or any environment specific
+# setting you want available to the traffic_router process.
+# This file is not replaced by the update process when a new version of traffic
+# router is installed.
+CATALINA_OPTS="\

Review comment:
       There is no mechanism with Java or Tomcat that automatically reads these variables from `startup.properties`. It's an ATC-specific thing, used as the `EnvironmentFile` for systemd:
   https://github.com/apache/trafficcontrol/blob/36829433dabcd7a169d7aaedc41b78b1d004ff7e/traffic_router/core/src/main/lib/systemd/system/traffic_router.service#L27
   CDN in a Box handles this by defining them in the shell script (and exporting them later):
   https://github.com/apache/trafficcontrol/blob/36829433dabcd7a169d7aaedc41b78b1d004ff7e/infrastructure/cdn-in-a-box/traffic_router/run.sh#L42
   
   https://github.com/apache/trafficcontrol/blob/36829433dabcd7a169d7aaedc41b78b1d004ff7e/infrastructure/cdn-in-a-box/traffic_router/run.sh#L57-L61




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman commented on pull request #6532: CDN-in-a-Box for Developers

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


   There are conflicts now that #6513 is 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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: docker-compose.yml
##########
@@ -0,0 +1,116 @@
+# 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.
+
+---
+version: '3.5'
+
+services:
+    trafficops:
+        build:
+            context: dev/traffic_ops/
+        depends_on:
+            - db
+        domainname: dev.ciab.test
+        hostname: trafficops
+        image: trafficops-dev
+        ports:
+            - 6443:443
+            - 6444:6444
+        volumes:
+            - .:/root/go/src/github.com/apache/trafficcontrol/
+
+    db:
+        image: postgres:13.2-alpine
+        ports:
+            - 5432:5432
+        environment:
+            - POSTGRES_PASSWORD=twelve12
+        hostname: db
+        domainname: dev.ciab.test
+
+    trafficportal:
+        build:
+            context: dev/traffic_portal
+        depends_on:
+            - trafficops
+        hostname: trafficportal
+        domainname: dev.ciab.test
+        image: trafficportal-dev
+        ports:
+            - 444:443
+        volumes:
+            - .:/root/go/src/github.com/apache/trafficcontrol
+
+    tpv2:
+        build:
+            context: dev/tpv2
+        depends_on:
+            - trafficops
+        hostname: tpv2
+        domainname: dev.ciab.test
+        image: tpv2-dev
+        ports:
+            - 443:443
+        volumes:
+            - .:/root/go/src/github.com/apache/trafficcontrol
+
+    trafficmonitor:
+        build:
+            context: dev/traffic_monitor
+        depends_on:
+            - trafficops
+        hostname: trafficmonitor
+        domainname: dev.ciab.test
+        image: trafficmonitor-dev
+        ports:
+            - 80:80
+            - 81:81
+        volumes:
+            - .:/root/go/src/github.com/apache/trafficcontrol
+
+    t3c:
+        build:
+            context: dev/t3c
+        depends_on:
+            - trafficops
+        hostname: edge
+        domainname: dev.ciab.test
+        image: t3c-dev
+        ports:
+            - 8080:80
+            - 8081:8081
+        volumes:
+            - .:/root/go/src/github.com/apache/trafficcontrol
+
+    trafficrouter:
+        build:
+            context: dev/traffic_router
+        depends_on:
+            - trafficmonitor
+        hostname: trafficrouter
+        domainname: dev.ciab.test
+        image: trafficrouter-dev
+        ports:
+            - 3053:53/tcp
+            - 3053:53/udp
+            - 3080:80
+            - 3443:443
+            - 3333:3333
+            - 2222:3443
+            - 5005:5005
+        volumes:
+            - .:/root/go/src/github.com/apache/trafficcontrol

Review comment:
       It needs `driver: bridge` though




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman edited a comment on pull request #6532: CDN-in-a-Box for Developers

Posted by GitBox <gi...@apache.org>.
zrhoffman edited a comment on pull request #6532:
URL: https://github.com/apache/trafficcontrol/pull/6532#issuecomment-1027131794


   > I had done that, and it would start but it was not servicing any HTTP or DNS requests I threw at it.
   
   That is normal if it cannot fetch the CrConfig yet, it only serves HTTP and DNS responses *after* that point. Once the  comments I have made on #6532 are addressed, TR prints only this message repeatedly:
   
   ```java
   trafficcontrol-trafficrouter-1  | 17:43:00.361 [pool-3-thread-1] ERROR org.apache.traffic_control.traffic_router.core.secure.CertificatesClient - No traffic ops hostname yet!
   ```
   which makes sense, since TM does not serve a CrConfig.
   
   ```
   trafficrouter:/# curl -v trafficmonitor/publish/CrConfig;
   *   Trying 172.25.0.4:80...
   * Connected to trafficmonitor (172.25.0.4) port 80 (#0)
   > GET /publish/CrConfig HTTP/1.1
   > Host: trafficmonitor
   > User-Agent: curl/7.80.0
   > Accept: */*
   >
   * Mark bundle as not supporting multiuse
   < HTTP/1.1 503 Service Unavailable
   < Date: Tue, 01 Feb 2022 17:59:21 GMT
   < Content-Length: 19
   < Content-Type: text/plain; charset=utf-8
   <
   * Connection #0 to host trafficmonitor left intact
   Service Unavailable
   ```
   
   Corresponding message from Traffic Monitor logs:
   
   ```go
   trafficcontrol-trafficmonitor-1  | ERROR: datareq.go:161: 2022-02-01T18:00:21.366963347Z: Request Error: /publish/CrConfig: service still starting, some caches unpolled: map[]
   ```
   
   So, the key to getting TR to serve HTTP and DNS responses is to get Traffic Monitor to serve the CrConfig. The TR piece works fine with the suggested changes.


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_router/conf/trafficrouter.dev.ciab.test.crt
##########
@@ -0,0 +1,23 @@
+-----BEGIN CERTIFICATE-----

Review comment:
       I don't know if there's a standard "comment" grammar structure in certificate syntax - that should work with implementations using openssl, but I believe Macs don't use that SSL library because it's "too open-source" or somesuch, and I'm not sure that all SSL implementations allow for arbitrary text outside the `BEGIN` and `END` statements. Do they?




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_router/Dockerfile
##########
@@ -0,0 +1,31 @@
+#
+#  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.
+#
+FROM alpine:latest AS trafficrouter-dev
+
+ENV TC=/root/go/src/github.com/apache/trafficcontrol
+VOLUME /root/go/src/github.com/apache/trafficcontrol
+ENV JPDA_OPTS="-agentlib:jdwp=transport=dt_socket,address=5005,server=y,suspend=n" JAVA_HOME=/usr/lib/jvm/java-11-openjdk M2_HOME=/root/.m2/
+EXPOSE 3053:53/tcp 3053:53/udp 3080:80 3443:443 3333:3333 2222:3443 5005:5005
+
+RUN apk add --no-cache openjdk11 inotify-tools maven && ln -s /usr/lib/jvm/java-1.11-openjdk/bin/jdb /bin/jdb

Review comment:
       Java 1.11 does not exist




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/t3c/run.sh
##########
@@ -0,0 +1,81 @@
+#!/bin/sh
+
+# 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 -o errexit
+trap '[ $? -eq 0 ] && exit 0 || echo "Error on line ${LINENO} of ${0}"; exit 1' EXIT
+
+
+cd "$TC/cache-config"
+
+# Build area may contain non-debug binaries
+make clean && make -j debug
+
+if [[ ! -f /usr/bin/t3c ]]; then
+	ln -s /root/go/src/github.com/apache/trafficcontrol/cache-config/t3c/t3c /usr/bin/
+fi
+if [[ ! -f /usr/bin/t3c-apply ]]; then
+	ln -s /root/go/src/github.com/apache/trafficcontrol/cache-config/t3c-apply/t3c-apply /usr/bin/
+fi
+if [[ ! -f /usr/bin/t3c-check ]]; then
+	ln -s /root/go/src/github.com/apache/trafficcontrol/cache-config/t3c-check/t3c-check /usr/bin/
+fi
+if [[ ! -f /usr/bin/t3c-check-refs ]]; then
+	ln -s /root/go/src/github.com/apache/trafficcontrol/cache-config/t3c-check-refs/t3c-check-refs /usr/bin/
+fi
+if [[ ! -f /usr/bin/t3c-check-reload ]]; then
+	ln -s /root/go/src/github.com/apache/trafficcontrol/cache-config/t3c-check-reload/t3c-check-reload /usr/bin/
+fi
+if [[ ! -f /usr/bin/t3c-diff ]]; then
+	ln -s /root/go/src/github.com/apache/trafficcontrol/cache-config/t3c-diff/t3c-diff /usr/bin/
+fi
+if [[ ! -f /usr/bin/t3c-generate ]]; then
+	ln -s /root/go/src/github.com/apache/trafficcontrol/cache-config/t3c-generate/t3c-generate /usr/bin/
+fi
+if [[ ! -f /usr/bin/t3c-preprocess ]]; then
+	ln -s /root/go/src/github.com/apache/trafficcontrol/cache-config/t3c-preprocess/t3c-preprocess /usr/bin/
+fi
+if [[ ! -f /usr/bin/t3c-request ]]; then
+	ln -s /root/go/src/github.com/apache/trafficcontrol/cache-config/t3c-request/t3c-request /usr/bin/
+fi
+if [[ ! -f /usr/bin/t3c-update ]]; then
+	ln -s /root/go/src/github.com/apache/trafficcontrol/cache-config/t3c-update/t3c-update /usr/bin/
+fi
+if [[ ! -f /usr/bin/tm-health-client ]]; then
+	ln -s /root/go/src/github.com/apache/trafficcontrol/cache-config/tm-health-client/tm-health-client /usr/bin/
+fi

Review comment:
       You know, I wanted to do that but initially I had thought that was going to be looping over a list of prohibitively long names, but I realize now I can make that a bit shorter.




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman edited a comment on pull request #6532: CDN-in-a-Box for Developers

Posted by GitBox <gi...@apache.org>.
zrhoffman edited a comment on pull request #6532:
URL: https://github.com/apache/trafficcontrol/pull/6532#issuecomment-1027131794


   > I had done that, and it would start but it was not servicing any HTTP or DNS requests I threw at it.
   
   That is normal if it cannot fetch the CRConfig yet, it only serves HTTP and DNS responses *after* that point. Once the  comments I have made on #6532 are addressed, TR prints only this message repeatedly:
   
   ```java
   trafficcontrol-trafficrouter-1  | 17:43:00.361 [pool-3-thread-1] ERROR org.apache.traffic_control.traffic_router.core.secure.CertificatesClient - No traffic ops hostname yet!
   ```
   which makes sense, since TM does not serve a CRConfig.
   
   ```
   trafficrouter:/# curl -v trafficmonitor/publish/CrConfig;
   *   Trying 172.25.0.4:80...
   * Connected to trafficmonitor (172.25.0.4) port 80 (#0)
   > GET /publish/CrConfig HTTP/1.1
   > Host: trafficmonitor
   > User-Agent: curl/7.80.0
   > Accept: */*
   >
   * Mark bundle as not supporting multiuse
   < HTTP/1.1 503 Service Unavailable
   < Date: Tue, 01 Feb 2022 17:59:21 GMT
   < Content-Length: 19
   < Content-Type: text/plain; charset=utf-8
   <
   * Connection #0 to host trafficmonitor left intact
   Service Unavailable
   ```
   
   Corresponding message from Traffic Monitor logs:
   
   ```go
   trafficcontrol-trafficmonitor-1  | ERROR: datareq.go:161: 2022-02-01T18:00:21.366963347Z: Request Error: /publish/CrConfig: service still starting, some caches unpolled: map[]
   ```
   
   So, the key to getting TR to serve HTTP and DNS responses is to get Traffic Monitor to serve the CRConfig. The TR piece works fine with the suggested changes.


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] mitchell852 commented on pull request #6532: CDN-in-a-Box for Developers

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


   @ocket8888 - when this is merged will we have 2 "cdn in a box"s? aka 2 code bases to maintain for ciab? should the other one be deprecated in favor of this one? what are your thoughts on 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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_router/Dockerfile
##########
@@ -15,12 +15,17 @@ FROM alpine:latest AS trafficrouter-dev
 
 ENV TC=/root/go/src/github.com/apache/trafficcontrol
 VOLUME /root/go/src/github.com/apache/trafficcontrol
-ENV JPDA_OPTS="-agentlib:jdwp=transport=dt_socket,address=*:5005,server=y,suspend=n" JAVA_HOME=/usr/lib/jvm/java-11-openjdk M2_HOME=/root/go/src/github.com/apache/trafficcontrol/.m2 CATALINA_BASE=/opt/traffic_router
+ENV JPDA_OPTS="-agentlib:jdwp=transport=dt_socket,address=*:5005,server=y,suspend=n" JAVA_HOME=/usr/lib/jvm/java-11-openjdk M2_HOME=/root/go/src/github.com/apache/trafficcontrol/.m2 CATALINA_BASE=/opt/traffic_router TRAFFIC_MONITOR_HOSTS=trafficmonitor
 EXPOSE 3053:53/tcp 3053:53/udp 3080:80 3443:443 3333:3333 2222:3443 5005:5005
 
-RUN apk add --no-cache openjdk11 inotify-tools maven && ln -s /usr/lib/jvm/java-11-openjdk/bin/jdb /bin/jdb
+RUN apk add --no-cache openjdk11 inotify-tools maven tomcat-native openssl && ln -s /usr/lib/jvm/java-11-openjdk/bin/jdb /bin/jdb
 
 ADD https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.43/bin/apache-tomcat-9.0.43.tar.gz /opt/tomcat.tgz
+
+ARG USER
+RUN adduser -H -D ${USER}
+RUN chown -R ${USER} /opt /usr/share/java/ /root
+USER ${USER}

Review comment:
       Oh it's not just Windows. I actually first noticed it using `sh` in Alpine containers. They don't have `UID` or `USER` set in the execution environment, although `id -u` outputs correctly. It's not a problem with `sh`, either. `sh` in CentOS containers has it set. Using `zsh` on Pop!_OS seems to set `USER` in the environment, but only makes `UID` available as a shell variable, not actually exported to the environment. It seems to just be a personal choice by the OS whether or not to set those by default in new shell sessions.




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_router/conf/log4j2.xml
##########
@@ -0,0 +1,34 @@
+<?xml version='1.0' encoding='utf-8'?>
+<!--
+
+	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.
+ -->
+<Configuration>
+	<Appenders>
+		<Console name="stdout" target="SYSTEM_OUT">
+			<PatternLayout pattern="%-5p %d{yyyy-MM-dd'T'HH:mm:ss.SSS} [%t] %c - %m%n"/>
+			<ThresholdFilter level="ALL"/>
+		</Console>
+	</Appenders>
+	<Loggers>
+		<Logger name="org.apache.traffic_control.traffic_router" level="INFO" additivity="false">
+			<AppenderRef ref="stdout"/>
+		</Logger>
+		<Logger name="org.apache.traffic_control.traffic_router.core.access" level="INFO" additivity="false">
+			<AppenderRef ref="stdout"/>
+		</Logger>
+		<Root level="ALL" additivity="false">

Review comment:
       `level="ALL"` is very verbose for the root logger. The default log4j2 config uses `level="WARN"`:
   https://github.com/apache/trafficcontrol/blob/8833d1c96b3bbdd973120a85e1b15e716afd4837/traffic_router/core/src/main/conf/log4j2.xml#L49




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] ocket8888 commented on pull request #6532: CDN-in-a-Box for Developers

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


   This is now waiting on #6578 


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_router/run.sh
##########
@@ -0,0 +1,38 @@
+#!/bin/sh
+# 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 -o errexit
+
+cd "$TC/traffic_router"
+
+mvn -Dmaven.test.skip=true compile package -P \!rpm-build
+
+chmod -R a+rw "$TC/dev/traffic_router/"
+/opt/tomcat/bin/catalina.sh jpda run

Review comment:
       Right now, `/opt/tomcat/bin/catalina.sh` is run using `/` as the working directory. Traffic Router wants to create a file named `./logs/juli.2022-02-21.log`, which fails, resulting in this error being logged:
   
   ```java
   java.util.logging.ErrorManager: 4: Unable to create [logs]
   ```
   
   So the working directory should be `/opt/traffic_router` or `$TC/dev/traffic_router`.




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman commented on pull request #6532: CDN-in-a-Box for Developers

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


   > > maybe there's a way to abstract out similar pieces?
   > 
   > The only truly similar parts are in the data-sets, and that similarity is honestly merely skin-deep. Other than that they don't run the same way, aren't packaged the same, and the service containers differ all the way down to the level of which OS they run on (distro, really). The way the CiaB "enroller" works is meant to be generic, it allows loading (somewhat) arbitrary data sets using the TO API - because of that, it has to wait for TO to be available and then each service that wants to exist is responsible for using it to "enroll" itself. The dev environment has some static data being inserted directly into the database, which allows each container to be started and stopped independently without creating any conflicting data, whereas CiaB needs to be entirely stopped and started together, but doesn't allow for arbitrary extension e.g. via the "optional" docker-compose files found in the CiaB directory.
   
   Agreed that we shouldn't try to combine the CiaB and dev-CiaB code. Abstractions would get messy fast, since they are built differently as @ocket8888 mentioned, as well as distro differences. dev-CiaB doesn't even have Bash, and most of the CiaB scripts require Bash, not just POSIX `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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_router/run.sh
##########
@@ -0,0 +1,41 @@
+#!/bin/sh
+# 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 -o errexit
+
+cd "$TC/traffic_router"
+
+mvn -Dmaven.test.skip=true compile -P \!rpm-build
+mvn -Dmaven.test.skip=true package -P \!rpm-build
+
+cp core/target/ROOT.war /opt/tomcat/webapps/
+ln -s $TC/dev/traffic_router/conf/* /opt/tomcat/conf/
+
+/opt/tomcat/bin/catalina.sh jpda run

Review comment:
       > <pre>Using CATALINA_BASE:   /opt/tomcat
   > Using CATALINA_HOME:   /opt/tomcat
   > Using CATALINA_TMPDIR: /opt/tomcat/temp
   > Using JRE_HOME:        /usr/lib/jvm/java-11-openjdk
   > Using CLASSPATH:       /opt/tomcat/bin/bootstrap.jar:/opt/tomcat/bin/tomcat-juli.jar
   > Using CATALINA_OPTS:</pre></quote>
   
   The way Traffic Router is set up, `CATALINA_BASE` is supposed to be `/opt/traffic_router`: https://github.com/apache/trafficcontrol/blob/abfbb3483afbb3deedb488e872d21d8c0ba6c94a/traffic_router/core/src/main/lib/systemd/system/traffic_router.service#L24-L25
   
   `CATALINA_BASE` should be equal to the `deploy.dir` system property. It is defined here: https://github.com/apache/trafficcontrol/blob/abfbb3483afbb3deedb488e872d21d8c0ba6c94a/traffic_router/pom.xml#L34
   
   Among other things, `deploy.dir` is used to find the property files. https://github.com/apache/trafficcontrol/blob/abfbb3483afbb3deedb488e872d21d8c0ba6c94a/traffic_router/core/src/main/resources/applicationProperties.xml#L28-L32
   If you can find a way to change `deploy.dir` to `${TC}/dev/traffic_router`, that would be ideal. Otherwise, `CATALINA_BASE` should be set to `/opt/traffic_router`, with `/opt/traffic_router` being a symlink to `${TC}/dev/traffic_router`.




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] mitchell852 commented on pull request #6532: CDN-in-a-Box for Developers

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


   > When I first started working on the Docker version of CDN-in-a-Box, this is much more what I had in mind than what we currently know as "CiaB" (although I can't speak for Dan who was working on it in some form or another before I knew what ATC was) - probably because as a developer I only had a developer's needs in mind. And that's likely why the decision was made to do things the way they currently are, with RPMs and running on CentOS and installing everything under `/opt/` etc. It's "prod-like" and that's highly valued for testing, which is a primary use-case of our current CiaB.
   
   yeah, seems there are 2 different use cases:
   
   1. a ciab for testing where a ciab most like prod is desired (rpms, centos, etc)
   2. a ciab for development (lightweight, fast build and rebuild, etc)
   
   i just worry about having to maintain the codebase of 2 ciab's. anyhow, that's for you guys to figure out. maybe there's a way to abstract out similar pieces? maybe not? i'll leave it to the experts but i think this is great and much needed for a long time. hopefully, it can help ease development of TC and encourage more code contributions from our open source community. 


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/atc.dev.sh
##########
@@ -0,0 +1,160 @@
+# 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.
+
+alias atc-start="docker-compose up -d --build";
+alias atc-build="docker-compose build";
+alias atc-stop="docker-compose down -v --remove-orphans";
+alias atc-restart="atc-stop && atc-start";
+
+function atc-ready {
+	local url="https://localhost:6443/api/4.0/ping";
+	if [[ $# -gt 0 ]]; then
+		case "$1" in
+			-w|--wait)
+				while ! curl -skL "$url" >/dev/null 2>&1; do
+					sleep 1;
+				done
+				return 0;;
+			-h|--help)
+				echo "Usage: $0 [-h] [-w]";
+				echo "";
+				echo "-h, --help  print usage information and exit";
+				echo "-w, --wait  wait for ATC to be ready, instead of just checking if it is ready";
+				return 0;;
+			*)
+				echo "Usage: $0 [-h] [-w]" >&2;
+				echo "" >&2;
+				echo "-h, --help  print usage information and exit" >&2;
+				echo "-w, --wait  wait for ATC to be ready, instead of just checking if it is ready" >&2;
+				return 1;;
+		esac
+	fi
+	curl -skL "$url" >/dev/null 2>&1;
+	return $?;
+}
+
+function atc-exec {
+	if [[ $# -lt 2 ]]; then
+		echo "Usage: atc-exec SERVICE CMD" >&2;
+		return 1;
+	fi;
+	local service="trafficcontrol_$1_1";
+	shift;
+	docker exec "$service" $@;
+	return $?;
+}
+
+function atc-connect {
+	if [[ $# -ne 1 ]]; then
+		echo "Usage: atc-connect SERVICE" >&2;
+		return 1;
+	fi;
+	docker exec -it "trafficcontrol_$1_1" /bin/sh;
+	return $?;
+}
+
+function atc {
+	if [[ $# -lt 1 ]]; then
+		echo "Usage: atc OPERATION" >&2;
+		return 1;
+	fi
+	local arg="$1";
+	shift;
+	case "$arg" in
+		build)
+			atc-build $@;;
+		connect)
+			atc-connect $@;;
+		exec)
+			atc-exec $@;;
+		ready)
+			atc-ready $@;;
+		restart)
+			atc-restart $@;;
+		start)
+			atc-start $@;;
+		stop)
+			atc-stop $@;;
+		-h|--help|/\?)
+			echo "Usage: atc OPERATION";
+			echo "";
+			echo "Valid OPERATIONs:";
+			echo "  build   Build the images for the environment, but do not start it";
+			echo "  connect Connect to a shell session inside a dev container";
+			echo "  exec    Run a command in a dev container";
+			echo "  ready   Check if the development environment is ready";
+			echo "  restart Retart up the development environment";
+			echo "  start   Start up the development environment";
+			echo "  stop    Stop the development environment";
+			;;
+		*)
+			echo "Usage: atc OPERATION" >&2;
+			echo "" >&2;
+			echo "Valid OPERATIONs:" >&2;
+			echo "  build   Build the images for the environment, but do not start it" >&2;
+			echo "  connect Connect to a shell session inside a dev container" >&2;
+			echo "  exec    Run a command in a dev container" >&2;
+			echo "  ready   Check if the development environment is ready" >&2;
+			echo "  restart Retart up the development environment" >&2;
+			echo "  start   Start up the development environment" >&2;
+			echo "  stop    Stop the development environment" >&2;
+			return 2;;
+	esac
+	return "$?";
+}
+
+export t3cDir="/root/go/src/github.com/apache/trafficcontrol/cache-config";
+
+function t3c {
+	trap 'atc-exec t3c ps | grep dlv | tr -s " " | cut -d " " -f1 | xargs docker exec trafficcontrol_t3c_1 kill' INT;
+	local dExec=(docker exec);
+	local dlv=();
+	if [[ ! -z "$TC_WAIT" ]]; then
+		dlv=(dlv --accept-multiclient --listen=:8081 --headless --api-version=2 debug --);
+	else;

Review comment:
       I didn't see that because apparently ZSH is fine with 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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_router/conf/trafficrouter.dev.ciab.test.crt
##########
@@ -0,0 +1,23 @@
+-----BEGIN CERTIFICATE-----

Review comment:
       > I believe Macs don't use that SSL library because it's "too open-source"
   
   Nah, macOS does come with an older version of OpenSSL




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_router/conf/traffic_ops.properties
##########
@@ -0,0 +1,13 @@
+# 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.
+traffic_ops.username=admin
+traffic_ops.password=twelve12

Review comment:
       Actually, IMO neither this nor CiaB should use `twelve12`, since that's not accepted by the API either. The password used here should ideally match the current CiaB for ease of use, but CiaB should not contain data we know to be invalid. If you are using the development or testing/demo setups in production, you have ignored all instructions to the contrary and in CiaB's case multiple warnings. We cannot reasonably prevent someone so determined to do improper things from doing those things.




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_monitor/Dockerfile
##########
@@ -0,0 +1,23 @@
+#
+#  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.
+#
+FROM alpine:latest AS trafficmonitor-dev
+
+ENV TC=/root/go/src/github.com/apache/trafficcontrol
+VOLUME /root/go/src/github.com/apache/trafficcontrol
+EXPOSE 80 81
+
+RUN apk add --no-cache inotify-tools go && go install github.com/go-delve/delve/cmd/dlv@latest && ln -s /root/go/bin/dlv /usr/bin/dlv

Review comment:
       I'm going to resolve this to make the feedback list smaller, conversation continues above on the TO dockerfile




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_router/Dockerfile
##########
@@ -15,12 +15,17 @@ FROM alpine:latest AS trafficrouter-dev
 
 ENV TC=/root/go/src/github.com/apache/trafficcontrol
 VOLUME /root/go/src/github.com/apache/trafficcontrol
-ENV JPDA_OPTS="-agentlib:jdwp=transport=dt_socket,address=*:5005,server=y,suspend=n" JAVA_HOME=/usr/lib/jvm/java-11-openjdk M2_HOME=/root/go/src/github.com/apache/trafficcontrol/.m2 CATALINA_BASE=/opt/traffic_router
+ENV JPDA_OPTS="-agentlib:jdwp=transport=dt_socket,address=*:5005,server=y,suspend=n" JAVA_HOME=/usr/lib/jvm/java-11-openjdk M2_HOME=/root/go/src/github.com/apache/trafficcontrol/.m2 CATALINA_BASE=/opt/traffic_router TRAFFIC_MONITOR_HOSTS=trafficmonitor
 EXPOSE 3053:53/tcp 3053:53/udp 3080:80 3443:443 3333:3333 2222:3443 5005:5005
 
-RUN apk add --no-cache openjdk11 inotify-tools maven && ln -s /usr/lib/jvm/java-11-openjdk/bin/jdb /bin/jdb
+RUN apk add --no-cache openjdk11 inotify-tools maven tomcat-native openssl && ln -s /usr/lib/jvm/java-11-openjdk/bin/jdb /bin/jdb
 
 ADD https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.43/bin/apache-tomcat-9.0.43.tar.gz /opt/tomcat.tgz
+
+ARG USER
+RUN adduser -H -D ${USER}
+RUN chown -R ${USER} /opt /usr/share/java/ /root
+USER ${USER}

Review comment:
       Oh right, it's using the first available user ID, `1000`. So permissions are still not correct on macOS or other cases where your UID is not 1000




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_router/run.sh
##########
@@ -21,7 +21,6 @@ set -o errexit
 cd "$TC/traffic_router"
 
 mvn -Dmaven.test.skip=true compile -P \!rpm-build
-mvn -Dmaven.test.skip=true package -P \!rpm-build

Review comment:
       Looks like `mvn package` is required to generate `traffic_router/core/target/ROOT`. But the 2 commands can be combined to save 5 seconds like
   ```shell
   mvn compile package
   ```




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_router/conf/log4j2.xml
##########
@@ -0,0 +1,34 @@
+<?xml version='1.0' encoding='utf-8'?>
+<!--
+
+	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.
+ -->
+<Configuration>
+	<Appenders>
+		<Console name="stdout" target="SYSTEM_OUT">
+			<PatternLayout pattern="%-5p %d{yyyy-MM-dd'T'HH:mm:ss.SSS} [%t] %c - %m%n"/>
+			<ThresholdFilter level="ALL"/>
+		</Console>
+	</Appenders>
+	<Loggers>
+		<Logger name="org.apache.traffic_control.traffic_router" level="INFO" additivity="false">
+			<AppenderRef ref="stdout"/>
+		</Logger>
+		<Logger name="org.apache.traffic_control.traffic_router.core.access" level="INFO" additivity="false">
+			<AppenderRef ref="stdout"/>
+		</Logger>
+		<Root level="ALL" additivity="false">

Review comment:
       Yeah, it's for development so I wanted it to be very verbose. Do you think the amount of logging is making it difficult for a developer to follow the logic flow? `"WARN"` isn't verbose enough IMO, but I definitely don't mind turning it down to `"DEBUG"`, since arguably if you really want a deep trace of the execution you'd just attach a debugger. Maybe `"INFO"` - I'm not sure precisely how different those are.




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman merged pull request #6532: CDN-in-a-Box for Developers

Posted by GitBox <gi...@apache.org>.
zrhoffman merged pull request #6532:
URL: https://github.com/apache/trafficcontrol/pull/6532


   


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: .github/actions/pr-to-update-go/pr_to_update_go/go_pr_maker.py
##########
@@ -24,81 +24,190 @@
 import re
 import subprocess
 import sys
-from typing import Optional
+from typing import Optional, TypedDict, Any, Final

Review comment:
       No, those are to support updating the `.env` file and also addresses some `Pylint`/`Pyright` errors I was seeing. I still haven't managed to get the `kwargs` stuff in the block that actually updates files to be happy with its typing for Pyright, but I spent way too long already trying to figure that out.




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_router/conf/startup.properties
##########
@@ -0,0 +1,30 @@
+#
+# 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.
+
+# Any environment variables you define here will become part of the startup
+# environment for the 'traffic_router' service. It is a good place to set
+# command line arguments for the Java command line or any environment specific
+# setting you want available to the traffic_router process.
+# This file is not replaced by the update process when a new version of traffic
+# router is installed.
+CATALINA_OPTS="\

Review comment:
       This is not resolved




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_ops/seed.psql
##########
@@ -0,0 +1,337 @@
+/* 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.
+*/
+
+INSERT INTO tm_user (
+	username,
+	tenant_id,
+	"role",
+	local_passwd,
+	confirm_local_passwd,
+	email,
+	full_name
+) VALUES (
+	'admin',
+	(SELECT id FROM tenant WHERE "name" = 'root'),
+	(SELECT id FROM "role" WHERE "name" = 'admin'),
+	-- 'twelve12' encrypted with SCRYPT
+	'SCRYPT:16384:8:1:p0Bppp/6IBeYxSwdLuYddsdMLBU/BNSlLY6fSIF7H1XW4eTbNVeMPVm7TuTEG4FM8PbqLlVwi8sPy8ZJznAlaQ==:sRcHWGe43mm/uEmXTIw37GcLEQZTlWAdf4vJqK8f0MDh8P+8gXoNx+nxWyb3r/0Bh+yyg0g/dUvti/ePZJL+Jw==',
+	'SCRYPT:16384:8:1:p0Bppp/6IBeYxSwdLuYddsdMLBU/BNSlLY6fSIF7H1XW4eTbNVeMPVm7TuTEG4FM8PbqLlVwi8sPy8ZJznAlaQ==:sRcHWGe43mm/uEmXTIw37GcLEQZTlWAdf4vJqK8f0MDh8P+8gXoNx+nxWyb3r/0Bh+yyg0g/dUvti/ePZJL+Jw==',
+	'admin@no-reply.atc.test',
+	'Development Admin User'
+)
+ON CONFLICT DO NOTHING;
+
+INSERT INTO cdn (
+	"name",
+	domain_name
+) VALUES (
+	'dev',
+	'ciab.test'
+)
+ON CONFLICT DO NOTHING;
+
+INSERT INTO snapshot (
+	cdn,
+	crconfig,
+	monitoring
+) VALUES (
+	'dev',
+	'{"config":{"coveragezone.polling.url":"file:///root/go/src/github.com/apache/trafficcontrol/traffic_router/core/src/test/resources/czf.json","dnssec.enabled":"false","domain_name":"ciab.test","geolocation.polling.url":"file:///root/go/src/github.com/apache/trafficcontrol/traffic_router/core/src/test/resources/geo/GeoLite2-City.mmdb.gz"},"contentServers":{"edge":{"cacheGroup":"dev","fqdn":"edge.dev.ciab.test","hashCount":999,"hashId":"edge","httpsPort":443,"interfaceName":"eth0","ip":"129.0.0.2","ip6":"","locationId":"dev","port":80,"profile":"EDGE_dev","status":"REPORTED","type":"EDGE","routingDisabled":0}},"contentRouters":{"trafficrouter":{"fqdn":"trafficrouter.dev.ciab.test","httpsPort":443,"ip":"","ip6":"","location":"tr-cg","port":80,"profile":"CCR_dev","status":"ONLINE"}},"deliveryServices":{"dev":{"anonymousBlockingEnabled":"false","coverageZoneOnly":"false","deepCachingType":"NEVER","dispersion":{"limit":1,"shuffled":"true"},"domains":["dev.ciab.test"],"ecsEnabled":"false"
 ,"geolocationProvider":"maxmindGeolocationService","ip6RoutingEnabled":"false","matchsets":[{"protocol":"HTTP","matchlist":[{"regex":".*\\\\.dev\\\\..*","match-type":"HOST"}]}],"protocol":{"acceptHttps":"false","redirectToHttps":"false"},"regionalGeoBlocking":"false","routingName":"cdn","soa":{"admin":"traffic_ops","expire":"604800","minimum":"30","refresh":"28800","retry":"7200"},"sslEnabled":"false","ttls":{"A":"","AAAA":"","NS":"3600","SOA":"86400"}}},"edgeLocations":{"dev":{"latitude":0,"longitude":0,"backupLocations":{"fallbackToClosest":"true"},"localizationMethods":["GEO","CZ","DEEP_CZ"]}},"trafficRouterLocations":{"tr-cg":{"latitude":0,"longitude":0,"backupLocations":{"fallbackToClosest":"false"},"localizationMethods":["GEO","CZ","DEEP_CZ"]}},"monitors":{"trafficmonitor":{"fqdn":"trafficmonitor.dev.ciab.test","httpsPort":null,"ip":"129.0.0.1","ip6":"","location":"dev","port":80,"profile":"RASCAL_TM_dev","status":"ONLINE"}},"stats":{"CDN_name":"dev","date":1645572050,"tm_host
 ":"trafficops","tm_user":"admin","tm_version":"development"}}',
+	'{"trafficServers":[{"profile":"EDGE_dev","status":"REPORTED","port":80,"cachegroup":"dev","hostname":"edge","fqdn":"edge.dev.ciab.test","interfaces":[{"ipAddresses":[{"address":"129.0.0.2","gateway":null,"serviceAddress":true}],"maxBandwidth":null,"monitor":true,"mtu":1500,"name":"eth0"}],"type":"EDGE","hashid":""}],"trafficMonitors":[{"profile":"RASCAL_TM_dev","status":"ONLINE","port":80,"cachegroup":"dev","hostname":"trafficmonitor","fqdn":"trafficmonitor.dev.ciab.test","ip":"129.0.0.1","ip6":""}],"cacheGroups":[{"name":"dev","coordinates":{"latitude":0,"longitude":0}},{"name":"tr-cg","coordinates":{"latitude":0,"longitude":0}}],"profiles":[{"name":"CCR_dev","type":"CCR","parameters":null},{"name":"EDGE_dev","type":"EDGE","parameters":{"health.polling.format":"stats_over_http","health.polling.url":"http://edge:8080/_stats?application=\u0026inf.name=${interface_name}"}}],"deliveryServices":[{"xmlId":"dev","totalTpsThreshold":0,"status":"REPORTED","totalKbpsThreshold":0}],"config"
 :{"health.polling.interval":6000,"heartbeat.polling.interval":3000,"peers.polling.interval":3000,"tm.polling.interval":2000}}'
+)
+ON CONFLICT DO NOTHING;
+
+INSERT INTO profile (
+	"name",
+	description,
+	"type",
+	cdn
+) VALUES (
+	'RASCAL_TM_dev',
+	'dev TM Profile',
+	'TM_PROFILE',
+	(SELECT id FROM cdn WHERE "name" = 'dev')
+), (
+	'EDGE_dev',
+	'dev edge Profile',
+	'ATS_PROFILE',
+	(SELECT id FROM cdn WHERE "name" = 'dev')
+), (
+	'CCR_dev',
+	'dev Traffic Router Profile',
+	'TR_PROFILE',
+	(SELECT id FROM cdn WHERE "name" = 'dev')
+)
+ON CONFLICT DO NOTHING;
+
+INSERT INTO parameter (
+	config_file,
+	"name",
+	"value"
+) VALUES (
+	'rascal-config.txt',
+	'health.polling.interval',
+	'6000'
+), (
+	'rascal-config.txt',
+	'heartbeat.polling.interval',
+	'3000'
+), (
+	'rascal-config.txt',
+	'peers.polling.interval',
+	'3000'
+), (
+	'rascal-config.txt',
+	'tm.polling.interval',
+	'2000'
+), (
+	'rascal.properties',
+	'health.polling.url',
+	'http://edge:8080/_stats?application=&inf.name=${interface_name}'
+), (
+	'rascal.properties',
+	'health.polling.format',
+	'stats_over_http'
+), (
+	'CRConfig.json',
+	'geolocation.polling.url',
+	'file:///root/go/src/github.com/apache/trafficcontrol/traffic_router/core/src/test/resources/geo/GeoLite2-City.mmdb.gz'
+), (
+	'CRConfig.json',
+	'coveragezone.polling.url',
+	'file:///root/go/src/github.com/apache/trafficcontrol/traffic_router/core/src/test/resources/czf.json'
+), (
+	'global',
+	'tm.url',
+	'https://trafficops'
+)
+ON CONFLICT DO NOTHING;
+
+INSERT INTO profile_parameter
+SELECT profile.id, parameter.id
+FROM profile, parameter
+WHERE parameter.config_file = 'rascal-config.txt'
+AND parameter."name" LIKE '%.polling.%'
+AND profile."name" = 'RASCAL_TM_dev'
+ON CONFLICT DO NOTHING;
+
+INSERT INTO profile_parameter
+SELECT profile.id, parameter.id
+FROM profile, parameter
+WHERE parameter.config_file = 'rascal.properties'
+AND profile."name" = 'EDGE_dev'
+ON CONFLICT DO NOTHING;
+
+INSERT INTO profile_parameter
+SELECT profile.id, parameter.id
+FROM profile, parameter
+WHERE parameter.config_file = 'CRConfig.json'
+AND profile."name" = 'CCR_dev'
+ON CONFLICT DO NOTHING;
+
+INSERT INTO division ("name") VALUES ('dev') ON CONFLICT DO NOTHING;
+INSERT INTO region (
+	"name",
+	division
+) VALUES (
+	'dev',
+	(SELECT id FROM division WHERE "name" = 'dev')
+)
+ON CONFLICT DO NOTHING;
+INSERT INTO phys_location (
+	"name",
+	short_name,
+	address,
+	city,
+	state,
+	zip,
+	region
+) VALUES (
+	'dev',
+	'dev',
+	'address',
+	'city',
+	'state',
+	'zip',
+	(SELECT id from region WHERE "name" = 'dev')
+)
+ON CONFLICT DO NOTHING;
+
+INSERT INTO coordinate (
+	"name",
+	latitude,
+	longitude
+) VALUES (
+	'dev',
+	0,
+	0
+)
+ON CONFLICT DO NOTHING;
+
+INSERT INTO cachegroup (
+	"name",
+	short_name,
+	"type",
+	coordinate
+) VALUES (
+	'dev',
+	'dev',
+	(SELECT id FROM "type" WHERE "name" = 'EDGE_LOC'),
+	(SELECT id FROM coordinate WHERE "name" = 'dev')
+), (
+	'tr-cg',
+	'tr-cg',
+	(SELECT id FROM "type" WHERE "name" = 'TR_LOC'),
+	(SELECT id FROM coordinate WHERE "name" = 'dev')
+)
+ON CONFLICT DO NOTHING;
+
+INSERT INTO "server" (
+	host_name,
+	domain_name,
+	tcp_port,
+	https_port,
+	phys_location,
+	cachegroup,
+	type,
+	status,
+	profile,
+	cdn_id
+) VALUES (
+	'trafficmonitor',
+	'dev.ciab.test',
+	80,
+	NULL,
+	(SELECT id FROM phys_location WHERE "name" = 'dev'),
+	(SELECT id FROM cachegroup WHERE "name" = 'dev'),
+	(SELECT id FROM "type" WHERE "name" = 'RASCAL'),
+	(SELECT id FROM status WHERE "name" = 'ONLINE'),
+	(SELECT id FROM profile WHERE "name"= 'RASCAL_TM_dev'),
+	(SELECT id FROM cdn WHERE "name" = 'dev')
+), (
+	'edge',
+	'dev.ciab.test',
+	80,
+	443,
+	(SELECT id FROM phys_location WHERE "name" = 'dev'),
+	(SELECT id FROM cachegroup WHERE "name" = 'dev'),
+	(SELECT id FROM "type" WHERE "name" = 'EDGE'),
+	(SELECT id FROM status WHERE "name" = 'REPORTED'),
+	(SELECT id FROM profile WHERE "name"= 'EDGE_dev'),
+	(SELECT id FROM cdn WHERE "name" = 'dev')
+), (
+	'trafficrouter',
+	'dev.ciab.test',
+	80,
+	443,
+	(SELECT id FROM phys_location WHERE "name" = 'dev'),
+	(SELECT id FROM cachegroup WHERE "name" = 'tr-cg'),
+	(SELECT id FROM "type" WHERE "name" = 'CCR'),
+	(SELECT id FROM status WHERE "name" = 'ONLINE'),
+	(SELECT id FROM profile WHERE "name" = 'CCR_dev'),
+	(SELECT id FROM cdn WHERE "name" = 'dev')
+)
+ON CONFLICT DO NOTHING;
+
+INSERT INTO interface (
+	monitor,
+	"name",
+	"server"
+) VALUES (
+	FALSE,
+	'eth0',
+	(SELECT id FROM "server" WHERE host_name = 'trafficmonitor' LIMIT 1)
+), (
+	TRUE,
+	'eth0',
+	(SELECT id FROM "server" WHERE host_name = 'edge' LIMIT 1)
+)
+ON CONFLICT DO NOTHING;
+
+INSERT INTO ip_address (
+	address,
+	interface,
+	"server",
+	service_address
+) VALUES (
+	'129.0.0.1'::inet,
+	'eth0',
+	(SELECT id FROM "server" WHERE host_name = 'trafficmonitor' LIMIT 1),
+	TRUE
+), (
+	'129.0.0.2'::inet,
+	'eth0',
+	(SELECT id FROM "server" WHERE host_name = 'edge' LIMIT 1),
+	TRUE
+)
+ON CONFLICT DO NOTHING;
+
+INSERT INTO deliveryservice (
+	xml_id,
+	active,
+	dscp,
+	qstring_ignore,
+	type,
+	cdn_id,
+	display_name,
+	tenant_id
+) VALUES (
+	'dev',
+	TRUE,
+	1,
+	0,
+	(SELECT id FROM "type" WHERE "name" = 'HTTP'),
+	(SELECT id FROM cdn WHERE "name" = 'dev'),
+	'dev',
+	(SELECT id FROM tenant WHERE "name" = 'root')
+)
+ON CONFLICT DO NOTHING;
+
+INSERT INTO regex (
+	"type",
+	pattern
+) VALUES (
+	(SELECT id FROM "type" WHERE "name" = 'HOST_REGEXP'),
+	'.*\\.dev\\..*'
+)
+ON CONFLICT DO NOTHING;
+
+INSERT INTO deliveryservice_regex (
+	deliveryservice,
+	regex,
+	set_number
+) VALUES (
+	(SELECT id FROM deliveryservice WHERE xml_id = 'dev') ,
+	(SELECT id FROM regex WHERE pattern = '.*\\.dev\\..*' LIMIT 1),

Review comment:
       > ```sql
   > '.*\\.dev\\..*'
   > ```
   
   Check the number of backslashes

##########
File path: dev/traffic_ops/seed.psql
##########
@@ -0,0 +1,337 @@
+/* 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.
+*/
+
+INSERT INTO tm_user (
+	username,
+	tenant_id,
+	"role",
+	local_passwd,
+	confirm_local_passwd,
+	email,
+	full_name
+) VALUES (
+	'admin',
+	(SELECT id FROM tenant WHERE "name" = 'root'),
+	(SELECT id FROM "role" WHERE "name" = 'admin'),
+	-- 'twelve12' encrypted with SCRYPT
+	'SCRYPT:16384:8:1:p0Bppp/6IBeYxSwdLuYddsdMLBU/BNSlLY6fSIF7H1XW4eTbNVeMPVm7TuTEG4FM8PbqLlVwi8sPy8ZJznAlaQ==:sRcHWGe43mm/uEmXTIw37GcLEQZTlWAdf4vJqK8f0MDh8P+8gXoNx+nxWyb3r/0Bh+yyg0g/dUvti/ePZJL+Jw==',
+	'SCRYPT:16384:8:1:p0Bppp/6IBeYxSwdLuYddsdMLBU/BNSlLY6fSIF7H1XW4eTbNVeMPVm7TuTEG4FM8PbqLlVwi8sPy8ZJznAlaQ==:sRcHWGe43mm/uEmXTIw37GcLEQZTlWAdf4vJqK8f0MDh8P+8gXoNx+nxWyb3r/0Bh+yyg0g/dUvti/ePZJL+Jw==',
+	'admin@no-reply.atc.test',
+	'Development Admin User'
+)
+ON CONFLICT DO NOTHING;
+
+INSERT INTO cdn (
+	"name",
+	domain_name
+) VALUES (
+	'dev',
+	'ciab.test'
+)
+ON CONFLICT DO NOTHING;
+
+INSERT INTO snapshot (
+	cdn,
+	crconfig,
+	monitoring
+) VALUES (
+	'dev',
+	'{"config":{"coveragezone.polling.url":"file:///root/go/src/github.com/apache/trafficcontrol/traffic_router/core/src/test/resources/czf.json","dnssec.enabled":"false","domain_name":"ciab.test","geolocation.polling.url":"file:///root/go/src/github.com/apache/trafficcontrol/traffic_router/core/src/test/resources/geo/GeoLite2-City.mmdb.gz"},"contentServers":{"edge":{"cacheGroup":"dev","fqdn":"edge.dev.ciab.test","hashCount":999,"hashId":"edge","httpsPort":443,"interfaceName":"eth0","ip":"129.0.0.2","ip6":"","locationId":"dev","port":80,"profile":"EDGE_dev","status":"REPORTED","type":"EDGE","routingDisabled":0}},"contentRouters":{"trafficrouter":{"fqdn":"trafficrouter.dev.ciab.test","httpsPort":443,"ip":"","ip6":"","location":"tr-cg","port":80,"profile":"CCR_dev","status":"ONLINE"}},"deliveryServices":{"dev":{"anonymousBlockingEnabled":"false","coverageZoneOnly":"false","deepCachingType":"NEVER","dispersion":{"limit":1,"shuffled":"true"},"domains":["dev.ciab.test"],"ecsEnabled":"false"
 ,"geolocationProvider":"maxmindGeolocationService","ip6RoutingEnabled":"false","matchsets":[{"protocol":"HTTP","matchlist":[{"regex":".*\\\\.dev\\\\..*","match-type":"HOST"}]}],"protocol":{"acceptHttps":"false","redirectToHttps":"false"},"regionalGeoBlocking":"false","routingName":"cdn","soa":{"admin":"traffic_ops","expire":"604800","minimum":"30","refresh":"28800","retry":"7200"},"sslEnabled":"false","ttls":{"A":"","AAAA":"","NS":"3600","SOA":"86400"}}},"edgeLocations":{"dev":{"latitude":0,"longitude":0,"backupLocations":{"fallbackToClosest":"true"},"localizationMethods":["GEO","CZ","DEEP_CZ"]}},"trafficRouterLocations":{"tr-cg":{"latitude":0,"longitude":0,"backupLocations":{"fallbackToClosest":"false"},"localizationMethods":["GEO","CZ","DEEP_CZ"]}},"monitors":{"trafficmonitor":{"fqdn":"trafficmonitor.dev.ciab.test","httpsPort":null,"ip":"129.0.0.1","ip6":"","location":"dev","port":80,"profile":"RASCAL_TM_dev","status":"ONLINE"}},"stats":{"CDN_name":"dev","date":1645572050,"tm_host
 ":"trafficops","tm_user":"admin","tm_version":"development"}}',

Review comment:
       > ```json
   > "matchlist":[{"regex":".*\\\\.dev\\\\..*","match-type":"HOST"}]
   > ```
   Too many backslashes

##########
File path: dev/traffic_ops/seed.psql
##########
@@ -0,0 +1,337 @@
+/* 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.
+*/
+
+INSERT INTO tm_user (
+	username,
+	tenant_id,
+	"role",
+	local_passwd,
+	confirm_local_passwd,
+	email,
+	full_name
+) VALUES (
+	'admin',
+	(SELECT id FROM tenant WHERE "name" = 'root'),
+	(SELECT id FROM "role" WHERE "name" = 'admin'),
+	-- 'twelve12' encrypted with SCRYPT
+	'SCRYPT:16384:8:1:p0Bppp/6IBeYxSwdLuYddsdMLBU/BNSlLY6fSIF7H1XW4eTbNVeMPVm7TuTEG4FM8PbqLlVwi8sPy8ZJznAlaQ==:sRcHWGe43mm/uEmXTIw37GcLEQZTlWAdf4vJqK8f0MDh8P+8gXoNx+nxWyb3r/0Bh+yyg0g/dUvti/ePZJL+Jw==',
+	'SCRYPT:16384:8:1:p0Bppp/6IBeYxSwdLuYddsdMLBU/BNSlLY6fSIF7H1XW4eTbNVeMPVm7TuTEG4FM8PbqLlVwi8sPy8ZJznAlaQ==:sRcHWGe43mm/uEmXTIw37GcLEQZTlWAdf4vJqK8f0MDh8P+8gXoNx+nxWyb3r/0Bh+yyg0g/dUvti/ePZJL+Jw==',
+	'admin@no-reply.atc.test',
+	'Development Admin User'
+)
+ON CONFLICT DO NOTHING;
+
+INSERT INTO cdn (
+	"name",
+	domain_name
+) VALUES (
+	'dev',
+	'ciab.test'
+)
+ON CONFLICT DO NOTHING;
+
+INSERT INTO snapshot (
+	cdn,
+	crconfig,
+	monitoring
+) VALUES (
+	'dev',
+	'{"config":{"coveragezone.polling.url":"file:///root/go/src/github.com/apache/trafficcontrol/traffic_router/core/src/test/resources/czf.json","dnssec.enabled":"false","domain_name":"ciab.test","geolocation.polling.url":"file:///root/go/src/github.com/apache/trafficcontrol/traffic_router/core/src/test/resources/geo/GeoLite2-City.mmdb.gz"},"contentServers":{"edge":{"cacheGroup":"dev","fqdn":"edge.dev.ciab.test","hashCount":999,"hashId":"edge","httpsPort":443,"interfaceName":"eth0","ip":"129.0.0.2","ip6":"","locationId":"dev","port":80,"profile":"EDGE_dev","status":"REPORTED","type":"EDGE","routingDisabled":0}},"contentRouters":{"trafficrouter":{"fqdn":"trafficrouter.dev.ciab.test","httpsPort":443,"ip":"","ip6":"","location":"tr-cg","port":80,"profile":"CCR_dev","status":"ONLINE"}},"deliveryServices":{"dev":{"anonymousBlockingEnabled":"false","coverageZoneOnly":"false","deepCachingType":"NEVER","dispersion":{"limit":1,"shuffled":"true"},"domains":["dev.ciab.test"],"ecsEnabled":"false"
 ,"geolocationProvider":"maxmindGeolocationService","ip6RoutingEnabled":"false","matchsets":[{"protocol":"HTTP","matchlist":[{"regex":".*\\\\.dev\\\\..*","match-type":"HOST"}]}],"protocol":{"acceptHttps":"false","redirectToHttps":"false"},"regionalGeoBlocking":"false","routingName":"cdn","soa":{"admin":"traffic_ops","expire":"604800","minimum":"30","refresh":"28800","retry":"7200"},"sslEnabled":"false","ttls":{"A":"","AAAA":"","NS":"3600","SOA":"86400"}}},"edgeLocations":{"dev":{"latitude":0,"longitude":0,"backupLocations":{"fallbackToClosest":"true"},"localizationMethods":["GEO","CZ","DEEP_CZ"]}},"trafficRouterLocations":{"tr-cg":{"latitude":0,"longitude":0,"backupLocations":{"fallbackToClosest":"false"},"localizationMethods":["GEO","CZ","DEEP_CZ"]}},"monitors":{"trafficmonitor":{"fqdn":"trafficmonitor.dev.ciab.test","httpsPort":null,"ip":"129.0.0.1","ip6":"","location":"dev","port":80,"profile":"RASCAL_TM_dev","status":"ONLINE"}},"stats":{"CDN_name":"dev","date":1645572050,"tm_host
 ":"trafficops","tm_user":"admin","tm_version":"development"}}',
+	'{"trafficServers":[{"profile":"EDGE_dev","status":"REPORTED","port":80,"cachegroup":"dev","hostname":"edge","fqdn":"edge.dev.ciab.test","interfaces":[{"ipAddresses":[{"address":"129.0.0.2","gateway":null,"serviceAddress":true}],"maxBandwidth":null,"monitor":true,"mtu":1500,"name":"eth0"}],"type":"EDGE","hashid":""}],"trafficMonitors":[{"profile":"RASCAL_TM_dev","status":"ONLINE","port":80,"cachegroup":"dev","hostname":"trafficmonitor","fqdn":"trafficmonitor.dev.ciab.test","ip":"129.0.0.1","ip6":""}],"cacheGroups":[{"name":"dev","coordinates":{"latitude":0,"longitude":0}},{"name":"tr-cg","coordinates":{"latitude":0,"longitude":0}}],"profiles":[{"name":"CCR_dev","type":"CCR","parameters":null},{"name":"EDGE_dev","type":"EDGE","parameters":{"health.polling.format":"stats_over_http","health.polling.url":"http://edge:8080/_stats?application=\u0026inf.name=${interface_name}"}}],"deliveryServices":[{"xmlId":"dev","totalTpsThreshold":0,"status":"REPORTED","totalKbpsThreshold":0}],"config"
 :{"health.polling.interval":6000,"heartbeat.polling.interval":3000,"peers.polling.interval":3000,"tm.polling.interval":2000}}'
+)
+ON CONFLICT DO NOTHING;
+
+INSERT INTO profile (
+	"name",
+	description,
+	"type",
+	cdn
+) VALUES (
+	'RASCAL_TM_dev',
+	'dev TM Profile',
+	'TM_PROFILE',
+	(SELECT id FROM cdn WHERE "name" = 'dev')
+), (
+	'EDGE_dev',
+	'dev edge Profile',
+	'ATS_PROFILE',
+	(SELECT id FROM cdn WHERE "name" = 'dev')
+), (
+	'CCR_dev',
+	'dev Traffic Router Profile',
+	'TR_PROFILE',
+	(SELECT id FROM cdn WHERE "name" = 'dev')
+)
+ON CONFLICT DO NOTHING;
+
+INSERT INTO parameter (
+	config_file,
+	"name",
+	"value"
+) VALUES (
+	'rascal-config.txt',
+	'health.polling.interval',
+	'6000'
+), (
+	'rascal-config.txt',
+	'heartbeat.polling.interval',
+	'3000'
+), (
+	'rascal-config.txt',
+	'peers.polling.interval',
+	'3000'
+), (
+	'rascal-config.txt',
+	'tm.polling.interval',
+	'2000'
+), (
+	'rascal.properties',
+	'health.polling.url',
+	'http://edge:8080/_stats?application=&inf.name=${interface_name}'
+), (
+	'rascal.properties',
+	'health.polling.format',
+	'stats_over_http'
+), (
+	'CRConfig.json',
+	'geolocation.polling.url',
+	'file:///root/go/src/github.com/apache/trafficcontrol/traffic_router/core/src/test/resources/geo/GeoLite2-City.mmdb.gz'
+), (
+	'CRConfig.json',
+	'coveragezone.polling.url',
+	'file:///root/go/src/github.com/apache/trafficcontrol/traffic_router/core/src/test/resources/czf.json'
+), (
+	'global',
+	'tm.url',
+	'https://trafficops'
+)
+ON CONFLICT DO NOTHING;
+
+INSERT INTO profile_parameter
+SELECT profile.id, parameter.id
+FROM profile, parameter
+WHERE parameter.config_file = 'rascal-config.txt'
+AND parameter."name" LIKE '%.polling.%'
+AND profile."name" = 'RASCAL_TM_dev'
+ON CONFLICT DO NOTHING;
+
+INSERT INTO profile_parameter
+SELECT profile.id, parameter.id
+FROM profile, parameter
+WHERE parameter.config_file = 'rascal.properties'
+AND profile."name" = 'EDGE_dev'
+ON CONFLICT DO NOTHING;
+
+INSERT INTO profile_parameter
+SELECT profile.id, parameter.id
+FROM profile, parameter
+WHERE parameter.config_file = 'CRConfig.json'
+AND profile."name" = 'CCR_dev'
+ON CONFLICT DO NOTHING;
+
+INSERT INTO division ("name") VALUES ('dev') ON CONFLICT DO NOTHING;
+INSERT INTO region (
+	"name",
+	division
+) VALUES (
+	'dev',
+	(SELECT id FROM division WHERE "name" = 'dev')
+)
+ON CONFLICT DO NOTHING;
+INSERT INTO phys_location (
+	"name",
+	short_name,
+	address,
+	city,
+	state,
+	zip,
+	region
+) VALUES (
+	'dev',
+	'dev',
+	'address',
+	'city',
+	'state',
+	'zip',
+	(SELECT id from region WHERE "name" = 'dev')
+)
+ON CONFLICT DO NOTHING;
+
+INSERT INTO coordinate (
+	"name",
+	latitude,
+	longitude
+) VALUES (
+	'dev',
+	0,
+	0
+)
+ON CONFLICT DO NOTHING;
+
+INSERT INTO cachegroup (
+	"name",
+	short_name,
+	"type",
+	coordinate
+) VALUES (
+	'dev',
+	'dev',
+	(SELECT id FROM "type" WHERE "name" = 'EDGE_LOC'),
+	(SELECT id FROM coordinate WHERE "name" = 'dev')
+), (
+	'tr-cg',
+	'tr-cg',
+	(SELECT id FROM "type" WHERE "name" = 'TR_LOC'),
+	(SELECT id FROM coordinate WHERE "name" = 'dev')
+)
+ON CONFLICT DO NOTHING;
+
+INSERT INTO "server" (
+	host_name,
+	domain_name,
+	tcp_port,
+	https_port,
+	phys_location,
+	cachegroup,
+	type,
+	status,
+	profile,
+	cdn_id
+) VALUES (
+	'trafficmonitor',
+	'dev.ciab.test',
+	80,
+	NULL,
+	(SELECT id FROM phys_location WHERE "name" = 'dev'),
+	(SELECT id FROM cachegroup WHERE "name" = 'dev'),
+	(SELECT id FROM "type" WHERE "name" = 'RASCAL'),
+	(SELECT id FROM status WHERE "name" = 'ONLINE'),
+	(SELECT id FROM profile WHERE "name"= 'RASCAL_TM_dev'),
+	(SELECT id FROM cdn WHERE "name" = 'dev')
+), (
+	'edge',
+	'dev.ciab.test',
+	80,
+	443,
+	(SELECT id FROM phys_location WHERE "name" = 'dev'),
+	(SELECT id FROM cachegroup WHERE "name" = 'dev'),
+	(SELECT id FROM "type" WHERE "name" = 'EDGE'),
+	(SELECT id FROM status WHERE "name" = 'REPORTED'),
+	(SELECT id FROM profile WHERE "name"= 'EDGE_dev'),
+	(SELECT id FROM cdn WHERE "name" = 'dev')
+), (
+	'trafficrouter',
+	'dev.ciab.test',
+	80,
+	443,
+	(SELECT id FROM phys_location WHERE "name" = 'dev'),
+	(SELECT id FROM cachegroup WHERE "name" = 'tr-cg'),
+	(SELECT id FROM "type" WHERE "name" = 'CCR'),
+	(SELECT id FROM status WHERE "name" = 'ONLINE'),
+	(SELECT id FROM profile WHERE "name" = 'CCR_dev'),
+	(SELECT id FROM cdn WHERE "name" = 'dev')
+)
+ON CONFLICT DO NOTHING;
+
+INSERT INTO interface (
+	monitor,
+	"name",
+	"server"
+) VALUES (
+	FALSE,
+	'eth0',
+	(SELECT id FROM "server" WHERE host_name = 'trafficmonitor' LIMIT 1)
+), (
+	TRUE,
+	'eth0',
+	(SELECT id FROM "server" WHERE host_name = 'edge' LIMIT 1)
+)
+ON CONFLICT DO NOTHING;
+
+INSERT INTO ip_address (
+	address,
+	interface,
+	"server",
+	service_address
+) VALUES (
+	'129.0.0.1'::inet,
+	'eth0',
+	(SELECT id FROM "server" WHERE host_name = 'trafficmonitor' LIMIT 1),
+	TRUE
+), (
+	'129.0.0.2'::inet,
+	'eth0',
+	(SELECT id FROM "server" WHERE host_name = 'edge' LIMIT 1),
+	TRUE
+)
+ON CONFLICT DO NOTHING;
+
+INSERT INTO deliveryservice (
+	xml_id,
+	active,
+	dscp,
+	qstring_ignore,
+	type,
+	cdn_id,
+	display_name,
+	tenant_id
+) VALUES (
+	'dev',
+	TRUE,
+	1,
+	0,
+	(SELECT id FROM "type" WHERE "name" = 'HTTP'),
+	(SELECT id FROM cdn WHERE "name" = 'dev'),
+	'dev',
+	(SELECT id FROM tenant WHERE "name" = 'root')
+)
+ON CONFLICT DO NOTHING;
+
+INSERT INTO regex (
+	"type",
+	pattern
+) VALUES (
+	(SELECT id FROM "type" WHERE "name" = 'HOST_REGEXP'),
+	'.*\\.dev\\..*'

Review comment:
       Check the number of backslashes




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_router/conf/log4j2.xml
##########
@@ -0,0 +1,34 @@
+<?xml version='1.0' encoding='utf-8'?>
+<!--
+
+	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.
+ -->
+<Configuration>
+	<Appenders>
+		<Console name="stdout" target="SYSTEM_OUT">
+			<PatternLayout pattern="%m%n"/>
+			<ThresholdFilter level="ALL"/>
+		</Console>
+	</Appenders>
+	<Loggers>
+		<Logger name="org.apache.traffic_control.traffic_router" level="INFO" additivity="false">
+			<AppenderRef ref="stdout"/>
+		</Logger>

Review comment:
       The appender used for the `org.apache.traffic_control.traffic_router` logger should include the class name and optionally other info that the default `log4j2.xml` includes:
   https://github.com/apache/trafficcontrol/blob/dfca6b12a736ee0430b27183acf2db911f85b65b/traffic_router/core/src/main/conf/log4j2.xml#L34




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_router/Dockerfile
##########
@@ -15,12 +15,17 @@ FROM alpine:latest AS trafficrouter-dev
 
 ENV TC=/root/go/src/github.com/apache/trafficcontrol
 VOLUME /root/go/src/github.com/apache/trafficcontrol
-ENV JPDA_OPTS="-agentlib:jdwp=transport=dt_socket,address=*:5005,server=y,suspend=n" JAVA_HOME=/usr/lib/jvm/java-11-openjdk M2_HOME=/root/go/src/github.com/apache/trafficcontrol/.m2 CATALINA_BASE=/opt/traffic_router
+ENV JPDA_OPTS="-agentlib:jdwp=transport=dt_socket,address=*:5005,server=y,suspend=n" JAVA_HOME=/usr/lib/jvm/java-11-openjdk M2_HOME=/root/go/src/github.com/apache/trafficcontrol/.m2 CATALINA_BASE=/opt/traffic_router TRAFFIC_MONITOR_HOSTS=trafficmonitor
 EXPOSE 3053:53/tcp 3053:53/udp 3080:80 3443:443 3333:3333 2222:3443 5005:5005
 
-RUN apk add --no-cache openjdk11 inotify-tools maven && ln -s /usr/lib/jvm/java-11-openjdk/bin/jdb /bin/jdb
+RUN apk add --no-cache openjdk11 inotify-tools maven tomcat-native openssl && ln -s /usr/lib/jvm/java-11-openjdk/bin/jdb /bin/jdb
 
 ADD https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.43/bin/apache-tomcat-9.0.43.tar.gz /opt/tomcat.tgz
+
+ARG USER
+RUN adduser -H -D ${USER}
+RUN chown -R ${USER} /opt /usr/share/java/ /root
+USER ${USER}

Review comment:
       > but also be aware that not all shell/system combinations set the environment variable `UID` (or `USER` for that matter) and idk what to do about those systems.
   
   AFAIK Windows doesn't care what user Docker says files are owned by




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_router/Dockerfile
##########
@@ -15,12 +15,17 @@ FROM alpine:latest AS trafficrouter-dev
 
 ENV TC=/root/go/src/github.com/apache/trafficcontrol
 VOLUME /root/go/src/github.com/apache/trafficcontrol
-ENV JPDA_OPTS="-agentlib:jdwp=transport=dt_socket,address=*:5005,server=y,suspend=n" JAVA_HOME=/usr/lib/jvm/java-11-openjdk M2_HOME=/root/go/src/github.com/apache/trafficcontrol/.m2 CATALINA_BASE=/opt/traffic_router
+ENV JPDA_OPTS="-agentlib:jdwp=transport=dt_socket,address=*:5005,server=y,suspend=n" JAVA_HOME=/usr/lib/jvm/java-11-openjdk M2_HOME=/root/go/src/github.com/apache/trafficcontrol/.m2 CATALINA_BASE=/opt/traffic_router TRAFFIC_MONITOR_HOSTS=trafficmonitor
 EXPOSE 3053:53/tcp 3053:53/udp 3080:80 3443:443 3333:3333 2222:3443 5005:5005
 
-RUN apk add --no-cache openjdk11 inotify-tools maven && ln -s /usr/lib/jvm/java-11-openjdk/bin/jdb /bin/jdb
+RUN apk add --no-cache openjdk11 inotify-tools maven tomcat-native openssl && ln -s /usr/lib/jvm/java-11-openjdk/bin/jdb /bin/jdb
 
 ADD https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.43/bin/apache-tomcat-9.0.43.tar.gz /opt/tomcat.tgz
+
+ARG USER
+RUN adduser -H -D ${USER}
+RUN chown -R ${USER} /opt /usr/share/java/ /root
+USER ${USER}

Review comment:
       > but also be aware that not all shell/system combinations set the environment variable `UID` (or `USER` for that matter) and idk what to do about those systems.
   AFAIK Windows doesn't care what user Docker says files are owned by




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: docker-compose.yml
##########
@@ -0,0 +1,116 @@
+# 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.
+
+---
+version: '3.5'
+
+services:
+    trafficops:
+        build:
+            context: dev/traffic_ops/
+        depends_on:
+            - db
+        domainname: dev.ciab.test
+        hostname: trafficops
+        image: trafficops-dev
+        ports:
+            - 6443:443
+            - 6444:6444
+        volumes:
+            - .:/root/go/src/github.com/apache/trafficcontrol/
+
+    db:
+        image: postgres:13.2-alpine
+        ports:
+            - 5432:5432
+        environment:
+            - POSTGRES_PASSWORD=twelve12
+        hostname: db
+        domainname: dev.ciab.test
+
+    trafficportal:
+        build:
+            context: dev/traffic_portal
+        depends_on:
+            - trafficops
+        hostname: trafficportal
+        domainname: dev.ciab.test
+        image: trafficportal-dev
+        ports:
+            - 444:443
+        volumes:
+            - .:/root/go/src/github.com/apache/trafficcontrol
+
+    tpv2:
+        build:
+            context: dev/tpv2
+        depends_on:
+            - trafficops
+        hostname: tpv2
+        domainname: dev.ciab.test
+        image: tpv2-dev
+        ports:
+            - 443:443
+        volumes:
+            - .:/root/go/src/github.com/apache/trafficcontrol
+
+    trafficmonitor:
+        build:
+            context: dev/traffic_monitor
+        depends_on:
+            - trafficops
+        hostname: trafficmonitor
+        domainname: dev.ciab.test

Review comment:
       Instead of specifying the domain, add the `trafficmonitor` service to a network:
   ```yml
           networks:
             - ciab
   ```

##########
File path: docker-compose.yml
##########
@@ -0,0 +1,116 @@
+# 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.
+
+---
+version: '3.5'
+
+services:
+    trafficops:
+        build:
+            context: dev/traffic_ops/
+        depends_on:
+            - db
+        domainname: dev.ciab.test
+        hostname: trafficops
+        image: trafficops-dev
+        ports:
+            - 6443:443
+            - 6444:6444
+        volumes:
+            - .:/root/go/src/github.com/apache/trafficcontrol/
+
+    db:
+        image: postgres:13.2-alpine
+        ports:
+            - 5432:5432
+        environment:
+            - POSTGRES_PASSWORD=twelve12
+        hostname: db
+        domainname: dev.ciab.test
+
+    trafficportal:
+        build:
+            context: dev/traffic_portal
+        depends_on:
+            - trafficops
+        hostname: trafficportal
+        domainname: dev.ciab.test
+        image: trafficportal-dev
+        ports:
+            - 444:443
+        volumes:
+            - .:/root/go/src/github.com/apache/trafficcontrol
+
+    tpv2:
+        build:
+            context: dev/tpv2
+        depends_on:
+            - trafficops
+        hostname: tpv2
+        domainname: dev.ciab.test
+        image: tpv2-dev
+        ports:
+            - 443:443
+        volumes:
+            - .:/root/go/src/github.com/apache/trafficcontrol
+
+    trafficmonitor:
+        build:
+            context: dev/traffic_monitor
+        depends_on:
+            - trafficops
+        hostname: trafficmonitor
+        domainname: dev.ciab.test
+        image: trafficmonitor-dev
+        ports:
+            - 80:80
+            - 81:81
+        volumes:
+            - .:/root/go/src/github.com/apache/trafficcontrol
+
+    t3c:
+        build:
+            context: dev/t3c
+        depends_on:
+            - trafficops
+        hostname: edge
+        domainname: dev.ciab.test

Review comment:
       Instead of specifying the domain, add the `t3c` service to a network:
   ```yml
           networks:
             - ciab
   ```

##########
File path: docker-compose.yml
##########
@@ -0,0 +1,116 @@
+# 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.
+
+---
+version: '3.5'
+
+services:
+    trafficops:
+        build:
+            context: dev/traffic_ops/
+        depends_on:
+            - db
+        domainname: dev.ciab.test
+        hostname: trafficops
+        image: trafficops-dev
+        ports:
+            - 6443:443
+            - 6444:6444
+        volumes:
+            - .:/root/go/src/github.com/apache/trafficcontrol/
+
+    db:
+        image: postgres:13.2-alpine
+        ports:
+            - 5432:5432
+        environment:
+            - POSTGRES_PASSWORD=twelve12
+        hostname: db
+        domainname: dev.ciab.test
+
+    trafficportal:
+        build:
+            context: dev/traffic_portal
+        depends_on:
+            - trafficops
+        hostname: trafficportal
+        domainname: dev.ciab.test
+        image: trafficportal-dev
+        ports:
+            - 444:443
+        volumes:
+            - .:/root/go/src/github.com/apache/trafficcontrol
+
+    tpv2:
+        build:
+            context: dev/tpv2
+        depends_on:
+            - trafficops
+        hostname: tpv2
+        domainname: dev.ciab.test
+        image: tpv2-dev
+        ports:
+            - 443:443
+        volumes:
+            - .:/root/go/src/github.com/apache/trafficcontrol
+
+    trafficmonitor:
+        build:
+            context: dev/traffic_monitor
+        depends_on:
+            - trafficops
+        hostname: trafficmonitor
+        domainname: dev.ciab.test
+        image: trafficmonitor-dev
+        ports:
+            - 80:80
+            - 81:81
+        volumes:
+            - .:/root/go/src/github.com/apache/trafficcontrol
+
+    t3c:
+        build:
+            context: dev/t3c
+        depends_on:
+            - trafficops
+        hostname: edge
+        domainname: dev.ciab.test
+        image: t3c-dev
+        ports:
+            - 8080:80
+            - 8081:8081
+        volumes:
+            - .:/root/go/src/github.com/apache/trafficcontrol
+
+    trafficrouter:
+        build:
+            context: dev/traffic_router
+        depends_on:
+            - trafficmonitor
+        hostname: trafficrouter
+        domainname: dev.ciab.test

Review comment:
       Instead of specifying the domain, add the `trafficrouter` service to a network:
   ```yml
           networks:
             - ciab
   ```




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_ops/Dockerfile
##########
@@ -0,0 +1,38 @@
+#
+#  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.
+#
+FROM alpine:latest AS certbuilder
+RUN apk add --no-cache openssl
+RUN openssl genrsa -passout pass:x -out server.pass.key 2048 && \
+	openssl rsa -passin pass:x -in server.pass.key -out server.key && \
+	rm server.pass.key && \
+	openssl req -new -key server.key -out server.csr \
+		-subj "/C=US/ST=CO/L=Denver/O=Apache/OU=Traffic Control/CN=trafficops.dev.ciab.test" && \
+	openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt && \
+	openssl rand 32 | base64 > /aes.key
+
+FROM alpine:latest AS trafficops-dev
+
+ENV TC="/root/go/src/github.com/apache/trafficcontrol/"
+VOLUME /root/go/src/github.com/apache/trafficcontrol
+ENV ADMIN="$TC/traffic_ops/app/db/admin"
+EXPOSE 443 6444
+
+COPY --from=certbuilder /server.key /server.crt /aes.key /
+RUN apk add --no-cache make inotify-tools go postgresql-client && go install github.com/go-delve/delve/cmd/dlv@latest && ln -s /root/go/bin/dlv /usr/bin/dlv

Review comment:
       That means either expanding the build scope to include the entire ATC repo or deferring the installation of Go to run-time. I'd rather not do either of those things, and if you update the cached layer where Go is installed, you should get 1.17.6.




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_router/Dockerfile
##########
@@ -0,0 +1,31 @@
+#
+#  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.
+#
+FROM alpine:latest AS trafficrouter-dev
+
+ENV TC=/root/go/src/github.com/apache/trafficcontrol
+VOLUME /root/go/src/github.com/apache/trafficcontrol
+ENV JPDA_OPTS="-agentlib:jdwp=transport=dt_socket,address=5005,server=y,suspend=n" JAVA_HOME=/usr/lib/jvm/java-11-openjdk M2_HOME=/root/.m2/

Review comment:
       since the entire ATC repo is already a mounted volume, I'll just change M2_HOME to point at `.m2` in the repo




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/t3c/Dockerfile
##########
@@ -0,0 +1,48 @@
+# 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:latest AS traffic-server-builder
+
+RUN apk add --no-cache build-base perl libexecinfo-dev pcre-dev libressl-dev libtool linux-headers openssl-dev zlib-dev
+ADD https://downloads.apache.org/trafficserver/trafficserver-9.1.0.tar.bz2 /
+RUN tar -xf trafficserver-9.1.0.tar.bz2 && cd trafficserver-9.1.0 && mkdir /ats && ./configure --prefix / --enable-experimental-plugins && make && make install && ls -R /ats

Review comment:
       Maybe the documentation should be changed from `make -j4` to just `make -j`:
   https://github.com/apache/trafficcontrol/blob/85f1073154a8cf3754fb454984b1e50a7a4e636c/docs/source/admin/quick_howto/ciab.rst#L43




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: traffic_portal/package-lock.json
##########
@@ -1,6210 +1,8 @@
 {

Review comment:
       Oh, that makes sense.




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_router/conf/startup.properties
##########
@@ -0,0 +1,30 @@
+#
+# 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.
+
+# Any environment variables you define here will become part of the startup
+# environment for the 'traffic_router' service. It is a good place to set
+# command line arguments for the Java command line or any environment specific
+# setting you want available to the traffic_router process.
+# This file is not replaced by the update process when a new version of traffic
+# router is installed.
+CATALINA_OPTS="\
+	-server -Xms2g -Xmx8g \
+	-Dlog4j.configuration=file:///opt/tomcat/conf/log4j.properties \

Review comment:
       I did change that, but I didn't commit it for some reason




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_router/Dockerfile
##########
@@ -0,0 +1,31 @@
+#
+#  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.
+#
+FROM alpine:latest AS trafficrouter-dev
+
+ENV TC=/root/go/src/github.com/apache/trafficcontrol
+VOLUME /root/go/src/github.com/apache/trafficcontrol
+ENV JPDA_OPTS="-agentlib:jdwp=transport=dt_socket,address=5005,server=y,suspend=n" JAVA_HOME=/usr/lib/jvm/java-11-openjdk M2_HOME=/root/.m2/

Review comment:
       In Java 11, the JPDA address needs to be `*:5005`, not just `5005`




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman commented on pull request #6532: CDN-in-a-Box for Developers

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


   > > The way the CiaB "enroller" works is meant to be generic, it allows loading (somewhat) arbitrary data sets using the TO API - because of that, it has to wait for TO to be available and then each service that wants to exist is responsible for using it to "enroll" itself
   > 
   > This was a big difference in all the ansible work from CiaB from the beginning. There's no concept of dynamically add/remove pieces. There's a definition of what you want generated at the very beginning of the lifecycle so it knows what all it has to wait through and shape the dataset accordingly.
   
   The enroller takes about 5 seconds on my workstation to complete. The ansible dataset loader takes 20 minutes


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: docker-compose.yml
##########
@@ -0,0 +1,116 @@
+# 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.
+
+---
+version: '3.5'
+
+services:
+    trafficops:
+        build:
+            context: dev/traffic_ops/
+        depends_on:
+            - db
+        domainname: dev.ciab.test
+        hostname: trafficops
+        image: trafficops-dev
+        ports:
+            - 6443:443
+            - 6444:6444
+        volumes:
+            - .:/root/go/src/github.com/apache/trafficcontrol/
+
+    db:
+        image: postgres:13.2-alpine
+        ports:
+            - 5432:5432
+        environment:
+            - POSTGRES_PASSWORD=twelve12
+        hostname: db
+        domainname: dev.ciab.test
+
+    trafficportal:
+        build:
+            context: dev/traffic_portal
+        depends_on:
+            - trafficops
+        hostname: trafficportal
+        domainname: dev.ciab.test
+        image: trafficportal-dev
+        ports:
+            - 444:443
+        volumes:
+            - .:/root/go/src/github.com/apache/trafficcontrol
+
+    tpv2:
+        build:
+            context: dev/tpv2
+        depends_on:
+            - trafficops
+        hostname: tpv2
+        domainname: dev.ciab.test
+        image: tpv2-dev
+        ports:
+            - 443:443
+        volumes:
+            - .:/root/go/src/github.com/apache/trafficcontrol
+
+    trafficmonitor:
+        build:
+            context: dev/traffic_monitor
+        depends_on:
+            - trafficops
+        hostname: trafficmonitor
+        domainname: dev.ciab.test
+        image: trafficmonitor-dev
+        ports:
+            - 80:80
+            - 81:81
+        volumes:
+            - .:/root/go/src/github.com/apache/trafficcontrol
+
+    t3c:
+        build:
+            context: dev/t3c
+        depends_on:
+            - trafficops
+        hostname: edge
+        domainname: dev.ciab.test
+        image: t3c-dev
+        ports:
+            - 8080:80
+            - 8081:8081
+        volumes:
+            - .:/root/go/src/github.com/apache/trafficcontrol
+
+    trafficrouter:
+        build:
+            context: dev/traffic_router
+        depends_on:
+            - trafficmonitor
+        hostname: trafficrouter
+        domainname: dev.ciab.test
+        image: trafficrouter-dev
+        ports:
+            - 3053:53/tcp
+            - 3053:53/udp
+            - 3080:80
+            - 3443:443
+            - 3333:3333
+            - 2222:3443
+            - 5005:5005
+        volumes:
+            - .:/root/go/src/github.com/apache/trafficcontrol

Review comment:
       There should be a `networks` section so you can specify the domain  name of your network:
   ```yml
   networks:
     ciab:
       name: dev.ciab.test
       driver: bridge
   ```




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_router/run.sh
##########
@@ -0,0 +1,41 @@
+#!/bin/sh
+# 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 -o errexit
+
+cd "$TC/traffic_router"
+
+mvn -Dmaven.test.skip=true compile -P \!rpm-build
+mvn -Dmaven.test.skip=true package -P \!rpm-build
+
+cp core/target/ROOT.war /opt/tomcat/webapps/
+ln -s $TC/dev/traffic_router/conf/* /opt/tomcat/conf/
+
+/opt/tomcat/bin/catalina.sh jpda run

Review comment:
       TR exits immediately after starting. The contents of `/opt/tomcat/logs/catalina.2022-02-04.log`:
   ```java
   04-Feb-2022 00:41:39.532 SEVERE [main] org.apache.tomcat.util.digester.Digester.startElement Begin event threw exception
   	java.lang.ClassNotFoundException: org.apache.traffic_control.traffic_router.tomcat.TomcatLifecycleListener
   		at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:476)
   		at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589)
   		at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
   		at org.apache.tomcat.util.digester.ObjectCreateRule.begin(ObjectCreateRule.java:104)
   		at org.apache.catalina.startup.ListenerCreateRule.begin(ListenerCreateRule.java:70)
   		at org.apache.tomcat.util.digester.Digester.startElement(Digester.java:1293)
   		at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:510)
   		at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:183)
   		at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1377)
   		at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2710)
   		at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:605)
   		at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:534)
   		at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:888)
   		at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:824)
   		at java.xml/com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
   		at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1216)
   		at java.xml/com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:635)
   		at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1551)
   		at org.apache.catalina.startup.Catalina.parseServerXml(Catalina.java:617)
   		at org.apache.catalina.startup.Catalina.load(Catalina.java:709)
   		at org.apache.catalina.startup.Catalina.load(Catalina.java:746)
   		at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   		at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
   		at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   		at java.base/java.lang.reflect.Method.invoke(Method.java:566)
   		at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:302)
   		at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:472)
   ```
   So Tomcat cannot find `org.apache.traffic_control.traffic_router.tomcat.TomcatLifecycleListener`, which `server.xml` tells it to load: https://github.com/apache/trafficcontrol/blob/7b30bab1a6931927f092f78c74b5ad7b4f6ab8c0/dev/traffic_router/conf/server.xml#L21
   
   That is because, aside from `ROOT.war`, the Traffic Router RPM includes an entire `lib` directory (which duplicates the `lib` directory contained in `ROOT.war`, which contains `traffic_router_connector-6.2.0.jar`, which contains `TomcatLifecycleListener.class`. https://github.com/apache/trafficcontrol/blob/abfbb3483afbb3deedb488e872d21d8c0ba6c94a/traffic_router/build/pom.xml#L188
   
   In order for Tomcat to find `traffic_router_connector-6.2.0.jar` (and assuming the `CATALINA_BASE` environment variable is `${TC}/dev/traffic_router`, `${TC}/dev/traffic_router/lib` can be a relative symlink to `traffic_router/core/target/ROOT/WEB-INF/lib`, generated by `mvn compile`.
   
   




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/t3c/run.sh
##########
@@ -0,0 +1,81 @@
+#!/bin/sh
+
+# 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 -o errexit
+trap '[ $? -eq 0 ] && exit 0 || echo "Error on line ${LINENO} of ${0}"; exit 1' EXIT
+
+
+cd "$TC/cache-config"
+
+# Build area may contain non-debug binaries
+make clean && make -j debug
+
+if [[ ! -f /usr/bin/t3c ]]; then
+	ln -s /root/go/src/github.com/apache/trafficcontrol/cache-config/t3c/t3c /usr/bin/
+fi
+if [[ ! -f /usr/bin/t3c-apply ]]; then
+	ln -s /root/go/src/github.com/apache/trafficcontrol/cache-config/t3c-apply/t3c-apply /usr/bin/
+fi
+if [[ ! -f /usr/bin/t3c-check ]]; then
+	ln -s /root/go/src/github.com/apache/trafficcontrol/cache-config/t3c-check/t3c-check /usr/bin/
+fi
+if [[ ! -f /usr/bin/t3c-check-refs ]]; then
+	ln -s /root/go/src/github.com/apache/trafficcontrol/cache-config/t3c-check-refs/t3c-check-refs /usr/bin/
+fi
+if [[ ! -f /usr/bin/t3c-check-reload ]]; then
+	ln -s /root/go/src/github.com/apache/trafficcontrol/cache-config/t3c-check-reload/t3c-check-reload /usr/bin/
+fi
+if [[ ! -f /usr/bin/t3c-diff ]]; then
+	ln -s /root/go/src/github.com/apache/trafficcontrol/cache-config/t3c-diff/t3c-diff /usr/bin/
+fi
+if [[ ! -f /usr/bin/t3c-generate ]]; then
+	ln -s /root/go/src/github.com/apache/trafficcontrol/cache-config/t3c-generate/t3c-generate /usr/bin/
+fi
+if [[ ! -f /usr/bin/t3c-preprocess ]]; then
+	ln -s /root/go/src/github.com/apache/trafficcontrol/cache-config/t3c-preprocess/t3c-preprocess /usr/bin/
+fi
+if [[ ! -f /usr/bin/t3c-request ]]; then
+	ln -s /root/go/src/github.com/apache/trafficcontrol/cache-config/t3c-request/t3c-request /usr/bin/
+fi
+if [[ ! -f /usr/bin/t3c-update ]]; then
+	ln -s /root/go/src/github.com/apache/trafficcontrol/cache-config/t3c-update/t3c-update /usr/bin/
+fi
+if [[ ! -f /usr/bin/tm-health-client ]]; then
+	ln -s /root/go/src/github.com/apache/trafficcontrol/cache-config/tm-health-client/tm-health-client /usr/bin/
+fi

Review comment:
       Can this be a *for* loop?

##########
File path: dev/traffic_router/run.sh
##########
@@ -0,0 +1,42 @@
+#!/bin/sh
+# 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 -o errexit
+trap '[ $? -eq 0 ] && exit 0 || echo "Error on line ${LINENO} of ${0}"; exit 1' EXIT
+
+cd "$TC/traffic_router"
+
+mvn -Dmaven.test.skip=true compile -P \!rpm-build
+mvn -Dmaven.test.skip=true package -P \!rpm-build
+
+cp core/target/ROOT.war /opt/tomcat/webapps/
+ln -s "$TC/dev/traffic_router/conf/*" /opt/tomcat/conf/

Review comment:
       The result of this command:
   ```shell
   trafficrouter:/# ls -l /opt/tomcat/conf
   total 240
   lrwxrwxrwx    1 root     root            71 Feb  2 22:25 * -> /root/go/src/github.com/apache/trafficcontrol/dev/traffic_router/conf/*
   drwxr-x---    3 root     root          4096 Feb  2 22:25 Catalina
   -rw-------    1 root     root         12873 Jan 28  2021 catalina.policy
   -rw-------    1 root     root          7262 Jan 28  2021 catalina.properties
   -rw-------    1 root     root          1400 Jan 28  2021 context.xml
   -rw-------    1 root     root          1149 Jan 28  2021 jaspic-providers.xml
   -rw-------    1 root     root          2313 Jan 28  2021 jaspic-providers.xsd
   -rw-------    1 root     root          4144 Jan 28  2021 logging.properties
   -rw-------    1 root     root          7588 Jan 28  2021 server.xml
   -rw-------    1 root     root          2164 Jan 28  2021 tomcat-users.xml
   -rw-------    1 root     root          2558 Jan 28  2021 tomcat-users.xsd
   -rw-------    1 root     root        172359 Jan 28  2021 web.xml
   ```




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_router/run.sh
##########
@@ -0,0 +1,39 @@
+#!/bin/sh
+# 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 -o errexit
+trap '[ $? -eq 0 ] && exit 0 || echo "Error on line ${LINENO} of ${0}"; exit 1' EXIT
+
+cd "$TC/traffic_router"
+
+mvn -Dmaven.test.skip=true compile -P \!rpm-build
+mvn -Dmaven.test.skip=true package -P \!rpm-build
+
+/opt/tomcat/bin/catalina.sh jpda run

Review comment:
       I removed them before they existed, and since I used `-f` it wasn't failing or warning me :facepalm: 




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] jhg03a commented on pull request #6532: CDN-in-a-Box for Developers

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


   > The way the CiaB "enroller" works is meant to be generic, it allows loading (somewhat) arbitrary data sets using the TO API - because of that, it has to wait for TO to be available and then each service that wants to exist is responsible for using it to "enroll" itself
   
   This was a big difference in all the ansible work from CiaB from the beginning.  There's no concept of dynamically add/remove pieces.  There's a definition of what you want generated at the very beginning of the lifecycle so it knows what all it has to wait through and shape the dataset accordingly.


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_router/conf/traffic_ops.properties
##########
@@ -0,0 +1,13 @@
+# 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.
+traffic_ops.username=admin
+traffic_ops.password=twelve12

Review comment:
       Actually, IMO neither this nor CiaB should use `twelve12`, since that's not accepted by the API either - `twelve12!` is, which makes it a viable candidate. The password used here should ideally match the current CiaB for ease of use, but CiaB should not contain data we know to be invalid. If you are using the development or testing/demo setups in production, you have ignored all instructions to the contrary and in CiaB's case multiple warnings. We cannot reasonably prevent someone so determined to do improper things from doing those things.




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] ocket8888 commented on pull request #6532: CDN-in-a-Box for Developers

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


   So Traffic Router will not respond with even a 503 to requests made to its API until it has a CDN snapshot on which to operate? I've been spinning my wheels trying various weird and unlikely things because I expected it to at least be capable of telling me that it wasn't working right - I think we ought to change that behavior if possible because it seems very confusing and annoying for people trying to set up components for the first time. I can open an issue for that (once I confirm one doesn't already exist)


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman edited a comment on pull request #6532: CDN-in-a-Box for Developers

Posted by GitBox <gi...@apache.org>.
zrhoffman edited a comment on pull request #6532:
URL: https://github.com/apache/trafficcontrol/pull/6532#issuecomment-1032019625


   Once these changes are made, TR responds on port 80 and port 3333:
   ```jsonc
   [zrhoffman@computer trafficcontrol]$ curl localhost:3333/crs/stats | jq
   {
     "app": {
       "buildTimestamp": "2022-02-07",
       "name": "traffic_router",
       "deploy-dir": "/opt/traffic_router",
       "git-revision": "${buildNumber}",
       "version": "6.2.0"
     },
     "stats": {
       "dnsMap": {},
       "httpMap": {},
       "totalDnsCount": 0,
       "totalHttpCount": 0,
       "totalDsMissCount": 1,
       "appStartTime": 1644274479863,
       "averageDnsTime": 0,
       "averageHttpTime": 0,
       "updateTracker": {
         "lastHttpsCertificatesCheck": 1644274540167,
         "lastCacheStateCheck": 1644274653886,
         "lastCacheStateChange": 1644274480649,
         "lastLetsEncryptDnsChallengeWatcherCheck": 1644274600401,
         "lastHttpsCertificatesFetchSuccess": 1644274540346,
         "lastConfigCheck": 1644274540186,
         "lastConfigChange": 1644274540200,
         "lastSteeringWatcherCheck": 1644274651137,
         "lastNetworkUpdaterCheck": 1644274480509,
         "lastGeolocationDatabaseUpdaterCheck": 1644274480509,
         "lastHttpsCertificatesFetchAttempt": 1644274540167
       }
     }
   }
   ```


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_ops/Dockerfile
##########
@@ -0,0 +1,38 @@
+#
+#  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.
+#
+FROM alpine:latest AS certbuilder
+RUN apk add --no-cache openssl
+RUN openssl genrsa -passout pass:x -out server.pass.key 2048 && \
+	openssl rsa -passin pass:x -in server.pass.key -out server.key && \
+	rm server.pass.key && \
+	openssl req -new -key server.key -out server.csr \
+		-subj "/C=US/ST=CO/L=Denver/O=Apache/OU=Traffic Control/CN=trafficops.dev.ciab.test" && \
+	openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt && \
+	openssl rand 32 | base64 > /aes.key
+
+FROM alpine:latest AS trafficops-dev
+
+ENV TC="/root/go/src/github.com/apache/trafficcontrol/"
+VOLUME /root/go/src/github.com/apache/trafficcontrol
+ENV ADMIN="$TC/traffic_ops/app/db/admin"
+EXPOSE 443 6444
+
+COPY --from=certbuilder /server.key /server.crt /aes.key /
+RUN apk add --no-cache make inotify-tools go postgresql-client && go install github.com/go-delve/delve/cmd/dlv@latest && ln -s /root/go/bin/dlv /usr/bin/dlv

Review comment:
       That means either expanding the build scope to include the entire ATC repo or deferring the installation of Go to run-time in at least 3 containers. I'd rather not do either of those things, and if you update the cached layer where Go is installed, you should get 1.17.6.




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] jhg03a commented on pull request #6532: CDN-in-a-Box for Developers

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


   > The enroller takes about 5 seconds on my workstation to complete. The ansible dataset loader takes 20 minutes
   
   That's really an apples/oranges type of comparison.  While they might have similar goals, the implementation and scope are different.  I'm not suggesting trying to use it in this capacity, but rather addressing the simplicity/consistency that came from specifically not trying to support dynamic system addition/removal.


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_router/conf/startup.properties
##########
@@ -0,0 +1,30 @@
+#
+# 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.
+
+# Any environment variables you define here will become part of the startup
+# environment for the 'traffic_router' service. It is a good place to set
+# command line arguments for the Java command line or any environment specific
+# setting you want available to the traffic_router process.
+# This file is not replaced by the update process when a new version of traffic
+# router is installed.
+CATALINA_OPTS="\
+	-server -Xms2g -Xmx8g \
+	-Dlog4j.configuration=file:///opt/tomcat/conf/log4j2.xml \

Review comment:
       needs to be `log4j.configurationFile=`. After this is added, TR logs as expected.




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: docker-compose.yml
##########
@@ -0,0 +1,116 @@
+# 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.
+
+---
+version: '3.5'
+
+services:
+    trafficops:
+        build:
+            context: dev/traffic_ops/
+        depends_on:
+            - db
+        domainname: dev.ciab.test
+        hostname: trafficops
+        image: trafficops-dev
+        ports:
+            - 6443:443
+            - 6444:6444
+        volumes:
+            - .:/root/go/src/github.com/apache/trafficcontrol/
+
+    db:
+        image: postgres:13.2-alpine
+        ports:
+            - 5432:5432
+        environment:
+            - POSTGRES_PASSWORD=twelve12
+        hostname: db
+        domainname: dev.ciab.test

Review comment:
       Instead of specifying the domain, add the `db` service to a network:
   ```yml
           networks:
             - ciab
   ```




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/t3c/Dockerfile
##########
@@ -0,0 +1,49 @@
+# 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:latest AS traffic-server-builder
+
+RUN apk add --no-cache build-base perl libexecinfo-dev pcre-dev libressl-dev libtool linux-headers openssl-dev zlib-dev
+ADD https://downloads.apache.org/trafficserver/trafficserver-9.1.1.tar.bz2 /
+RUN tar -xf trafficserver-9.1.1.tar.bz2 && cd trafficserver-9.1.1 && mkdir /ats && ./configure --prefix / --enable-experimental-plugins && make -j && make install && ls -R /ats
+
+FROM alpine:latest AS t3c-dev
+
+ENV TC="/root/go/src/github.com/apache/trafficcontrol/"
+VOLUME /root/go/src/github.com/apache/trafficcontrol
+EXPOSE 80 8081
+
+COPY --from=traffic-server-builder /bin/traffic_cache_tool /bin/traffic_crashlog /bin/traffic_ctl /bin/traffic_layout /bin/traffic_logcat /bin/traffic_logstats /bin/traffic_manager /bin/traffic_server /bin/traffic_via /bin/trafficserver /bin/tspush /bin/tsxs /bin/
+COPY --from=traffic-server-builder /etc/trafficserver /etc/trafficserver
+COPY --from=traffic-server-builder /include/ts /include/ts
+COPY --from=traffic-server-builder /include/tscpp /include/tscpp
+COPY --from=traffic-server-builder /lib/perl5 /lib/perl5
+COPY --from=traffic-server-builder /lib/pkgconfig/trafficserver.pc /lib/pkgconfig/trafficserver.pc
+COPY --from=traffic-server-builder /lib/libtscore.la /lib/libtscore.so /lib/libtscore.so.9 /lib/libtscore.so.9.1.1 /lib/libtscppapi.la /lib/libtscppapi.so /lib/libtscppapi.so.9 /lib/libtscppapi.so.9.1.1 /lib/libtscpputil.la /lib/libtscpputil.so /lib/libtscpputil.so.9 /lib/libtscpputil.so.9.1.1 /lib/libtsmgmt.la /lib/libtsmgmt.so /lib/libtsmgmt.so.9 /lib/libtsmgmt.so.9.1.1 /lib/plugin_init_fail.la /lib/plugin_init_fail.so /lib/plugin_instinit_fail.la /lib/plugin_instinit_fail.so /lib/plugin_missing_deleteinstance.la /lib/plugin_missing_deleteinstance.so /lib/plugin_missing_doremap.la /lib/plugin_missing_doremap.so /lib/plugin_missing_init.la /lib/plugin_missing_init.so /lib/plugin_missing_newinstance.la /lib/plugin_missing_newinstance.so /lib/plugin_required_cb.la /lib/plugin_required_cb.so /lib/plugin_testing_calls.la /lib/plugin_testing_calls.so /lib/plugin_v1.la /lib/plugin_v1.so /lib/plugin_v2.la /lib/plugin_v2.so /lib/
+COPY --from=traffic-server-builder /libexec/trafficserver /libexec/trafficserver
+COPY --from=traffic-server-builder /share/man /share/man
+RUN mkdir /share/trafficserver && mkdir -p /var/log/trafficserver && mkdir /var/trafficserver
+
+RUN apk add --no-cache make inotify-tools go pcre libexecinfo && \

Review comment:
       I'm going to resolve this to make the feedback list smaller, conversation continues above on the TO dockerfile




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_router/run.sh
##########
@@ -0,0 +1,38 @@
+#!/bin/sh
+# 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 -o errexit
+
+cd "$TC/traffic_router"
+
+mvn -Dmaven.test.skip=true compile package -P \!rpm-build
+
+chmod -R a+rw "$TC/dev/traffic_router/"
+/opt/tomcat/bin/catalina.sh jpda run

Review comment:
       Right now, `/opt/tomcat/bin/catalina.sh` is run using `/` as the working directory. Traffic Router wants to create a file named `logs/juli.2022-02-21.log` (relative to the working directory), which fails, resulting in this error being logged:
   
   ```java
   java.util.logging.ErrorManager: 4: Unable to create [logs]
   ```
   
   So the working directory should be `/opt/traffic_router` or `$TC/dev/traffic_router`.

##########
File path: dev/traffic_ops/seed.psql
##########
@@ -0,0 +1,290 @@
+/* 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.
+*/
+
+INSERT INTO tm_user (
+	username,
+	tenant_id,
+	"role",
+	local_passwd,
+	confirm_local_passwd,
+	email,
+	full_name
+) VALUES (
+	'admin',
+	(SELECT id FROM tenant WHERE "name" = 'root'),
+	(SELECT id FROM "role" WHERE "name" = 'admin'),
+	-- 'twelve12' encrypted with SCRYPT
+	'SCRYPT:16384:8:1:p0Bppp/6IBeYxSwdLuYddsdMLBU/BNSlLY6fSIF7H1XW4eTbNVeMPVm7TuTEG4FM8PbqLlVwi8sPy8ZJznAlaQ==:sRcHWGe43mm/uEmXTIw37GcLEQZTlWAdf4vJqK8f0MDh8P+8gXoNx+nxWyb3r/0Bh+yyg0g/dUvti/ePZJL+Jw==',
+	'SCRYPT:16384:8:1:p0Bppp/6IBeYxSwdLuYddsdMLBU/BNSlLY6fSIF7H1XW4eTbNVeMPVm7TuTEG4FM8PbqLlVwi8sPy8ZJznAlaQ==:sRcHWGe43mm/uEmXTIw37GcLEQZTlWAdf4vJqK8f0MDh8P+8gXoNx+nxWyb3r/0Bh+yyg0g/dUvti/ePZJL+Jw==',
+	'admin@no-reply.atc.test',
+	'Development Admin User'
+)
+ON CONFLICT (username) DO NOTHING;
+
+INSERT INTO cdn (
+	"name",
+	domain_name
+) VALUES (
+	'dev',
+	'ciab.test'
+);
+
+INSERT INTO snapshot (
+	cdn,
+	crconfig,
+	monitoring
+) VALUES (
+	'dev',
+	'{"config":{"coveragezone.polling.url":"file:///root/go/src/github.com/apache/trafficcontrol/traffic_router/core/src/test/resources/czmap.json","dnssec.enabled":"false","domain_name":"ciab.test","geolocation.polling.url":"file:///root/go/src/github.com/apache/trafficcontrol/traffic_router/core/src/test/resources/geo/GeoLite2-City.mmdb.gz"},"contentServers":{"edge":{"cacheGroup":"dev","fqdn":"edge.dev.ciab.test","hashCount":999,"hashId":"edge","httpsPort":443,"interfaceName":"eth0","ip":"129.0.0.2","ip6":"","locationId":"dev","port":80,"profile":"EDGE_dev","status":"REPORTED","type":"EDGE","routingDisabled":0}},"deliveryServices":{"dev":{"anonymousBlockingEnabled":"false","coverageZoneOnly":"false","deepCachingType":"NEVER","dispersion":{"limit":1,"shuffled":"true"},"domains":["dev.ciab.test"],"ecsEnabled":"false","geolocationProvider":"maxmindGeolocationService","ip6RoutingEnabled":"false","matchsets":[{"protocol":"HTTP","matchlist":[{"regex":".*\\\\.dev\\\\..*","match-type":"HOST"
 }]}],"protocol":{"acceptHttps":"false","redirectToHttps":"false"},"regionalGeoBlocking":"false","routingName":"cdn","soa":{"admin":"traffic_ops","expire":"604800","minimum":"30","refresh":"28800","retry":"7200"},"sslEnabled":"false","ttls":{"A":"","AAAA":"","NS":"3600","SOA":"86400"}}},"edgeLocations":{"dev":{"latitude":0,"longitude":0,"backupLocations":{"fallbackToClosest":"true"},"localizationMethods":["GEO","CZ","DEEP_CZ"]}},"monitors":{"trafficmonitor":{"fqdn":"trafficmonitor.dev.ciab.test","httpsPort":null,"ip":"129.0.0.1","ip6":"","location":"dev","port":80,"profile":"RASCAL_TM_dev","status":"ONLINE"}},"stats":{"CDN_name":"dev","date":1643833749,"tm_host":"trafficops","tm_user":"admin","tm_version":"development"}}',

Review comment:
       In order for `coveragezone.polling.url` and `geolocation.polling.url` to show up a live CRConfig,
   * The parameters need to be assigned to a Traffic Router profile for config file `CRConfig.json`
   * The Traffic Router profile should have an `ONLINE`-status Traffic Router assigned to it
   
   As a result of doing this, a `contentRouters` section is also added to the CRConfig. Since this snapshot in the `snapshot` table does not that `contentRouters` section, Traffic Router rejects the CRConfig. Logged at `org.apache.traffic_control.traffic_router.core.monitor.TrafficMonitorWatcher:119`:
   ```
   Failed querying JSON for key: contentRouters
   ```




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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



[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #6532: CDN-in-a-Box for Developers

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



##########
File path: dev/traffic_router/run.sh
##########
@@ -0,0 +1,38 @@
+#!/bin/sh
+# 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 -o errexit
+
+cd "$TC/traffic_router"
+
+mvn -Dmaven.test.skip=true compile package -P \!rpm-build
+
+chmod -R a+rw "$TC/dev/traffic_router/"
+/opt/tomcat/bin/catalina.sh jpda run

Review comment:
       Right now, `/opt/tomcat/bin/catalina.sh` is run using `/` as the working directory. Traffic Router wants to create a file named `./logs/juli.2022-02-21.log` (relative to the working directory), which fails, resulting in this error being logged:
   
   ```java
   java.util.logging.ErrorManager: 4: Unable to create [logs]
   ```
   
   So the working directory should be `/opt/traffic_router` or `$TC/dev/traffic_router`.




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

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