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 <brooks@cosmonic.com>

added Cross.toml

Signed-off-by: Brooks Townsend <brooks@cosmonic.com>

corrected the artifact name

Signed-off-by: Brooks Townsend <brooks@cosmonic.com>
Signed-off-by: Brooks Townsend <brooks@cosmonic.com>

debug check paths

Signed-off-by: Brooks Townsend <brooks@cosmonic.com>

dll not exe

Signed-off-by: Brooks Townsend <brooks@cosmonic.com>

WINDOWSS

Signed-off-by: Brooks Townsend <brooks@cosmonic.com>

giving a full build a try

Signed-off-by: Brooks Townsend <brooks@cosmonic.com>

renamed needs sections

Signed-off-by: Brooks Townsend <brooks@cosmonic.com>

fix small mv error, test docker build too

Signed-off-by: Brooks Townsend <brooks@cosmonic.com>

correct windows target, copy into dockerfile

Signed-off-by: Brooks Townsend <brooks@cosmonic.com>
Signed-off-by: Brooks Townsend <brooks@cosmonic.com>

redid some paths

Signed-off-by: Brooks Townsend <brooks@cosmonic.com>

added built

Signed-off-by: Brooks Townsend <brooks@cosmonic.com>

updated mix env to release_prod

Signed-off-by: Brooks Townsend <brooks@cosmonic.com>

added release prod file

Signed-off-by: Brooks Townsend <brooks@cosmonic.com>

removed executable for windows, ls for debugging

Signed-off-by: Brooks Townsend <brooks@cosmonic.com>

MIX ENVIRONMENT WINDOWS GAH

Signed-off-by: Brooks Townsend <brooks@cosmonic.com>

corrected docker path

Signed-off-by: Brooks Townsend <brooks@cosmonic.com>

see if anything else is broken

Signed-off-by: Brooks Townsend <brooks@cosmonic.com>

compile esbuild in release_prod, correct mix env in docker

Signed-off-by: Brooks Townsend <brooks@cosmonic.com>

added file debug

Signed-off-by: Brooks Townsend <brooks@cosmonic.com>

updated deps, use macos-11

Signed-off-by: Brooks Townsend <brooks@cosmonic.com>

use release prod for docker

Signed-off-by: Brooks Townsend <brooks@cosmonic.com>

create the directory first just in case

Signed-off-by: Brooks Townsend <brooks@cosmonic.com>

create dir

Signed-off-by: Brooks Townsend <brooks@cosmonic.com>

install specific otp/elixir version

Signed-off-by: Brooks Townsend <brooks@cosmonic.com>

updated dart saas, create RELEASES

Signed-off-by: Brooks Townsend <brooks@cosmonic.com>

remove unused targets for Rust

Signed-off-by: Brooks Townsend <brooks@cosmonic.com>

reintroduce aarch64 linux

Signed-off-by: Brooks Townsend <brooks@cosmonic.com>

don't tar up the release

Signed-off-by: Brooks Townsend <brooks@cosmonic.com>

upload correct file

Signed-off-by: Brooks Townsend <brooks@cosmonic.com>

updated distillery

Signed-off-by: Brooks Townsend <brooks@cosmonic.com>

updated makefiles

Signed-off-by: Brooks Townsend <brooks@cosmonic.com>

corrected filename

Signed-off-by: Brooks Townsend <brooks@cosmonic.com>
Signed-off-by: Brooks Townsend <brooks@cosmonic.com>
Signed-off-by: Brooks Townsend <brooks@cosmonic.com>
Signed-off-by: Brooks Townsend <brooks@cosmonic.com>
Signed-off-by: Brooks Townsend <brooks@cosmonic.com>
Signed-off-by: Brooks Townsend <brooks@cosmonic.com>
Signed-off-by: Brooks Townsend <brooks@cosmonic.com>
Signed-off-by: Brooks Townsend <brooks@cosmonic.com>
Signed-off-by: Brooks Townsend <brooks@cosmonic.com>
Signed-off-by: Brooks Townsend <brooks@cosmonic.com>
Signed-off-by: Brooks Townsend <brooks@cosmonic.com>
Signed-off-by: Brooks Townsend <brooks@cosmonic.com>
Signed-off-by: Brooks Townsend <brooks@cosmonic.com>
Signed-off-by: Brooks Townsend <brooks@cosmonic.com>
Signed-off-by: Brooks Townsend <brooks@cosmonic.com>
Signed-off-by: Brooks Townsend <brooks@cosmonic.com>
Signed-off-by: Brooks Townsend <brooks@cosmonic.com>
@brooksmtownsend brooksmtownsend marked this pull request as ready for review June 7, 2022 21:40
Signed-off-by: Brooks Townsend <brooks@cosmonic.com>
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

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.

None yet

2 participants