-
Notifications
You must be signed in to change notification settings - Fork 67
fix: --embedded-database does not work when using fuel-indexer binary directly #892
Conversation
fe336ad
to
f10df37
Compare
d10b40e
to
9c92a65
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Looks mostly OK
- Left some minor comments
- Left a bigger comment about the feature flagging / service start change is gonna require manual testing steps
- Hopefully https://github.com/FuelLabs/fuel-indexer/issues will alleviate this a bit
@@ -57,56 +100,82 @@ pub async fn exec(args: IndexerArgs) -> anyhow::Result<()> { | |||
|
|||
let service_handle = tokio::spawn(service.run()); | |||
|
|||
// for graceful shutdown |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Just a heads up here.
- I see the logic of how the service starts and is feature flagged has been changed
- Totally fine with that overall, but just an FYI that the manual testing to verify this works is gonna be a bit vigorous
- You will need to test:
- The fuel-indexer service starts with all/any features
--all-features
,--no-default-features
- The fuel-indexer service starts with
--local-fuel-node
- The fuel-indexer-api-server starts with all/any features
--all-features
,--no-default-features
- Native execution starts with all/any features
--all-features
,--no-default-features
- Native execution starts with
--local-fuel-node
- Native execution is here btw
- It's pretty much a copy/paste of how the non-native fuel-indexer service is started
- Docker builds still work
- Hello-indexer example
- Block-explorer example
- Hello-indexer-native example
- The fuel-indexer service starts with all/any features
- And we'd need to update the PR testing steps to reflect this
- You can see something somewhat similar over in fix: correct usage of
fuel-indexer
feature flags #772
- You can see something somewhat similar over in fix: correct usage of
After the fix yesterday, I re-ran various variations. Pasting outputs here:
|
2622986
to
f3abd25
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spent some time reviewing this:
The following things work:
- Ctrl+C stops
cargo run --embedded-database
forc index kill
does not stop forc-postgres (but still stops forc-index)- Ctrl+C stops
./target/release/fuel-indexer
./target/release/fuel-indexer --embedded-database
works./target/release/fuel-indexer --no-default-features
starts & stops- hello-native works
I was not able to get the following things to work:
- explorer-indexer works via docker
- hello-world works via docker
When trying to run the dockerized examples I'm consistently getting the following error
> docker compose up
block-explorer-fuel-indexer-1 | ./fuel-indexer: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory
block-explorer-fuel-indexer-1 exited with code 127
My local image was built with the following command:
docker build -t fuel-indexer/local:latest -f deployment/Dockerfile .
@lostman I'm assuming the Dockerized examples worked for you?
@ra0x3 We could switch to I'll re-check the Docker builds. |
@lostman Yep, we can definitely handle the postgres killing separately :) Lmk how the Docker thing works for you. @deekerno Could you also test the docker parts of this when you get a minute? I've already verified the other parts are working 👌🏽 |
With
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docker examples run correctly without --embedded-database
, but not with the flag. @lostman, did you happen to run the Docker examples with the postgres
container commented out? I may be missing something here.
What is the error you're encountering? |
…exer-embedded-database
After speaking about it with @lostman, I totally forgot that the fix itself would not be a part of the Docker compose workflow because it hasn't been included as part of an image yet. 😅 so I'm fine with this. Re-reviewing now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hello-world
is working via docker now ✅
Description
This PR makes
fuel-indexer start
run an embeddedpostgres
database when--embedded-database
flag is specified.When
fuel-indexer
exits, the embedded database is shut down. For this purpose,fuel-indexer
now listens toSIGHUP/INT/TERM
signals.Testing steps
fuel-indexer
--embedded-database
--embedded-database
and--local-fuel-node
Note:
fuel-core-lib
must be enabled.3
--embedded-database
and--all-features
,--no-default-features
fuel-api-server
--all-features
,--no-default-features
And check it works by visiting:
http://localhost:29987/api/playground/fuel_examples/explorer_indexer
Changelog
--embedded-database
is specifiedforc index start
passes--embedded-database
flag tofuel-indexer
instead of callingforc_postgres::commands::create::exec
openssl
it's a fix for
Cannot build due to libssl.so.1.1 link error launchbadge/sqlx#473
"the issue is because procedural macro executed in a slightly different environment"
I think we're running into the same situation with our Docker build—we build with
cargo chef
image, but run onubuntu:22.04