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

[Merged by Bors] - Decouple cluster components from Fluvio cluster #928

Closed
wants to merge 25 commits into from

Conversation

nicholastmosher
Copy link
Contributor

@nicholastmosher nicholastmosher commented Apr 5, 2021

Closes #866

  • Removes fluvio-runner-local as a dependency from fluvio-cluster
  • Renames fluvio-runner-local to fluvio-run and makes it a standalone executable
  • Adds fluvio-run as an independent plugin on packages.fluvio.io
  • Updates install.sh to include fluvio-run as a default plugin during installation

@nicholastmosher nicholastmosher changed the title Decouple cluster components from Fluvio runner Decouple cluster components from Fluvio cluster Apr 5, 2021
@nicholastmosher nicholastmosher marked this pull request as draft April 5, 2021 12:30
@nicholastmosher nicholastmosher force-pushed the cc-plugin branch 8 times, most recently from 51cbb63 to 7b3e606 Compare April 12, 2021 16:01
@nicholastmosher
Copy link
Contributor Author

I can update the PR description so that it becomes a nice commit message when Bors squashes it 👍

Copy link
Contributor

@sehz sehz left a comment

Choose a reason for hiding this comment

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

great work. few minor comments

src/cluster/src/delete.rs Show resolved Hide resolved
src/runner/Cargo.toml Outdated Show resolved Hide resolved
src/sc/build.rs Outdated Show resolved Hide resolved
src/cluster/Cargo.toml Show resolved Hide resolved
sehz added a commit that referenced this pull request Apr 13, 2021
First part of #928.

Re-organize Leader and Follower replica such that it can be better refactored.
Decouple replication logic from storage logic much as possible.
Make it easier to write unit test replication logic
src/command/src/lib.rs Show resolved Hide resolved
src/runner/Cargo.toml Outdated Show resolved Hide resolved
@sehz
Copy link
Contributor

sehz commented Apr 13, 2021

Running smoke test didn't delete run components:

make smoke-test
cargo build   --bin fluvio 
    Finished dev [unoptimized + debuginfo] target(s) in 0.19s
cargo build   --bin fluvio-run 
    Finished dev [unoptimized + debuginfo] target(s) in 0.20s
cargo build   --bin flv-test 
    Finished dev [unoptimized + debuginfo] target(s) in 0.20s
echo "clean up previous installation"
clean up previous installation
./target/debug/fluvio cluster delete
./target/debug/fluvio cluster delete --local
kubectl delete configmap authorization --ignore-not-found
FLUVIO_CMD=true ./target/debug/flv-test smoke --spu 1 --local --client-log warn --server-log fluvio=debug --skip-checks  -- --producer-iteration=1000
Start running fluvio test runner
deleting cluster
installing cluster
Performing pre-flight checks
✅ ok: Supported helm version is installed
✅ ok: Supported kubernetes version is installed
✅ ok: Kubernetes config is loadable
✅ ok: Fluvio system charts are installed
Creating the topic: test
topic "test" created
found topic: test offset: 0
starting fetch stream for: test base offset: 0, expected new records: 1000
<<consume test done for: test >>>>
consume message validated!, records: 1000
Test completed
deleting cluster
+--------------+---------------+
| Test Results |               |
+--------------+---------------+
| Pass?        | true          |
+--------------+---------------+
| Duration     | 12.267184004s |
+--------------+---------------+

ubuntu@ip-172-31-20-82:~/fluvio$ ps -ef | grep fluvio
ubuntu   3645556       1  0 16:45 pts/11   00:00:00 /home/ubuntu/fluvio/target/debug/fluvio run sc
ubuntu   3645566 3645556 88 16:45 pts/11   00:02:45 /home/ubuntu/fluvio/target/debug/fluvio-run sc
ubuntu   3645583       1  0 16:45 pts/11   00:00:00 /home/ubuntu/fluvio/target/debug/fluvio run spu -i 5001 -p 0.0.0.0:9010 -v 0.0.0.0:9011 --log-base-dir /tmp/fluvio
ubuntu   3645593 3645583  6 16:45 pts/11   00:00:11 /home/ubuntu/fluvio/target/debug/fluvio-run spu -i 5001 -p 0.0.0.0:9010 -v 0.0.0.0:9011 --log-base-dir /tmp/fluvio
ubuntu   3652910 3000105  0 16:48 pts/11   00:00:00 grep --color=auto fluvio

@sehz
Copy link
Contributor

sehz commented Apr 13, 2021

Also, can you update DEVELOPER.md?

@sehz
Copy link
Contributor

sehz commented Apr 13, 2021

Delete still doesn't work in Linux:

flvd cluster delete --local
ubuntu@ip-172-31-20-82:~/fluvio$ ps -ef | grep fluvio
ubuntu   3645556       1  0 16:45 pts/11   00:00:00 /home/ubuntu/fluvio/target/debug/fluvio run sc
ubuntu   3645566 3645556  1 16:45 pts/11   00:02:52 /home/ubuntu/fluvio/target/debug/fluvio-run sc
ubuntu   3645583       1  0 16:45 pts/11   00:00:00 /home/ubuntu/fluvio/target/debug/fluvio run spu -i 5001 -p 0.0.0.0:9010 -v 0.0.0.0:9011 --log-base-dir /tmp/fluvio
ubuntu   3645593 3645583  0 16:45 pts/11   00:00:36 /home/ubuntu/fluvio/target/debug/fluvio-run spu -i 5001 -p 0.0.0.0:9010 -v 0.0.0.0:9011 --log-base-dir /tmp/fluvio
ubuntu   3737568 3000105  0 20:09 pts/11   00:00:00 grep --color=auto fluvio

@sehz
Copy link
Contributor

sehz commented Apr 13, 2021

Also, there are two process spawn for each SC and SPU. Can we collapse into a single process for each?

For example, running sc spawn two process.

ubuntu   3738481       1  0 20:10 pts/11   00:00:00 /home/ubuntu/fluvio/target/debug/fluvio run sc
ubuntu   3738493 3738481  2 20:10 pts/11   00:00:00 /home/ubuntu/fluvio/target/debug/fluvio-run sc

@nicholastmosher
Copy link
Contributor Author

I noticed that as well, the reason that there are two processes is because the actual invocation for cluster components is now

  • fluvio run spu -> fluvio-run spu, and
  • fluvio run sc -> fluvio-run sc.

This has to do with how we use fluvio to call out to other subcommands, and right now that simply runs the subcommand inside itself rather than spawning as an independent process. I think this is better for now because otherwise, running any kind of external fluvio subcommand would appear to just quit the prompt early, even though the subcommand is still running. I think this would really hurt plugins like fluvio-cloud.

So I think it's fine how it is right now. I'll make a quick change that will hopefully fix the pkill on linux.

@sehz
Copy link
Contributor

sehz commented Apr 13, 2021

Hooray, cluster delete finally work!

@nicholastmosher
Copy link
Contributor Author

Whoops, I broke local test, one sec

@nicholastmosher
Copy link
Contributor Author

bors r+

bors bot pushed a commit that referenced this pull request Apr 13, 2021
Closes #866 

- Removes `fluvio-runner-local` as a dependency from `fluvio-cluster`
- Renames `fluvio-runner-local` to `fluvio-run` and makes it a standalone executable
- Adds `fluvio-run` as an independent plugin on packages.fluvio.io
- Updates install.sh to include `fluvio-run` as a default plugin during installation
@bors bors bot changed the title Decouple cluster components from Fluvio cluster [Merged by Bors] - Decouple cluster components from Fluvio cluster Apr 13, 2021
@bors bors bot closed this Apr 13, 2021
@nicholastmosher nicholastmosher deleted the cc-plugin branch April 13, 2021 21:00
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.

Separate Fluvio cluster components into an independent plugin
2 participants