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

[Utility][Infra]Deploy an Anvil node in LocalNet #971

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

adshmh
Copy link
Contributor

@adshmh adshmh commented Aug 7, 2023

Description

Deploy an Anvil node as part of LocalNet to facilitate E2E tests.

Issue

Fixes #963, but using Anvil instead which has a feature set comparable to Ganache for our testing requirements. @dylanlott would appreciate any items you could add here.

Type of change

Please mark the relevant option(s):

  • New feature, functionality or library
  • Bug fix
  • Code health or cleanup
  • Major breaking change
  • Documentation
  • Other

List of changes

  • New chart for Anvil deployment
  • Add the loading of Anvil chart to Tiltfile.
  • ...

Testing

  • make develop_test; if any code changes were made
  • make test_e2e on k8s LocalNet; if any code changes were made
  • e2e-devnet-test passes tests on DevNet; if any code was changed
  • Docker Compose LocalNet; if any major functionality was changed or introduced
  • k8s LocalNet; if any infrastructure or configuration changes were made

Required Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added, or updated, godoc format comments on touched members (see: tip.golang.org/doc/comment)
  • I have tested my changes using the available tooling
  • I have updated the corresponding CHANGELOG

If Applicable Checklist

  • I have updated the corresponding README(s); local and/or global
  • I have added tests that prove my fix is effective or that my feature works
  • I have added, or updated, mermaid.js diagrams in the corresponding README(s)
  • I have added, or updated, documentation and mermaid.js diagrams in shared/docs/* if I updated shared/*README(s)

@adshmh adshmh added utility Utility specific changes infra Core infrastructure - not protocol related labels Aug 7, 2023
@adshmh adshmh added this to the M3: Pocket RoS (Relay or Slash) milestone Aug 7, 2023
@adshmh adshmh self-assigned this Aug 7, 2023
@adshmh adshmh requested a review from okdas August 7, 2023 19:46
@reviewpad reviewpad bot added large Pull request is large waiting-for-review labels Aug 7, 2023
@adshmh
Copy link
Contributor Author

adshmh commented Aug 7, 2023

@okdas in addition to review, could you please advise whether the labels I have added are correct?

@adshmh adshmh requested a review from dylanlott August 7, 2023 19:47
@dylanlott
Copy link
Contributor

@adshmh I'll take a deeper look at this today, but at first glance this looks sweet 🔥

@@ -314,6 +314,16 @@ for x in range(localnet_config["full_nodes"]["count"]):

k8s_resource("full-node-%s-pocket" % formatted_number, labels=["pocket-full-nodes"])

# Provisions anvil node and service for E2E testing
Copy link
Contributor

Choose a reason for hiding this comment

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

💯


{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
Copy link
Contributor

Choose a reason for hiding this comment

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

Great comment, good to know 👍

@@ -314,6 +314,16 @@ for x in range(localnet_config["full_nodes"]["count"]):

k8s_resource("full-node-%s-pocket" % formatted_number, labels=["pocket-full-nodes"])

# Provisions anvil node and service for E2E testing
k8s_yaml(
helm(
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm getting an error coming form this line when trying to run this code locally .

Running: helm template anvil-node /Users/shakezula/dev/pokt/pocket/charts/anvil --include-crds
Error: Traceback (most recent call last):
  /Users/shakezula/dev/pokt/pocket/build/localnet/Tiltfile:319:9: in <toplevel>
Error in helm: command "helm template anvil-node /Users/shakezula/dev/pokt/pocket/charts/anvil --include-crds" failed.
error: exit status 1
stdout: ""
stderr: "Error: template: anvil/templates/deployment.yaml:8:20: executing \"anvil/templates/deployment.yaml\" at <.Values.autoscaling.enabled>: nil pointer evaluating interface {}.enabled\n\nUse --debug flag to render out invalid YAML\n"
make: *** [localnet_down] Error 1

make localnet_up and make localnet_down are both reporting this error. Have you seen this error before, by chance?

Copy link
Contributor

@dylanlott dylanlott left a comment

Choose a reason for hiding this comment

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

This is gonna be sweet! However, I'm getting a build error on this locally when running make localnet_up that I think is related to a value not being set but referred to by the template. Once that gets cleared up though this should be good to go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infra Core infrastructure - not protocol related large Pull request is large utility Utility specific changes waiting-for-review
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

[Utility] Deploy a Ganache node to support E2E testing
2 participants