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

fix(system-services): allow overriding binary paths for system services [fixes NET-503] #1663

Merged
merged 7 commits into from
Jul 14, 2023

Conversation

kmd-fl
Copy link
Contributor

@kmd-fl kmd-fl commented Jul 6, 2023

Description

Allow overriding binary paths for some system services:

  • aqua-ipfs (path to the ipfs binary)
  • connector (path to the curl binary)

Overriding happens in the node config Config.toml like that:

# Note that we also must allow the node to use those binaries
allowed_binaries = [
        "/home/maar/curl",
        "/home/maar/ipfs"
]

[system_services.connector]
curl_binary_path = "/home/maar/curl"

[system_services.aqua_ipfs]
ipfs_binary_path = "/home/maar/ipfs"

Motivation

Mainly for local development.

The default paths for these services are the following;

  • /usr/bin/ipfs
  • /usr/bin/curl

However, some team members run Nox on MacBooks, where those paths are invalid, the default ones there are, for example, /opt/homebrew/bin/ipfs.

It should help with the development process.

Proposed Changes

  • Modify the config to add paths to binaries:
    • add ipfs_binary_path to AquaIpfsConfig
    • introduce ConnectorConfig with curl_binary_path field
  • On deployment, change paths in the Marine service configuration provided by the system service crates
    • At the moment, the easiest way to do it is to find the necessary fields by their names (like module name curl_adapter and binary name curl).

Additional Notes

  • If we find this feature useful in the future, we will find a more general approach with the help of the crates.
  • Note that at the moment, we do not redeploy services when their marine config changes. I guess, we need a linear task for this.

Checklist

  • The code follows the project's coding conventions and style guidelines.
  • All tests related to the changes have passed successfully.
  • Documentation has been updated to reflect the changes (if applicable).
  • All new and existing unit tests have passed.
  • I have self-reviewed my code and ensured its quality.
  • I have added/updated necessary comments to aid understanding.

Reviewer Checklist

  • Code has been reviewed for quality and adherence to guidelines.
  • Tests have been reviewed and are sufficient to validate the changes.
  • Documentation has been reviewed and is up to date.
  • Any questions or concerns have been addressed.

@linear
Copy link

linear bot commented Jul 6, 2023

NET-503 Override binary paths of system services

  1. Add to the config fields to override binary paths of system services that required external binary
  2. Override them in the corresponding module configs.
  • aqua-ipfs: /usr/bin/ipfs
  • connector: /usr/bin/curl

@kmd-fl kmd-fl added the e2e Run e2e workflow label Jul 7, 2023
@folex
Copy link
Member

folex commented Jul 7, 2023

Maybe it makes sense to add these binaries to allowed_binaries automatically? 🤔

Both when override is present and when it is not. Not sure.

@kmd-fl kmd-fl requested a review from folex July 13, 2023 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
e2e Run e2e workflow
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants