nils-braun / b2luigi

Task scheduling and batch running for basf2 jobs made simple
GNU General Public License v3.0
17 stars 11 forks source link

New path for setting up environment since gbasf2 release 5.8.2 #206

Closed miverone closed 1 year ago

miverone commented 1 year ago

@meliache since release 5.8.2 the path to set up the environment on kekcc has changed from:

/cvmfs/belle.kek.jp/grid/gbasf2/pro/setup.sh

to:

/cvmfs/belle.kek.jp/grid/gbasf2/pro/bashrc

So it leads to the following error:

FileNotFoundError: [Errno 2] No such file or directory: '/cvmfs/belle.kek.jp/grid/gbasf2/pro/setup.sh'

0ctagon commented 1 year ago

I also have the error. I tried to replace every instance of the old setup path with the new setup path but it doesn't fix the problem. This is the log after the worker is shut down:

INFO: Worker Worker(salt=8402490694, workers=1, host=cc.kek.jp, username=a, pid=255855) was stopped. Shutting down Keep-Alive thread
Traceback (most recent call last):
  File "b2luigi_gridSubmitDL.py", line 128, in <module>
    main()
  File "b2luigi_gridSubmitDL.py", line 117, in main
    b2luigi.process(
  File "/home/belle2/.local/lib/python3.8/site-packages/b2luigi/cli/process.py", line 113, in process
    runner.run_local(task_list, cli_args, kwargs)
  File "/home/belle2/.local/lib/python3.8/site-packages/b2luigi/cli/runner.py", line 46, in run_local
    run_luigi(task_list, cli_args, kwargs)
  File "/home/belle2/.local/lib/python3.8/site-packages/b2luigi/cli/runner.py", line 62, in run_luigi
    luigi.build(task_list, **kwargs)
  File "/home/belle2/.local/lib/python3.8/site-packages/luigi/interface.py", line 239, in build
    luigi_run_result = _schedule_and_run(tasks, worker_scheduler_factory, override_defaults=env_params)
  File "/home/belle2/.local/lib/python3.8/site-packages/luigi/interface.py", line 173, in _schedule_and_run
    success &= worker.run()
  File "/home/belle2/.local/lib/python3.8/site-packages/luigi/worker.py", line 650, in __exit__
    if task.is_alive():
  File "/home/belle2/.local/lib/python3.8/site-packages/b2luigi/batch/processes/__init__.py", line 135, in is_alive
    job_status = self.get_job_status()
  File "/home/belle2/.local/lib/python3.8/site-packages/b2luigi/batch/processes/gbasf2.py", line 319, in get_job_status
    job_status_dict = get_gbasf2_project_job_status_dict(
  File "/home/belle2/.local/lib/python3.8/site-packages/decorator.py", line 232, in fun
    return caller(func, *(extras + args), **kw)
  File "/home/belle2/.local/lib/python3.8/site-packages/retry/api.py", line 90, in retry_decorator
    return __retry_internal(partial(f, *args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter,
  File "/home/belle2/.local/lib/python3.8/site-packages/retry/api.py", line 35, in __retry_internal
    return f()
  File "/home/belle2/.local/lib/python3.8/site-packages/b2luigi/batch/processes/gbasf2.py", line 1107, in get_gbasf2_project_job_status_dict
    return json.loads(job_status_json_string)
  File "/cvmfs/belle.cern.ch/el7/externals/v01-12-01/Linux_x86_64/common/lib/python3.8/json/__init__.py", line 357, in loads
    return _default_decoder.decode(s)
  File "/cvmfs/belle.cern.ch/el7/externals/v01-12-01/Linux_x86_64/common/lib/python3.8/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/cvmfs/belle.cern.ch/el7/externals/v01-12-01/Linux_x86_64/common/lib/python3.8/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
meliache commented 1 year ago

In b2luigi v0.10.1 (PR #162)I introduced the b2luigi_setup_path setting to customize the path to the setupfile, so you can fix your jobs without waiting for upstream changes. And therefore this is also not a bug from my point of view.

I don't have access to resources to test gbasf2 jobs anymore, but would be happy about a PR to fix the default (or will fix it when I come around to it). Also we could extend the FileNotFoundError message to inform users of the setting.

0ctagon commented 1 year ago

Unfortunately, changing the path with b2luigi_setup_path doesn't fix the problem.

meliache commented 1 year ago

@0ctagon

I tried to replace every instance of the old setup path with the new setup path but it doesn't fix the problem.

You mean you changed the gbasf2_setup_path setting? That shound only be necessary once in the settings.json or via b2luigi.set_setting, not sure what you mean by "every instance"?

I also have the error.

So the same FileNotFoundError? From the log message this seems like it could be a separate issue with the new release. Maybe the new setup file does something differently? This might warant being a separate issue.

0ctagon commented 1 year ago

@meliache Sorry I was not really clear, let me clarify:

You mean you changed the gbasf2_setup_path setting? That shound only be necessary once in the settings.json or via b2luigi.set_setting, not sure what you mean by "every instance"?

Since /cvmfs/belle.kek.jp/grid/gbasf2/pro/setup.sh doesn't exist anymore (error from @miverone), I replaced every instance of it in b2luigi/batch/processes/gbasf2.py in my b2luigi package folder with the new path /cvmfs/belle.kek.jp/grid/gbasf2/pro/bashrc (which is equivalent of changing gbasf2_setup_path). Doing this lead to the log message of my first comment.

meliache commented 1 year ago

The default setup path is fixed in PR #207. @0ctagon @miverone can you please test the PR to check if it gets rid of the FileNotFoundError at least? That's an easy fix and we can merge that fast and close this issue.

For the other issue that @0ctagon reports about the None value of the job status JSON I created the separate issue #208. If this error is true, that might be more complex to fix and I can't do that alone without having access to gbasf2 anymore. However in that issue I gave some hints how to debug it and where I think the bug might be located, from what I saw in the backtrace.

miverone commented 1 year ago

@meliache it does get rid of the FileNotFoundError but it now gives the json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

meliache commented 1 year ago

@miverone

@meliache it does get rid of the FileNotFoundError but it now gives the json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

That's issue #208, solved by #209.