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 2017/01/20 21:39:41 UTC

[4/6] incubator-trafficcontrol git commit: additional changes to support Ansible streamlining

additional changes to support Ansible streamlining


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

Branch: refs/heads/master
Commit: 422c15222bef5a714bff0db7d98b551b4d7e3c15
Parents: afec447
Author: Dewayne Richardson <de...@apache.org>
Authored: Fri Jan 20 13:58:17 2017 -0700
Committer: Dan Kirkwood <da...@gmail.com>
Committed: Fri Jan 20 14:15:33 2017 -0700

----------------------------------------------------------------------
 traffic_ops/app/db/pg-migration/Dockerfile-convert  | 2 +-
 traffic_ops/app/db/pg-migration/Dockerfile-mysql    | 2 +-
 traffic_ops/app/db/pg-migration/Dockerfile-postgres | 2 +-
 traffic_ops/app/db/pg-migration/README.md           | 9 +++------
 traffic_ops/app/db/pg-migration/dataimport.yml      | 6 ++++--
 traffic_ops/app/db/pg-migration/docker-compose.yml  | 6 ++++--
 traffic_ops/app/db/pg-migration/mysql.env           | 2 ++
 traffic_ops/app/db/pg-migration/postgres.env        | 6 +++++-
 traffic_ops/app/db/pg-migration/runpgloader.sh      | 9 +--------
 9 files changed, 22 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/422c1522/traffic_ops/app/db/pg-migration/Dockerfile-convert
----------------------------------------------------------------------
diff --git a/traffic_ops/app/db/pg-migration/Dockerfile-convert b/traffic_ops/app/db/pg-migration/Dockerfile-convert
index f10624f..4f1223d 100644
--- a/traffic_ops/app/db/pg-migration/Dockerfile-convert
+++ b/traffic_ops/app/db/pg-migration/Dockerfile-convert
@@ -11,7 +11,7 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 #
-FROM postgres:9.6
+FROM dewrich/postgres:latest
 
 MAINTAINER Dan Kirkwood
 

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/422c1522/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
index 36e7826..a4bf51f 100644
--- a/traffic_ops/app/db/pg-migration/Dockerfile-mysql
+++ b/traffic_ops/app/db/pg-migration/Dockerfile-mysql
@@ -11,7 +11,7 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 #
-FROM mysql:5.5
+FROM mysql:5.6
 
 MAINTAINER Dan Kirkwood
 

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/422c1522/traffic_ops/app/db/pg-migration/Dockerfile-postgres
----------------------------------------------------------------------
diff --git a/traffic_ops/app/db/pg-migration/Dockerfile-postgres b/traffic_ops/app/db/pg-migration/Dockerfile-postgres
index 4ff1f83..1279b50 100644
--- a/traffic_ops/app/db/pg-migration/Dockerfile-postgres
+++ b/traffic_ops/app/db/pg-migration/Dockerfile-postgres
@@ -11,7 +11,7 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 #
-FROM postgres:9.6
+FROM dewrich/postgres:latest
 
 MAINTAINER Dan Kirkwood
 

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/422c1522/traffic_ops/app/db/pg-migration/README.md
----------------------------------------------------------------------
diff --git a/traffic_ops/app/db/pg-migration/README.md b/traffic_ops/app/db/pg-migration/README.md
index 4d0ba53..f565291 100644
--- a/traffic_ops/app/db/pg-migration/README.md
+++ b/traffic_ops/app/db/pg-migration/README.md
@@ -1,16 +1,13 @@
 # Converting existing mysql `traffic_ops` database to postgres
 
-## Overview
-  - This conversion will convert an existing Mysql database by pulling the data from Traffic Ops (using Tools.dbdump) and loading that 
-    data into a temporary Mysql Database to make it easier to work with in the conversion process.  Additionally, it will use the 'pgloader' tool
-    to perform that conversion in yet another Docker container which will then push that converted data into your permanent Postgres instance(s).
-
-Software requirements
 * Requires a recent ( 1.12 ) version of `docker-engine` and `docker-compose`.
 
+* Modify the mysql.env for your existing Mysql Database
+
 * Modify the postgres.env for your new Postgres Database
   (NOTE: do not set the POSTGRES_HOST to 'localhost' it needs to be the IP address or DNS available hostname so that the container can reach out to Postgres)
 
+
 * Ensure that your new Postgres service is running (local or remote)
 
 * Run the Mysql to Postgres Migration Docker flow

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/422c1522/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
index b949925..1087efa 100644
--- a/traffic_ops/app/db/pg-migration/dataimport.yml
+++ b/traffic_ops/app/db/pg-migration/dataimport.yml
@@ -20,5 +20,7 @@ services:
         context: .
         dockerfile: Dockerfile-traffic_ops-client
     restart: "no"
-    env_file:
-      - dataimport.env
+    environment:
+      - TO_USER
+      - TO_PASSWORD
+      - TO_SERVER

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/422c1522/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 b989860..31145a4 100644
--- a/traffic_ops/app/db/pg-migration/docker-compose.yml
+++ b/traffic_ops/app/db/pg-migration/docker-compose.yml
@@ -19,7 +19,7 @@ services:
       context: ..
       dockerfile: pg-migration/Dockerfile-postgres
     environment:
-      - PGDATA=/opt/postgresql/data
+      - PGDATA=/opt/postgresql/data/pgdata
       - POSTGRES_DB=traffic_ops
       - POSTGRES_PASSWORD=twelve
       - POSTGRES_USER=traffic_ops
@@ -28,7 +28,8 @@ services:
     ports:
       - "5432:5432"
     volumes:
-      - pgdata:/opt/postgresql/data
+      - /opt/postgresql/data/pgdata:/opt/postgresql/data/pgdata
+      - /var/log/postgresql:/var/log/postgresql
     networks:
       - default
 
@@ -38,3 +39,4 @@ networks:
 
 volumes:
   pgdata:
+

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/422c1522/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 15d3bea..ead4c15 100644
--- a/traffic_ops/app/db/pg-migration/mysql.env
+++ b/traffic_ops/app/db/pg-migration/mysql.env
@@ -1,3 +1,4 @@
+#!/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.
@@ -11,6 +12,7 @@
 #  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/422c1522/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 c08bc5b..a759b89 100644
--- a/traffic_ops/app/db/pg-migration/postgres.env
+++ b/traffic_ops/app/db/pg-migration/postgres.env
@@ -1,3 +1,4 @@
+#!/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.
@@ -11,7 +12,10 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 #
-POSTGRES_HOST=postgres
+
+POSTGRES_HOST=localhost
 POSTGRES_DB=traffic_ops
 POSTGRES_PASSWORD=twelve
 POSTGRES_USER=traffic_ops
+POSTGRES_USER_UID=9999
+POSTGRES_USER_GID=9999

http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/422c1522/traffic_ops/app/db/pg-migration/runpgloader.sh
----------------------------------------------------------------------
diff --git a/traffic_ops/app/db/pg-migration/runpgloader.sh b/traffic_ops/app/db/pg-migration/runpgloader.sh
index 2aa2206..b56cb55 100755
--- a/traffic_ops/app/db/pg-migration/runpgloader.sh
+++ b/traffic_ops/app/db/pg-migration/runpgloader.sh
@@ -29,11 +29,4 @@ pgloader -v \
 	--cast 'type double to numeric drop typemod' \
 	mysql://$MYSQL_USER:$MYSQL_PASSWORD@$MYSQL_HOST/traffic_ops_db \
 	postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@$POSTGRES_HOST/$POSTGRES_DB
-
-waiting=/sync/waiting-for-pgloader
-while [[ ! -f $waiting ]]; do
-	echo "Nothing waiting for pgloader?"
-	sleep 3
-done
-
-rm $waiting
+exit 0