Skip to content
Snippets Groups Projects

Draft: Run Luigi task directly from Python instead of subprocess

Closed Maciej Pawel Szymanski requested to merge maszyman-luigi-direct into master
1 unresolved thread

Merge request reports

Pipeline #3961851 passed

Pipeline passed for d41abd2f on maszyman-luigi-direct

Approval is optional

Closed by Maciej Pawel SzymanskiMaciej Pawel Szymanski 2 years ago (Jul 6, 2022 1:01pm UTC)

Merge details

  • The changes were not merged into master.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
8 8 # granted to it by virtue of its status as an Intergovernmental Organization #
9 9 # or submit itself to any jurisdiction. #
10 10 ###############################################################################
11 from subprocess import run
11 import luigi
12 from lb.nightly.scheduler.workflow import Slot
  • added 1 commit

    • 97d771ef - move imports inside task function and prevent ImportError if unavailable

    Compare with previous version

  • added 1 commit

    • db86f25d - send logs from luigi call of start_slot task to the file

    Compare with previous version

  • added 1 commit

    • edf03a02 - Update black in .pre-commit-config.yaml

    Compare with previous version

  • Maciej Pawel Szymanski marked this merge request as ready

    marked this merge request as ready

  • added 1 commit

    Compare with previous version

  • Maciej Pawel Szymanski marked this merge request as draft

    marked this merge request as draft

  • added 17 commits

    • c3315dd0...42c383fa - 11 commits from branch master
    • 35dd5770 - Run Luigi task directly from Python instead of subprocess
    • 82126e09 - add lb-nightly-scheduler to ci job
    • 304f1527 - move imports inside task function and prevent ImportError if unavailable
    • b8b867fc - send logs from luigi call of start_slot task to the file
    • 0f705ebd - fix f-string construction
    • c36e80b0 - Reduce log level in luigi call from DEBUG to INFO

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • Unfortunately, we can't really use this approach because of AssertionError: daemonic processes are not allowed to have children. AFAIU, the celery worker is running as a daemon, and luigi.build() uses multiprocessing (when number of workers is >1). I'm not sure if workarounds for this are worth the effort and we may just stick with running luigi in subprocess.

  • Let's stick to invoking luigi in a subprocess, but we still have the problem that when we try to stop celery, the task waits that luigi completes (IIRC).

  • mentioned in issue #14

  • Yes, that is the problem. I'll create an issue and close this MR.

  • Please register or sign in to reply
    Loading