harlanc / xiu

A simple,high performance and secure live media server in pure Rust (RTMP[cluster]/RTSP/WebRTC[whip/whep]/HTTP-FLV/HLS).🦀
https://www.rustxiu.com
MIT License
1.6k stars 168 forks source link

Publish container images #100

Closed svenstaro closed 1 month ago

svenstaro commented 4 months ago

I really like xiu but currently deploying it is a bit tedious because I first need to compile it on my server and then start it. I think it might be more convenient if you used either DockerHub or the GitHub Container Registry to publish pre-built images (with the WebRTC web files in the right location for the binary already).

This could also solve #80 if you published multi-arch packages. You can copy parts of the process from miniserve if you like.

rsubr commented 4 months ago

Thanks @harlanc for the great project.

I'm a rust noob and do not have the rust knowledge or toolchain on my computer to build xiu.

Please see the attached build scripts which will create a docker container and build xiu inside it. The host machine does not need any rust tools, the entire build is inside docker. Using this build script, I have successfully built xiu on Linux x64 and aarch64.

To use, unzip the build.zip file into the repo base directory and run ./build.sh. Please consider adding build.sh and build2.sh to the repo if you find it useful.

As @svenstaro suggests having pre-built images will be fabulous. Also please consider releasing binaries on GitHub for those who want to run xiu natively without docker 🙏

Attachments: build.zip

harlanc commented 4 months ago

@rsubr Thanks for your new idea to build xiu, I run the script on my M1 Mac book, after the compilation process is completed, a "xiu" binary is generated on macOS, but this binary can only be run inside the docker image where xiu was compiled due to system differences, the system of docker is :

Linux beb91e124e02 5.10.47-linuxkit #1 SMP PREEMPT Sat Jul 3 21:50:16 UTC 2021 aarch64 GNU/Linux

So this script will pull a corresponding Linux version for the CPU architecture of your physical machine for compilation.,

image

right?I will consider whether to add it to the repository, thank you. 😊

harlanc commented 4 months ago

@svenstaro Based on your GitHub Action workflow, pre-builds for some CPU architectures have been generated successfully, but the Docker image publishing failed which will be fixed in the next release. Thank you.

svenstaro commented 4 months ago

Great to hear!

harlanc commented 4 months ago

@svenstaro A question about podman push in github action, where's the value of the environment variable "needs.publish.outputs.version" read from? I can retrieve the value during testing, but I don't know why I can't get it in the official release, it's empty:

image

svenstaro commented 4 months ago

It's the output of a step of another job, see here: https://github.com/svenstaro/miniserve/blob/b78c59ead7184cbcc937153f36a5e6420e49b8d2/.github/workflows/build-release.yml#L10. This refers to this: https://github.com/svenstaro/miniserve/blob/b78c59ead7184cbcc937153f36a5e6420e49b8d2/.github/workflows/build-release.yml#L103

murlakatamenka commented 4 months ago

Since we talk about packaging and distribution here...

@svenstaro do you plan do add xiu to Arch repos or is it safe to make an AUR package?

I've been aware of it for a few years and using it from time to time, but didn't push to AUR for others.

harlanc commented 4 months ago

It's the output of a step of another job, see here: https://github.com/svenstaro/miniserve/blob/b78c59ead7184cbcc937153f36a5e6420e49b8d2/.github/workflows/build-release.yml#L10. This refers to this: https://github.com/svenstaro/miniserve/blob/b78c59ead7184cbcc937153f36a5e6420e49b8d2/.github/workflows/build-release.yml#L103

@svenstaro The problem is fixed, thanks.

harlanc commented 4 months ago

Install xiu doc

svenstaro commented 4 months ago

Since we talk about packaging and distribution here...

@svenstaro do you plan do add xiu to Arch repos or is it safe to make an AUR package?

I've been aware of it for a few years and using it from time to time, but didn't push to AUR for others.

I might push it to repos later on. Let's have it in AUR for now.

murlakatamenka commented 4 months ago

I might push it to repos later on. Let's have it in AUR for now.

okay, boss

https://aur.archlinux.org/packages/xiu