Skip to content

Conversation

@roman1e2f5p8s
Copy link
Contributor

@roman1e2f5p8s roman1e2f5p8s commented Nov 27, 2025

Note

This change is only needed for gas price prediction experiments, and the base branch of this PR is not planned to be merged to develop.

Description of change

This PR copies libtorch (required by the gas price predictor) to the iota-tools docker image, in the same way how it is done for the iota-node image.

The iota-tools image builds the iota-node component, which is then used in dev-tools/iota-private-network/bootstrap.sh to generate genesis. Running the dev-tools/iota-private-network/bootstrap.sh script results in

/usr/local/bin/iota: error while loading shared libraries: libtorch_cpu.so: cannot open shared object file: No such file or directory

if the libtorch library is not copied to the iota-tools docker image.

EDIT:

  • Fixed formatting, clippy, and license checks.

How the change has been tested

Run these commands from the monorepo root folder:

  1. Build the iota-tools image:

    cd docker/iota-tools; ./build.sh -t iota-tools --no-cache; cd -
  2. Bootstrap iota-private-network:

    cd dev-tools/iota-private-network; ./bootstrap.sh; cd -

Signed-off-by: Roman Overko <roman.overko@iota.org>
@vercel
Copy link

vercel bot commented Nov 27, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

6 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
apps-backend Ignored Ignored Preview Dec 4, 2025 5:38pm
apps-ui-kit Ignored Ignored Preview Dec 4, 2025 5:38pm
iota-evm-bridge Ignored Ignored Preview Dec 4, 2025 5:38pm
iota-multisig-toolkit Ignored Ignored Preview Dec 4, 2025 5:38pm
rebased-explorer Ignored Ignored Preview Dec 4, 2025 5:38pm
wallet-dashboard Ignored Ignored Preview Dec 4, 2025 5:38pm

@roman1e2f5p8s roman1e2f5p8s changed the title fix(docker): copy libtorch to iota-tools docker image fix(docker, predictor): copy libtorch to iota-tools docker image Nov 27, 2025
Copy link
Contributor

@bingyanglin bingyanglin left a comment

Choose a reason for hiding this comment

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

Except for the minor formatting issue, LGTM.

Signed-off-by: Roman Overko <roman.overko@iota.org>
@roman1e2f5p8s roman1e2f5p8s requested review from a team as code owners December 3, 2025 19:44
Signed-off-by: Roman Overko <roman.overko@iota.org>
Signed-off-by: Roman Overko <roman.overko@iota.org>
Signed-off-by: Roman Overko <roman.overko@iota.org>
@roman1e2f5p8s roman1e2f5p8s force-pushed the protocol-research/fix/copy-libtorch-to-iota-tools-image branch from 2cef271 to a1dc026 Compare December 3, 2025 22:02
Comment on lines +73 to +77
# Copy LibTorch runtime so iota-node can load predictor components
COPY --from=builder /iota/target/${PROFILE}/build/torch-sys-*/out/libtorch/libtorch/lib/ /opt/libtorch/lib/
# Set an explicit LD_LIBRARY_PATH without referencing an undefined variable to satisfy linters
ENV LD_LIBRARY_PATH=/opt/libtorch/lib
RUN echo "/opt/libtorch/lib" > /etc/ld.so.conf.d/libtorch.conf && ldconfig
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't a apt install -y libtorch1.13 enough?

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add libtorch1.13 to the # Install runtime dependencies and tools line above, and try without this change here, if it works?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, @muXxer, I will try that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We have agreed to leave it as it is, since it will not be merged into develop and the following did not work:

  • apt install libtorch2.6 gives build error:

    1.881 E: Unable to locate package libtorch2.6
    1.881 E: Couldn't find any package by glob 'libtorch2.6'
    
  • apt install libtorch1.13 gives run error:

    /usr/local/bin/iota: error while loading shared libraries: libtorch_cpu.so: cannot open shared object file: No such file or directory
    
  • apt install libtorch-dev gives run error:

    /usr/local/bin/iota: symbol lookup error: /usr/local/bin/iota: undefined symbol: _ZNK3c107SymBool10guard_boolEPKcl
    

@roman1e2f5p8s roman1e2f5p8s requested a review from muXxer December 4, 2025 17:18
Signed-off-by: Roman Overko <roman.overko@iota.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants