caracal-pipeline / stimela

Stimela 2.0
GNU General Public License v2.0
5 stars 3 forks source link

add Xvfb launch to runtime #122

Open o-smirnov opened 1 year ago

o-smirnov commented 1 year ago

@landmanbester this is for you. Things like casaplotms want an X11 display even if they don't need one. There may be other tools that sneakily connect to X11, so better to have an Xvfb running in the background at all times to work around this.

o-smirnov commented 1 year ago

Speaking of which, @landmanbester I think I saw a notification on my phone this morning where you reminded me on this, but now I can't find mention in the Kubernauts space. Where/how did you send the message?

landmanbester commented 1 year ago

Just pinged you on the same thread, used your sarao account by mistake

o-smirnov commented 1 year ago

Actually @landmanbester this may be a trivial fix. There's a wrapper called xvfb-run that does the job for us. So just add

casa: xvfb-run -a casa

to your cab definition for casaplotms, and it might be all you need. I pushed a small fix to issue-126 to support this (it needs to split the casa string into multiple arguments for this to work).

landmanbester commented 1 year ago

I am not sure I follow. Do you mean to define a cab like so?

casa.plotms:
    command: plotms
    flavour: casa-task
    casa: xvfb-run -a casa
    inputs:
      _include: casa/plotms.yaml

Or where do I add that bit?

o-smirnov commented 1 year ago

Yep exactly.

Cheers, Oleg

-- Sent from my phone, excuse the brevity.

On Fri, 13 Jan 2023, 10:43 Landman Bester, @.***> wrote:

I am not sure I follow. Do you mean to define a cab like so?

casa.plotms: command: plotms flavour: casa-task casa: xvfb-run -a casa inputs: _include: casa/plotms.yaml

Or where do I add that bit?

— Reply to this email directly, view it on GitHub https://github.com/caracal-pipeline/stimela2/issues/122#issuecomment-1381487107, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABRLTP57OJFNSJMHOYHSQTTWSEIUZANCNFSM6AAAAAATQXI4LQ . You are receiving this because you were assigned.Message ID: @.***>

landmanbester commented 1 year ago

I get the following error if I try that

2023-01-13 15:44:43 STIMELA ERROR: error applying configuration from triA.yaml: Key 'casa' not in 'Cab'
    full_key: cabs.casa.plotms.casa
    reference_type=Cab
    object_type=Cab

This is on the issue-126 branch

o-smirnov commented 1 year ago

Yeah sorry, misleading you. Try:

casa.plotms:
    command: plotms
    flavour: 
      kind: casa-task
      casa: xvfb-run -a casa
    inputs:
      _include: casa/plotms.yaml
landmanbester commented 1 year ago

Hooray! That works. Thanks

o-smirnov commented 1 year ago

All right, closing this, as we don't seem to need a "centralized" solution in the code itself.

o-smirnov commented 2 weeks ago

Reopening this, as it's probably useful to do this centrally for all casa-flavour tasks.

o-smirnov commented 1 week ago

Perhaps I can add something like

flavour:
  kind: casa-task
  path: /path/to/casa # optional
  wrapper: xvfb-run -a

With xvfb-run -a being the default setting for wrapper?