Skip to content

feature: implement ipfs upload in worker #609

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

Merged
merged 16 commits into from
Jul 8, 2025
Merged

Conversation

noot
Copy link
Contributor

@noot noot commented Jul 1, 2025

  • implement ipfs file upload in worker. previously, the file was being uploaded to s3 only. it's now uploaded to ipfs as well if the with_ipfs_upload config flag is supplied
  • the file is found via cid, which contains the sha256 hash inside it, so it's fetchable given the hash (as you can deterministically reconstruct the cid)

Base automatically changed from noot/refactor-work-submission to develop July 3, 2025 17:17
@JannikSt JannikSt requested a review from Copilot July 5, 2025 20:03
Copy link
Contributor

@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 adds optional IPFS file upload support in the worker: when enabled via a CLI flag, files are uploaded to IPFS (in addition to S3). It refactors the file‐upload logic into dedicated functions and wires IPFS through the task bridge.

  • Extracted S3 upload and signed‐URL retrieval into separate async functions and added an IPFS upload helper.
  • Propagated an Option<Ipfs> through TaskBridge and CLI, with new --with-ipfs-upload and --ipfs-port flags.
  • Updated Cargo manifests to include rust-ipfs, cid, and enabled tokio_unstable in CI.

Reviewed Changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
crates/worker/src/docker/taskbridge/file_handler.rs Factored S3+IPFS upload into handle_file_upload_s3 and handle_file_upload_ipfs, added IPFS flag
crates/worker/src/docker/taskbridge/bridge.rs Added ipfs: Option<Ipfs> to config, threaded through TaskBridge and tests
crates/worker/src/cli/command.rs Introduced with_ipfs_upload/ipfs_port args and IPFS node setup
crates/worker/Cargo.toml Added workspace deps: rust-ipfs, cid
Cargo.toml Added root deps: ipld-core, rust-ipfs, cid
.github/workflows/checks.yml Enabled --cfg tokio_unstable for CI builds
Comments suppressed due to low confidence (2)

crates/worker/src/docker/taskbridge/file_handler.rs:109

  • The new IPFS branch isn't covered by existing tests; add unit or integration tests that simulate with_ipfs_upload = true to verify handle_file_upload_ipfs logic.
    if let Some(ipfs) = ipfs {

crates/worker/src/cli/command.rs:122

  • [nitpick] Add a doc comment above with_ipfs_upload (and ipfs_port) to explain its purpose, expected behavior, and any constraints.
        #[arg(long, default_value = "false")]

@JannikSt JannikSt merged commit 77e2708 into develop Jul 8, 2025
1 check passed
@JannikSt JannikSt deleted the noot/worker-ipfs branch July 8, 2025 13:05
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.

2 participants