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

feat: k2pow service #362

Merged
merged 33 commits into from
Oct 3, 2024
Merged

feat: k2pow service #362

merged 33 commits into from
Oct 3, 2024

Conversation

acud
Copy link
Contributor

@acud acud commented Sep 11, 2024

Work in progress.
As discussed with NJ, this implementation will:

  • allow users to run a k2pow compute worker as a separate binary
  • the worker will have a very simple HTTP API
    • the API will have create, read, update operations for jobs
    • right now all is done in-memory for the worker, no persistence of state
  • the post service needs a new flag that will start it in a special mode, in which jobs of k2pow computations will call a specified HTTP hook with the necessary params
    • how the result comes back to the post service is still TBD (either a hook on the service, or wait for response)

closes #343

@acud acud force-pushed the k2pow-serv branch 2 times, most recently from e8bc2ee to 67e7e46 Compare September 12, 2024 20:06
Copy link

codecov bot commented Sep 12, 2024

Codecov Report

Attention: Patch coverage is 81.11111% with 51 lines in your changes missing coverage. Please review.

Project coverage is 93.09%. Comparing base (d6e2f51) to head (937d596).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
k2pow-service/src/job_manager.rs 78.68% 26 Missing ⚠️
src/pow/service.rs 76.71% 17 Missing ⚠️
src/pow/randomx.rs 46.66% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #362      +/-   ##
==========================================
- Coverage   94.08%   93.09%   -1.00%     
==========================================
  Files          27       29       +2     
  Lines        3383     3633     +250     
==========================================
+ Hits         3183     3382     +199     
- Misses        200      251      +51     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@acud acud force-pushed the k2pow-serv branch 5 times, most recently from 710c1ab to 9d194ba Compare September 17, 2024 15:06
@acud acud changed the title K2pow serv feat: k2pow service Sep 17, 2024
@acud acud self-assigned this Sep 19, 2024
@acud acud marked this pull request as ready for review September 19, 2024 21:35
curling the request works curl -XPOST localhost:3000/job/11/1122334455667788/aabbccddeeff00112233aabbccddeeff00112233aabbccddeeff001122334455/aabbccddeeff00112233aabbccddeeff00112233aabbccddeeff001122334455

wip

wip

wip

wip

wip

wip

cleanup

wip

chore: add to ci

wip

compiled

compiling again

cleanup

wip-svc

wip

wip

wip

pick implementation explicitly

add sleep

simplify

add par expectation

clippy

cleanups

wip integrate into service

change to dynamic dispatch for Prover implementations

add logging

wip add more configuration options

add test vector with mock remote k2pow server

fix certifier test

cleanup

lint
.github/workflows/ci.yml Outdated Show resolved Hide resolved
src/prove.rs Outdated Show resolved Hide resolved
src/prove.rs Outdated Show resolved Hide resolved
src/pow/mod.rs Outdated Show resolved Hide resolved
src/pow/mod.rs Outdated Show resolved Hide resolved
k2pow-service/src/main.rs Outdated Show resolved Hide resolved
k2pow-service/src/job_manager.rs Outdated Show resolved Hide resolved
k2pow-service/src/job_manager.rs Outdated Show resolved Hide resolved
k2pow-service/src/main.rs Outdated Show resolved Hide resolved
src/prove.rs Outdated Show resolved Hide resolved
service/src/service.rs Outdated Show resolved Hide resolved
service/src/service.rs Outdated Show resolved Hide resolved
service/tests/test_client.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@poszu poszu left a comment

Choose a reason for hiding this comment

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

Generally, looking good! Only few small things left :)

Cargo.toml Outdated Show resolved Hide resolved
k2pow-service/src/job_manager.rs Outdated Show resolved Hide resolved
k2pow-service/src/job_manager.rs Outdated Show resolved Hide resolved
src/pow/service.rs Outdated Show resolved Hide resolved
service/src/service.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@poszu poszu left a comment

Choose a reason for hiding this comment

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

There is one small thing still open: #362 (comment).

Otherwise LGTM:)

@acud acud merged commit 168ee31 into main Oct 3, 2024
18 checks passed
@acud acud deleted the k2pow-serv branch October 3, 2024 21:01
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.

Feature request: remote compute server (proving k2pow)
2 participants