Skip to content

Commit

Permalink
update to 1.2.7 version, add WAIT_TIME to crunchy-watch, fix pgadmin4
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff McCormick committed Jan 30, 2017
1 parent e0fbfe9 commit 080f382
Show file tree
Hide file tree
Showing 83 changed files with 98 additions and 93 deletions.
14 changes: 7 additions & 7 deletions bin/install-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,18 @@ if [ $? -ne 0 ]; then
#
# install oc binary into /usr/bin
#
wget -O /tmp/openshift-origin-client-tools-v1.1.3-cffae05-linux-64bit.tar.gz \
https://github.com/openshift/origin/releases/download/v1.1.3/openshift-origin-client-tools-v1.1.3-cffae05-linux-64bit.tar.gz
tar xvzf /tmp/openshift-origin-client-tools-v1.1.3-cffae05-linux-64bit.tar.gz -C /tmp
sudo cp /tmp/openshift-origin-client-tools-v1.1.3-cffae05-linux-64bit/oc /usr/bin/oc

FILE=openshift-origin-client-tools-v1.4.1-3f9807a-linux-64bit.tar.gz
wget -O /tmp/$FILE \
https://github.com/openshift/origin/releases/download/v1.4.1/$FILE

tar xvzf /tmp/$FILE -C /tmp
sudo cp /tmp/openshift-origin-client-tools-v1.4.1+3f9807a-linux-64bit/oc /usr/bin/oc

sudo yum -y install postgresql-server

#
# install kubectl binary into /usr/bin
#
wget -O /tmp/kubernetes.tar.gz https://github.com/kubernetes/kubernetes/releases/download/v1.2.4/kubernetes.tar.gz
tar xvzf /tmp/kubernetes.tar.gz -C /tmp
sudo cp /tmp/kubernetes/platforms/linux/amd64/kubectl /usr/bin
sudo yum -y install kubernetes-client
fi
6 changes: 3 additions & 3 deletions bin/pgadmin4/start-pgadmin4.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ if [ ! -f "$THISDIR/config_local.py" ]; then
cp /opt/cpm/conf/pgadmin4.db $THISDIR/
fi

if [ ! -f "/usr/lib/python2.7/site-packages/pgadmin4-web" ]; then
cp $THISDIR/config_local.py /usr/lib/python2.7/site-packages/pgadmin4-web-web/
if [ -d "/usr/lib/python2.7/site-packages/pgadmin4-web" ]; then
cp $THISDIR/config_local.py /usr/lib/python2.7/site-packages/pgadmin4-web/
python2 /usr/lib/python2.7/site-packages/pgadmin4-web/pgAdmin4.py &
fi
if [ ! -f "/usr/lib/python2.7/site-packages/pgadmin4" ]; then
if [ -d "/usr/lib/python2.7/site-packages/pgadmin4" ]; then
cp $THISDIR/config_local.py /usr/lib/python2.7/site-packages/pgadmin4/
python2 /usr/lib/python2.7/site-packages/pgadmin4/pgAdmin4.py &
fi
Expand Down
12 changes: 8 additions & 4 deletions bin/watch/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ function ose_hack() {
if [ ! -v SLEEP_TIME ]; then
SLEEP_TIME=10
fi
if [ ! -v WAIT_TIME ]; then
WAIT_TIME=40
fi
echo "SLEEP_TIME is set to " $SLEEP_TIME
echo "WAIT_TIME is set to " $WAIT_TIME

export PG_MASTER_SERVICE=$PG_MASTER_SERVICE
export PG_SLAVE_SERVICE=$PG_SLAVE_SERVICE
Expand Down Expand Up @@ -117,8 +121,8 @@ function kube_failover() {
if [ "$targetslave" = $i ] ; then
echo "going to trigger failover on slave:" $i
kubectl exec $i touch /tmp/pg-failover-trigger
echo "sleeping 60 secs to give failover a chance before setting label"
sleep 60
echo "sleeping WAIT_TIME to give failover a chance before setting label"
sleep $WAIT_TIME
echo "changing label of slave to " $PG_MASTER_SERVICE
kubectl label --overwrite=true pod $i name=$PG_MASTER_SERVICE
else
Expand Down Expand Up @@ -163,8 +167,8 @@ function ose_failover() {
if [ "$targetslave" = $i ] ; then
echo "going to trigger failover on slave:" $i
oc exec $i touch /tmp/pg-failover-trigger
echo "sleeping 60 secs to give failover a chance before setting label"
sleep 60
echo "sleeping WAIT_TIME to give failover a chance before setting label"
sleep $WAIT_TIME
echo "changing label of slave to " $PG_MASTER_SERVICE
oc label --overwrite=true pod $i name=$PG_MASTER_SERVICE
# echo "recreating master service..."
Expand Down
2 changes: 1 addition & 1 deletion centos7/9.5/Dockerfile.backup.centos7
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM centos:7

LABEL Release="1.2.6" Vendor="Crunchy Data Solutions" PostgresVersion="9.5"
LABEL Release="1.2.7" Vendor="Crunchy Data Solutions" PostgresVersion="9.5"

ENV PGVERSION="9.5" \
PGDG_REPO="pgdg-centos95-9.5-3.noarch.rpm"
Expand Down
2 changes: 1 addition & 1 deletion centos7/9.5/Dockerfile.collect.centos7
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM centos:7

LABEL Release="1.2.6" Vendor="Crunchy Data Solutions" PostgresVersion="9.5"
LABEL Release="1.2.7" Vendor="Crunchy Data Solutions" PostgresVersion="9.5"

# PGDG Postgres repo
ENV PGVERSION="9.5" \
Expand Down
2 changes: 1 addition & 1 deletion centos7/9.5/Dockerfile.pgadmin4.centos7
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM centos:7

LABEL Release="1.2.6" Vendor="Crunchy Data Solutions" PostgresVersion="9.5"
LABEL Release="1.2.7" Vendor="Crunchy Data Solutions" PostgresVersion="9.5"

ENV PGVERSION="9.5" \
PGDG_REPO="pgdg-centos95-9.5-3.noarch.rpm"
Expand Down
2 changes: 1 addition & 1 deletion centos7/9.5/Dockerfile.pgbadger.centos7
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM centos:7

LABEL Release="1.2.6" Vendor="Crunchy Data Solutions" PostgresVersion="9.5"
LABEL Release="1.2.7" Vendor="Crunchy Data Solutions" PostgresVersion="9.5"

ENV PGVERSION="9.5" \
PGDG_REPO="pgdg-centos95-9.5-3.noarch.rpm"
Expand Down
2 changes: 1 addition & 1 deletion centos7/9.5/Dockerfile.pgbouncer.centos7
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM centos:7

LABEL Release="1.2.6" Vendor="Crunchy Data Solutions" PostgresVersion="9.5"
LABEL Release="1.2.7" Vendor="Crunchy Data Solutions" PostgresVersion="9.5"

ENV PGVERSION="9.5" \
PGDG_REPO="pgdg-centos95-9.5-3.noarch.rpm"
Expand Down
2 changes: 1 addition & 1 deletion centos7/9.5/Dockerfile.pgpool.centos7
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM centos:7

LABEL Release="1.2.6" Vendor="Crunchy Data Solutions" PostgresVersion="9.5"
LABEL Release="1.2.7" Vendor="Crunchy Data Solutions" PostgresVersion="9.5"

ENV PGVERSION="9.5" \
PGDG_REPO="pgdg-centos95-9.5-3.noarch.rpm"
Expand Down
2 changes: 1 addition & 1 deletion centos7/9.5/Dockerfile.postgres-gis.centos7
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM centos:7

LABEL Release="1.2.6" Vendor="Crunchy Data Solutions" PostgresVersion="9.5"
LABEL Release="1.2.7" Vendor="Crunchy Data Solutions" PostgresVersion="9.5"

ENV PGVERSION="9.5" \
PGDG_REPO="pgdg-centos95-9.5-3.noarch.rpm"
Expand Down
2 changes: 1 addition & 1 deletion centos7/9.5/Dockerfile.postgres.centos7
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM centos:7

LABEL Release="1.2.6" Vendor="Crunchy Data Solutions" PostgresVersion="9.5"
LABEL Release="1.2.7" Vendor="Crunchy Data Solutions" PostgresVersion="9.5"

ENV PGVERSION="9.5" \
PGDG_REPO="pgdg-centos95-9.5-3.noarch.rpm"
Expand Down
2 changes: 1 addition & 1 deletion centos7/9.5/Dockerfile.watch.centos7
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM centos:7

LABEL Release="1.2.6" Vendor="Crunchy Data Solutions" PostgresVersion="9.5"
LABEL Release="1.2.7" Vendor="Crunchy Data Solutions" PostgresVersion="9.5"

ENV PGVERSION="9.5" \
PGDG_REPO="pgdg-centos95-9.5-3.noarch.rpm"
Expand Down
2 changes: 1 addition & 1 deletion centos7/9.6/Dockerfile.backup.centos7
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM centos:7

LABEL Release="1.2.6" Vendor="Crunchy Data Solutions" PostgresVersion="9.6"
LABEL Release="1.2.7" Vendor="Crunchy Data Solutions" PostgresVersion="9.6"

ENV PGVERSION="9.6" \
PGDG_REPO="pgdg-centos96-9.6-3.noarch.rpm"
Expand Down
2 changes: 1 addition & 1 deletion centos7/9.6/Dockerfile.collect.centos7
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM centos:7

LABEL Release="1.2.6" Vendor="Crunchy Data Solutions" PostgresVersion="9.6"
LABEL Release="1.2.7" Vendor="Crunchy Data Solutions" PostgresVersion="9.6"

ENV PGVERSION="9.6" \
PGDG_REPO="pgdg-centos96-9.6-3.noarch.rpm"
Expand Down
2 changes: 1 addition & 1 deletion centos7/9.6/Dockerfile.pgadmin4.centos7
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM centos:7

LABEL Release="1.2.6" Vendor="Crunchy Data Solutions" PostgresVersion="9.6"
LABEL Release="1.2.7" Vendor="Crunchy Data Solutions" PostgresVersion="9.6"

ENV PGVERSION="9.6" \
PGDG_REPO="pgdg-centos96-9.6-3.noarch.rpm"
Expand Down
2 changes: 1 addition & 1 deletion centos7/9.6/Dockerfile.pgbadger.centos7
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM centos:7

LABEL Release="1.2.6" Vendor="Crunchy Data Solutions" PostgresVersion="9.6"
LABEL Release="1.2.7" Vendor="Crunchy Data Solutions" PostgresVersion="9.6"

ENV PGVERSION="9.6" \
PGDG_REPO="pgdg-centos96-9.6-3.noarch.rpm"
Expand Down
2 changes: 1 addition & 1 deletion centos7/9.6/Dockerfile.pgbouncer.centos7
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM centos:7

LABEL Release="1.2.6" Vendor="Crunchy Data Solutions" PostgresVersion="9.6"
LABEL Release="1.2.7" Vendor="Crunchy Data Solutions" PostgresVersion="9.6"

ENV PGVERSION="9.6" \
PGDG_REPO="pgdg-centos96-9.6-3.noarch.rpm"
Expand Down
2 changes: 1 addition & 1 deletion centos7/9.6/Dockerfile.pgpool.centos7
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM centos:7

LABEL Release="1.2.6" Vendor="Crunchy Data Solutions" PostgresVersion="9.6"
LABEL Release="1.2.7" Vendor="Crunchy Data Solutions" PostgresVersion="9.6"

ENV PGVERSION="9.6" \
PGDG_REPO="pgdg-centos96-9.6-3.noarch.rpm"
Expand Down
2 changes: 1 addition & 1 deletion centos7/9.6/Dockerfile.postgres-gis.centos7
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM centos:7

LABEL Release="1.2.6" Vendor="Crunchy Data Solutions" PostgresVersion="9.6"
LABEL Release="1.2.7" Vendor="Crunchy Data Solutions" PostgresVersion="9.6"

ENV PGVERSION="9.6" \
PGDG_REPO="pgdg-centos96-9.6-3.noarch.rpm"
Expand Down
2 changes: 1 addition & 1 deletion centos7/9.6/Dockerfile.postgres.centos7
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM centos:7

LABEL Release="1.2.6" Vendor="Crunchy Data Solutions" PostgresVersion="9.6"
LABEL Release="1.2.7" Vendor="Crunchy Data Solutions" PostgresVersion="9.6"

ENV PGVERSION="9.6" \
PGDG_REPO="pgdg-centos96-9.6-3.noarch.rpm"
Expand Down
2 changes: 1 addition & 1 deletion centos7/9.6/Dockerfile.watch.centos7
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM centos:7

LABEL Release="1.2.6" Vendor="Crunchy Data Solutions" PostgresVersion="9.6"
LABEL Release="1.2.7" Vendor="Crunchy Data Solutions" PostgresVersion="9.6"

ENV PGVERSION="9.6" \
PGDG_REPO="pgdg-centos96-9.6-3.noarch.rpm"
Expand Down
2 changes: 1 addition & 1 deletion centos7/Dockerfile.dba.centos7
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM centos:7

LABEL Release="1.2.6" Vendor="Crunchy Data Solutions"
LABEL Release="1.2.7" Vendor="Crunchy Data Solutions"

RUN yum -y install psmisc procps-ng iproute bind-utils openssh-clients hostname && yum clean all -y

Expand Down
2 changes: 1 addition & 1 deletion centos7/Dockerfile.dns.centos7
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM centos:7

LABEL Release="1.2.6" Vendor="Crunchy Data Solutions"
LABEL Release="1.2.7" Vendor="Crunchy Data Solutions"

#RUN rpm -Uvh http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
RUN yum -y install procps-ng iproute bind-utils openssh-clients hostname && yum clean all -y
Expand Down
2 changes: 1 addition & 1 deletion centos7/Dockerfile.grafana.centos7
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM centos:7

LABEL Release="1.2.6" Vendor="Crunchy Data Solutions"
LABEL Release="1.2.7" Vendor="Crunchy Data Solutions"

RUN yum -y install procps-ng openssh-clients hostname && yum clean all -y

Expand Down
2 changes: 1 addition & 1 deletion centos7/Dockerfile.prometheus.centos7
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM centos:7

LABEL Release="1.2.6" Vendor="Crunchy Data Solutions"
LABEL Release="1.2.7" Vendor="Crunchy Data Solutions"

RUN yum -y install procps-ng openssh-clients hostname && yum clean all -y

Expand Down
2 changes: 1 addition & 1 deletion centos7/Dockerfile.promgateway.centos7
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM centos:7

LABEL Release="1.2.6" Vendor="Crunchy Data Solutions"
LABEL Release="1.2.7" Vendor="Crunchy Data Solutions"

RUN yum -y install procps-ng openssh-clients && yum clean all -y

Expand Down
2 changes: 1 addition & 1 deletion centos7/Dockerfile.vacuum.centos7
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM centos:7

LABEL Release="1.2.6" Vendor="Crunchy Data Solutions"
LABEL Release="1.2.7" Vendor="Crunchy Data Solutions"

RUN yum -y install procps-ng iproute bind-utils openssh-clients hostname && yum clean all -y

Expand Down
2 changes: 1 addition & 1 deletion dba/dbaserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var logger *log.Logger

func main() {
logger = log.New(os.Stdout, "logger: ", log.Lshortfile|log.Ldate|log.Ltime)
var VERSION = os.Getenv("VERSION")
var VERSION = os.Getenv("CCP_VERSION")

logger.Println("dbaserver " + VERSION + ": starting")

Expand Down
1 change: 1 addition & 0 deletions docs/containers.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ the watch logic to interact with the replica containers.
=== Environment Variables

* SLEEP_TIME - the time to sleep in seconds between checking on the master
* WAIT_TIME - the time to sleep in seconds between triggering the failover and updating its label (default is 40 secs)
* PG_MASTER_SERVICE - the master service name
* PG_SLAVE_SERVICE - the slave service name
* PG_MASTER_PORT - database port to use when checking the database
Expand Down
2 changes: 1 addition & 1 deletion examples/docker/pgadmin4/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ docker run \
-p 5050:5050 \
--privileged=true \
--volume-driver=local \
-v $VOLUME_NAME:/root/.pgadmin:z \
-v $VOLUME_NAME:/pgdata:z \
--name=$CONTAINER_NAME \
--hostname=$CONTAINER_NAME \
-d crunchydata/crunchy-pgadmin4:$CCP_IMAGE_TAG
Expand Down
2 changes: 1 addition & 1 deletion examples/templates/backup/backup-job.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
}, {
"name": "CCP_IMAGE_TAG",
"description": "image tag to use",
"value": "centos7-9.5-1.2.6"
"value": "centos7-9.5-1.2.7"
}],

"objects": [{
Expand Down
2 changes: 1 addition & 1 deletion examples/templates/badger/master-badger.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"value": "master"
}, {
"name": "CCP_IMAGE_TAG",
"value": "centos7-9.5-1.2.6",
"value": "centos7-9.5-1.2.7",
"description": "The image tag to use"
}, {
"name": "CCP_IMAGE_PREFIX",
Expand Down
2 changes: 1 addition & 1 deletion examples/templates/collect/master-collect.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"value": "master"
}, {
"name": "CCP_IMAGE_TAG",
"value": "centos7-9.5-1.2.6",
"value": "centos7-9.5-1.2.7",
"description": "The image tag to pull images with"
}, {
"name": "CCP_IMAGE_PREFIX",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"value": "master"
}, {
"name": "CCP_IMAGE_TAG",
"value": "centos7-9.5-1.2.6",
"value": "centos7-9.5-1.2.7",
"description": "The image tag to pull images with"
}, {
"name": "CCP_IMAGE_PREFIX",
Expand Down
2 changes: 1 addition & 1 deletion examples/templates/master-replica-dc/master-slave-dc.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"description": "The image prefix to pull with"
}, {
"name": "CCP_IMAGE_TAG",
"value": "centos7-9.5-1.2.6",
"value": "centos7-9.5-1.2.7",
"description": "The image tag to pull with"
}, {
"name": "PG_MASTER_PASSWORD",
Expand Down
2 changes: 1 addition & 1 deletion examples/templates/master-replica/master-replica.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"value": "pgslave"
}, {
"name": "CCP_IMAGE_TAG",
"value": "centos7-9.5-1.2.6",
"value": "centos7-9.5-1.2.7",
"description": "The image tag to pull with"
}, {
"name": "CCP_IMAGE_PREFIX",
Expand Down
2 changes: 1 addition & 1 deletion examples/templates/master-restore/master-restore.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"parameters": [{
"name": "CCP_IMAGE_TAG",
"value": "centos7-9.5-1.2.6",
"value": "centos7-9.5-1.2.7",
"description": "The image tag to pull with"
}, {
"name": "CCP_IMAGE_PREFIX",
Expand Down
2 changes: 1 addition & 1 deletion examples/templates/metrics/metrics.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"parameters": [{
"name": "CCP_IMAGE_TAG",
"value": "centos7-9.5-1.2.6",
"value": "centos7-9.5-1.2.7",
"description": "The image tag to use"
}, {
"name": "CCP_IMAGE_PREFIX",
Expand Down
2 changes: 1 addition & 1 deletion examples/templates/pgadmin4/pgadmin4.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"parameters": [{
"name": "CCP_IMAGE_TAG",
"value": "centos7-9.5-1.2.6",
"value": "centos7-9.5-1.2.7",
"description": "image tag to use"
}, {
"name": "CCP_IMAGE_PREFIX",
Expand Down
2 changes: 1 addition & 1 deletion examples/templates/pgbouncer/pgbouncer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"description": "The accessmode of the pvc"
}, {
"name": "CCP_IMAGE_TAG",
"value": "centos7-9.5-1.2.6",
"value": "centos7-9.5-1.2.7",
"description": "The image tag to pull images with"
}, {
"name": "CCP_IMAGE_PREFIX",
Expand Down
2 changes: 1 addition & 1 deletion examples/templates/pgpool/pgpool-dc.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"parameters": [{
"name": "CCP_IMAGE_TAG",
"value": "centos7-9.5-1.2.6",
"value": "centos7-9.5-1.2.7",
"description": "The image tag to pull with"
}, {
"name": "CCP_IMAGE_PREFIX",
Expand Down
Loading

0 comments on commit 080f382

Please sign in to comment.