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

AAP-39817 [Proof-of-Concept] DAB tasking app #702

Draft
wants to merge 21 commits into
base: devel
Choose a base branch
from

Conversation

AlanCoding
Copy link
Member

[AAP-39817] DAB app for background tasks via pg_notify

Description

This gives a higher-level interface to the dispatcher library, formerly the AWX dispatcher. As DAB exists to provide a framework for Django things, this splits out current practices for this in AWX to provide a framework for a background task service.

Apps, at their choosing, may use either dispatcher (lower-level) tasks, or durable tasks tracked by this app. By "lower-level", we mean, specifically, the psycopg client library for postgres. Since the dispatcher library only speaks psycopg, and not Django, this, predictably, contains a number of utils for translating between Django and psycopg language.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Test update
  • Refactoring (no functional changes)
  • Development environment change
  • Configuration change

Self-Review Checklist

  • I have performed a self-review of my code
  • I have added relevant comments to complex code sections
  • I have updated documentation where needed
  • I have considered the security impact of these changes
  • I have considered performance implications
  • I have thought about error handling and edge cases
  • I have tested the changes in my local environment

Testing Instructions

From my manual demo instructions, in a tab, run honcho start.

In another tab, you can run these snippets

from test_app.tasks import sleep
from ansible_base.task.tasks import manage_lost_tasks
from uuid import uuid4
from django.utils.timezone import now
import time

sleep.delay(seconds=60)

Task.objects.create(name='footask', state='running', wrapper_uuid=uuid4(), started_at=now())

time.sleep(1)

manage_lost_tasks(grace_period=0)
from test_app.tasks import *

hello_world.delay()
hello_world_other_queue.delay()

Steps to Test

  1. you can run the test_app content by honcho start
  2. /api/v1/trigger_task/ can trigger by the API

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

Successfully merging this pull request may close these issues.

1 participant