Page MenuHomePhabricator

setup-tomcat does not work
Closed, ResolvedPublic

Description

https://wikitech.wikimedia.org/wiki/Help:Tool_Labs/Web#Java_.28Tomcat.29 says that you can enter setup-tomcat and it'll do some magic, but the spell does not work:

tools.basebot@tools-bastion-02:~$ setup-tomcat
-bash: setup-tomcat: command not found

Event Timeline

Base raised the priority of this task from to Needs Triage.
Base updated the task description. (Show Details)
Base added a project: Toolforge.
Base subscribed.
Restricted Application added subscribers: StudiesWorld, Aklapper. · View Herald Transcript
Base set Security to None.
chasemp subscribed.
Shoichi raised the priority of this task from Low to High.Feb 22 2016, 8:30 AM
Shoichi subscribed.

I need it to launch my java servlet for runing our plan.

@coren, do you have a backup of setup-tomcat or a rough outline what it did?

It's still here: https://github.com/wikimedia/labs-toollabs/blob/master/misctools/setup-tomcat, but somehow it isn't included in Makefile.am, nor there's a manpage for it.

Change 272699 had a related patch set uploaded (by Zhuyifei1999):
misctools: add setup-tomcat to Makefile.am

https://gerrit.wikimedia.org/r/272699

@Base, @Shoichi: I have manually installed setup-tomcat on all instances, so running it should work now.

@zhuyifei1999: Thanks for the patch! There's a minor problem with it which I will explain on Gerrit, but the bigger blocker is that at the moment, the package cannot be deployed due to some name collision. I'll file separate tasks for that and will subscribe you to those.

@scfc
Thank you . I tested.

setup-tomcat

Indeed appears,but setup-tomcat won't build ~/public_tomcat/ as what manual says.

@scfc

Sorry I am wrong, setup-tomcat give me the replying:

Setting up your public_tomcat directory...
Unable to run job: Job was rejected because job requests unknown queue "webgrid-tomcat".
Exiting.
All done.
You can edit the configuration in /data/project/idsgen/public_tomcat/conf/server.xml as needed.

Apparently at least tools-webgrid-generic-1401 has tomcat7-instance-create:

11:02:37 0 ✓ zhuyifei1999@tools-webgrid-generic-1401: ~$ which tomcat7-instance-create
/usr/bin/tomcat7-instance-create

I'll amend the patch to use the webgrid-generic queue.

@scfc Any progress on the code review? And what about the name collision?

@zhuyifei1999: Sorry for the delay. Regarding the name collision, I thought that it was already a problem, but it turned out that that would only happen when a change of mine is merged, so this is not a blocker at the moment.

I built a package with your patch, and it worked great, but when I run the new setup-tomcat on tools-login, it is hanging because it tries to execute a job on the grid that requires resources that are not available?

tools.templatecheck@tools-webgrid-lighttpd-1414:~$ qstat -j 3918985
==============================================================
job_number:                 3918985
exec_file:                  job_scripts/3918985
submission_time:            Mon Feb 29 13:11:21 2016
owner:                      tools.templatecheck
uid:                        51199
group:                      tools.templatecheck
gid:                        51199
sge_o_home:                 /data/project/templatecheck
sge_o_log_name:             tools.templatecheck
sge_o_path:                 /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
sge_o_shell:                /bin/bash
sge_o_workdir:              /data/project/templatecheck
sge_o_host:                 tools-bastion-05
account:                    sge
stderr_path_list:           NONE:NONE:/dev/null
hard resource_list:         release=precise,h_vmem=512m
mail_list:                  tools.templatecheck@tools-bastion-05.tools.eqiad.wmflabs
notify:                     FALSE
job_name:                   setup-templatecheck
stdout_path_list:           NONE:NONE:/dev/null
stdin_path_list:            NONE:NONE:/dev/null
jobshare:                   0
hard_queue_list:            webgrid-generic
env_list:                   
job_args:                   public_tomcat
script_file:                tomcat7-instance-create
scheduling info:            queue instance "continuous@tools-exec-1205.eqiad.wmflabs" dropped because it is overloaded: np_load_avg=3.447500 (= 3.447500 + 0.50 * 0.000000 with nproc=4) >= 1.75
                            queue instance "mailq@tools-exec-1205.eqiad.wmflabs" dropped because it is overloaded: np_load_avg=3.447500 (= 3.447500 + 0.50 * 0.000000 with nproc=4) >= 2.25
                            queue instance "task@tools-exec-1205.eqiad.wmflabs" dropped because it is overloaded: np_load_avg=3.447500 (= 3.447500 + 0.50 * 0.000000 with nproc=4) >= 1.75
                            (-l h_vmem=512m,release=precise) cannot run at host "tools-webgrid-generic-1401.eqiad.wmflabs" because it offers only hf:release=trusty
                            cannot run in queue "webgrid-lighttpd" because it is not contained in its hard queue list (-q)
                            (-l h_vmem=512m,release=precise) cannot run at host "tools-webgrid-generic-1403.eqiad.wmflabs" because it offers only hf:release=trusty
                            cannot run in queue "giftbot" because it is not contained in its hard queue list (-q)
                            (-l h_vmem=512m,release=precise) cannot run at host "tools-webgrid-generic-1405.tools.eqiad.wmflabs" because it offers only hf:release=trusty
                            (-l h_vmem=512m,release=precise) cannot run at host "tools-webgrid-generic-1404.tools.eqiad.wmflabs" because it offers only hf:release=trusty
                            cannot run in queue "mailq" because it is not contained in its hard queue list (-q)
                            cannot run in queue "task" because it is not contained in its hard queue list (-q)
                            cannot run in queue "continuous" because it is not contained in its hard queue list (-q)
                            (-l h_vmem=512m,release=precise) cannot run at host "tools-webgrid-generic-1402.eqiad.wmflabs" because it offers only hf:release=trusty
                            cannot run in queue "cyberbot" because it is not contained in its hard queue list (-q)
tools.templatecheck@tools-webgrid-lighttpd-1414:~$

Let me find out why.

(I don't get why:

/usr/bin/qsub -sync y -o /dev/null -e /dev/null -i /dev/null -q "webgrid-generic" -l h_vmem=512m -b y -N "setup-$tool" tomcat7-instance-create public_tomcat >/dev/null

triggers -l h_vmem=512m,release=precise; qconf -sc says DEFAULT = NONE.)

I'll try adding an -l release=trusty.

Adding -l release=trusty worked (I did not check whether that actually produces a working Tomcat server). I'll amend your patch, @zhuyifei1999, make new packages and deploy them.

Change 272699 merged by Tim Landscheidt:
setup-tomcat: Add to install list & Change queue

https://gerrit.wikimedia.org/r/272699

scfc assigned this task to zhuyifei1999.

Thanks. I was asking because a mail in Wikitech-I was giving me pressure :)

I got the ~/public_tomcat/. It works. Thank you all very much!

Hi @zhuyifei1999,

Sorry if I make you feel pressured, this really helps us to move forward. The volunteer engineering team has been working on this for about a year, and it is a crucial moment for us to connect the database into wikimedia projects. So your effort on this is really important! Thank you thank you and thank you!

:D