hyperlane-monorepo icon indicating copy to clipboard operation
hyperlane-monorepo copied to clipboard

Add Ansible Playbook IaC option for agents

Open avious00 opened this issue 1 year ago • 12 comments

Similar to our deploy with terraform guide, create an ansible playbook and accompanying v3-docs guide that can be used by community operators

avious00 avatar Jun 13 '24 18:06 avious00

claimed by Polkachu ⚡️

avious00 avatar Jun 13 '24 18:06 avious00

🫡

PolkachuIntern avatar Jun 13 '24 18:06 PolkachuIntern

claimed by Polkachu ⚡️

If claimed can you close this issue, or ya mean claimed means assigned ?

TouchstoneTheDev avatar Jun 17 '24 01:06 TouchstoneTheDev

TouchstoneTheDev

assigned to! but i'm happy to create more devops bounties if you're interested and we have a bunch of other bounties up too

fyi all bounty payouts require a one-time KYC

avious00 avatar Jun 18 '24 15:06 avious00

Polkachu's work for this here: https://github.com/polkachu/hyperlane

avious00 avatar Jul 03 '24 19:07 avious00

@paulbalaji to review https://github.com/polkachu/hyperlane

avious00 avatar Jul 03 '24 19:07 avious00

@PolkachuIntern this looks great, thanks for sharing! The only suggestion I have is to consider how to keep the agent configs up to date.

The main concern here is that the validators rely on the mailbox and merkle tree hook addresses, and although they haven't really changed - it's also not a guarantee that they will stay the same. I think it's also generally good practice to periodically sync with the latest monorepo state

I've mocked up a quick bash script here which can be used to do the above, it copies the chain-specific section from the mainnet_config.json

#!/bin/bash

HYPERLANE_MONOREPO_DIR="/path/to/hyperlane-monorepo"

# Loop through ${chain}.json files
for filepath in roles/hyperlane/files/*
do
    filename=$(basename -- "$filepath")
    extension="${filename##*.}"
    chain="${filename%.*}"

    if [[ $extension != "json" ]]
    then
        continue
    fi

    # Update only the specific .chains.$chain key in the chain configuration
    jq ".chains.$chain = input.chains.$chain" \
        "roles/hyperlane/files/$chain.json" \
        "$HYPERLANE_MONOREPO_DIR/rust/config/mainnet_config.json" > tmp.json \
        && mv tmp.json "roles/hyperlane/files/$chain.json"

    echo "Configuration for chain $chain has been updated successfully."
done

(Threw up a draft PR here)

You could either do this in the playbook itself to ensure the configs always match the latest versions in the repo you are building the validators from, alternatively I've left it here so you can periodically update the configs at your will. I'm thinking the latter option makes more sense, given that you will have your own public RPCs or config that you would want to use

paulbalaji avatar Jul 04 '24 11:07 paulbalaji

Thanks. I have merged the PR and responded to your comment. I am copy and paste the commend here too.

"thanks for the shell script. I will keep the script there, but I do not plan to use it for my own deployment. The reason is that we always prefer to use our own endpoints whenever possible and we often refuse any upstream dependency in order to avoid mistakes that we do not control ourselves. That's not to say you guys have mistakes. It is more about that if we find a mistake, the PR timeline is controlled by an entity outside of my control. That's just does not work with our preferred workflow.

The plan is that we will support only the hyperlane chains that we have our own deployments so the info will always be correct as long we our own deployment is running.

Finally, I want to add that we are not gunning for the bounty. This script is really designed to fit our own needs as we want to support many hyperlane chains. I can imagine that someone will fork this repo and maintain a version that integrate with your monorepo tightly. When that happens, that repo probably deserves the bounty more than us."

PolkachuIntern avatar Jul 04 '24 20:07 PolkachuIntern

@bertux will attempt it this weekend, claimed by him

avious00 avatar Jul 26 '24 17:07 avious00

Finally, I want to add that we are not gunning for the bounty. This script is really designed to fit our own needs as we want to support many hyperlane chains. I can imagine that someone will fork this repo and maintain a version that integrate with your monorepo tightly. When that happens, that repo probably deserves the bounty more than us."

Thanks for the opportunity to integrate more tightly with the monorepo. I have forked the repository where the bash script has been merged and I will look to integrate in the Ansible part if it doesn't make it too heavy. A lighter approach would be to run it as a GitHub Action which would generate a Pull Request when there is some change. And I would like to support more chains there too because I am more into EVM chains so far. I will work on it at https://github.com/bertux/hyperlane-ansible

bertux avatar Jul 27 '24 16:07 bertux

When it will work in my fork, I will prepare a PR here to integrate it into monorepo so it should make it easier to maintain.

bertux avatar Jul 29 '24 14:07 bertux

I'm back, I will create the draft and I hope to finish.

bertux avatar Oct 03 '24 12:10 bertux

Project is down ? i'm interested too

Maissacrement avatar Dec 20 '24 01:12 Maissacrement

Project is down ? i'm interested too

No, I was just too busy to finish it yet.

bertux avatar Dec 20 '24 11:12 bertux

Ok, i think i will wrote some proposal to you

Maissacrement avatar Dec 23 '24 02:12 Maissacrement

U can see my work here

Maissacrement avatar Dec 25 '24 01:12 Maissacrement

@Maissacrement I've seen it, will you try to do a Pull Request on this repository to have the feedback from the maintainer of this personal repository ? We should try to get it adapted to this monorepo as it was done for Terraform. I'm working on a more innovative integration of Hyperlane, but I will try to test your work on this Ansible integration to give you feedback as well.

bertux avatar Jan 03 '25 02:01 bertux

@bertux Ok no worries I've been looking to test a multicloud approach and not aws only because i have too many error in config approch on premise. But it's so easy to copy what they did on terraform. But I prefer to stay on the approach of the group

Maissacrement avatar Jan 03 '25 05:01 Maissacrement