Page MenuHomePhabricator

Migrate cdrbot from Toolforge GridEngine to Toolforge Kubernetes
Closed, ResolvedPublic

Description

Kindly migrate your tool(https://grid-deprecation.toolforge.org/t/cdrbot) 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!

I cleared my job list, i ran the script, it worked. Then inserted it to the job list (toolforge jobs run myjob --command ./ckbCAB.sh --image bullseye), it doesn't performed, its error file shows (Permission denied).

The Bash file runs pywikibot scripts. The tool has TOOL_DISABLED file in root directory.

What can I do to solve this problem?

Umm, have you disabled the tool by any chance in toolsadmin?

https://wikitech.wikimedia.org/wiki/Help:Toolforge/Tool_Accounts#Delete_a_tool_account

I didn't disable it from toolsadmin, it disabled automatically cause it worked on GridEngine. Webservice is Kubernetes, but job command say Permission denied.

How to do it enable?

Hi @Kizule.
I'm working to migrate to Kubernetes, I performed this command in my tool, it worked.

tools.cdrbot@tools-sgebastion-10:~$ pyvenv/bin/python stars-test.py
Template File readed
1st Contents Updated!
2nd Contents Updated!
File Writed!17815

When I ran this command in toolforge jobs, it failed.

tools.cdrbot@tools-sgebastion-10:~$ toolforge jobs run mytool --command "pyvenv/bin/python stars-test.py" --image bullseye --wait
ERROR: job 'mytool' failed:

Its error log said /bin/sh: 1: pyvenv/bin/python: not found. How can I solve it?

Its error log said /bin/sh: 1: pyvenv/bin/python: not found. How can I solve it?

Hi, please see https://wikitech.wikimedia.org/wiki/News/Toolforge_Grid_Engine_deprecation#venv.

Its error log said /bin/sh: 1: pyvenv/bin/python: not found. How can I solve it?

Hi, please see https://wikitech.wikimedia.org/wiki/News/Toolforge_Grid_Engine_deprecation#venv.

@taavi, I installed a new Virtual Environment (pyvenv) yesterday, it ran with pyvenv successfully. In toolforge jobs it occurs error. pyvenv/bin/python is available.

tools.cdrbot@tools-sgebastion-10:~$ ls -l pyvenv/bin/python
lrwxrwxrwx 1 tools.cdrbot tools.cdrbot 7 Dec 25 12:47 pyvenv/bin/python -> python3

You also need to run the jobs using the same python3.X image that was used to create the venv. --image bullseye definitely won't work.

You also need to run the jobs using the same python3.X image that was used to create the venv. --image bullseye definitely won't work.

Thanks @taavi. My pyvenv is Python 3.7.3. It worked with --image python3.7. My Tasks is performed by a Bash Shell Scripting, which have two actions.
The First Action is performed individually with that image. The Second Action is performed through pywikibot script (pagefromefile), I used shared script (/data/project/shared/pywikibot/stable/scripts/pagefromfile.py).

When I run the shell script with --image python3.7, the 1st part was worked, the last part occurs error.

#!/bin/bash
${PWD}/pyvenv/bin/python3 $HOME/stars-test.py
${PWD}/pyvenv/bin/python3 /data/project/shared/pywikibot/stable/scripts/pagefromfile.py -file:ckbStatsUpdated.txt -notitle -begin:CABs -end:CABe -force -summary:"Updated by Bot"<< EOF
y
y
EOF

Using the shared pywikibot scripts is not supported in k8s. See Help:Toolforge/Running Pywikibot scripts and Help:Toolforge/Running Pywikibot scripts (advanced) for the supported methods.

Muhammed4IT changed the task status from Open to In Progress.Dec 25 2023, 6:03 PM

Using the shared pywikibot scripts is not supported in k8s. See Help:Toolforge/Running Pywikibot scripts and Help:Toolforge/Running Pywikibot scripts (advanced) for the supported methods.

Thanks @JJMC89 for your reply that solved the problem. They immediately worked. I scheduled for them.

@Muhammed4IT if this issue resolved, mark this ticket as 'resolved'.

@Muhammed4IT if this issue resolved, mark this ticket as 'resolved'.

@komla, I schedule jobs with python3.7, which is deprecated, I built pyvenv on this example (bootsrap_venv.sh), How to build a venv with Python3.11?

@Muhammed4IT if this issue resolved, mark this ticket as 'resolved'.

@komla, I schedule jobs with python3.7, which is deprecated, I built pyvenv on this example (bootsrap_venv.sh), How to build a venv with Python3.11?

By using --image python3.11 when running the bootstrap_venv.sh script. There are example commands directly below the script on the page you linked.

Thanks for your helps, the migration was successfully done.