This is an automated email from the ASF dual-hosted git repository.

zrhoffman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git


The following commit(s) were added to refs/heads/master by this push:
     new 36a47e9  Update Traffic Ops database from PostgreSQL 9.6 to 13.2 
(#5630)
36a47e9 is described below

commit 36a47e9a397e3eafc3049cdf4e965c5d24100ef9
Author: Rawlin Peters <[email protected]>
AuthorDate: Mon Mar 22 17:56:59 2021 -0600

    Update Traffic Ops database from PostgreSQL 9.6 to 13.2 (#5630)
    
    * Upgrade TODB postgresql version from 9.6 to 13.2
    
    Update TODB tests to postgres 13.2
    
    Capture stderr when checking if DB/user exists and print it if error
    
    Update traffic_ops_db container to postgres 13.2
    
    Update postinstall and TO markdown files to reference postgres 13.2
    
    Update docs to reference postgres 13.2
    
    Update docs to provide instructions for upgrading to postgres 13.2
    
    Update traffic_ops_ort integration tests to postgres 13.2
    
    Update ort_test to use postgres 13
    
    Add changelog
    
    Update changelog
    
    * Address review comments
    
    * Update infrastructure/docker/traffic_ops containers to postgres 13.2
    
    * Fix centos 7 build issues
    
    * Fix install_goose.sh error for centos 7.9
---
 CHANGELOG.md                                        |  1 +
 docs/source/admin/traffic_ops.rst                   | 21 +++++++++++++--------
 docs/source/development/traffic_ops.rst             | 17 +++++++++++++----
 infrastructure/cdn-in-a-box/traffic_ops/Dockerfile  |  8 ++++++--
 .../cdn-in-a-box/traffic_ops/Dockerfile-db          |  4 ++--
 infrastructure/cdn-in-a-box/traffic_ops/run-db.sh   |  2 +-
 infrastructure/cdn-in-a-box/traffic_ops/run-go.sh   |  4 ++--
 infrastructure/docker/traffic_ops/Dockerfile        |  5 ++---
 infrastructure/docker/traffic_ops/Dockerfile_psql   |  3 ++-
 .../docker/traffic_ops/docker-compose.yml           |  7 +++++--
 traffic_ops/INSTALL.md                              | 14 +++++++-------
 traffic_ops/README.md                               |  6 +-----
 traffic_ops/app/bin/tests/docker-compose.yml        |  3 ---
 traffic_ops/app/db/admin.go                         |  8 ++++++--
 traffic_ops/build/traffic_ops.spec                  |  2 +-
 traffic_ops/install/bin/postinstall                 |  2 +-
 traffic_ops/traffic_ops_golang/README.md            | 13 +------------
 traffic_ops_db/docker/Dockerfile                    |  3 ++-
 traffic_ops_db/docker/docker-compose.dev.yml        |  1 +
 traffic_ops_db/docker/todb.sh                       |  2 +-
 traffic_ops_db/test/docker/Dockerfile-db            |  4 ++--
 traffic_ops_db/test/docker/Dockerfile-db-admin      |  1 +
 traffic_ops_db/test/docker/run-db-test.sh           |  8 ++++++--
 traffic_ops_ort/testing/README.md                   |  2 +-
 traffic_ops_ort/testing/docker/db_init/Dockerfile   |  2 +-
 traffic_ops_ort/testing/docker/docker-compose.yml   |  5 +++--
 traffic_ops_ort/testing/docker/ort_test/Dockerfile  |  2 +-
 .../testing/docker/traffic_ops/Dockerfile           |  8 ++++++--
 traffic_ops_ort/testing/docker/variables.env        |  3 ++-
 29 files changed, 91 insertions(+), 70 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4e23e4a..e5aa937 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -52,6 +52,7 @@ The format is based on [Keep a 
Changelog](http://keepachangelog.com/en/1.0.0/).
 - Updated the Traffic Ops Python client to 3.0
 - Updated Flot libraries to supported versions
 - [apache/trafficcontrol](https://github.com/apache/trafficcontrol) is now a 
Go module
+- Updated Traffic Ops supported database version from PostgreSQL 9.6 to 13.2
 - Set Traffic Router to also accept TLSv1.3 protocols by default in server.xml
 - Updated Apache Tomcat from 8.5.63 to 9.0.43
 
diff --git a/docs/source/admin/traffic_ops.rst 
b/docs/source/admin/traffic_ops.rst
index 61dff7d..4f01e08 100644
--- a/docs/source/admin/traffic_ops.rst
+++ b/docs/source/admin/traffic_ops.rst
@@ -46,20 +46,20 @@ Guide
 
                yum update -y
                yum install -y 
https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
-               yum install -y postgresql96-server
-               su - postgres -c '/usr/pgsql-9.6/bin/initdb -A md5 -W' #-W 
forces the user to provide a superuser (postgres) password
+               yum install -y postgresql13-server
+               su - postgres -c '/usr/pgsql-13/bin/initdb -A md5 -W' #-W 
forces the user to provide a superuser (postgres) password
 
 
-#. Edit :file:`/var/lib/pgsql/9.6/data/pg_hba.conf` to allow the Traffic Ops 
instance to access the PostgreSQL server. For example, if the IP address of the 
machine to be used as the Traffic Ops host is ``192.0.2.1`` add the line ``host 
 all   all     192.0.2.1/32 md5`` to the appropriate section of this file.
+#. Edit :file:`/var/lib/pgsql/13/data/pg_hba.conf` to allow the Traffic Ops 
instance to access the PostgreSQL server. For example, if the IP address of the 
machine to be used as the Traffic Ops host is ``192.0.2.1`` add the line ``host 
 all   all     192.0.2.1/32 md5`` to the appropriate section of this file.
 
-#. Edit the :file:`/var/lib/pgsql/9.6/data/postgresql.conf` file to add the 
appropriate listen_addresses or ``listen_addresses = '*'``, set ``timezone = 
'UTC'``, and start the database
+#. Edit the :file:`/var/lib/pgsql/13/data/postgresql.conf` file to add the 
appropriate listen_addresses or ``listen_addresses = '*'``, set ``timezone = 
'UTC'``, and start the database
 
        .. code-block:: shell
                :caption: Starting PostgreSQL with :manpage:`systemd(1)`
 
-               systemctl enable postgresql-9.6
-               systemctl start postgresql-9.6
-               systemctl status postgresql-9.6 # Prints the status of the 
PostgreSQL service, to prove it's running
+               systemctl enable postgresql-13
+               systemctl start postgresql-13
+               systemctl status postgresql-13 # Prints the status of the 
PostgreSQL service, to prove it's running
 
 
 #. Build a :file:`traffic_ops-{version string}.rpm` file using the 
instructions under the :ref:`dev-building` page - or download a pre-built 
release from `the Apache Continuous Integration server 
<https://builds.apache.org/view/S-Z/view/TrafficControl/>`_.
@@ -87,7 +87,7 @@ Guide
 
                to-# psql -h pg -U postgres
                Password for user postgres:
-               psql (9.6.3)
+               psql (13.2)
                Type "help" for help.
 
                postgres=#
@@ -237,6 +237,11 @@ To upgrade from older Traffic Ops versions, stop the 
service, use :manpage:`yum(
 
 After this completes, see Guide_ for instructions on running the 
:program:`postinstall` script. Once the :program:`postinstall` script, has 
finished, run the following command as the root user (or with 
:manpage:`sudo(8)`): ``systemctl start traffic_ops`` to start the service.
 
+Upgrading to 6.0
+----------------
+
+As of Apache Traffic Control 6.0, Traffic Ops supports PostgreSQL version 
13.2. In order to migrate from the prior PostgreSQL version 9.6, it is 
recommended to use the `pg_upgrade 
<https://www.postgresql.org/docs/13/pgupgrade.html>`_ tool.
+
 .. _to-running:
 
 Running
diff --git a/docs/source/development/traffic_ops.rst 
b/docs/source/development/traffic_ops.rst
index d4510d2..19453b4 100644
--- a/docs/source/development/traffic_ops.rst
+++ b/docs/source/development/traffic_ops.rst
@@ -26,12 +26,21 @@ Traffic Ops at its core is mainly a PostgreSQL database 
used to store configurat
 
 Software Requirements
 =====================
-Traffic Ops is only supported on CentOS 7+ systems (although many developers 
do use Mac OS with some success).
-
-The two different implementations have different requirements, but they do 
share a few:
+Traffic Ops is only supported on CentOS 7+ systems (although many developers 
do use Mac OS with some success). Here are the requirements:
 
 - `Goose <https://bitbucket.org/liamstask/goose/>`_ (although the 
``postinstall`` Perl script will install this if desired)
-- `PostgreSQL 9.6.6 <https://www.postgresql.org/download/>`_ - the machine 
where (either implementation of) Traffic Ops is running must have the client 
tool set (e.g. :manpage:`psql(1)`), but the actual database can be run anywhere 
so long as it is accessible.
+- `PostgreSQL 13.2 <https://www.postgresql.org/download/>`_ - the machine 
where Traffic Ops is running must have the client tool set (e.g. 
:manpage:`psql(1)`), but the actual database can be run anywhere so long as it 
is accessible.
+
+       .. note:: Prior to version 13.2, Traffic Ops used version 9.6. For 
upgrading an existing Mac OS Homebrew-based PostgreSQL instance, you can use 
`Homebrew <https://brew.sh/>`_ to easily upgrade from 9.6 to 13.2:
+
+               .. code-block:: shell
+
+                       brew services stop postgresql
+                       brew upgrade postgresql
+                       brew postgresql-upgrade-database
+                       brew cleanup [email protected]
+                       brew services start postgresql
+
 - :manpage:`openssl(1SSL)` is recommended to generate server certificates, 
though not strictly required if certificates can be obtained by other means.
 - Some kind of SMTP server is required for certain :ref:`to-api` endpoints to 
work, but for purposes unrelated to them an SMTP server is not required. 
:ref:`ciab` comes with a relayless SMTP server for testing (you can view the 
emails that Traffic Ops sends, but they aren't sent anywhere outside 
CDN-in-a-Box).
 
diff --git a/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile 
b/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile
index 9de708f..eec5d45 100644
--- a/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile
+++ b/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile
@@ -35,12 +35,16 @@ RUN set -o nounset -o errexit && \
        if [[ "${RHEL_VERSION%%.*}" -eq 7 ]]; then \
                use_repo=''; \
                enable_repo=''; \
+               # needed for llvm-toolset-7-clang, which is needed for 
postgresql13-devel-13.2-1PGDG, required by TO rpm
+               dnf -y install gcc centos-release-scl-rh; \
        else \
-               use_repo='--repo=pgdg96'; \
+               use_repo='--repo=pgdg13'; \
                enable_repo='--enablerepo=powertools'; \
        fi; \
        dnf -y install 
"https://download.postgresql.org/pub/repos/yum/reporpms/EL-${RHEL_VERSION%%.*}-x86_64/pgdg-redhat-repo-latest.noarch.rpm";;
 \
-       dnf -y $use_repo -- install postgresql96; \
+       # libicu required by postgresql13
+       dnf -y install libicu; \
+       dnf -y $use_repo -- install postgresql13; \
        dnf -y install epel-release; \
        dnf -y $enable_repo install      \
                bind-utils           \
diff --git a/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile-db 
b/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile-db
index 3dd73a1..593db61 100644
--- a/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile-db
+++ b/infrastructure/cdn-in-a-box/traffic_ops/Dockerfile-db
@@ -19,7 +19,7 @@
 # Dockerfile for trafficops db
 ############################################################
 
-FROM postgres:9.6-alpine
+FROM postgres:13.2-alpine
 
 ENV POSTGRES_PASSWORD=$POSTGRES_PASSWORD
 RUN apk add bind-tools \
@@ -35,4 +35,4 @@ COPY dns/set-dns.sh \
      /usr/local/sbin/
 
 RUN chmod -R a+rx /run-db.sh /docker-entrypoint-initdb.d
-ENTRYPOINT /run-db.sh
+CMD ["/run-db.sh"]
diff --git a/infrastructure/cdn-in-a-box/traffic_ops/run-db.sh 
b/infrastructure/cdn-in-a-box/traffic_ops/run-db.sh
index c26b7af..2f5e3ad 100755
--- a/infrastructure/cdn-in-a-box/traffic_ops/run-db.sh
+++ b/infrastructure/cdn-in-a-box/traffic_ops/run-db.sh
@@ -19,7 +19,7 @@
 set-dns.sh
 insert-self-into-dns.sh
 set -o monitor #enable job control
-/docker-entrypoint.sh postgres &
+docker-entrypoint.sh postgres &
 
 source /to-access.sh
 # Enroll with traffic ops
diff --git a/infrastructure/cdn-in-a-box/traffic_ops/run-go.sh 
b/infrastructure/cdn-in-a-box/traffic_ops/run-go.sh
index 252d5f6..237d8b9 100755
--- a/infrastructure/cdn-in-a-box/traffic_ops/run-go.sh
+++ b/infrastructure/cdn-in-a-box/traffic_ops/run-go.sh
@@ -99,9 +99,9 @@ chmod -R a+rw "$X509_CA_PERSIST_DIR";
 # Write config files
 . /config.sh;
 
-pg_isready=$(rpm -ql postgresql96 | grep bin/pg_isready);
+pg_isready=$(rpm -ql postgresql13 | grep bin/pg_isready);
 if [[ ! -x $pg_isready ]]; then
-       echo "Can't find pg_ready in postgresql96" >&2;
+       echo "Can't find pg_ready in postgresql13" >&2;
        echo "PATH: $PATH" >&2;
        find / -name "*postgresql*";
        exit 1;
diff --git a/infrastructure/docker/traffic_ops/Dockerfile 
b/infrastructure/docker/traffic_ops/Dockerfile
index 714eb24..fcb48bc 100644
--- a/infrastructure/docker/traffic_ops/Dockerfile
+++ b/infrastructure/docker/traffic_ops/Dockerfile
@@ -38,6 +38,8 @@ RUN yum install -y perl-Crypt-ScryptKDF
 RUN yum install -y perl cpanminus perl-Test-CPAN-Meta
 RUN cpanm Carton
 RUN yum install -y perl-DBIx-Connector
+# needed for llvm-toolset-7-clang, which is needed for 
postgresql13-devel-13.2-1PGDG, required by TO rpm
+RUN yum install -y centos-release-scl-rh
 
 # Override RPM arg to use a different one using --build-arg RPM=...  Can be 
local file or http://...
 ARG RPM=traffic_ops.rpm
@@ -47,9 +49,6 @@ RUN yum install -y /$(basename $RPM)
 # once installed, remove rpm to lower image size
 RUN rm /$(basename $RPM)
 
-RUN POSTGRES_HOME=/usr/pgsql-9.6 cd /opt/traffic_ops/app && carton
-
-RUN /opt/traffic_ops/install/bin/install_go.sh
 RUN /opt/traffic_ops/install/bin/install_goose.sh
 
 # RUN export 
PERL5LIB=/opt/traffic_ops/app/local/lib/perl5/:/opt/traffic_ops/install/lib/ \
diff --git a/infrastructure/docker/traffic_ops/Dockerfile_psql 
b/infrastructure/docker/traffic_ops/Dockerfile_psql
index 7cb028f..b03d339 100644
--- a/infrastructure/docker/traffic_ops/Dockerfile_psql
+++ b/infrastructure/docker/traffic_ops/Dockerfile_psql
@@ -25,13 +25,14 @@ FROM centos/systemd
 RUN yum install -y 
https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
 
 RUN yum -y install \
-  postgresql96 \
+  postgresql13 \
   nmap-ncat \
   cpanminus && \
   yum clean all
 
 ENV POSTGRES_HOME $POSTGRES_HOME
 ENV PGPASSWORD $PGPASSWORD 
+ENV POSTGRES_PASSWORD $POSTGRES_PASSWORD
 ENV DB_USERNAME $DB_USERNAME
 ENV DB_NAME $DB_NAME
 ENV DB_USER_PASS $DB_USER_PASS 
diff --git a/infrastructure/docker/traffic_ops/docker-compose.yml 
b/infrastructure/docker/traffic_ops/docker-compose.yml
index f966ee6..74f65b3 100644
--- a/infrastructure/docker/traffic_ops/docker-compose.yml
+++ b/infrastructure/docker/traffic_ops/docker-compose.yml
@@ -39,14 +39,17 @@ volumes:
 
 services:
   db:
-    image: postgres:9.6.6
+    image: postgres:13.2
+    environment:
+      POSTGRES_PASSWORD: secretrootpass
     ports: 
       - "5432:5432"
 
   db_init:
     environment:
-      POSTGRES_HOME: /usr/pgsql-9.6
+      POSTGRES_HOME: /usr/pgsql-13
       PGPASSWORD: secretrootpass
+      POSTGRES_PASSWORD: secretrootpass
       DB_USERNAME: traffic_ops
       DB_NAME: traffic_ops
       DB_USER_PASS: twelve
diff --git a/traffic_ops/INSTALL.md b/traffic_ops/INSTALL.md
index 0d87cf2..d35de2e 100644
--- a/traffic_ops/INSTALL.md
+++ b/traffic_ops/INSTALL.md
@@ -22,7 +22,7 @@
 ## Disable selinux:
 ### change `/etc/selinux/config` to `SELINUX=disabled`
 
-## Add access to Postgreql 9.6 yum repository 
+## Add access to PostgreSQL yum repository 
 
 Instructions are here: https://yum.postgresql.org/
 
@@ -30,21 +30,21 @@ Instructions are here: https://yum.postgresql.org/
 
     `$ sudo yum install 
https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm`
     
-## Install Postgres 9.6 server (in a container or on the host)
+## Install Postgres 13.2 server (in a container or on the host)
 
 ### on the host:
 
     $ sudo su -
-    # yum install postgresql96-server
+    # yum install postgresql13-server
     $ su - postgres
-    $ /usr/pgsql-9.6/bin/initdb -A md5 -W #-W forces the user to provide a 
superuser (postgres) password
+    $ /usr/pgsql-13/bin/initdb -A md5 -W #-W forces the user to provide a 
superuser (postgres) password
     $ exit
-    # systemctl start postgresql-9.6
-    # systemctl status postgresql-9.6
+    # systemctl start postgresql-13
+    # systemctl status postgresql-13
 
 ### -or- in a container
 
-NOTE: you do *not* need postgresql96-server if running postgres within a 
`docker` container.
+NOTE: you do *not* need postgresql13-server if running postgres within a 
`docker` container.
 
 Install `docker` and `docker-compose` using instructions here:
 
diff --git a/traffic_ops/README.md b/traffic_ops/README.md
index 6a3feeb..7fd09f9 100644
--- a/traffic_ops/README.md
+++ b/traffic_ops/README.md
@@ -17,11 +17,7 @@
     under the License.
 -->
 
-> :warning: **Importing this client via un-versioned
-`github.com/apache/trafficcontrol/traffic_ops/client` paths is deprecated!** 
Use
-`github.com/apache/trafficcontrol/traffic_ops/v3-client` (for API v3.0) 
instead.
-
-Traffic Ops is the tool for administration (configuration and monitoring) of 
all components in a Traffic Control CDN. The CDN administrator uses Traffic Ops 
to manage servers, cache groups, delivery services, etc. In many cases, a 
configuration change requires propagation to several, or even all, caches and 
only explicitly after or before the same change propagates to Traffic Router. 
Traffic Ops takes care of this required consistency between the different 
components and their configurat [...]
+Traffic Ops is the tool for administration (configuration and monitoring) of 
all components in a Traffic Control CDN. The CDN administrator uses Traffic Ops 
to manage servers, cache groups, delivery services, etc. In many cases, a 
configuration change requires propagation to several, or even all, caches and 
only explicitly after or before the same change propagates to Traffic Router. 
Traffic Ops takes care of this required consistency between the different 
components and their configurat [...]
 
 
 For more info see the [Traffic Control Website 
](http://traffic-control-cdn.readthedocs.io/en/latest/overview/traffic_ops.html)
diff --git a/traffic_ops/app/bin/tests/docker-compose.yml 
b/traffic_ops/app/bin/tests/docker-compose.yml
index 199b6f5..9ba2adf 100644
--- a/traffic_ops/app/bin/tests/docker-compose.yml
+++ b/traffic_ops/app/bin/tests/docker-compose.yml
@@ -21,9 +21,6 @@ volumes:
   traffic_ops_golang:
 
 services:
-  db:
-    image: postgres:9.6
-
   unit_golang:
     build:
       context: ../../../..
diff --git a/traffic_ops/app/db/admin.go b/traffic_ops/app/db/admin.go
index c9b4507..67e2518 100644
--- a/traffic_ops/app/db/admin.go
+++ b/traffic_ops/app/db/admin.go
@@ -173,9 +173,11 @@ func parseDBConfig() error {
 
 func createDB() {
        dbExistsCmd := exec.Command("psql", "-h", HostIP, "-U", DBSuperUser, 
"-p", HostPort, "-tAc", "SELECT 1 FROM pg_database WHERE datname='"+DBName+"'")
+       stderr := bytes.Buffer{}
+       dbExistsCmd.Stderr = &stderr
        out, err := dbExistsCmd.Output()
        if err != nil {
-               die("unable to check if DB already exists: " + err.Error())
+               die("unable to check if DB already exists: " + err.Error() + ", 
stderr: " + stderr.String())
        }
        if len(out) > 0 {
                fmt.Println("Database " + DBName + " already exists")
@@ -202,9 +204,11 @@ func dropDB() {
 func createUser() {
        fmt.Println("Creating user: " + DBUser)
        userExistsCmd := exec.Command("psql", "-h", HostIP, "-U", DBSuperUser, 
"-p", HostPort, "-tAc", "SELECT 1 FROM pg_roles WHERE rolname='"+DBUser+"'")
+       stderr := bytes.Buffer{}
+       userExistsCmd.Stderr = &stderr
        out, err := userExistsCmd.Output()
        if err != nil {
-               die("unable to check if user already exists: " + err.Error())
+               die("unable to check if user already exists: " + err.Error() + 
", stderr: " + stderr.String())
        }
        if len(out) > 0 {
                fmt.Println("User " + DBUser + " already exists")
diff --git a/traffic_ops/build/traffic_ops.spec 
b/traffic_ops/build/traffic_ops.spec
index b788b6d..a04bc30 100644
--- a/traffic_ops/build/traffic_ops.spec
+++ b/traffic_ops/build/traffic_ops.spec
@@ -36,7 +36,7 @@ AutoReqProv:      no
 Requires:         cpanminus, expat-devel, gcc-c++, golang >= 1.12, libcurl, 
libpcap-devel, mkisofs, tar
 Requires:         openssl-devel, perl, perl-core, perl-DBD-Pg, perl-DBI, 
perl-Digest-SHA1
 Requires:         libidn-devel, libcurl-devel, libcap
-Requires:         postgresql96 >= 9.6.2 , postgresql96-devel >= 9.6.2
+Requires:         postgresql13 >= 13.2 , postgresql13-devel >= 13.2
 Requires:         perl-JSON, perl-libwww-perl, perl-Test-CPAN-Meta, 
perl-WWW-Curl, perl-TermReadKey, perl-Crypt-ScryptKDF
 Requires:         python(abi)
 Requires(pre):    /usr/sbin/useradd, /usr/bin/getent
diff --git a/traffic_ops/install/bin/postinstall 
b/traffic_ops/install/bin/postinstall
index 145ab73..ebaf512 100755
--- a/traffic_ops/install/bin/postinstall
+++ b/traffic_ops/install/bin/postinstall
@@ -47,7 +47,7 @@ cpanm Carton
 # carton installs all the perl dependencies in cpanfile
 cd /opt/traffic_ops/app
 
-export POSTGRES_HOME=${POSTGRES_HOME:-/usr/pgsql-9.6}
+export POSTGRES_HOME=${POSTGRES_HOME:-/usr/pgsql-13}
 perl -MCarton::CLI -e'Carton::CLI->new->run(@ARGV)'
 
 # Install go and goose
diff --git a/traffic_ops/traffic_ops_golang/README.md 
b/traffic_ops/traffic_ops_golang/README.md
index d12c9fd..af6d1c5 100644
--- a/traffic_ops/traffic_ops_golang/README.md
+++ b/traffic_ops/traffic_ops_golang/README.md
@@ -24,8 +24,7 @@
 To run `traffic_ops_golang` proxy locally the following prerequisites are 
needed:
 
 * Golang version greater or equal to the Go version found in the `GO_VERSION` 
file at the base of this repository. See: 
[https://golang.org/doc/install](https://golang.org/doc/install)
-* Postgres 9.6 or greater
-* Because the Golang proxy is fronting Mojolicious Perl you need to have that 
service setup and running as well [TO Perl Setup 
Here](https://github.com/apache/trafficcontrol/blob/master/traffic_ops/INSTALL.md)
+* Postgres 13.2 or greater
 
 
 ## Vendoring and Building
@@ -40,16 +39,6 @@ To download the remaining `golang.org/x` dependencies you 
need to:
 
 ## Configuration
 
-To run the Golang TO API locally the following represents a typical sequence 
flow.  */api/1.x* will proxy through to Mojo Perl if the given route is not 
found or the route is blacklisted else it will serve the response from the 
Golang API. */api/2.0* will always serve the response from the Golang directly 
and/or interact with Postgres accordingly.
-
-**/api/1.x** routes:
-
-`TO Golang API (port 8443)`<-->`TO Mojo Perl`(if route not found or 
blacklisted)<-->`TO Database (Postgres)`
-
-**/api/2.0** routes:
-
-`TO Golang API (port 8443)`<-->`TO Database (Postgres)`
-
 ### cdn.conf changes
 
 Copy `traffic_ops/app/conf/cdn.conf` to `$HOME/cdn.conf` so you can modify it 
for development purposes.
diff --git a/traffic_ops_db/docker/Dockerfile b/traffic_ops_db/docker/Dockerfile
index 3710b4d..ce3f53a 100644
--- a/traffic_ops_db/docker/Dockerfile
+++ b/traffic_ops_db/docker/Dockerfile
@@ -11,12 +11,13 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 #
-FROM postgres:9.6.6
+FROM postgres:13.2
 
 MAINTAINER [email protected]
 
 # Postgres Access
 ENV POSTGRES_USER=$POSTGRES_USER
+ENV POSTGRES_PASSWORD=$POSTGRES_PASSWORD
 ENV POSTGRES_HOST=$POSTGRES_HOST
 ENV POSTGRES_PORT=$POSTGRES_PORT
 ENV POSTGRES_DATABASE=$POSTGRES_DATABASE
diff --git a/traffic_ops_db/docker/docker-compose.dev.yml 
b/traffic_ops_db/docker/docker-compose.dev.yml
index 16abd5f..fb78962 100644
--- a/traffic_ops_db/docker/docker-compose.dev.yml
+++ b/traffic_ops_db/docker/docker-compose.dev.yml
@@ -23,6 +23,7 @@ services:
       - POSTGRES_PORT=5432
       - POSTGRES_DATABASE=traffic_ops
       - POSTGRES_USER=postgres
+      - POSTGRES_PASSWORD=twelve
       - POSTGRES_USER_UID=9999
       - POSTGRES_USER_GID=9999
       - PGDATA=./pgdata
diff --git a/traffic_ops_db/docker/todb.sh b/traffic_ops_db/docker/todb.sh
old mode 100644
new mode 100755
index 9481e38..9863cbe
--- a/traffic_ops_db/docker/todb.sh
+++ b/traffic_ops_db/docker/todb.sh
@@ -36,10 +36,10 @@ elif [[ "$ACTION" == "stop" ]];then
   echo "Stopping Docker container: $CONTAINER_NAME"
 
 elif [[ "$ACTION" == "clean" ]];then
-  rm -rf pgdata
   docker stop $CONTAINER_NAME
   docker rm $CONTAINER_NAME
   docker rmi $PROJECT_NAME
+  rm -rf pgdata
 
 elif [[ "$ACTION" == "seed" ]];then
   docker-compose -f docker-compose.dev.yml -p $PROJECT_NAME down -v
diff --git a/traffic_ops_db/test/docker/Dockerfile-db 
b/traffic_ops_db/test/docker/Dockerfile-db
index 23132d0..d023dc5 100644
--- a/traffic_ops_db/test/docker/Dockerfile-db
+++ b/traffic_ops_db/test/docker/Dockerfile-db
@@ -19,9 +19,9 @@
 # Dockerfile for trafficops db
 ############################################################
 
-FROM postgres:9.6.6
+FROM postgres:13.2
 
-ENV POSTGRES_PASSWORD=$POSTGRES_PASSWORD
+ENV POSTGRES_PASSWORD=twelve
 ENV POSTGRES_DB=traffic_ops
 ENV DB_NAME=traffic_ops
 ENV DB_USER=traffic_ops
diff --git a/traffic_ops_db/test/docker/Dockerfile-db-admin 
b/traffic_ops_db/test/docker/Dockerfile-db-admin
index 05a9d08..7f58a81 100644
--- a/traffic_ops_db/test/docker/Dockerfile-db-admin
+++ b/traffic_ops_db/test/docker/Dockerfile-db-admin
@@ -25,6 +25,7 @@ FROM centos:7
 # NOTE: temporary workaround for removal of golang packages from CentOS 7 base 
repo
 RUN yum install -y \
     epel-release \
+    centos-release-scl-rh \
     
https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
 \
     git && \
     yum -y install golang
diff --git a/traffic_ops_db/test/docker/run-db-test.sh 
b/traffic_ops_db/test/docker/run-db-test.sh
index b801f3b..cca9f5b 100755
--- a/traffic_ops_db/test/docker/run-db-test.sh
+++ b/traffic_ops_db/test/docker/run-db-test.sh
@@ -32,9 +32,9 @@ if [[ ! -r /goose-config.sh ]]; then
 fi
 . /goose-config.sh
 
-pg_isready=$(rpm -ql postgresql96 | grep bin/pg_isready)
+pg_isready=$(rpm -ql postgresql13 | grep bin/pg_isready)
 if [[ ! -x $pg_isready ]] ; then
-    echo "Can't find pg_ready in postgresql96"
+    echo "Can't find pg_ready in postgresql13"
     exit 1
 fi
 
@@ -43,6 +43,10 @@ while ! $pg_isready -h$DB_SERVER -p$DB_PORT -d $DB_NAME; do
         sleep 3
 done
 
+echo "*:*:*:postgres:$DB_USER_PASS" > $HOME/.pgpass
+echo "*:*:*:traffic_ops:$DB_USER_PASS" >> $HOME/.pgpass
+chmod 0600 $HOME/.pgpass
+
 export TO_DIR=/opt/traffic_ops/app
 
 export PATH=/usr/local/go/bin:/opt/traffic_ops/go/bin:$PATH
diff --git a/traffic_ops_ort/testing/README.md 
b/traffic_ops_ort/testing/README.md
index 95dd29f..c97c02d 100644
--- a/traffic_ops_ort/testing/README.md
+++ b/traffic_ops_ort/testing/README.md
@@ -52,7 +52,7 @@ Docker containers you will need to provide the following 
resources:
   1.  Build the Traffic Ops and Traffic Ops ORT RPM's that you wish
       to test.  See the top level 'build' directory for building 
       instructions. 
-  2.  Copy the Traffic Ops RPM to docker/trafffic_ops/traffic_ops.rpm 
+  2.  Copy the Traffic Ops RPM to docker/traffic_ops/traffic_ops.rpm
       (NOTE:  Use the file name 'traffic_ops.rpm')
   3.  Copy the Traffic Ops ORT rpm to docker/ort_test/traffic_ops_ort.rpm
       (NOTE:  Use the file name 'traffic_ops_ort.rpm'
diff --git a/traffic_ops_ort/testing/docker/db_init/Dockerfile 
b/traffic_ops_ort/testing/docker/db_init/Dockerfile
index fdc1da6..e101c4f 100644
--- a/traffic_ops_ort/testing/docker/db_init/Dockerfile
+++ b/traffic_ops_ort/testing/docker/db_init/Dockerfile
@@ -25,7 +25,7 @@ FROM centos/systemd
 RUN yum install -y 
https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
 
 RUN yum -y install \
-  postgresql96 \
+  postgresql13 \
   nmap-ncat \
   cpanminus && \
   yum clean all
diff --git a/traffic_ops_ort/testing/docker/docker-compose.yml 
b/traffic_ops_ort/testing/docker/docker-compose.yml
index e777e6a..e95bf9e 100644
--- a/traffic_ops_ort/testing/docker/docker-compose.yml
+++ b/traffic_ops_ort/testing/docker/docker-compose.yml
@@ -21,7 +21,6 @@
 #   Copy an ATS rpm to yumserver/test-rpms and update the 
 #     ../ort-tests/tc-fixtures.json to match the rpm version
 #     string you've chosen
-#   Copy the riak-2.2.3-1.el7.centos.x86_64.rpm to traffic_vault/
 #
 #   Run: docker-compose build
 #   Run: docker-compose run ort_test
@@ -37,7 +36,9 @@ volumes:
 
 services:
   db:
-    image: postgres:9.6.6
+    image: postgres:13.2
+    env_file:
+      - variables.env
     ports: 
       - "5432:5432"
 
diff --git a/traffic_ops_ort/testing/docker/ort_test/Dockerfile 
b/traffic_ops_ort/testing/docker/ort_test/Dockerfile
index 3110b48..c5dc46f 100644
--- a/traffic_ops_ort/testing/docker/ort_test/Dockerfile
+++ b/traffic_ops_ort/testing/docker/ort_test/Dockerfile
@@ -33,7 +33,7 @@ MAINTAINER [email protected]
 
 RUN yum install -y \
   
https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
 \
-  epel-release initscripts postgresql96.x86_64 git gcc lua-5.1.4-15.el7 
lua-devel-5.1.4-15.el7 \
+  epel-release initscripts postgresql13.x86_64 git gcc lua-5.1.4-15.el7 
lua-devel-5.1.4-15.el7 \
   ImageMagick-c++-devel
 
 ARG RPM=traffic_ops_ort.rpm
diff --git a/traffic_ops_ort/testing/docker/traffic_ops/Dockerfile 
b/traffic_ops_ort/testing/docker/traffic_ops/Dockerfile
index b457ba6..d3c5b01 100644
--- a/traffic_ops_ort/testing/docker/traffic_ops/Dockerfile
+++ b/traffic_ops_ort/testing/docker/traffic_ops/Dockerfile
@@ -35,12 +35,16 @@ RUN set -o nounset -o errexit && \
        if [[ "${RHEL_VERSION%%.*}" -eq 7 ]]; then \
                use_repo=''; \
                enable_repo=''; \
+               # needed for llvm-toolset-7-clang, which is needed for 
postgresql13-devel-13.2-1PGDG, required by TO rpm
+               dnf -y install gcc centos-release-scl-rh; \
        else \
-               use_repo='--repo=pgdg96'; \
+               use_repo='--repo=pgdg13'; \
                enable_repo='--enablerepo=powertools'; \
        fi; \
        dnf -y install 
"https://download.postgresql.org/pub/repos/yum/reporpms/EL-${RHEL_VERSION%%.*}-x86_64/pgdg-redhat-repo-latest.noarch.rpm";;
 \
-       dnf -y $use_repo -- install postgresql96; \
+       # libicu required by postgresql13
+       dnf -y install libicu; \
+       dnf -y $use_repo -- install postgresql13; \
        dnf -y install epel-release; \
        dnf -y $enable_repo install      \
                bind-utils           \
diff --git a/traffic_ops_ort/testing/docker/variables.env 
b/traffic_ops_ort/testing/docker/variables.env
index 3a8e122..c01c796 100644
--- a/traffic_ops_ort/testing/docker/variables.env
+++ b/traffic_ops_ort/testing/docker/variables.env
@@ -22,8 +22,9 @@ CERT_CITY=Denver
 CERT_COMPANY=NotComcast
 DBCONF=/opt/traffic_ops/app/db/dbconf.yml
 DATABASECONF=/opt/traffic_ops/app/conf/production/database.conf
-POSTGRES_HOME=/usr/pgsql-9.6
+POSTGRES_HOME=/usr/pgsql-13
 PGPASSWORD=secretrootpass
+POSTGRES_PASSWORD=secretrootpass
 DB_NAME=traffic_ops
 DB_PORT=5432
 DB_ROOT_PASS=null

Reply via email to