Skip to content

Remove Tideways dependency #706

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Jun 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ install_dependency: &install_dependency
install_deploysuite: &install_deploysuite
name: Installation of install_deploysuite.
command: |
git clone --branch v1.4 https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript
git clone --branch v1.4.14 https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript
cp ./../buildscript/master_deploy.sh .
cp ./../buildscript/buildenv.sh .
cp ./../buildscript/awsconfiguration.sh .
Expand All @@ -31,7 +31,7 @@ builddeploy_steps: &builddeploy_steps
- run: *install_dependency
- run: *install_deploysuite
#- restore_cache: *restore_cache_settings_for_build
- run: ./build.sh ${APPNAME} ${CI_DEPLOY_TOKEN} ${LOGICAL_ENV} ${BRANCH} ${TIDEWAYS_ENV}
- run: ./build.sh ${APPNAME} ${CI_DEPLOY_TOKEN} ${LOGICAL_ENV} ${BRANCH}
#- save_cache: *save_cache_settings
- deploy:
name: Running MasterScript.
Expand All @@ -54,7 +54,6 @@ jobs:
APPNAME: "vanilla-forums"
CI_DEPLOY_TOKEN: $CI_DEPLOY_TOKEN
BRANCH: "develop"
TIDEWAYS_ENV: "dev"
steps: *builddeploy_steps

"build-prod":
Expand All @@ -65,7 +64,6 @@ jobs:
APPNAME: "vanilla-forums"
CI_DEPLOY_TOKEN: $CI_DEPLOY_TOKEN
BRANCH: "master"
TIDEWAYS_ENV: "production"
steps: *builddeploy_steps

workflows:
Expand Down
50 changes: 7 additions & 43 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,9 @@ ARG CI_DEPLOY_TOKEN
ARG VANILLA_VERSION=3.3
ARG ENV
ARG BRANCH
ARG TIDEWAYS_ENV

# TIDEWAYS DAEMON
ENV TIDEWAYS_SERVICE web
ENV TIDEWAYS_ENVIRONMENT=$TIDEWAYS_ENV
ENV TIDEWAYS_DAEMON_EXTRA="--env=$TIDEWAYS_ENVIRONMENT --debug"

# VANILLA
ENV VANILLA_ENV=$ENV
ENV WEB_DOCUMENT_ROOT /vanillapp

RUN echo "Tideways Daemon for '$TIDEWAYS_ENV' env"

# Get the latest release of Vanilla Forums
RUN wget https://github.com/vanilla/vanilla/releases/download/Vanilla_${VANILLA_VERSION}/vanilla-${VANILLA_VERSION}.zip
RUN unzip vanilla-${VANILLA_VERSION}.zip -d /tmp
Expand Down Expand Up @@ -45,23 +35,18 @@ RUN git clone --branch ${BRANCH} https://${CI_DEPLOY_TOKEN}@github.com/topcoder-

# Copy the forum-theme repository
RUN git clone --branch ${BRANCH} https://${CI_DEPLOY_TOKEN}@github.com/topcoder-platform/forums-theme.git /vanillapp/themes/topcoder
RUN git clone --branch mfe https://${CI_DEPLOY_TOKEN}@github.com/topcoder-platform/forums-theme.git /vanillapp/themes/mfe-topcoder

# Remove DebugPlugin from PROD env
# RUN if [ "$ENV" = "prod" ]; \
# then rm -R /tmp/forums-plugins/DebugPlugin; \
# fi

RUN git clone --branch mfe https://${CI_DEPLOY_TOKEN}@github.com/topcoder-platform/forums-theme.git /vanillapp/themes/mfe-topcoder

# Copy all plugins to the Vanilla plugins folder
RUN cp -r /tmp/forums-plugins/. /vanillapp/plugins

# Get the debug bar plugin
RUN if [ "$ENV" = "dev" ]; then \
wget https://us.v-cdn.net/5018160/uploads/addons/KSBIPJYMC0F2.zip; \
unzip KSBIPJYMC0F2.zip; \
cp -r debugbar /vanillapp/plugins; \
fi
#Get the debug bar plugin
#RUN if [ "$ENV" = "dev" ]; then \
# wget https://us.v-cdn.net/5018160/uploads/addons/KSBIPJYMC0F2.zip; \
# unzip KSBIPJYMC0F2.zip; \
# cp -r debugbar /vanillapp/plugins; \
#fi

# Install Topcoder dependencies
RUN composer install --working-dir /vanillapp/plugins/Topcoder
Expand All @@ -78,24 +63,3 @@ COPY ./vanilla/. /vanillapp/.
# Set permissions on config file
RUN chown application:application /vanillapp/conf/config.php
RUN chmod ug=rwx,o=rx /vanillapp/conf/config.php

# Tideways
RUN apt-get update && apt-get install -yq --no-install-recommends gnupg2;
RUN echo 'deb https://packages.tideways.com/apt-packages-main any-version main' > /etc/apt/sources.list.d/tideways.list && \
curl -L -sS 'https://packages.tideways.com/key.gpg' | apt-key add - && \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get -yq install tideways-php tideways-daemon && \
apt-get autoremove --assume-yes && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*; \
echo 'extension=tideways.so\ntideways.enable_cli=0\ntideways.sample_rate=25' >> opt/docker/etc/php/php.ini;

# Copy custom supervisor's configs and scripts
# Netcat is used to connect to a memcached server
RUN apt-get update && apt-get install -y netcat
COPY ./services/*.conf /opt/docker/etc/supervisor.d/
COPY ./services/*.sh /opt/docker/bin/service.d/

# Ensure the service files are already executable
RUN chmod +x /opt/docker/bin/service.d/flush_cache.sh
RUN chmod +x /opt/docker/bin/service.d/tideways.sh
3 changes: 1 addition & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ APP_NAME=$1
CI_DEPLOY_TOKEN=$2
ENV=$3
BRANCH=$4
TIDEWAYS_ENV=$5
UPDATE_CACHE=""
echo "" > vanilla.env
ENV=$ENV CI_DEPLOY_TOKEN=$CI_DEPLOY_TOKEN BRANCH=$BRANCH TIDEWAYS_ENV=$TIDEWAYS_ENV docker-compose -f docker-compose.yml build $APP_NAME
ENV=$ENV CI_DEPLOY_TOKEN=$CI_DEPLOY_TOKEN BRANCH=$BRANCH docker-compose -f docker-compose.yml -f docker-compose.dev.yml build $APP_NAME
#docker create --name app $APP_NAME:latest
10 changes: 0 additions & 10 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
version: '3'
services:
vanilla-forums:
links:
- tideways-daemon
tideways-daemon:
container_name: tideways-daemon
build:
context: ./tideways-daemon
args:
- TIDEWAYS_ENV
ports:
- 9135:9135
33 changes: 16 additions & 17 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
version: '3'
services:
vanilla-forums:
image: vanilla-forums:latest
container_name: vanilla-forums
env_file:
- ./vanilla.env
build:
context: .
args:
- ENV='dev'
- VANILLA_VERSION=3.3
- CI_DEPLOY_TOKEN
- BRANCH
- TIDEWAYS_ENV
ports:
- 80:80
version: '3'
services:
vanilla-forums:
image: vanilla-forums:latest
container_name: vanilla-forums
env_file:
- ./vanilla.env
build:
context: .
args:
- ENV
- VANILLA_VERSION=3.3
- CI_DEPLOY_TOKEN
- BRANCH
ports:
- 80:80
- 443:443
15 changes: 0 additions & 15 deletions services/tideways.conf

This file was deleted.

9 changes: 0 additions & 9 deletions services/tideways.sh

This file was deleted.

21 changes: 0 additions & 21 deletions tideways-daemon/Dockerfile

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,8 @@ function writeListItem($category, $depth) {
<?php } else { ?>
<span class="MItem"></span>
<?php };
if ($writeChildren === 'list'): ?>
$show = false;
if ($show && $writeChildren === 'list'): ?>
<div class="ChildCategories">
<?php echo wrap(t('Child Categories').': ', 'b'); ?>
<?php echo categoryString($children, $depth + 1); ?>
Expand Down
9 changes: 0 additions & 9 deletions vanilla/library/core/class.controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -1733,10 +1733,6 @@ protected function _renderXml($data, $node = 'Data', $indent = '') {
* @param Exception $ex The exception to render.
*/
public function renderException($ex) {
// FIX: https://github.com/topcoder-platform/forums/issues/570
if (class_exists('Tideways\Profiler')) {
\Tideways\Profiler::logException($ex);
}
if ($this->deliveryMethod() == DELIVERY_METHOD_XHTML) {
try {
// Pick our route.
Expand Down Expand Up @@ -2116,11 +2112,6 @@ public function sendHeaders() {
\Vanilla\Web\CacheControlMiddleware::sendCacheControlHeaders($this->_Headers['Cache-Control']);
}

// FIX: https://github.com/topcoder-platform/forums/issues/381
if (class_exists('Tideways\Profiler')) {
safeHeader("Server-Timing: ".\Tideways\Profiler::generateServerTimingHeaderValue(), true);
}

// Empty the collection after sending
$this->_Headers = [];
}
Expand Down