Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
S slapos.core
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Labels
    • Labels
  • Merge requests 26
    • Merge requests 26
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Environments
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Members
    • Members
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • nexedi
  • slapos.core
  • Merge requests
  • !329

Merged
Created Sep 07, 2021 by Xavier Thompson@xavier_thompsonOwner

slapgrid: Process promises with SR python

  • Overview 45
  • Commits 7
  • Changes 8

Let slapos node (slapgrid) launch each instance's promises using the Python installed by the SR (the Python for and by which the promises are installed).

This means that when computing the promises a Python subprocess is started for each partition. This is not as good as a single Python process (but then we have version problems), but not as bad as a Python process per promise.

To propagate exceptions to the calling slapos node process, I take advantage of the fact that the logger only uses stderr: I redirect stdout to sderr in case the promise happens to print things to stdout directly instead of using the logger, and now that stdout is unused I just print the error message to stdout and use the returncode to distinguish between PromiseError and other exceptions.

A possible optimisation would be to share the same python process for all partitions that share the same python. This would be difficult in a real slapos node because each partition has a different user and the SR python should not be run as root, but could be used inside webrunner and theia.

Also do some general refactoring along the way.

Edited Oct 19, 2021 by Xavier Thompson
Assignee
Assign to
Reviewer
Request review from
None
Milestone
None
Assign milestone
Time tracking
Source branch: instance_python_promises
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7