Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Celery + RabbitMQ => Stop/Reset schedule #5

Closed
mrblacyk opened this issue Feb 20, 2020 · 1 comment
Closed

Celery + RabbitMQ => Stop/Reset schedule #5

mrblacyk opened this issue Feb 20, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@mrblacyk
Copy link
Owner

Create a Celery + RabbitMQ + PostgreSQL setup and integration with the project.

This must provide a robust scheduling system which can be cancelled. All the edgy cases should be handled (trying to cancel a task in a queue which was already cancelled, etc).

The idea is to provide a functionality to:

  • Schedule a reset of a box with the ability to cancel the reset within 2 minutes.
  • Schedule a shutoff of a box with the ability to cancel the shutdown within 2 minutes.

The code should call resetMachine and stopMachine from aplibvirt.py accordingly. The former is not yet defined and needs to be created (but in the worst case it can be similar to stopMachine), the latter is with the code of:

def stopMachine(
        virt_conn: libvirt.virConnect, domain_name: str) -> [int, bool]:
    """ Stop a domain by name
    Returns a list with:
    * an integer return code,
    * a boolean saying if the machine was already stopped.
"""

    virt_conn = reassureConnection(virt_conn)

    return _machineOperation(virt_conn, domain_name, "stop")
@mrblacyk mrblacyk added the enhancement New feature or request label Feb 20, 2020
@mrblacyk mrblacyk pinned this issue Feb 20, 2020
@mrblacyk
Copy link
Owner Author

Done in e786d18.

It's Celery + Redis. I will build an image soon-ish and push to Docker Hub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant