Page MenuHomePhabricator

Migrate pywikibot from Toolforge GridEngine to Toolforge Kubernetes
Closed, ResolvedPublic

Description

Kindly migrate your tool(https://grid-deprecation.toolforge.org/t/pywikibot) from Toolforge GridEngine to Toolforge Kubernetes.

Toolforge GridEngine is getting deprecated.
See: https://techblog.wikimedia.org/2022/03/14/toolforge-and-grid-engine/

Please note that a volunteer may perform this migration if this has not been done after some time.
If you have already migrated this tool, kindly mark this as resolved.

If you would rather shut down this tool, kindly do so and mark this as resolved.

Useful Resources:
Migrating Jobs from GridEngine to Kubernetes
https://wikitech.wikimedia.org/wiki/Help:Toolforge/Jobs_framework#Grid_Engine_migration
Migrating Web Services from GridEngine to Kubernetes
https://wikitech.wikimedia.org/wiki/News/Toolforge_Stretch_deprecation#Move_a_grid_engine_webservice
Python
https://wikitech.wikimedia.org/wiki/News/Toolforge_Stretch_deprecation#Rebuild_virtualenv_for_python_users

Event Timeline

My apologies if this ticket comes as a surprise to you. In order to ensure WMCS can provide a stable, secure and supported platform, it’s important we migrate away from GridEngine. I want to assure you that while it is WMCS’s intention to shutdown GridEngine as outlined in the blog post https://techblog.wikimedia.org/2022/03/14/toolforge-and-grid-engine/, a shutdown date for GridEngine has not yet been set. The goal of the migration is to migrate as many tools as possible onto kubernetes and ensure as smooth a transition as possible for everyone. Once the majority of tools have migrated, discussion on a shutdown date is more appropriate. See T314664: [infra] Decommission the Grid Engine infrastructure.

As noted in https://techblog.wikimedia.org/2022/03/16/toolforge-gridengine-debian-10-buster-migration/ some use cases are already supported by kubernetes and should be migrated. If your tool can migrate, please do plan a migration. Reach out if you need help or find you are blocked by missing features. Most of all, WMCS is here to support you.

However, it’s possible your tool needs a mixed runtime environment or some other features that aren't yet present in https://techblog.wikimedia.org/2022/03/18/toolforge-jobs-framework/. We’d love to hear of this or any other blocking issues so we can work with you once a migration path is ready. Thanks for your hard work as volunteers and help in this migration!

@Dvorapa: Is this assignment intentionally?

Multichill added a subscriber: Dvorapa.

@Dvorapa: Is this assignment intentionally?

As mentioned in T314664: I object to some of these subtasks being assigned to me as this is against https://www.mediawiki.org/wiki/Bug_management/Phabricator_etiquette : "Only manually assign a task to someone if they have given their prior agreement. It is up to developers (or their product managers) what they plan to work on." I asked in the Cloud Telegram channel @komla to unassign all these tasks.

That was just before the weekend so I guess @komla hasn't done something yet.

Thanks @Multichill. Anyway, I check periodically every 3-6 months if the transition is possible, but there are still some issues with K8s and it waits for them to be resolved.

If I remember correctly, last time I tried there was git not working properly in K8s, which is a blocker for both Pywikibot and DvorapaBot

Last time in May 7th. Result:

toolforge-bullseye-standalone based pod
line 6: git: command not found

toolforge-bullseye-sssd based pod
line 6: git: error: cannot run ssh: No such file or directory
line 6: git: fatal: unable to fork

Also there is gzip missing (Pywikibot needs that as well)

@Dvorapa pywikibot should work. have you given it another try?

This is a reminder that the tool for which this ticket is created is still running on the Grid.
The grid is deprecated and all remaining tools need to migrate to Toolforge Kubernetes.

We've sent several emails to maintainers as we continue to make the move away from the Grid.
Many of the issues that have held users back from moving away from the Grid have been addressed in
the latest updates to Build Service. See: https://wikitech.wikimedia.org/wiki/Portal:Toolforge/Changelog

You might find the following resources helpful in migrating your tool:

  1. https://wikitech.wikimedia.org/wiki/Help:Toolforge/Build_Service#Migrating_an_existing_tool
  2. https://wikitech.wikimedia.org/wiki/Help:Toolforge/Build_Service#Tutorials_for_popular_languages

Don't hesitate to reach out to us using this ticket or via any of our support channels

If you have already migrated this tool, kindly mark this ticket as 'resolved'
To do this, click on the 'Add Action' dropdown above the comment text box, select 'Change Status', then 'Resolved'.
Click 'Submit'

Thank you!

@komla: I have no glue, what to do here.

@komla: I have no glue, what to do here.

@Xqt pywikibot is listed as running on the grid. Is this in error or that job has a confusing name?
We are trying to move all jobs to k8s.

Let me know if this clarifies it.

The nightly cronjobs need to be migrated from Grid Engine to the jobs framework.

The nightly cronjobs need to be migrated from Grid Engine to the jobs framework.

$ sudo become pywikibot
$ crontab -l | grep -Ev '^#'
PATH=/usr/local/bin:/usr/bin:/bin
01      23,11   *       *       *       jsub -release buster -once -mem 1g -N pre_nightly /data/project/pywikibot/pre_nightly > /dev/null
01      01,12   *       *       *       jsub -release buster -once -mem 1g -N nightly /data/project/pywikibot/nightly-source/nightly > /dev/null

These both seem to be shell scripts which do git operations on checkouts in /data/project/pywikibot.

Yeah, I looked at it (and several others did too), I don't know any docker image that would have git installed. Is jlocal getting shut down too? If not, we can do the update via jlocal and zipping it via docker? If none of them work, we could potentially make a tiny cloud VPS project?

I don't know any docker image that would have git installed.

Don't all of the Toolforge images have git?

[00:26:32]tools.jjmc89-bot-dev@tools-sgebastion-11:~$ webservice python3.11 shell
WARNING: No explict backend provided.
  Using default of 'kubernetes'
  For help refer to <https://wikitech.wikimedia.org/wiki/Help:Toolforge/Web>
[00:27:24]tools.jjmc89-bot-dev@shell-1703032033:~$ which git
/usr/bin/git
[00:27:27]tools.jjmc89-bot-dev@shell-1703032033:~$
logout
[00:29:23]tools.jjmc89-bot-dev@tools-sgebastion-11:~$ toolforge jobs run git-test --command "which git" --wait --image bullseye
INFO: job 'git-test' completed
[00:30:13]tools.jjmc89-bot-dev@tools-sgebastion-11:~$ cat git-test.*
/usr/bin/git

Is jlocal getting shut down too?

Everything for the grid is being removed - jsub/jstart/jlocal/crontab.

Maybe it has changed recently but I got the exact same thing when I tried it: T319981#8372518

After removing the python2 bits and adding a venv, I get to the point of zipping before the script fails with zip: command not found. No issues with git.

After removing the python2 bits and adding a venv, I get to the point of zipping before the script fails with zip: command not found. No issues with git.

Adding zip to the base images so it is available everywhere actually seems reasonable. I created T353769: Add zip to Kubernetes base images and will check with folks to see if they have any objections.

My version of the script is working now.

[17:16:43]tools.jjmc89-bot-dev@tools-sgebastion-11:~$ cat pre_nightly
rm -rf nightly-source
git clone https://github.com/JJMC89/pywikibot-nightly-creator nightly-source
git -C nightly-source checkout venv
chmod -R 755 nightly-source
[17:16:50]tools.jjmc89-bot-dev@tools-sgebastion-11:~$ toolforge jobs run pwb-pre-nightly --wait --image bullseye --command "bash $HOME/pre_nightly"
INFO: job 'pwb-pre-nightly' completed
[17:17:06]tools.jjmc89-bot-dev@tools-sgebastion-11:~$ cat pwb-pre-nightly.*
Cloning into 'nightly-source'...
Switched to a new branch 'venv'
Branch 'venv' set up to track remote branch 'venv' from 'origin'.
[17:17:11]tools.jjmc89-bot-dev@tools-sgebastion-11:~$ toolforge jobs run pwb-nightly --wait --image python3.11 --command "bash $HOME/nightly-source/nightly"
INFO: job 'pwb-nightly' completed

Unfortunately, the script has not been released under an OSI-approved license (as required by the TOU).

Unfortunately, the script has not been released under an OSI-approved license (as required by the TOU).

I would say that Pywikibot-nightly-creator as well as the https://pywikibot.toolforge.org/ tool is part of the pywikibot framework which is published under the MIT licence: https://doc.wikimedia.org/pywikibot/master/licenses.html.

Dvorapa claimed this task.

Simplified a bit (not using venv branch, rather creating venv from scratch every time) and deployed