Page MenuHomePhabricator

Add maintainers to quarry
Closed, ResolvedPublic

Description

Add maintainers and leave ticket open to assist in ramp up.

Event Timeline

Added

root@cloudcontrol1005:~# openstack role add --project quarry --user sd member
root@cloudcontrol1005:~# openstack role add --project quarry --user sd reader
root@cloudcontrol1005:~# openstack role add --project quarry --user tmoney reader
root@cloudcontrol1005:~# openstack role add --project quarry --user tmoney member

I assume we need some kind of access to the Github repo too? https://github.com/toolforge/quarry

I assume we need some kind of access to the Github repo too? https://github.com/toolforge/quarry

Oh that would be helpful, wouldn't it :)
What are yinz github accounts?

My github id is siddharthvp. Also, how do we login to the instances where quarry runs? Doesn't seem to be documented on wikitech.

My github id is siddharthvp. Also, how do we login to the instances where quarry runs? Doesn't seem to be documented on wikitech.

I've sent a github invite for 'read' could you verify that I got the right github account here and I'll bump it up to admin.

You can get in with ssh, you'll need to setup a key in wikitech if you don't have it, and set your ssh config to go through the bastion for the cloud vps instances. There are instructions
https://wikitech.wikimedia.org/wiki/Help:Accessing_Cloud_VPS_instances#Accessing_Cloud_VPS_instances

After which you should be able to get in via ssh with:

ssh <hostname>.<project name>.eqiad1.wikimedia.cloud

Such as:

ssh quarry-web-02.quarry.eqiad1.wikimedia.cloud

To deploy hosts, or find their hostnames that is usually done through horizon (https://horizon.wikimedia.org/ ...admittedly it appears down at the moment). Can also be done through the openstack command line, though horizon is really the nicer way. Though you can also find hostnames and maintainer information at https://openstack-browser.toolforge.org/project/quarry

I'm audiodude on github. Thanks!

I'm audiodude on github. Thanks!

Added. Similarly please confirm here that I added the right person and I'll up the permission.

Confirming that I got the invite. (And am able to login to the instances now.) Thanks.

Confirmed: I got the github invite. I can also access the instances with my wikitech account, thanks!

Awesome, Ok I think everyone is all connected. Let me know if I missed anything, feel free to poke me with any questions.

@rook Is there any staging/beta/QA environment as well for quarry? Never mind, got it: https://quarry-dev.wmflabs.org/

@rook Is there any staging/beta/QA environment as well for quarry?

A local dev environment can be setup as described in the README under "Setting up a local dev environment"

As for a staging env there is not one. It would be possible to set one up in a different project, but it would be easier to deploy parallel systems in the existing project. This is how OS upgrades usually would happen, the new systems would be deployed in parallel with the existing systems, then tested (Better testing could be had by making an additional oauth key for "test-quarry.wmcloud.org" or the like such that a web proxy could be pointed to the new systems while leaving the existing serving traffic).

@rook Is there any staging/beta/QA environment as well for quarry? Never mind, got it: https://quarry-dev.wmflabs.org/

Oh yeah, quarry-dev. It's not the best representation of quarry, as it wasn't the web/worker group. So it was kind of weird. But it does have the oauth token already in /srv/quarry/quarry/config.yaml so that can be transferred about as needed.

FWIW I set up the dev environment without any issue and was able to run queries against mywiki.

@rook is it possible to query replicas on toolforge from the dev environment if I use an SSH tunnel and change my config?

FWIW I set up the dev environment without any issue and was able to run queries against mywiki.

@rook is it possible to query replicas on toolforge from the dev environment if I use an SSH tunnel and change my config?

Maybe? I believe the primary limitation is networking, so the ssh tunnel might overcome that? Though I've never tried that.

The networking limitation is overcome with an ssh tunnel. However, the code in replica.py to create the replica host URL is rather weird:

repl_host = (
    f"{self.database_name}.{self.config['REPLICA_DOMAIN']}"
    if self.config["REPLICA_DOMAIN"]
    else self.database_name
)

It ignores the REPLICA_HOST config entirely, but works out correctly for prod (<dbname>.analytics.db.svc.wikimedia.cloud) and local (mywiki).

But to query toolforge replicas from local we need the host to be localhost (for linux) or host.docker.internal (for Mac/Windows), which is not supported by the above code.

Shouldn't REPLICA_DOMAIN be set to analytics.db.svc.wikimedia.cloud for this to work? I haven't tried it myself yet. Then you would get enwiki.analytics.db.svc.wikimedia.cloud which would be correct right?

Edit: sorry, yes what I suggested works in production but not if the host needs to be localhost.

@rook Are there any docs on how to do deployments once a GitHub PR gets merged?

Looking at that wiki page I linked, it seems at least somewhat out of date. I'd like to work on upgrading Python to at least 3.11, since 3.7 is EOL since June of 2023. Of course this might require upgrading dependencies as well. I see that @Framawiki has some quarry-dev-* instances with a puppet "skip" note of:

Notice: Skipping run of Puppet configuration client; administratively disabled (Reason: 'framawiki: testing python 3.11');

Anyways, it seems to me like Quarry runs in horizon on a few compute instances, a Trove instance for the application database, and a Redis server for Celery that I'm not sure where it lives. It's unclear if the services are launched/managed/restarted by Puppet or systemd or some combination of both (I'm not too familiar with Puppet).

Would it be possible for someone to jump on a call with @SD0001 and myself to discuss the production architecture? I know it might be a touchy subject, something that's been the subject of debate for updating/modernizing. I think we need to have some concept of the "state of the world" before we can properly address any existing or future issues.

At the very least, we should understand and document the basic procedures for deploying new versions.

Thanks!

@rook Are there any docs on how to do deployments once a GitHub PR gets merged?

The document you found describes the process. https://wikitech.wikimedia.org/wiki/Portal:Data_Services/Admin/Quarry#Deployment in particular. Let me look through that and see if there is anything obviously misleading. Ok, I've cleaned that up a little bit. Basically you would log into the system associated with the change, usually a web system, occasionally the worker systems (I guess it could be possible with the redis system, but I've never actually needed too). I pull down the branch to the /srv/quarry dir, and then run:
systemctl restart uwsgi-quarry-web.service
for web services, and:
systemctl restart celery-quarry-worker.service
for worker services. Then when I'm content that it is working I'll merge it. You can check the main branch back out or not at that point they should be the same.

Looking at that wiki page I linked, it seems at least somewhat out of date.

Should be a little better now, though not in the "Admin Operations" section, I didn't look at that too much.

I'd like to work on upgrading Python to at least 3.11, since 3.7 is EOL since June of 2023.

This would be an excellent thing to do.

Anyways, it seems to me like Quarry runs in horizon on a few compute instances, a Trove instance for the application database, and a Redis server for Celery that I'm not sure where it lives. It's unclear if the services are launched/managed/restarted by Puppet or systemd or some combination of both (I'm not too familiar with Puppet).

You are correct, a lot of the stuff in the project is test stuff. The primary vms are:

quarry-nfs-2.quarry.eqiad1.wikimedia.cloud
quarry-puppet-master-02.quarry.eqiad1.wikimedia.cloud
quarry-redis-01.quarry.eqiad1.wikimedia.cloud
quarry-web-02.quarry.eqiad1.wikimedia.cloud
quarry-worker-03.quarry.eqiad1.wikimedia.cloud
quarry-worker-04.quarry.eqiad1.wikimedia.cloud

And the trove db quarry-db-02

So that's where the redis lives (quarry-redis-01), I've actually not been in there in...years? Doesn't come up too much in day to day maintenance.

Would it be possible for someone to jump on a call with @SD0001 and myself to discuss the production architecture? I know it might be a touchy subject, something that's been the subject of debate for updating/modernizing. I think we need to have some concept of the "state of the world" before we can properly address any existing or future issues.

We could get on a call if liked. Though I'm usually better with ticket/irc kinds of communication. The primary thing that would help modernize quarry from a platform perspective is moving to k8s. T301469 had the initial exploration of that, though I believe @Framawiki was working on that a few months ago, maybe in a different ticket? At any rate that is what the magnum cluster (quarry-123) represents. Moving to k8s would get us away from needing to upgrade/port OS versions. At that point things like python and associated libraries could be upgraded to any version desired, wouldn't be restricted to debian OS versions.

One important file to be aware of is /srv/quarry/quarry/config.yaml on the web and worker nodes it isn't tracked in git. Though should be with git-crypt or the like. Opened T348476 for that.

Thank you for all the information, it is very helpful! We can stick to asynchronous communication if that's what works best, no problem. I guess we can keep using this ticket for Q&A?

Anyways looking at T301469, another thing that confuses me is the use of gerrit. I understand vaguely that this is the Wikimedia preferred hosted git solution. What is it's relationship to the repo on github here: https://github.com/toolforge/quarry? Are they kept in sync somehow? @SD0001 and I have started doing development on github, is that a bad idea?

Ah yes when the k8s investigation ticket was opened the quarry source was hosted in Gerrit. The source has since moved to GitHub and GitHub would be the correct place to do development. I can add some container building logic to GitHub if we start moving to k8s

• rook updated the task description. (Show Details)

Thanks for the details. I had figured out the manual deployment process but had been confused about the role of Puppet – we don't use Puppet at all for this project?

The primary thing that would help modernize quarry from a platform perspective is moving to k8s. T301469 had the initial exploration of that, though I believe @Framawiki was working on that a few months ago, maybe in a different ticket? At any rate that is what the magnum cluster (quarry-123) represents.

How to get inside the k8s cluster? SSH into master node fails (permission denied), and the bastion itself doesn't have kubectl. I see the cluster health shows up as The cluster quarry-123 is not accessible so I assume it's not functional any more?

we don't use Puppet at all for this project?

Puppet is used*
*in the usual confusing puppet ways. The following directories in the puppet repo will do things to quarry:

./modules/profile/files/quarry
./modules/profile/manifests/quarry
./modules/profile/templates/quarry
./modules/quarry
./modules/role/manifests/wmcs/quarry
./modules/role/manifests/labs/quarry
./hieradata/cloud/eqiad1/quarry

Mostly it is for setting up a given VM, doing a git clone, making a venv, installing requirements, then other things based off of the type of system. Things that are not needed if a move to k8s is had (with the exception of NFS). It is also out of date, requesting branches that no longer exist for instance. A move to k8s would make almost all of puppet irrelevant, and I hear rumor that we have object storage which might make the nfs irrelevant as well...Indeed on quarry it is just one volume, it may be possible to attach a volume to a k8s and call it good. In summation, puppet is used a little bit, mostly on initial setup of a server, it's not actually fully functional, I'm team 'move away from puppet'

The primary thing that would help modernize quarry from a platform perspective is moving to k8s. T301469 had the initial exploration of that, though I believe @Framawiki was working on that a few months ago, maybe in a different ticket? At any rate that is what the magnum cluster (quarry-123) represents.

How to get inside the k8s cluster? SSH into master node fails (permission denied), and the bastion itself doesn't have kubectl. I see the cluster health shows up as The cluster quarry-123 is not accessible so I assume it's not functional any more?

I wouldn't trust what horizon has to say about cluster status, it hasn't been quite reliable. The cluster itself probably had a filled log, which we've learned more about: https://wikitech.wikimedia.org/wiki/Portal:Cloud_VPS/Admin/Magnum#Known_issues I've updated it so the logs shouldn't fill the disk again. If you want to get into a node you can with the instructions on that page. Let me open a ticket to make a bastion for quarry where creds, and kubectl can live, and could be used as a deployment point should k8s go live or just to experiment with deploying to k8s. (T348642)

At any rate I did pull down a cred for the existing k8s cluster. It appears to have things deployed in the quarry-test namespace. I'll drop the credential on the quarry-bastion node once it is up.