ORES/Prepare deployment

From Wikitech

Push LFS data to gerrit

There's a known issue with LFS data not being mirrored via phabricator's diffusion to gerrit (Phab:T212818). So we need to manually do that ourselves for the time being.

Using a local version of the repository with a github.com origin, you need to pull down all the LFS content and then push it to gerrit directly.

Add a `gerrit` remote to your github.com clone

For example, for the editquality repo, we have the following lines in ./.git/config.

[remote "origin"]
        url = https://github.com/wikimedia/editquality
        fetch = +refs/heads/*:refs/remotes/origin/*
[remote "gerrit"]
        url = https://gerrit.wikimedia.org/r/scoring/ores/editquality
        fetch = +refs/heads/*:refs/remotes/gerrit/*

Pull and push LFS data

For each repository where changes were made in LFS and the repos main origin is on github, you'll need to pull and push LFS data.

$ git lfs fetch --all
$ git lfs push gerrit master

Update the deploy repository

  1. Update all of the submodules
    • In the deploy repo, cd submodules/<submodule> and run git pull origin master
  2. If necessary, make any updates to requirements.txt in the deploy repo
  3. If necessary, make any changes to config/00-main.yaml -- e.g. add new models
  4. Update frozen-requirements.txt
    1. In the deploy repo, run make -- this will re-generate the complete set of dependencies for running ORES
    2. Review frozen-requirements.txt with git diff frozen-requirements.txt to see if any strange new packages appeared or any package was downgraded.
      • Note that sometimes, strange versions appear when requirements.txt was not updated or the submodules have requirements.txt that disagree on versions. Double-check each of those requirements.txt files if you see anything weird.

Update wheels

  1. Copy the new wheels to the wheels repo
    • From a clone of the `wheels` repo, run cp ../deploy/wheels/*.whl .
  2. Update the wheels repo
    • run `git status`
      • for modified files, we're going to just re-check them out git checkout <filename>
      • for "untracked" files, we're going to remove the old version of the same package and add the new one
        • `git rm <old-file> && git add <new-file>` -- e.g., `git rm revscoring-2.5.2-py2.py3-none-any.whl && git add revscoring-2.6.1-py2.py3-none-any.whl`
      • if no old version exists, this is a new dependency so you can just `git add <new-file>`
  3. Submit a new patchset with git review -R

After the change to wheels is merged: Submit the deploy repo changes for review

  1. Update the wheels submodule
    • From the clone of the deploy repo, cd submodules/wheels and run git pull origin master
    • Then cd ../..
    • And git commit
  2. Submit a new patchset
    • From the clone of the deploy repo, run git review -R