You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by de...@apache.org on 2016/12/14 19:31:16 UTC

[1/4] incubator-trafficcontrol git commit: add apache license

Repository: incubator-trafficcontrol
Updated Branches:
  refs/heads/psql-rebase 6a46616fb -> 87048433c


add apache license


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/da0009e3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/da0009e3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/da0009e3

Branch: refs/heads/psql-rebase
Commit: da0009e3317d1771df4aab5382b87f138323e0b2
Parents: d187c2d
Author: Dan Kirkwood <da...@gmail.com>
Authored: Tue Dec 13 17:41:53 2016 +0000
Committer: Dewayne Richardson <de...@apache.org>
Committed: Wed Dec 14 12:30:04 2016 -0700

----------------------------------------------------------------------
 traffic_ops/app/db/pg-migration/mysql.env    | 15 +++++++++++++++
 traffic_ops/app/db/pg-migration/postgres.env | 15 +++++++++++++++
 2 files changed, 30 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/da0009e3/traffic_ops/app/db/pg-migration/mysql.env
----------------------------------------------------------------------
diff --git a/traffic_ops/app/db/pg-migration/mysql.env b/traffic_ops/app/db/pg-migration/mysql.env
index de12f7d..ead4c15 100644
--- a/traffic_ops/app/db/pg-migration/mysql.env
+++ b/traffic_ops/app/db/pg-migration/mysql.env
@@ -1,3 +1,18 @@
+#!/bin/bash -x
+#
+#  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.
+#
+
 MYSQL_DATABASE=traffic_ops_db
 MYSQL_HOST=mysql
 MYSQL_RANDOM_ROOT_PASSWORD=yes

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/da0009e3/traffic_ops/app/db/pg-migration/postgres.env
----------------------------------------------------------------------
diff --git a/traffic_ops/app/db/pg-migration/postgres.env b/traffic_ops/app/db/pg-migration/postgres.env
index 3e3c636..db23c8f 100644
--- a/traffic_ops/app/db/pg-migration/postgres.env
+++ b/traffic_ops/app/db/pg-migration/postgres.env
@@ -1,3 +1,18 @@
+#!/bin/bash -x
+#
+#  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.
+#
+
 POSTGRES_HOST=postgres
 POSTGRES_DB=traffic_ops
 POSTGRES_PASSWORD=twelve


[2/4] incubator-trafficcontrol git commit: avoid race condition between dataimport and mysql

Posted by de...@apache.org.
avoid race condition between dataimport and mysql


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/d187c2d0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/d187c2d0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/d187c2d0

Branch: refs/heads/psql-rebase
Commit: d187c2d0bbd128e6b842e04bbf20b98498a18a0e
Parents: 70e0057
Author: Dan Kirkwood <da...@gmail.com>
Authored: Tue Dec 13 17:36:41 2016 +0000
Committer: Dewayne Richardson <de...@apache.org>
Committed: Wed Dec 14 12:30:04 2016 -0700

----------------------------------------------------------------------
 .../app/db/pg-migration/Dockerfile-mysql        | 19 ++++++++++++++
 .../app/db/pg-migration/docker-compose.yml      |  8 +++---
 traffic_ops/app/db/pg-migration/get-to-data.sh  | 10 ++++++++
 traffic_ops/app/db/pg-migration/mysql.env       |  1 +
 traffic_ops/app/db/pg-migration/mysql_host.yml  |  4 ++-
 traffic_ops/app/db/pg-migration/postgres.env    |  2 +-
 traffic_ops/app/db/pg-migration/runmysql.sh     | 27 ++++++++++++++++++++
 7 files changed, 64 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/d187c2d0/traffic_ops/app/db/pg-migration/Dockerfile-mysql
----------------------------------------------------------------------
diff --git a/traffic_ops/app/db/pg-migration/Dockerfile-mysql b/traffic_ops/app/db/pg-migration/Dockerfile-mysql
new file mode 100644
index 0000000..a4bf51f
--- /dev/null
+++ b/traffic_ops/app/db/pg-migration/Dockerfile-mysql
@@ -0,0 +1,19 @@
+#
+#  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 mysql:5.6
+
+MAINTAINER Dan Kirkwood
+
+ADD runmysql.sh /
+CMD /runmysql.sh

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/d187c2d0/traffic_ops/app/db/pg-migration/docker-compose.yml
----------------------------------------------------------------------
diff --git a/traffic_ops/app/db/pg-migration/docker-compose.yml b/traffic_ops/app/db/pg-migration/docker-compose.yml
index b611f75..a9d9d85 100644
--- a/traffic_ops/app/db/pg-migration/docker-compose.yml
+++ b/traffic_ops/app/db/pg-migration/docker-compose.yml
@@ -23,9 +23,8 @@ services:
       service: dataimport
       file: dataimport.yml
     volumes:
-      - ./mysql/initdb.d:/docker-entrypoint-initdb.d
-    volumes:
       - sync:/sync
+      - ./mysql/initdb.d:/docker-entrypoint-initdb.d
 
   # mysql_host loads mysql data locally and provides direct access for pgloader
   mysql:
@@ -51,11 +50,10 @@ services:
     depends_on:
       - mysql
     volumes:
-      - /opt/traffic_ops-db:/var/lib/postgresql/data
+      - sync:/sync
+      - ./db:/var/lib/postgresql/data
     ports:
       - 5432
-    volumes:
-      - sync:/sync
 
   # pgloader converts the data from mysql to postgres
   pgloader:

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/d187c2d0/traffic_ops/app/db/pg-migration/get-to-data.sh
----------------------------------------------------------------------
diff --git a/traffic_ops/app/db/pg-migration/get-to-data.sh b/traffic_ops/app/db/pg-migration/get-to-data.sh
index c1be98a..fd9f739 100755
--- a/traffic_ops/app/db/pg-migration/get-to-data.sh
+++ b/traffic_ops/app/db/pg-migration/get-to-data.sh
@@ -26,3 +26,13 @@ CREDS
 
 curl -k -H "Accept: application/json" --cookie "$cookiejar" --cookie-jar "$cookiejar" -X POST --data @"$cred" "$TO_SERVER/api/1.2/user/login"
 curl $output -k -s --cookie "$cookiejar" -X GET "$TO_SERVER/dbdump"
+
+waiting=/sync/waiting-for-dataimport
+while [[ ! -f $waiting ]]; do
+    # wait for signal that other container is waiting
+    echo "Data import finished.."
+    sleep 3
+done
+
+# signal to waiting container that we're finished
+rm $waiting

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/d187c2d0/traffic_ops/app/db/pg-migration/mysql.env
----------------------------------------------------------------------
diff --git a/traffic_ops/app/db/pg-migration/mysql.env b/traffic_ops/app/db/pg-migration/mysql.env
index b6cba06..de12f7d 100644
--- a/traffic_ops/app/db/pg-migration/mysql.env
+++ b/traffic_ops/app/db/pg-migration/mysql.env
@@ -1,4 +1,5 @@
 MYSQL_DATABASE=traffic_ops_db
+MYSQL_HOST=mysql
 MYSQL_RANDOM_ROOT_PASSWORD=yes
 MYSQL_PASSWORD=twelve
 MYSQL_USER=to_user

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/d187c2d0/traffic_ops/app/db/pg-migration/mysql_host.yml
----------------------------------------------------------------------
diff --git a/traffic_ops/app/db/pg-migration/mysql_host.yml b/traffic_ops/app/db/pg-migration/mysql_host.yml
index e7be262..59d0b9b 100644
--- a/traffic_ops/app/db/pg-migration/mysql_host.yml
+++ b/traffic_ops/app/db/pg-migration/mysql_host.yml
@@ -15,6 +15,8 @@ version: '2'
 
 services:
   mysql_host:
-    image: mysql:5.6
+    build:
+      context: .
+      dockerfile: Dockerfile-mysql
     env_file:
       - mysql.env

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/d187c2d0/traffic_ops/app/db/pg-migration/postgres.env
----------------------------------------------------------------------
diff --git a/traffic_ops/app/db/pg-migration/postgres.env b/traffic_ops/app/db/pg-migration/postgres.env
index dbd85cd..3e3c636 100644
--- a/traffic_ops/app/db/pg-migration/postgres.env
+++ b/traffic_ops/app/db/pg-migration/postgres.env
@@ -1,4 +1,4 @@
-POSTGRES_HOST=postgres_host
+POSTGRES_HOST=postgres
 POSTGRES_DB=traffic_ops
 POSTGRES_PASSWORD=twelve
 POSTGRES_USER=traffic_ops

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/d187c2d0/traffic_ops/app/db/pg-migration/runmysql.sh
----------------------------------------------------------------------
diff --git a/traffic_ops/app/db/pg-migration/runmysql.sh b/traffic_ops/app/db/pg-migration/runmysql.sh
new file mode 100755
index 0000000..58185f7
--- /dev/null
+++ b/traffic_ops/app/db/pg-migration/runmysql.sh
@@ -0,0 +1,27 @@
+#!/bin/bash -x
+#
+#  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.
+#
+
+waiting=/sync/waiting-for-dataimport
+touch $waiting
+
+# Wait for pgloader to finish
+while [[ -f $waiting ]]; do
+    ls -l $waiting
+    sleep 3
+done
+
+echo "Looks like dataimport is finished..  Starting mysql..."
+
+docker-entrypoint.sh mysqld


[4/4] incubator-trafficcontrol git commit: This closes #138

Posted by de...@apache.org.
This closes #138


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/87048433
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/87048433
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/87048433

Branch: refs/heads/psql-rebase
Commit: 87048433c75456e84f2b1168045929d78f80ff06
Parents: da0009e
Author: Dewayne Richardson <de...@apache.org>
Authored: Wed Dec 14 12:31:00 2016 -0700
Committer: Dewayne Richardson <de...@apache.org>
Committed: Wed Dec 14 12:31:00 2016 -0700

----------------------------------------------------------------------

----------------------------------------------------------------------



[3/4] incubator-trafficcontrol git commit: break docker-compose to smaller components

Posted by de...@apache.org.
break docker-compose to smaller components


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/70e0057b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/70e0057b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/70e0057b

Branch: refs/heads/psql-rebase
Commit: 70e0057bdf794dacdbfeca325437cedb8a25944a
Parents: 6a46616
Author: Dan Kirkwood <da...@gmail.com>
Authored: Mon Dec 12 15:10:27 2016 -0700
Committer: Dewayne Richardson <de...@apache.org>
Committed: Wed Dec 14 12:30:04 2016 -0700

----------------------------------------------------------------------
 traffic_ops/app/db/pg-migration/convert.yml     | 23 ++++++
 traffic_ops/app/db/pg-migration/dataimport.yml  | 26 +++++++
 .../app/db/pg-migration/docker-compose.yml      | 76 ++++++++------------
 traffic_ops/app/db/pg-migration/mysql.env       |  4 ++
 traffic_ops/app/db/pg-migration/mysql_host.yml  | 20 ++++++
 traffic_ops/app/db/pg-migration/pgloader.yml    | 24 +++++++
 traffic_ops/app/db/pg-migration/postgres.env    |  4 ++
 .../app/db/pg-migration/postgres_host.yml       | 26 +++++++
 8 files changed, 155 insertions(+), 48 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/70e0057b/traffic_ops/app/db/pg-migration/convert.yml
----------------------------------------------------------------------
diff --git a/traffic_ops/app/db/pg-migration/convert.yml b/traffic_ops/app/db/pg-migration/convert.yml
new file mode 100644
index 0000000..ab547e1
--- /dev/null
+++ b/traffic_ops/app/db/pg-migration/convert.yml
@@ -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.
+#
+version: '2'
+
+services:
+  # convert runs necessary post-import conversion(s) in postgres
+  convert:
+    build:
+      context: ..
+      dockerfile: pg-migration/Dockerfile-convert
+    env_file:
+      - postgres.env

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/70e0057b/traffic_ops/app/db/pg-migration/dataimport.yml
----------------------------------------------------------------------
diff --git a/traffic_ops/app/db/pg-migration/dataimport.yml b/traffic_ops/app/db/pg-migration/dataimport.yml
new file mode 100644
index 0000000..1087efa
--- /dev/null
+++ b/traffic_ops/app/db/pg-migration/dataimport.yml
@@ -0,0 +1,26 @@
+#
+#  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.
+#
+version: '2'
+
+services:
+  # dataimport reads data from an existing traffic_ops server running mysql thru the API
+  dataimport:
+    build:
+        context: .
+        dockerfile: Dockerfile-traffic_ops-client
+    restart: "no"
+    environment:
+      - TO_USER
+      - TO_PASSWORD
+      - TO_SERVER

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/70e0057b/traffic_ops/app/db/pg-migration/docker-compose.yml
----------------------------------------------------------------------
diff --git a/traffic_ops/app/db/pg-migration/docker-compose.yml b/traffic_ops/app/db/pg-migration/docker-compose.yml
index ce7c8b3..b611f75 100644
--- a/traffic_ops/app/db/pg-migration/docker-compose.yml
+++ b/traffic_ops/app/db/pg-migration/docker-compose.yml
@@ -19,81 +19,61 @@ volumes:
 services:
   # dataimport reads data from an existing traffic_ops server running mysql thru the API
   dataimport:
-    build:
-        context: .
-        dockerfile: Dockerfile-traffic_ops-client
-    restart: "no"
-    environment:
-      - TO_USER
-      - TO_PASSWORD
-      - TO_SERVER
-
+    extends:
+      service: dataimport
+      file: dataimport.yml
     volumes:
       - ./mysql/initdb.d:/docker-entrypoint-initdb.d
+    volumes:
+      - sync:/sync
 
   # mysql_host loads mysql data locally and provides direct access for pgloader
-  mysql_host:
-    image: mysql:5.6
-    restart: "no"
-    environment:
-      - MYSQL_DATABASE=traffic_ops_db
-      - MYSQL_RANDOM_ROOT_PASSWORD=yes
-      - MYSQL_PASSWORD=twelve
-      - MYSQL_USER=to_user
+  mysql:
+    extends:
+      service: mysql_host
+      file: mysql_host.yml
     depends_on:
       - dataimport
     volumes:
+      - sync:/sync
       - ./mysql/conf.d:/etc/mysql/conf.d
       - ./mysql/initdb.d:/docker-entrypoint-initdb.d
 
   # postgres_host provides a postgres data to import data to
-  postgres_host:
-    build:
-      context: ..
-      dockerfile: pg-migration/Dockerfile-postgres
-    restart: "no"
+  postgres:
+    extends:
+      service: postgres_host
+      file: postgres_host.yml
     environment:
       - POSTGRES_DB=traffic_ops
       - POSTGRES_PASSWORD=twelve
       - POSTGRES_USER=traffic_ops
+    depends_on:
+      - mysql
     volumes:
       - /opt/traffic_ops-db:/var/lib/postgresql/data
     ports:
       - 5432
+    volumes:
+      - sync:/sync
 
   # pgloader converts the data from mysql to postgres
   pgloader:
-    build:
-      context: ..
-      dockerfile: pg-migration/Dockerfile-pgloader
-    restart: "no"
+    extends:
+      service: pgloader
+      file: pgloader.yml
     depends_on:
-      - mysql_host
-      - postgres_host
-    environment:
-      - MYSQL_HOST=mysql_host
-      - MYSQL_DATABASE=traffic_ops_db
-      - MYSQL_PASSWORD=twelve
-      - MYSQL_USER=to_user
-      - POSTGRES_HOST=postgres_host
-      - POSTGRES_DB=traffic_ops
-      - POSTGRES_PASSWORD=twelve
-      - POSTGRES_USER=traffic_ops
+      - mysql
+      - postgres
     volumes:
       - sync:/sync
 
-  # convert runs necessary post-import conversion(s) in postgres
+  # convert runs needed post-migration conversions
   convert:
-    build:
-      context: ..
-      dockerfile: pg-migration/Dockerfile-convert
-    restart: "no"
+    extends:
+      service: convert
+      file: convert.yml
     depends_on:
-      - postgres_host
-    environment:
-      - POSTGRES_HOST=postgres_host
-      - POSTGRES_DB=traffic_ops
-      - POSTGRES_PASSWORD=twelve
-      - POSTGRES_USER=traffic_ops
+      - postgres
     volumes:
       - sync:/sync

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/70e0057b/traffic_ops/app/db/pg-migration/mysql.env
----------------------------------------------------------------------
diff --git a/traffic_ops/app/db/pg-migration/mysql.env b/traffic_ops/app/db/pg-migration/mysql.env
new file mode 100644
index 0000000..b6cba06
--- /dev/null
+++ b/traffic_ops/app/db/pg-migration/mysql.env
@@ -0,0 +1,4 @@
+MYSQL_DATABASE=traffic_ops_db
+MYSQL_RANDOM_ROOT_PASSWORD=yes
+MYSQL_PASSWORD=twelve
+MYSQL_USER=to_user

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/70e0057b/traffic_ops/app/db/pg-migration/mysql_host.yml
----------------------------------------------------------------------
diff --git a/traffic_ops/app/db/pg-migration/mysql_host.yml b/traffic_ops/app/db/pg-migration/mysql_host.yml
new file mode 100644
index 0000000..e7be262
--- /dev/null
+++ b/traffic_ops/app/db/pg-migration/mysql_host.yml
@@ -0,0 +1,20 @@
+#
+#  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.
+#
+version: '2'
+
+services:
+  mysql_host:
+    image: mysql:5.6
+    env_file:
+      - mysql.env

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/70e0057b/traffic_ops/app/db/pg-migration/pgloader.yml
----------------------------------------------------------------------
diff --git a/traffic_ops/app/db/pg-migration/pgloader.yml b/traffic_ops/app/db/pg-migration/pgloader.yml
new file mode 100644
index 0000000..23329a7
--- /dev/null
+++ b/traffic_ops/app/db/pg-migration/pgloader.yml
@@ -0,0 +1,24 @@
+#
+#  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.
+#
+version: '2'
+
+services:
+  # pgloader converts the data from mysql to postgres
+  pgloader:
+    build:
+      context: ..
+      dockerfile: pg-migration/Dockerfile-pgloader
+    env_file:
+      - mysql.env
+      - postgres.env

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/70e0057b/traffic_ops/app/db/pg-migration/postgres.env
----------------------------------------------------------------------
diff --git a/traffic_ops/app/db/pg-migration/postgres.env b/traffic_ops/app/db/pg-migration/postgres.env
new file mode 100644
index 0000000..dbd85cd
--- /dev/null
+++ b/traffic_ops/app/db/pg-migration/postgres.env
@@ -0,0 +1,4 @@
+POSTGRES_HOST=postgres_host
+POSTGRES_DB=traffic_ops
+POSTGRES_PASSWORD=twelve
+POSTGRES_USER=traffic_ops

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/70e0057b/traffic_ops/app/db/pg-migration/postgres_host.yml
----------------------------------------------------------------------
diff --git a/traffic_ops/app/db/pg-migration/postgres_host.yml b/traffic_ops/app/db/pg-migration/postgres_host.yml
new file mode 100644
index 0000000..f8e0439
--- /dev/null
+++ b/traffic_ops/app/db/pg-migration/postgres_host.yml
@@ -0,0 +1,26 @@
+#
+#  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.
+#
+version: '2'
+
+services:
+  postgres_host:
+    build:
+      context: ..
+      dockerfile: pg-migration/Dockerfile-postgres
+    environment:
+      - POSTGRES_DB=traffic_ops
+      - POSTGRES_PASSWORD=twelve
+      - POSTGRES_USER=traffic_ops
+    ports:
+      - 5432