Skip to content

Commit

Permalink
Updates to protobuf and adding Dockerfile for video-daemon
Browse files Browse the repository at this point in the history
  • Loading branch information
griffobeid committed Oct 7, 2023
1 parent 276f6f0 commit d02ae9b
Show file tree
Hide file tree
Showing 21 changed files with 1,684 additions and 76 deletions.
91 changes: 52 additions & 39 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ resolver = "2"
members = [
"actix-api",
"bot",
"src-tauri",
"types",
"video-daemon",
]
exclude = [
"src-tauri",
"yew-ui"
]
2 changes: 1 addition & 1 deletion Dockerfile.actix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM securityunion/rustlemania-api-base:push-images-to-dockerhub-304d6434 as build
FROM securityunion/rustlemania-api-base:1.72-slim as build

ENV CARGO_TARGET_DIR=/app/actix-api/target
COPY . /app
Expand Down
18 changes: 15 additions & 3 deletions Dockerfile.video-daemon
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM debian:bookworm-slim
FROM debian:bookworm-slim as build

# Install rust
RUN apt-get update && apt-get install -y curl
Expand All @@ -12,15 +12,27 @@ RUN apt-get install -y libssl-dev pkg-config libvpx-dev build-essential libglib2
WORKDIR /app
COPY . .

ENV LOGIN_URL ""
ENV ACTIX_UI_BACKEND_URL ""
ENV WEBTRANSPORT_HOST ""

# Build
RUN rustup default nightly-2023-10-05
RUN cargo build --release

FROM debian:bookworm-slim

ENV RUST_LOG=info
ENV RUST_BACKTRACE=0
ENV QUIC_HOST=https://transport.rustlemania.com
ENV MEETING_ID=1234
ENV USER_ID=1234

# Run
CMD ["./target/release/video-daemon", "${QUIC_HOST}", "--meeting-id", "${MEETING_ID}", "--user-id", "${USER_ID}"]
RUN apt-get update && \
apt-get install -y pkg-config libvpx-dev && \
apt-get clean

COPY --from=build /app/target/release/video-daemon /usr/bin/

CMD ["video-daemon"]

2 changes: 1 addition & 1 deletion Dockerfile.yew
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM securityunion/yew:fix-image-no-cigar-c4770e96 as build
FROM securityunion/yew:1.72-slim as build

# TODO - this is a hack to get around the fact that the yew-ui crate is not bundled with the backend
ENV ENABLE_OAUTH=false
Expand Down
2 changes: 1 addition & 1 deletion actix-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jsonwebtoken= "8.1.1"
oauth2 = { version = "4" }
octets = "0.2.0"
quinn = { version = "0.10.1", features = ["runtime-tokio", "tls-rustls", "ring"] }
protobuf = "3.2.0"
protobuf = "3.3.0"
r2d2 = "0.8.10"
r2d2_postgres = "0.18.1"
rand = "0.8.5"
Expand Down
12 changes: 12 additions & 0 deletions cut_build_push_video_daemon.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
set -e

IMAGE_URL=securityunion/video-daemon:staging
echo "Building image $IMAGE_URL"

if ! docker build -t $IMAGE_URL . --file Dockerfile.video-daemon; then
echo "Failed to build docker image"
else
docker push $IMAGE_URL
echo "New image uploaded to $IMAGE_URL"
fi
2 changes: 1 addition & 1 deletion docker/Dockerfile.actix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM securityunion/rustlemania-api-base:push-images-to-dockerhub-304d6434
FROM securityunion/rustlemania-api-base:1.72-slim

RUN rustup component add clippy-preview
RUN rustup component add rustfmt
2 changes: 1 addition & 1 deletion docker/Dockerfile.yew
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM securityunion/yew:fix-image-no-cigar-c4770e96
FROM securityunion/yew:1.72-slim

RUN rustup component add clippy-preview
RUN rustup component add rustfmt
2 changes: 1 addition & 1 deletion docker/base_images/Dockerfile.actix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rust:1.70-slim-bullseye
FROM rust:1.72-slim

RUN apt-get --yes update && apt-get --yes install curl git pkg-config libssl-dev
RUN curl https://github.com/amacneil/dbmate/releases/download/v2.4.0/dbmate-linux-amd64 -L -o /usr/bin/dbmate && chmod +x /usr/bin/dbmate
Expand Down
10 changes: 5 additions & 5 deletions docker/base_images/Dockerfile.yew
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM rust:1.65-slim-bullseye as development
FROM rust:1.72-slim as development

RUN rustup default nightly-2023-01-27
RUN rustup default nightly-2023-10-05
RUN apt-get --yes update && apt-get --yes install git pkg-config libssl-dev
RUN cargo install wasm-bindgen-cli --version 0.2.78
RUN cargo install trunk --version 0.16.0
RUN rustup target add wasm32-unknown-unknown
RUN cargo install wasm-bindgen-cli --version 0.2.87
RUN cargo install trunk --version 0.17.5
RUN rustup target add wasm32-unknown-unknown
4 changes: 2 additions & 2 deletions protobuf/build-env-rust.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rust:1.71-slim
FROM rust:1.72-slim
ENV DEBIAN_FRONTEND=noninteractive
ARG USER
ARG UID
Expand All @@ -10,7 +10,7 @@ RUN apt-get update && \
curl \
protobuf-compiler

RUN cargo install protobuf-codegen --vers 3.2.0
RUN cargo install protobuf-codegen --vers 3.3.0

RUN useradd --create-home $USER --uid $UID && \
adduser $USER sudo && \
Expand Down
Loading

0 comments on commit d02ae9b

Please sign in to comment.