Skip to content

Commit

Permalink
Update PSMDB-60 Dockerfile with telemetry phase-1 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
surbhat1595 committed Jul 30, 2024
1 parent 6ce4d9b commit 35f31ea
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 3 deletions.
14 changes: 14 additions & 0 deletions percona-server-mongodb-6.0/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ ARG PERCONA_TELEMETRY_DISABLE=1

RUN set -ex; \
percona-release enable psmdb-60 ${PSMDB_REPO}; \
percona-release enable telemetry ${PSMDB_REPO}; \
dnf config-manager --enable ol8_u4_security_validation; \
dnf -y update openssh; \
dnf -y update bind-export-libs; \
Expand Down Expand Up @@ -87,6 +88,19 @@ RUN chown 1001:1001 /usr/local/percona
ENV CALL_HOME_OPTIONAL_PARAMS=" -s ${OS_VER}"

COPY ps-entry.sh /entrypoint.sh
COPY telemetry-agent-supervisor.sh /usr/bin/
RUN set -ex; \
chown mongodb /usr/bin/telemetry-agent-supervisor.sh; \
chown mongodb /usr/bin/percona-telemetry-agent; \
chown mongodb /usr/local/percona/telemetry/history; \
chown mongodb:percona-telemetry /usr/local/percona/telemetry/psmdb; \
chown mongodb:percona-telemetry /usr/local/percona/telemetry/psmdbs; \
chmod ug+rwx /usr/bin/telemetry-agent-supervisor.sh; \
chmod -R go+w /var/log/percona
ENV PERCONA_TELEMETRY_CHECK_INTERVAL=86400
ENV PERCONA_TELEMETRY_HISTORY_KEEP_INTERVAL=604800
ENV PERCONA_TELEMETRY_RESEND_INTERVAL=60
ENV PERCONA_TELEMETRY_URL=https://check.percona.com/v1/telemetry/GenericReport

ENTRYPOINT ["/entrypoint.sh"]

Expand Down
14 changes: 14 additions & 0 deletions percona-server-mongodb-6.0/Dockerfile.aarch64
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ ARG PERCONA_TELEMETRY_DISABLE=1
RUN set -ex; \
sed -i "s|x86_64|x86_64 aarch64|" /usr/bin/percona-release; \
percona-release enable psmdb-60 ${PSMDB_REPO}; \
percona-release enable telemetry ${PSMDB_REPO}; \
dnf config-manager --enable ol8_u4_security_validation; \
dnf -y update openssh; \
dnf -y update bind-export-libs; \
Expand Down Expand Up @@ -98,6 +99,19 @@ RUN chown 1001:1001 /usr/local/percona
ENV CALL_HOME_OPTIONAL_PARAMS=" -s ${OS_VER}"

COPY ps-entry.sh /entrypoint.sh
COPY telemetry-agent-supervisor.sh /usr/bin/
RUN set -ex; \
chown mongodb /usr/bin/telemetry-agent-supervisor.sh; \
chown mongodb /usr/bin/percona-telemetry-agent; \
chown mongodb /usr/local/percona/telemetry/history; \
chown mongodb:percona-telemetry /usr/local/percona/telemetry/psmdb; \
chown mongodb:percona-telemetry /usr/local/percona/telemetry/psmdbs; \
chmod ug+rwx /usr/bin/telemetry-agent-supervisor.sh; \
chmod -R go+w /var/log/percona
ENV PERCONA_TELEMETRY_CHECK_INTERVAL=86400
ENV PERCONA_TELEMETRY_HISTORY_KEEP_INTERVAL=604800
ENV PERCONA_TELEMETRY_RESEND_INTERVAL=60
ENV PERCONA_TELEMETRY_URL=https://check.percona.com/v1/telemetry/GenericReport

ENTRYPOINT ["/entrypoint.sh"]

Expand Down
9 changes: 6 additions & 3 deletions percona-server-mongodb-6.0/ps-entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,9 @@ else
CALL_HOME_OPTIONAL_PARAMS+=" -c 2"
fi

/call-home.sh -f "PRODUCT_FAMILY_PSMDB" -v "${PSMDB_VERSION}" -d "DOCKER" ${CALL_HOME_OPTIONAL_PARAMS} &> /dev/null || :

exec "$@"
if [[ ${PERCONA_TELEMETRY_DISABLE} -ne "0" ]]; then
exec "$@" --setParameter perconaTelemetry=false
else
/usr/bin/telemetry-agent-supervisor.sh &
exec "$@"
fi
14 changes: 14 additions & 0 deletions percona-server-mongodb-6.0/telemetry-agent-supervisor.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

# phase-0 telemetry
/call-home.sh -f "PRODUCT_FAMILY_PSMDB" -v "${PSMDB_VERSION}" -d "DOCKER" ${CALL_HOME_OPTIONAL_PARAMS} &> /dev/null || :

# phase-1 telemetry
for i in {1..3}; do
/usr/bin/percona-telemetry-agent >> /var/log/percona/telemetry-agent.log 2>> /var/log/percona/telemetry-agent-error.log
if [ $? -eq 0 ]; then
break
fi
sleep 5
done
sleep infinity

0 comments on commit 35f31ea

Please sign in to comment.