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

Rework release CI/CD for efficiency #409

Merged
merged 20 commits into from
Jun 9, 2022
Merged

Conversation

brooksmtownsend
Copy link
Member

@brooksmtownsend brooksmtownsend commented Jun 1, 2022

This PR reworks the release CI/CD for our host_core and wasmcloud_host releases to use precompiled NIFs while still preserving the development experience of using a local cargo install. This is under the release_prod profile to avoid confusion. Additionally, as you can see in a mostly successful run on https://github.com/wasmCloud/wasmcloud-otp/actions/runs/2457366553, this cuts the total release time down to around 40 minutes. From tag push to releasing new tarballs is around 15 minutes, and tag push to new docker images (yes, even the aarch64 one) is around 30 minutes.

I'm blocked here as there is a specific combination of OTP/Elixir versions that we're forced to use with homebrew (currently investigating ways to manually select a homebrew version) that Distillery isn't quite updated for yet. See issue here: bitwalker/distillery#744. For now, I'm resorting to using ASDF on macos to install erlang/elixir specific versions as my homebrew tap hack didn't end up working.

I started this PR with the notion that this would be a good way to upgrade to the self-extracting tarball that distillery offers, but it isn't supported on Windows, and with the general unmaintained feel of the distillery package I would suggest we move to mix release, the officially reported release mechanism, instead. mix release also doesn't support self-extracting tarballs, which is unfortunate, but at the very least changing to the executable tarball format now would require a breaking change if we moved to mix releases.

Signed-off-by: Brooks Townsend <[email protected]>

added Cross.toml

Signed-off-by: Brooks Townsend <[email protected]>

corrected the artifact name

Signed-off-by: Brooks Townsend <[email protected]>
Signed-off-by: Brooks Townsend <[email protected]>

debug check paths

Signed-off-by: Brooks Townsend <[email protected]>

dll not exe

Signed-off-by: Brooks Townsend <[email protected]>

WINDOWSS

Signed-off-by: Brooks Townsend <[email protected]>

giving a full build a try

Signed-off-by: Brooks Townsend <[email protected]>

renamed needs sections

Signed-off-by: Brooks Townsend <[email protected]>

fix small mv error, test docker build too

Signed-off-by: Brooks Townsend <[email protected]>

correct windows target, copy into dockerfile

Signed-off-by: Brooks Townsend <[email protected]>
Signed-off-by: Brooks Townsend <[email protected]>

redid some paths

Signed-off-by: Brooks Townsend <[email protected]>

added built

Signed-off-by: Brooks Townsend <[email protected]>

updated mix env to release_prod

Signed-off-by: Brooks Townsend <[email protected]>

added release prod file

Signed-off-by: Brooks Townsend <[email protected]>

removed executable for windows, ls for debugging

Signed-off-by: Brooks Townsend <[email protected]>

MIX ENVIRONMENT WINDOWS GAH

Signed-off-by: Brooks Townsend <[email protected]>

corrected docker path

Signed-off-by: Brooks Townsend <[email protected]>

see if anything else is broken

Signed-off-by: Brooks Townsend <[email protected]>

compile esbuild in release_prod, correct mix env in docker

Signed-off-by: Brooks Townsend <[email protected]>

added file debug

Signed-off-by: Brooks Townsend <[email protected]>

updated deps, use macos-11

Signed-off-by: Brooks Townsend <[email protected]>

use release prod for docker

Signed-off-by: Brooks Townsend <[email protected]>

create the directory first just in case

Signed-off-by: Brooks Townsend <[email protected]>

create dir

Signed-off-by: Brooks Townsend <[email protected]>

install specific otp/elixir version

Signed-off-by: Brooks Townsend <[email protected]>

updated dart saas, create RELEASES

Signed-off-by: Brooks Townsend <[email protected]>

remove unused targets for Rust

Signed-off-by: Brooks Townsend <[email protected]>

reintroduce aarch64 linux

Signed-off-by: Brooks Townsend <[email protected]>

don't tar up the release

Signed-off-by: Brooks Townsend <[email protected]>

upload correct file

Signed-off-by: Brooks Townsend <[email protected]>

updated distillery

Signed-off-by: Brooks Townsend <[email protected]>

updated makefiles

Signed-off-by: Brooks Townsend <[email protected]>

corrected filename

Signed-off-by: Brooks Townsend <[email protected]>
Signed-off-by: Brooks Townsend <[email protected]>
Signed-off-by: Brooks Townsend <[email protected]>
Signed-off-by: Brooks Townsend <[email protected]>
Signed-off-by: Brooks Townsend <[email protected]>
Signed-off-by: Brooks Townsend <[email protected]>
Signed-off-by: Brooks Townsend <[email protected]>
Signed-off-by: Brooks Townsend <[email protected]>
Signed-off-by: Brooks Townsend <[email protected]>
Signed-off-by: Brooks Townsend <[email protected]>
Signed-off-by: Brooks Townsend <[email protected]>
Signed-off-by: Brooks Townsend <[email protected]>
@brooksmtownsend brooksmtownsend marked this pull request as ready for review June 7, 2022 21:40
Copy link
Contributor

@thomastaylor312 thomastaylor312 left a comment

Choose a reason for hiding this comment

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

Minor nits, but otherwise LGTM

target:
- x86_64-unknown-linux-gnu
- aarch64-unknown-linux-gnu
- x86_64-apple-darwin
Copy link
Contributor

Choose a reason for hiding this comment

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

You can build for an m1 on an x86_mac. Should we have a separate step that runs-on mac and builds the nif for m1 macs?

Copy link
Contributor

Choose a reason for hiding this comment

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

NOTE: I don't know if we could build the rest of the elixir stuff as well, but I know we can at least get the nif

Copy link
Member Author

Choose a reason for hiding this comment

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

I can definitely build the NIF for m1 mac, even with cross here but I don't have a way to get the erlang runtime system for the m1 mac (I tested and verified that x86-macos.tar.gz that we normally publish doesn't work even with rosetta but that was a quick test)

Copy link
Member Author

@brooksmtownsend brooksmtownsend Jun 8, 2022

Choose a reason for hiding this comment

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

We could possibly get the elixir stuff by running the erlang docker image with --platform linux/arm64/v8 and downloading the erts folder... but it's a stretch and would require rearranging all of this to not package the erts with the release

(This is something I really want to do, but I'm not sure if it's best done now since this PR has been in progress for a while)

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah no need to block on this. It is just a nit

@brooksmtownsend brooksmtownsend merged commit 199527e into main Jun 9, 2022
@brooksmtownsend brooksmtownsend deleted the ci/precompiled-nifs branch June 9, 2022 18:44
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.

2 participants