-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Generate AppImage #6208
Generate AppImage #6208
Conversation
master was broken, so I updated the gist to have lotus v1.8.0 |
this isn't ready yet. I'm changing this to a draft PR to work out an issue. There is a bug that I need to troubleshoot, when this is run on another machine, go.rice file embeds are not working correctly.
|
69a1566
to
5f9d7b7
Compare
I took another look at this. The way the rice box files were included in the original binary didn't carry over to the appimage binary. Embedding the files fixes this. If you want to give this file a go. If this seems reasonable, I can wire up CI to build and release this automatically. In case you want to build this yourself, the AppImageBuilder.yml file assumes we are building from Ubuntu 18, and this script has the dependencies needed to run |
Makefile
Outdated
build/rice-box.go: | ||
go run github.com/GeertJohan/go.rice/rice embed-go -i ./build | ||
|
||
BUILD_DEPS+=build/rice-box.go |
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.
This will generate a massive Go file which slows down builds, and likely IDEs.
At this point we should probably just switch builtin Go embed (https://golang.org/pkg/embed/)
We only use rice in builtin/
in a few places:
build/bootstrap.go
18: b := rice.MustFindBox("bootstrap")
build/openrpc.go
31: data := rice.MustFindBox("openrpc").MustBytes("full.json.gz")
36: data := rice.MustFindBox("openrpc").MustBytes("miner.json.gz")
41: data := rice.MustFindBox("openrpc").MustBytes("worker.json.gz")
build/parameters.go
6: return rice.MustFindBox("proof-params").MustBytes("parameters.json")
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.
Good point about the huge source file.
I have swapped out go rice for go:embed for everything under build. There is still a rice box in the townhall and fountain and that can be removed as well if we want to switch all embeded files to go:embed.
This feature is only available on go 1.16+ a
@magik6k here's the appimage generated with go:embed in case you want to try it out. |
(rebased on latest master) |
b530054
to
3c71d9b
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.
This is really cool. I'm guessing the next step here will be building those images in CI and including in releases
This generates an AppImage, which bundles the libraries into a portable executable.
As with https://github.com/filecoin-project/lotus/pull/6202/files this is intended to run on Ubuntu 18.04 which is easily available in CI. AppImageBuilder.yaml is generaed using appimage-builder https://appimage-builder.readthedocs.io/en/latest/ on Ubuntu 18.04, but if you want to generate images yourself and do not have this OS installed, you can re-generate it.
possible solution to #6030
However, anyone can can run the resulting appimage wihtout worrying about installing dependencies.
https://gist.github.com/coryschwartz/552a0983925d50f575c2fd17a8b5032a
just showing that this is, indeed, lotus:
and that this does not require installation of dependencies: