Skip to content

add: Tasking service #47

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

Draft
wants to merge 18 commits into
base: add/round-service
Choose a base branch
from
Draft

add: Tasking service #47

wants to merge 18 commits into from

Conversation

pyropy
Copy link
Contributor

@pyropy pyropy commented Apr 14, 2025

This pull request includes changes to the tasking service, focusing on adding task generation logic and adding tests. The implementing task generation logic, creating a new database table for subnet tasks, and adding tests for the round and tasking services.

Tasking service is triggered on the round creation. Once the service is triggered it will call all registered task sampling functions for each subnet, generate tasks for each of them and save them to the database.

Tasks definition is saved in the database using JSONB types which enables us to have dynamic task definitions for different subnets.

Change log:

Closes:

Related to:

@pyropy pyropy marked this pull request as draft April 14, 2025 11:58
@pyropy pyropy self-assigned this Apr 14, 2025
@pyropy pyropy changed the base branch from main to add/round-service April 14, 2025 13:11
@pyropy pyropy changed the base branch from add/round-service to main April 14, 2025 13:12
@pyropy pyropy changed the base branch from main to add/round-service April 14, 2025 13:15
@pyropy pyropy requested a review from Copilot April 14, 2025 13:44
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a combined round and tasking service by consolidating tests and updating service interfaces.

  • Removed the previous round service tests.
  • Added new tests covering both round and tasking services.
  • Updated TaskingService and configuration to use "maxTasksPerSubnet" for task sampling.

Reviewed Changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.

File Description
test/round-service.test.js Removed old tests for round service.
test/round-and-tasking-service.test.js Added comprehensive tests for both round and tasking functionalities.
lib/tasking-service.js Updated task sampler typedef, registration, and task generation/storage logic.
lib/config.js Updated tasking configuration to use maxTasksPerSubnet instead of maxTasks.
Files not reviewed (1)
  • migrations/004.do.checker-subnet-tasks.sql: Language not supported

@pyropy pyropy mentioned this pull request Apr 14, 2025
@pyropy pyropy changed the title Add/tasking service add: Tasking service Apr 14, 2025
@pyropy pyropy marked this pull request as ready for review April 14, 2025 17:18
checkRoundIntervalMs: 200
}

describe('round and tasking service', () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to merge round and tasking service tasks together as splitting them up causes flaky tests due to concurrent database reads writes.

@pyropy pyropy marked this pull request as draft April 14, 2025 17:21
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