You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by mi...@apache.org on 2017/01/13 18:02:24 UTC
[3/7] incubator-trafficcontrol git commit: added
docker-compose-pgmigration.yml
added docker-compose-pgmigration.yml
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/245d379d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/245d379d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/245d379d
Branch: refs/heads/master
Commit: 245d379dc0319f2058bf0f35b64de28278fdc024
Parents: f2fe62a
Author: Dewayne Richardson <de...@apache.org>
Authored: Wed Jan 11 14:13:03 2017 -0700
Committer: Dan Kirkwood <da...@gmail.com>
Committed: Fri Jan 13 10:30:32 2017 -0700
----------------------------------------------------------------------
.../app/db/pg-migration/Dockerfile-pgloader | 2 +-
.../pg-migration/docker-compose-pgmigration.yml | 77 ++++++++++++++++++++
.../app/db/pg-migration/docker-compose.yml | 74 ++++++-------------
3 files changed, 99 insertions(+), 54 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/245d379d/traffic_ops/app/db/pg-migration/Dockerfile-pgloader
----------------------------------------------------------------------
diff --git a/traffic_ops/app/db/pg-migration/Dockerfile-pgloader b/traffic_ops/app/db/pg-migration/Dockerfile-pgloader
index faf98b3..35a4f4e 100644
--- a/traffic_ops/app/db/pg-migration/Dockerfile-pgloader
+++ b/traffic_ops/app/db/pg-migration/Dockerfile-pgloader
@@ -11,7 +11,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
-FROM dimitri/pgloader:ccl.latest
+FROM dimitri/pgloader:latest
MAINTAINER Dan Kirkwood <da...@apache.org>
# install nc to check that postgres and mysql are ready..
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/245d379d/traffic_ops/app/db/pg-migration/docker-compose-pgmigration.yml
----------------------------------------------------------------------
diff --git a/traffic_ops/app/db/pg-migration/docker-compose-pgmigration.yml b/traffic_ops/app/db/pg-migration/docker-compose-pgmigration.yml
new file mode 100644
index 0000000..1b3b7f0
--- /dev/null
+++ b/traffic_ops/app/db/pg-migration/docker-compose-pgmigration.yml
@@ -0,0 +1,77 @@
+
+# Ansible managed
+#
+# 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'
+
+volumes:
+ sync:
+ pgdata:
+
+networks:
+ default:
+ driver: bridge
+
+services:
+ # dataimport reads data from an existing traffic_ops server running mysql thru the API
+ dataimport:
+ extends:
+ service: dataimport
+ file: dataimport.yml
+ volumes:
+ - sync:/sync
+ - ./mysql/initdb.d:/docker-entrypoint-initdb.d
+
+ # mysql_host loads mysql data locally and provides direct access for pgloader
+ 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
+
+ # db provides a postgres data to import data to
+ postgres:
+ extends:
+ service: db
+ file: docker-compose.yml
+ depends_on:
+ - mysql
+ volumes:
+ - sync:/sync
+
+ # pgloader converts the data from mysql to postgres
+ pgloader:
+ extends:
+ service: pgloader
+ file: pgloader.yml
+ depends_on:
+ - mysql
+ - postgres
+ volumes:
+ - sync:/sync
+
+ # convert runs needed post-migration conversions
+ convert:
+ extends:
+ service: convert
+ file: convert.yml
+ depends_on:
+ - postgres
+ volumes:
+ - sync:/sync
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/245d379d/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 7dc4f5b..1a97110 100644
--- a/traffic_ops/app/db/pg-migration/docker-compose.yml
+++ b/traffic_ops/app/db/pg-migration/docker-compose.yml
@@ -13,61 +13,29 @@
#
version: '2'
-volumes:
- sync:
-
services:
- # dataimport reads data from an existing traffic_ops server running mysql thru the API
- dataimport:
- extends:
- service: dataimport
- file: dataimport.yml
- volumes:
- - sync:/sync
- - ./mysql/initdb.d:/docker-entrypoint-initdb.d
-
- # mysql_host loads mysql data locally and provides direct access for pgloader
- mysql:
- extends:
- service: mysql_host
- file: mysql_host.yml
- depends_on:
- - dataimport
+ db:
+ build:
+ context: ..
+ dockerfile: pg-migration/Dockerfile-postgres
+ environment:
+ - PGDATA=/opt/postgresql/data
+ - POSTGRES_DB=traffic_ops
+ - POSTGRES_PASSWORD=twelve
+ - POSTGRES_USER=traffic_ops
+ env_file:
+ - postgres.env
+ ports:
+ - "5432:5432"
volumes:
- - sync:/sync
- - ./mysql/conf.d:/etc/mysql/conf.d
- - ./mysql/initdb.d:/docker-entrypoint-initdb.d
+ - pgdata:/opt/postgresql/data
+ networks:
+ - default
- # postgres_host provides a postgres data to import data to
- postgres:
- extends:
- service: postgres_host
- file: postgres_host.yml
- depends_on:
- - mysql
- volumes:
- - sync:/sync
- - ./db:/var/lib/postgresql/data
- ports:
- - 5432
+networks:
+ default:
+ driver: bridge
- # pgloader converts the data from mysql to postgres
- pgloader:
- extends:
- service: pgloader
- file: pgloader.yml
- depends_on:
- - mysql
- - postgres
- volumes:
- - sync:/sync
+volumes:
+ pgdata:
- # convert runs needed post-migration conversions
- convert:
- extends:
- service: convert
- file: convert.yml
- depends_on:
- - postgres
- volumes:
- - sync:/sync