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

[BUG] make release-prod can not work properly #444

Closed
Taction opened this issue Aug 16, 2022 · 8 comments
Closed

[BUG] make release-prod can not work properly #444

Taction opened this issue Aug 16, 2022 · 8 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@Taction
Copy link
Contributor

Taction commented Aug 16, 2022

Describe the bug

When running make release-prod I encountered the following error:

==> Copying applications to _build/release_prod/rel/wasmcloud_host
==> Generating start_erl.data
==> Generating vm.args from rel/vm.args
==> Generating sys.config from config/config.exs
==> Including ERTS 13.0.1 from /usr/lib/erlang/erts-13.0.1
==> Generating boot scripts
==> Generating RELEASES
==> Release failed: no match of right hand side value: {:error, :eacces}
    (distillery 2.1.1) lib/distillery/releases/assembler.ex:863: Distillery.Releases.Assembler.create_RELEASES/2
    (distillery 2.1.1) lib/distillery/releases/assembler.ex:290: Distillery.Releases.Assembler.write_release_scripts/1
    (distillery 2.1.1) lib/distillery/releases/assembler.ex:50: Distillery.Releases.Assembler.assemble/1
    (distillery 2.1.1) lib/distillery/tasks/release.ex:130: Mix.Tasks.Distillery.Release.do_release/2
    (mix 1.13.0) lib/mix/task.ex:397: anonymous fn/3 in Mix.Task.run_task/3
    (mix 1.13.0) lib/mix/cli.ex:84: Mix.CLI.run_task/2
    (elixir 1.13.0) src/elixir_compiler.erl:73: :elixir_compiler.dispatch/4
    (elixir 1.13.0) src/elixir_compiler.erl:58: :elixir_compiler.compile/3

make: *** [Makefile:47: release-prod] Error 1

To Reproduce

Steps to reproduce the behavior:

  1. Run command 'cd wasmcloud_host'
  2. Run other command 'make release-prod'
  3. See error

Expected behavior

A clear and concise description of what you expected to happen.

Environment (please complete the following information)

  • OS:Linux
  • Arch: x86_64
  • wasmCloud Version: master branch

If you ran into this issue while developing a feature for wasmCloud:

  • Output of elixir --version e.g.:
Erlang/OTP 25 [erts-13.0.1] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [jit:ns]

Elixir 1.13.0 (compiled with Erlang/OTP 24)
  • Output of cargo --version e.g.:
cargo 1.62.0 (a748cf5a3 2022-06-08)

Additional context

The makefile seems to have some typo error, and I changed it to the following:

release-prod: build
	cd ../host_core && make copy-nif
	cd ../wasmcloud_host
	MIX_ENV=release_prod SECRET_KEY_BASE=$(SECRET_KEY_BASE) mix distillery.release --executable --verbose
@Taction Taction added bug Something isn't working help wanted Extra attention is needed labels Aug 16, 2022
@brooksmtownsend
Copy link
Member

Thanks for submitting this @Taction, unfortunately OTP 25 is not supported by distillery bitwalker/distillery#744 and we'll likely move to mix releases as a way to compensate. Distillery has gradually become less maintained as the official tooling caught up to its revolutionary features.

If you'd like to try, I'd be curious if this occurs for you with OTP 24, but if not I'd love to learn about your use case for building a release manually and see if I can help

@Taction
Copy link
Contributor Author

Taction commented Aug 17, 2022

@brooksmtownsend Thanks for your reply. I am kindly new to the elixir, and I failed to downgrade the OTP to 24. 😭

I'd love to learn about your use case for building a release manually and see if I can help.

I would like to build my own image for I may change the source code. But since I am in china so there are some network issues with the command make build-image. so I want to build on my local machine instead of using docker, change the dockerfile to just copy the files.

@brooksmtownsend
Copy link
Member

brooksmtownsend commented Aug 17, 2022

@Taction If you're looking to contribute, that's fantastic! If you'd like to build on your local machine, you can use the Elixir toolchain to do so. Check out https://github.com/wasmCloud/wasmcloud-otp/tree/main/wasmcloud_host#starting-the-host-and-web-ui-dashboard for instructions there 😄

Let me know how these steps work for you! I'll take a look at the release prod script in the meantime

brooksmtownsend added a commit that referenced this issue Aug 19, 2022
Signed-off-by: Brooks Townsend <brooks@cosmonic.com>
brooksmtownsend added a commit that referenced this issue Aug 19, 2022
Signed-off-by: Brooks Townsend <brooks@cosmonic.com>
@Taction
Copy link
Contributor Author

Taction commented Aug 22, 2022

@Taction If you're looking to contribute, that's fantastic! If you'd like to build on your local machine, you can use the Elixir toolchain to do so. Check out https://github.com/wasmCloud/wasmcloud-otp/tree/main/wasmcloud_host#starting-the-host-and-web-ui-dashboard for instructions there 😄

Let me know how these steps work for you! I'll take a look at the release prod script in the meantime

I can start successfully with mix phx.server command. Our team wants to build a test environment running on k8s, so we are finding a way to create an image, looking forward to solving the release prod script.

Also, is it possible to move build esbuild steps into dockerfile? In this way when running build-arm-image all steps will be running inside docker otherwise the host machine should also have the mix enviroment.

@brooksmtownsend
Copy link
Member

I can start successfully with mix phx.server command. Our team wants to build a test environment running on k8s, so we are finding a way to create an image, looking forward to solving the release prod script.

@Taction I did just want to point you to https://hub.docker.com/r/wasmcloud/wasmcloud_host, we publish a docker image with each release so you should be able to use that for your k8s test environment. However, if you're looking to contribute your own changes and test for k8s, I would recommend using the make build-image or make build-arm-image targets instead, the release_prod target is a little more purpose built for our CI.

Also, is it possible to move build esbuild steps into dockerfile? In this way when running build-arm-image all steps will be running inside docker otherwise the host machine should also have the mix enviroment.

Unfortunately the dart_sass package doesn't have support for aarch64-unknown-linux-gnu so it's not possible to build it into the Docker image 😢. That being said, the only time the static assets need to be updated are when there are CSS/JS changes, so we could explore committing those files. I'm also open to changing the tooling to a different bundler if that is available

@Taction
Copy link
Contributor Author

Taction commented Aug 23, 2022

@brooksmtownsend Thanks for your reply. We would like to test it in k8s if the changes work correctly. Waiting for the official image to be released is a bit slow behind and some of the custom modifications are not always accepted.

I've tried make build-image with

Erlang/OTP 24 [erts-12.3.1] [source] [64-bit] [smp:1:1] [ds:1:1:10] [async-threads:1] [jit]

Elixir 1.13.0 (compiled with Erlang/OTP 24)

getting the error:

Step 28/46 : RUN ls -R ./host_core/priv/built
 ---> Running in e70fb11fe763
./host_core/priv/built:
libhostcore_wasmcloud_native.so
Removing intermediate container e70fb11fe763
 ---> 219af61f198b
Step 29/46 : COPY ./host_core/priv/built/x86_64/libhostcore_wasmcloud_native.so ./host_core/priv/built/x86_64/libhostcore_wasmcloud_native.so
COPY failed: file not found in build context or excluded by .dockerignore: stat host_core/priv/built/x86_64/libhostcore_wasmcloud_native.so: file does not exist
make: *** [Makefile:21: build-image] Error 1

@brooksmtownsend
Copy link
Member

Ah @Taction this was a measure to speed up CI builds since that's generally the only reason we build containers nowadays. I'm actually looking into our CI this week thanks to a few bugs in OTP 24, so I'll look into a fallback that can build the NIF inside of the container if it's not supplied.

@brooksmtownsend
Copy link
Member

Closing as the new make targets like make build-image fixes this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants