Skip to content

Commit

Permalink
add debug and custom pxc_scheduler build
Browse files Browse the repository at this point in the history
  • Loading branch information
hors committed Jun 16, 2023
1 parent dd70bdc commit 66e3d48
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
17 changes: 17 additions & 0 deletions proxysql/Dockerfile.k8s
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,19 @@ RUN export GO111MODULE=off \
&& curl -Lf -o /go/src/github.com/percona/percona-xtradb-cluster-operator/src/peer-list.go https://raw.githubusercontent.com/percona/percona-xtradb-cluster-operator/main/cmd/peer-list/main.go \
&& go build peer-list.go

FROM golang:1.19 AS go_builder_pxc_scheduler

RUN git clone --branch=FR-72-Shunned https://github.com/percona/pxc_scheduler_handler.git /go/src/github.com/percona/pxc_scheduler_handler/

WORKDIR /go/src/github.com/percona/pxc_scheduler_handler

RUN go get github.com/Tusamarco/toml \
&& go get github.com/go-sql-driver/mysql \
&& go get github.com/sirupsen/logrus \
&& go get golang.org/x/text/language \
&& go get golang.org/x/text/message \
&& go build -o pxc_scheduler_handler .

FROM redhat/ubi8-minimal AS ubi8

# Please don't remove old-style LABEL since it's needed for RedHat certification
Expand Down Expand Up @@ -97,6 +110,10 @@ RUN cp /usr/share/doc/proxysql2/LICENSE /licenses/LICENSE.proxysql

COPY dockerdir /
COPY --from=go_builder /go/src/github.com/percona/percona-xtradb-cluster-operator/src/peer-list /usr/bin/

RUN rm -rf /usr/bin/pxc_scheduler_handler
COPY --from=go_builder_pxc_scheduler /go/src/github.com/percona/pxc_scheduler_handler/pxc_scheduler_handler /usr/bin/

RUN chown 1001:1001 /etc/proxysql/proxysql.cnf /etc/proxysql-admin.cnf /etc/config.toml; \
chmod 664 /etc/proxysql/proxysql.cnf /etc/proxysql-admin.cnf /etc/config.toml

Expand Down
2 changes: 2 additions & 0 deletions proxysql/dockerdir/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ sed "s/^writerIsAlsoReader.*=.*$/writerIsAlsoReader = 1/" ${PERCONA_SCHEDULER_CF
sed "s/^hgW.*=.*$/hgW = 11/" | \
sed "s/^hgR.*=.*$/hgR = 10/" | \
sed "s/^clustered.*=.*false$/clustered = true/" | \
sed 's/logLevel = "info"/logLevel = "debug"/g' | \
sed '/lockClusterTimeout/a lockrefreshtime=450' | \
sed "s/^failBack.*=.*false$/failBack = true/" > ${TEMP_PROXY_SCHEDULER_CFG}
cp -f ${TEMP_PROXY_SCHEDULER_CFG} ${PERCONA_SCHEDULER_CFG}
# internal scheduler
Expand Down

0 comments on commit 66e3d48

Please sign in to comment.