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: add ansible run to the deploy command #3

Merged
merged 11 commits into from
Aug 17, 2023

Commits on Aug 3, 2023

  1. feat: add ansible run to the deploy command

    Right now this only provisions the genesis node. We need to implement the retrieval of the genesis
    IP and peer ID before we can run against the remaining nodes.
    
    It uses a very similar pattern to Terraform, with an interface, so that we can do behaviour-based
    unit testing.
    jacderida committed Aug 3, 2023
    Configuration menu
    Copy the full SHA
    8cede34 View commit details
    Browse the repository at this point in the history
  2. tests: reorganise unit tests

    There were over 700 lines of tests and setup code inside a single `test` module, which was becoming
    unwieldy to work were.
    
    This splits the setup code into one module, then a module for each function on `TestnetDeploy` that
    is under test. With the use of modules, the function name was removed from the test case names.
    jacderida committed Aug 3, 2023
    Configuration menu
    Copy the full SHA
    7d86f8b View commit details
    Browse the repository at this point in the history
  3. refactor: split deploy into smaller functions

    The smaller functions are easier to test and don't require as much mocking setup.
    jacderida committed Aug 3, 2023
    Configuration menu
    Copy the full SHA
    8741d35 View commit details
    Browse the repository at this point in the history

Commits on Aug 4, 2023

  1. feat: run ansible against remaining nodes

    The multiaddr of the genesis node is composed by running `ansible-inventory` to get its IP address,
    by running the rpc client to get its peer ID.
    
    After we have that, we can then run against the remaining nodes.
    
    Those two functions were separated for easier test setup and admin.
    jacderida committed Aug 4, 2023
    Configuration menu
    Copy the full SHA
    f9ff92c View commit details
    Browse the repository at this point in the history
  2. feat: ssh availability check

    It's possible that before we run Ansible, the SSH service is not yet running on the genesis node.
    This is something we seen happen occasionally, so we added in a little loop to sit and wait for it
    to become available.
    
    We only check this for the genesis run because the remaining nodes are provisioned after genesis, by
    which point the SSH service should be available.
    jacderida committed Aug 4, 2023
    Configuration menu
    Copy the full SHA
    81dd653 View commit details
    Browse the repository at this point in the history
  3. feat: provide --node-count arg for deploy cmd

    This will control how many node processes run on each VM. The default is 20.
    jacderida committed Aug 4, 2023
    Configuration menu
    Copy the full SHA
    f2fe39e View commit details
    Browse the repository at this point in the history
  4. feat: run deploy with custom binary

    If the `--branch` and `--repo-owner` arguments are used, the build machine will be spun up to build
    a custom binary, which will then be uploaded to S3. Then when the nodes are being provisioned, this
    binary will be pulled in.
    jacderida committed Aug 4, 2023
    Configuration menu
    Copy the full SHA
    18b26be View commit details
    Browse the repository at this point in the history

Commits on Aug 5, 2023

  1. feat: provide setup command

    This creates the `.env` file by gathering input from the user, trying to assist them with which
    values should be provided.
    
    We are leaving it to the user to setup Terraform and Ansible on their OS.
    jacderida committed Aug 5, 2023
    Configuration menu
    Copy the full SHA
    ce8129d View commit details
    Browse the repository at this point in the history
  2. docs: provide setup and usage instructions

    This still needs to be extended with some information on how to obtain the IP addresses of each
    VM.
    jacderida committed Aug 5, 2023
    Configuration menu
    Copy the full SHA
    36106c5 View commit details
    Browse the repository at this point in the history
  3. feat: provide inventory command

    This will produce a list of all the VMs participating in the testnet, along with the SSH user for
    the cloud provider.
    jacderida committed Aug 5, 2023
    Configuration menu
    Copy the full SHA
    58ce76d View commit details
    Browse the repository at this point in the history

Commits on Aug 15, 2023

  1. chore: respond to feedback

    Addresses two issues that were noted during review:
    
    * Provide more helpful error message when inventory list is empty
    * Set other environment variables for Digital Ocean based on the `DO_PAT` variable
    
    For the first issue, there are a few different ways in which it might be possible for the
    environment to be non-existent. These were documented with comments in the code, which you can see
    in the diff.
    
    In addition, license headers were applied where they were missing.
    jacderida committed Aug 15, 2023
    Configuration menu
    Copy the full SHA
    1ab077c View commit details
    Browse the repository at this point in the history