Skip to content

Commit

Permalink
addition of the --memory-limit flag (with a value of 512M) when calli…
Browse files Browse the repository at this point in the history
…ng runJobs.php
  • Loading branch information
naresh-kumar-babu committed Jun 21, 2024
1 parent f530a87 commit 5340a22
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 31 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ COPY --from=source $MW_ORIGIN_FILES $MW_ORIGIN_FILES
# Default values
ENV MW_ENABLE_JOB_RUNNER=true \
MW_JOB_RUNNER_PAUSE=2 \
MW_JOB_RUNNER_MEMORY_LIMIT=512M \
MW_ENABLE_TRANSCODER=true \
MW_JOB_TRANSCODER_PAUSE=60 \
MW_MAP_DOMAIN_TO_DOCKER_GATEWAY=true \
Expand Down
3 changes: 3 additions & 0 deletions _sources/canasta/CanastaDefaultSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@
$wgCdnServersNoPurge[] = '172.16.0.0/12'; // 172.16.0.0 – 172.31.255.255
$wgCdnServersNoPurge[] = '192.168.0.0/16'; // 192.168.0.0 – 192.168.255.255

# SemanticMediaWiki
$smwgConfigFileDir = "$DOCKER_MW_VOLUME/extensions/SemanticMediaWiki/config";

# Include user defined CommonSettings.php file
if ( file_exists( $canastaCommonSettingsFilePath ) ) {
require_once "$canastaCommonSettingsFilePath";
Expand Down
8 changes: 4 additions & 4 deletions _sources/scripts/maintenance-scripts/mw_job_runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ if [ -f "$MW_VOLUME/config/wikis.yaml" ]; then
while true; do
# Job types that need to be run ASAP no matter how many of them are in the queue
# Those jobs should be very "cheap" to run
php $RJ --type="enotifNotify" --server="https://$wiki_url" --wiki="$wiki_id"
php $RJ --memory-limit="$MW_JOB_RUNNER_MEMORY_LIMIT" --type="enotifNotify" --server="https://$wiki_url" --wiki="$wiki_id"
sleep 1
php $RJ --type="createPage" --server="https://$wiki_url" --wiki="$wiki_id"
php $RJ --memory-limit="$MW_JOB_RUNNER_MEMORY_LIMIT" --type="createPage" --server="https://$wiki_url" --wiki="$wiki_id"
sleep 1
php $RJ --type="refreshLinks" --server="https://$wiki_url" --wiki="$wiki_id"
php $RJ --memory-limit="$MW_JOB_RUNNER_MEMORY_LIMIT" --type="refreshLinks" --server="https://$wiki_url" --wiki="$wiki_id"
sleep 1
php $RJ --type="htmlCacheUpdate" --maxjobs=500 --server="https://$wiki_url" --wiki="$wiki_id"
php $RJ --memory-limit="$MW_JOB_RUNNER_MEMORY_LIMIT" --type="htmlCacheUpdate" --maxjobs=500 --server="https://$wiki_url" --wiki="$wiki_id"
sleep 1
# Everything else, limit the number of jobs on each batch
# The --wait parameter will pause the execution here until new jobs are added,
Expand Down
38 changes: 11 additions & 27 deletions _sources/scripts/run-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,31 +24,13 @@ isFalse() {
esac
}

dir_is_writable() {
# Use -L to get information about the target of a symlink,
# not the link itself, as pointed out in the comments
INFO=( $(stat -L -c "0%a %G %U" "$1") )
PERM=${INFO[0]}
GROUP=${INFO[1]}
OWNER=${INFO[2]}

if (( ($PERM & 0002) != 0 )); then
# Everyone has write access
return 0
elif (( ($PERM & 0020) != 0 )); then
# Some group has write access.
# Is user in that group?
if [[ $GROUP == $WWW_GROUP ]]; then
return 0
fi
elif (( ($PERM & 0200) != 0 )); then
# The owner has write access.
# Does the user own the file?
[[ $WWW_USER == $OWNER ]] && return 0
fi

return 1
}
if ! mountpoint -q -- "$MW_VOLUME"; then
echo "Folder $MW_VOLUME contains important data and must be mounted to persistent storage!"
if ! isTrue "$MW_ALLOW_UNMOUNTED_VOLUME"; then
exit 1
fi
echo "You allowed to continue because MW_ALLOW_UNMOUNTED_VOLUME is set as true"
fi

# Symlink all extensions and skins (both bundled and user)
/create-symlinks.sh
Expand All @@ -63,8 +45,10 @@ rsync -ah --inplace --ignore-existing --remove-source-files \
-og --chown=$WWW_GROUP:$WWW_USER --chmod=Fg=rw,Dg=rwx \
"$MW_ORIGIN_FILES"/ "$MW_VOLUME"/

# We don't need it anymore
rm -rf "$MW_ORIGIN_FILES"
# Create needed directories
#TODO check below command need
mkdir -p "$MW_VOLUME"/extensions/SemanticMediaWiki/config
mkdir -p "$MW_VOLUME"/l10n_cache

/update-docker-gateway.sh

Expand Down

0 comments on commit 5340a22

Please sign in to comment.