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

chore: update examples and qa script #1392

Merged
merged 4 commits into from
Oct 9, 2023
Merged

Conversation

ra0x3
Copy link
Contributor

@ra0x3 ra0x3 commented Oct 2, 2023

Thanks for opening a PR with the Fuel Indexer project. Please review the Checklist below and ensure you've completed all of the necessary steps to make this PR review as painless as possible.

Checklist

  • Ensure your top-level commit message is in line with our contributor guidelines.
  • Please add proper labels.
  • If there is an issue associated with this PR, please link the issue (right-hand sidebar)
  • If there is not an issue associated with this PR, add this PR to the "Fuel Indexer" project (right-hand sidebar)
  • Please allow Codeowners at least 24 hours to do a first-pass review.
  • Please add thoroughly detailed testing steps below.
  • Please keep your Changelog message short and sweet.

Description

  • PR does a few things:
    • Updates examples
      • Our "Hello-world" example has always been too complex for a hello-world program
      • This PR changes the previous "hello world" to be "greetings" and "hello world native" to be "greetings native"
      • I also created a new default indexer forc index new and called it "hello world" (since this is our actual hello world example)
      • Also went through all examples/docs and updated all Docker components to ensure they work
      • Dockerized greetings-native example (all examples are now dockerized)
    • Adds new forc index run-native command to run native indexers

Testing steps

  • QA run report is attached below

Ensure new command works

# start local fuel node
cargo run -p greetings-fuel-client --bin greetings-fuel-client

# run native indexer
cargo run --bin forc-index -- run-native --path examples/greetings-native/greetings-native-indexer -- --run-migrations

# Trigger data 
cargo run -p greetings-data --bin greetings-data -- --host 0.0.0.0:4000

# Verify data in DB

Ensure examples work

  • Stop any local Postgres
Hello world
# Go to example
cd examples/hello-world

# Spin up containers
docker compose up 

# Deploy
forc index deploy --path hello-world --url http://0.0.0.0:29987

# Trigger data
<< NO DATA TRIGGERED BECAUSE IT CONNECTS TO BETA-4 >> 

# Verify data in DB
Greetings
# Go to example
cd examples/greetings

# Spin up containers
docker compose up 

# Deploy
forc index deploy --path greetings-indexer --url http://0.0.0.0:29987

# Trigger data
cargo run -p greetings-data --bin greetings-data -- --host 0.0.0.0:4000

# Verify data in DB
Greetings Native
# Go to example
cd examples/greetings-native

# Spin up containers
docker compose up 

# Deploy
<< NO DEPLOY BECAUSE THIS IS NATIVE EXECUTION >>

# Trigger data
cargo run -p greetings-data --bin greetings-data -- --host 0.0.0.0:4000

# Verify data in DB

Changelog

  • chore: update examples and qa script

@ra0x3 ra0x3 self-assigned this Oct 2, 2023
@ra0x3 ra0x3 marked this pull request as draft October 2, 2023 13:50
lostman
lostman previously approved these changes Oct 2, 2023
packages/fuel-indexer-benchmarks/src/bin/qa.rs Outdated Show resolved Hide resolved
@ra0x3 ra0x3 linked an issue Oct 2, 2023 that may be closed by this pull request
@ra0x3 ra0x3 force-pushed the rashad/update-examples-and-qa branch from c02203f to 8d711d0 Compare October 2, 2023 19:02
@ra0x3
Copy link
Contributor Author

ra0x3 commented Oct 2, 2023

@ra0x3 ra0x3 force-pushed the rashad/update-examples-and-qa branch 4 times, most recently from bb9b3cb to 025ad3a Compare October 3, 2023 21:23
# ********************************

# TODO: https://github.com/FuelLabs/fuel-indexer/issues/1069
# cd ../greetings-native
Copy link
Contributor Author

Choose a reason for hiding this comment

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

  • There's something odd happening on CI here where starting this indexer sort've blocks the rest of CI - even if the command is launched in the background.
  • I want to continue to look into this but don't want to block the PR
  • However, you can confirm that running these steps locally works

@ra0x3 ra0x3 marked this pull request as ready for review October 4, 2023 13:05
@deekerno
Copy link
Contributor

deekerno commented Oct 5, 2023

@ra0x3 I'm reviewing this now; while I'm doing that, can you share the reasoning behind adding a separate command -- forc index run-native -- for running native indexers? It seems to me that we could keep it as forc index run --native.

@ra0x3
Copy link
Contributor Author

ra0x3 commented Oct 5, 2023

@ra0x3 I'm reviewing this now...

@deekerno

  • We have forc index start but I don't believe we have a forc index run command?
  • I originally called it forc index run but felt that might be confusing so I explicitly named it run-native

@ra0x3 ra0x3 requested a review from lostman October 5, 2023 20:15
@deekerno
Copy link
Contributor

deekerno commented Oct 5, 2023

@ra0x3 I'm reviewing this now...

@deekerno

  • We have forc index start but I don't believe we have a forc index run command?

  • I originally called it forc index run but felt that might be confusing so I explicitly named it run-native

Oops, you're totally right. And in that case, I think "run-native" is fine. I'm just thinking that we can keep it as a separate operation but maybe invoke it as start --native to keep the number of commands low.

@ra0x3
Copy link
Contributor Author

ra0x3 commented Oct 5, 2023

@ra0x3 I'm reviewing this now...

@deekerno

  • We have forc index start but I don't believe we have a forc index run command?
  • I originally called it forc index run but felt that might be confusing so I explicitly named it run-native

Oops, you're totally right. And in that case, I think "run-native" is fine. I'm just thinking that we can keep it as a separate operation but maybe invoke it as start --native to keep the number of commands low.

@deekerno

  • So keep in mind fuel-indexer has a subcommand run and that doesn't apply to native indexers (so a different entrypoint is needed)
    • We'd have to do some voodoo where we compile the run command into native indexers
  • Also an FYI (cc @lostman) that as I'm working on enhancement: add predicate support #1381 I think we're reaching the limits of what we can do with if (is_native) { this } else { that } 😅
    • Hopefully after the leadership offsite we'll have more direction with where the project is going
    • I'm trying to keep the native stuff to the point where we can yank all if $is_native code in a single easy PR if we decide we should just nuke it (which is inching closer)

deekerno
deekerno previously approved these changes Oct 6, 2023
lostman
lostman previously approved these changes Oct 9, 2023
examples/hello-world/hello-world/hello_world.manifest.yaml Outdated Show resolved Hide resolved
@@ -1,6 +1,10 @@
use duct::cmd;
use fuel_indexer_lib::config::IndexerConfig;

const FUEL_INDEXER: &str = "./../../target/release/fuel-indexer";
Copy link
Contributor

Choose a reason for hiding this comment

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

We could run all of these through cargo run --bin PKG to make this fully automatic. These are better than before—no need to manipulate the path—but still require pre-building the binaries before running tests.

@ra0x3 ra0x3 merged commit 2b3ef29 into develop Oct 9, 2023
19 checks passed
@ra0x3 ra0x3 deleted the rashad/update-examples-and-qa branch October 9, 2023 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create forc index command for starting native indexers
3 participants