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

Building using docker #74

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Building using docker #74

wants to merge 1 commit into from

Conversation

tartavull
Copy link

Let me know what you think of this :)

@kclyu
Copy link
Owner

kclyu commented Mar 31, 2019

What I talked about in the issue meant to include a multi-stage build in the dockerfile.
(Since I am not familiar with the docker file syntax yet, the example below is a basic idea.)

DOCKER_BUILDKIT=1 docker build -t prod --build-arg ARCH=armv6 -<<'EOF'
# Defining environment
ARG ARCH=armv7
ARG [email protected]

FROM ubuntu:18.04 AS osbase
# install  basic pkg( git, wget, ...)
# install depot_tool
# install  custom-built-gcc

FROM osbase AS pipkg-install
# install package for raspberry pi on RPI

FROM pipkg-install as rootfs
# generate rpi-rootfs

FROM rootfs AS webrtc-native-code-package-base
# fetch ...
# gclient sync

FROM webrtc-native-code-package-base AS webrtc-base
# install package for web-rtc-packages

FROM webrtc-base AS armv6-webrtc-base
# building armv6

FROM webrtc-base AS armv7-webrtc-base
# building armv7

#  The `Prod` stage is the default stage if the Dockerfile is run without a target stage set. 
FROM $[ARCH}-webrtc-base AS Prod
# git clone rws
# build rws

FROM Prod AS  rws-install
# 
# making required directory in rws ( etc web-root LICENSES log log/01 ... log/09)
# install rws-service file in systemd directory
# install rws-binary and config
...

Things to check out a bit more
- Check whether the already executed stage can not be executed again

@kclyu
Copy link
Owner

kclyu commented Mar 31, 2019

The name of the Dockerfile should be Dockerfile.RwsBuild.

@kclyu
Copy link
Owner

kclyu commented Mar 31, 2019

I will check the codec_specific_info parameter deleted from the Encode function and commit it.

@tartavull
Copy link
Author

Thank you, I'll give that a try.
I had to modify
src/raspi_encoder_impl.cc
src/raspi_encoder_impl.h
in order for it to compile.

@tartavull tartavull force-pushed the master branch 2 times, most recently from 4f48070 to 2421e31 Compare April 19, 2019 20:39
@tartavull
Copy link
Author

As a side note, I just stumbled across this project https://github.com/llamerada-jp/libwebrtc
which compiles webrtc library make it very easy to use them.
I was wondering if you thought it was a good idea to use them and just build rws on the raspberry pi?

Thank you,
Ignacio

@kclyu
Copy link
Owner

kclyu commented Apr 23, 2019

The answer is a lot late. There are currently some repos that provide WebRTC library, but it does not supports the arm build . Even if it provides an arm build, it is not easy to use it unless it is provided for a specific OS due to the nature of cross compiling.

If you build using webrtc library from another project, it will be possible to use it after checking from the buidling procedure to the verification.
The current building method is a little low level, but there is good advantage of this method is that you can use the specific version of WebRTC native code you want, and you can use the built libraries with debugging symbol and native code all at once in the debugger.

@tartavull
Copy link
Author

Thank you @kclyu, that make sense.
I had to modify the code again because of modifications on webrtc.
I'm on macos, so I need an ubuntu container in order to build this project, it currently seems pretty useful run docker run -it -v /Users/it/code/rpi-webrtc-streamer:/root/Workspace/rpi-webrtc-streamer tartavull/webrtc bash
that way I can keep modifying the files on my root operating system and run make inside to re build base on changes.
We could make the docker image available and building only rpi-webrtc-streamer is quite fast.

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