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

deliver all-in-one binary to users #552

Closed
skyzh opened this issue Feb 25, 2022 · 10 comments · Fixed by #796
Closed

deliver all-in-one binary to users #552

skyzh opened this issue Feb 25, 2022 · 10 comments · Fixed by #796

Comments

@skyzh
Copy link
Contributor

skyzh commented Feb 25, 2022

image

We can pack all of them into risingwave, so as to reduce duplicated binary.

After that, we can start the binary in one of the ways:

RW_BIN=meta ./risingwave xxx
ln -s risingwave meta-node
./meta-node

cc @pangzhenzhou @BowenXiao1999 what do you think?

@skyzh
Copy link
Contributor Author

skyzh commented Feb 25, 2022

Another issue is that, we are using lazy_static everywhere, so there is risk that something will break if we start compute-node, meta-node within one process (e.g., jaeger-all-in-one)

@BowenXiao1999
Copy link
Contributor

ln -s risingwave meta-node

I didn't know this command very well. So it seems that risingwave symbol is point to meta-node? Emmm it looks strange cuz meta-node is included in risingwave.

I guess it can also reduce the download/upload binary in CI? Rest LGTM, but seems like there are not too much aware-able improvement for users (IMO it's kind of optimization), given that our risedev is already handle this.

@skyzh
Copy link
Contributor Author

skyzh commented Feb 25, 2022

So it seems that risingwave symbol is point to meta-node

meta-node, compute-node, frontend-node are all symbol links of risingwave. When the binary starts, it will determine which program to bootstrap.

(I might have mistaken the order of the two parameters of ln?)

@twocode
Copy link
Contributor

twocode commented Feb 25, 2022

Looks like you want to bundle them to one process and use environment variable (option 1) or arg[0] (option 2) to load the correct main entry. I haven't seen this usage before. Does it bring benefits to reducing package size or deployment?

@skyzh
Copy link
Contributor Author

skyzh commented Feb 25, 2022

Looks like you want to bundle them to one process and use environment variable (option 1) or arg[0] (option 2) to load the correct main entry. I haven't seen this usage before. Does it bring benefits to reducing package size or deployment?

One program, but not one process.

Does it bring benefits to reducing package size or deployment

I guess it would reduce binary size greatly. e.g., risingwave_common is embed in almost all binaries, and the expression framework would take a lot of space.

I haven't seen this usage before.

Indeed, you are using it everyday -- rustc installed by rustup is already leveraging this technique. See "工作原理" in this article for more information: https://note.xuanwo.io/#/page/rustup

@twocode
Copy link
Contributor

twocode commented Feb 25, 2022

looks fun😄

@skyzh
Copy link
Contributor Author

skyzh commented Mar 6, 2022

-rwxr-xr-x   2 skyzh skyzh 825M Mar  6 21:54 risingwave-all
-rwxr-xr-x   2 skyzh skyzh 458M Mar  6 21:37 meta-node
-rwxr-xr-x   2 skyzh skyzh 381M Mar  6 21:37 frontend-v2
-rwxr-xr-x   2 skyzh skyzh 680M Mar  6 21:38 compute-node

458MB + 318MB + 680MB = 1519MB -> 825MB

@skyzh
Copy link
Contributor Author

skyzh commented Mar 6, 2022

... we've reduced about half the space!

@skyzh skyzh added the ramp up label Mar 6, 2022
@TennyZhuang
Copy link
Contributor

Looks like you want to bundle them to one process and use environment variable (option 1) or arg[0] (option 2) to load the correct main entry. I haven't seen this usage before. Does it bring benefits to reducing package size or deployment?

cockroachdb is all-in-one binary.

@TennyZhuang
Copy link
Contributor

I suggest to add another risingwave-playground binary (command).

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 a pull request may close this issue.

4 participants