Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Krinkle/mw-tool-snapshots

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Build Status

Snapshots

Install

  • Copy sample-config.php and rename to config.php
  • Edit config.php and change the directory paths if needed (and ensure they exist). Keep in mind that the PHP script needs to be able to read, write, and remove files from these directories. In the case of cacheDir, it also needs to be able to create subdirectories.
  • Make sure the path of mediawikiCoreRepoDir points to a mediawiki core checkout:
    git clone https://gerrit.wikimedia.org/r/p/mediawiki/core.git mediawiki-core
  • Run:
    php scripts/updateSnaphots.php
  • Symlink {cacheDir}/snapshots to ./public_html/builds
  • Schedule updateSnaphots.php to run hourly
    0 * * * * php /path/to/mw-tool-snapshots/scripts/updateSnaphots.php > {logsDir}/updateSnaphots.log 2>&1
  • Symlink ./public_html to be, or inside of, /path/to/your/public_html

Git memory

The updateSnaphots.php uses Git for many of its tasks. By default, Git will periodically run git-gc as part of an otherwise unrelated Git command. This sub process can take up a substantial amount of memory, and if you run the update script in an environment with limited memory, it may end up crashing as a result.

Further reading:

In short:

  • Set pack.threads = 1 to restrict git-gc to one git-pack-objects thread.
  • Set pack.windowMemory to 256m (or other value, as needed) to restrict how much memory may be at the same time. Other internal values are dynamically derived from this.

To set these configurations for the the mediawikiCoreRepoDir directory only, use:

cd ~/src/snapshots/remotes/mediawiki/
git config --local --add pack.threads 1
git config --local --add pack.windowMemory 256m
# Confirm
git config --local -l

Or, without changing directories:

GIT_DIR=~/src/snapshots/remotes/mediawiki/.git git config --local --add pack.threads 1
GIT_DIR=~/src/snapshots/remotes/mediawiki/.git git config --local --add pack.windowMemory 256m
# Confirm
GIT_DIR=~/src/snapshots/remotes/mediawiki/.git git config --local -l