From 305904525eaaafcbb6926c5822bd2361e0be99d7 Mon Sep 17 00:00:00 2001 From: Zachary Corvidae Date: Thu, 30 Jan 2025 21:36:54 -0800 Subject: [PATCH 01/16] Try using an ffmpeg image --- config/queue.Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/config/queue.Dockerfile b/config/queue.Dockerfile index 471313f..623812d 100644 --- a/config/queue.Dockerfile +++ b/config/queue.Dockerfile @@ -26,12 +26,11 @@ RUN --mount=type=cache,target=/usr/local/cargo/registry \ cp /app/target/release/forge /usr/local/bin/forge # Runtime stage -FROM --platform=$TARGETPLATFORM debian:bullseye-slim +FROM --platform=$TARGETPLATFORM jrottenberg/ffmpeg:ffmpeg-7.1-alpine320 # Install runtime dependencies RUN apt-get update && apt-get install -y \ ca-certificates \ - ffmpeg \ libpq5 \ && rm -rf /var/lib/apt/lists/* From a3f423e064728039b46a381aed83f03b4ea5cf4c Mon Sep 17 00:00:00 2001 From: Zachary Corvidae Date: Thu, 30 Jan 2025 21:40:13 -0800 Subject: [PATCH 02/16] Fix tag --- config/queue.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/queue.Dockerfile b/config/queue.Dockerfile index 623812d..af94628 100644 --- a/config/queue.Dockerfile +++ b/config/queue.Dockerfile @@ -26,7 +26,7 @@ RUN --mount=type=cache,target=/usr/local/cargo/registry \ cp /app/target/release/forge /usr/local/bin/forge # Runtime stage -FROM --platform=$TARGETPLATFORM jrottenberg/ffmpeg:ffmpeg-7.1-alpine320 +FROM jrottenberg/ffmpeg:7.1-alpine320 # Install runtime dependencies RUN apt-get update && apt-get install -y \ From 0e38855bc7ae97feab4b8199eb17088f75968ddb Mon Sep 17 00:00:00 2001 From: Zachary Corvidae Date: Thu, 30 Jan 2025 21:42:09 -0800 Subject: [PATCH 03/16] Change out image --- config/queue.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/queue.Dockerfile b/config/queue.Dockerfile index af94628..fc3af91 100644 --- a/config/queue.Dockerfile +++ b/config/queue.Dockerfile @@ -26,7 +26,7 @@ RUN --mount=type=cache,target=/usr/local/cargo/registry \ cp /app/target/release/forge /usr/local/bin/forge # Runtime stage -FROM jrottenberg/ffmpeg:7.1-alpine320 +FROM jrottenberg/ffmpeg:7.1-ubuntu2404-edge # Install runtime dependencies RUN apt-get update && apt-get install -y \ From cfaaf77c0192a3384fd545f1cbcc0ab1e93ce348 Mon Sep 17 00:00:00 2001 From: Zachary Corvidae Date: Thu, 30 Jan 2025 21:58:54 -0800 Subject: [PATCH 04/16] Try copying binary from source build --- config/queue.Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config/queue.Dockerfile b/config/queue.Dockerfile index fc3af91..f4e3470 100644 --- a/config/queue.Dockerfile +++ b/config/queue.Dockerfile @@ -25,8 +25,10 @@ RUN --mount=type=cache,target=/usr/local/cargo/registry \ cargo build --release -p forge && \ cp /app/target/release/forge /usr/local/bin/forge +COPY --from=jrottenberg/ffmpeg:7.1-ubuntu2404-edge /usr/local/bin/ffmpeg /usr/bin/ffmpeg + # Runtime stage -FROM jrottenberg/ffmpeg:7.1-ubuntu2404-edge +FROM --platform=$TARGETPLATFORM debian:bullseye-slim # Install runtime dependencies RUN apt-get update && apt-get install -y \ From a55f5bc5287a6fae219ad8737e051063fee92e27 Mon Sep 17 00:00:00 2001 From: Zachary Corvidae Date: Thu, 30 Jan 2025 22:09:08 -0800 Subject: [PATCH 05/16] Try a different location --- config/queue.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/queue.Dockerfile b/config/queue.Dockerfile index f4e3470..d7a08a2 100644 --- a/config/queue.Dockerfile +++ b/config/queue.Dockerfile @@ -25,7 +25,7 @@ RUN --mount=type=cache,target=/usr/local/cargo/registry \ cargo build --release -p forge && \ cp /app/target/release/forge /usr/local/bin/forge -COPY --from=jrottenberg/ffmpeg:7.1-ubuntu2404-edge /usr/local/bin/ffmpeg /usr/bin/ffmpeg +COPY --from=jrottenberg/ffmpeg:7.1-ubuntu2404-edge /opt/ffmpeg /usr/local/ffmpeg # Runtime stage FROM --platform=$TARGETPLATFORM debian:bullseye-slim From 2d91968b82674e63e683bb40efc631e034a2703e Mon Sep 17 00:00:00 2001 From: Zachary Corvidae Date: Thu, 30 Jan 2025 22:13:55 -0800 Subject: [PATCH 06/16] Try adding just a where ffmpeg command --- config/queue.Dockerfile | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/config/queue.Dockerfile b/config/queue.Dockerfile index d7a08a2..336c69e 100644 --- a/config/queue.Dockerfile +++ b/config/queue.Dockerfile @@ -25,22 +25,25 @@ RUN --mount=type=cache,target=/usr/local/cargo/registry \ cargo build --release -p forge && \ cp /app/target/release/forge /usr/local/bin/forge -COPY --from=jrottenberg/ffmpeg:7.1-ubuntu2404-edge /opt/ffmpeg /usr/local/ffmpeg +# COPY --from=jrottenberg/ffmpeg:7.1-ubuntu2404-edge /opt/ffmpeg /usr/local/ffmpeg +FROM jrottenberg/ffmpeg:7.1-ubuntu2404-edge + +ENTRYPOINT [ "where ffmpeg" ] # Runtime stage -FROM --platform=$TARGETPLATFORM debian:bullseye-slim +# FROM --platform=$TARGETPLATFORM debian:bullseye-slim -# Install runtime dependencies -RUN apt-get update && apt-get install -y \ - ca-certificates \ - libpq5 \ - && rm -rf /var/lib/apt/lists/* +# # Install runtime dependencies +# RUN apt-get update && apt-get install -y \ +# ca-certificates \ +# libpq5 \ +# && rm -rf /var/lib/apt/lists/* -# Copy the binary from builder -COPY --from=builder /usr/local/bin/forge /usr/local/bin/forge +# # Copy the binary from builder +# COPY --from=builder /usr/local/bin/forge /usr/local/bin/forge -# Expose the health check server -EXPOSE 8080 +# # Expose the health check server +# EXPOSE 8080 -# Set the entrypoint -ENTRYPOINT ["/usr/local/bin/forge"] +# # Set the entrypoint +# ENTRYPOINT ["/usr/local/bin/forge"] From 1854062e5b8a39804566105bfba89aefbb4d98ee Mon Sep 17 00:00:00 2001 From: Zachary Corvidae Date: Thu, 30 Jan 2025 22:19:08 -0800 Subject: [PATCH 07/16] Fix exec --- config/queue.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/queue.Dockerfile b/config/queue.Dockerfile index 336c69e..f84033f 100644 --- a/config/queue.Dockerfile +++ b/config/queue.Dockerfile @@ -29,7 +29,7 @@ RUN --mount=type=cache,target=/usr/local/cargo/registry \ FROM jrottenberg/ffmpeg:7.1-ubuntu2404-edge -ENTRYPOINT [ "where ffmpeg" ] +ENTRYPOINT [ "which ffmpeg" ] # Runtime stage # FROM --platform=$TARGETPLATFORM debian:bullseye-slim From cb61d164c8a28fa908c238ef0d116de742b5bf7e Mon Sep 17 00:00:00 2001 From: Zachary Corvidae Date: Thu, 30 Jan 2025 22:22:15 -0800 Subject: [PATCH 08/16] Anotha one --- config/queue.Dockerfile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/config/queue.Dockerfile b/config/queue.Dockerfile index f84033f..253df6d 100644 --- a/config/queue.Dockerfile +++ b/config/queue.Dockerfile @@ -28,8 +28,13 @@ RUN --mount=type=cache,target=/usr/local/cargo/registry \ # COPY --from=jrottenberg/ffmpeg:7.1-ubuntu2404-edge /opt/ffmpeg /usr/local/ffmpeg FROM jrottenberg/ffmpeg:7.1-ubuntu2404-edge +# Install runtime dependencies +RUN apt-get update && apt-get install -y \ + mlocate \ + && rm -rf /var/lib/apt/lists/* -ENTRYPOINT [ "which ffmpeg" ] +ENTRYPOINT ["which"] +CMD ["ffmpeg"] # Runtime stage # FROM --platform=$TARGETPLATFORM debian:bullseye-slim From b3a82eccbdbd71450ce0eafa59c2228bfe21437d Mon Sep 17 00:00:00 2001 From: Zachary Corvidae Date: Thu, 30 Jan 2025 22:24:23 -0800 Subject: [PATCH 09/16] Anotha one --- config/queue.Dockerfile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/config/queue.Dockerfile b/config/queue.Dockerfile index 253df6d..7f99b55 100644 --- a/config/queue.Dockerfile +++ b/config/queue.Dockerfile @@ -29,9 +29,8 @@ RUN --mount=type=cache,target=/usr/local/cargo/registry \ FROM jrottenberg/ffmpeg:7.1-ubuntu2404-edge # Install runtime dependencies -RUN apt-get update && apt-get install -y \ - mlocate \ - && rm -rf /var/lib/apt/lists/* +RUN apt-get update && apt-get install -y which + ENTRYPOINT ["which"] CMD ["ffmpeg"] From 8fa786d53bebca75aeb31024dcfda9fe0aa1f7e5 Mon Sep 17 00:00:00 2001 From: Zachary Corvidae Date: Thu, 30 Jan 2025 22:28:08 -0800 Subject: [PATCH 10/16] Anotha one --- config/queue.Dockerfile | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/config/queue.Dockerfile b/config/queue.Dockerfile index 7f99b55..11d34aa 100644 --- a/config/queue.Dockerfile +++ b/config/queue.Dockerfile @@ -25,29 +25,23 @@ RUN --mount=type=cache,target=/usr/local/cargo/registry \ cargo build --release -p forge && \ cp /app/target/release/forge /usr/local/bin/forge -# COPY --from=jrottenberg/ffmpeg:7.1-ubuntu2404-edge /opt/ffmpeg /usr/local/ffmpeg -FROM jrottenberg/ffmpeg:7.1-ubuntu2404-edge -# Install runtime dependencies -RUN apt-get update && apt-get install -y which - - -ENTRYPOINT ["which"] -CMD ["ffmpeg"] # Runtime stage -# FROM --platform=$TARGETPLATFORM debian:bullseye-slim +FROM --platform=$TARGETPLATFORM debian:bullseye-slim -# # Install runtime dependencies -# RUN apt-get update && apt-get install -y \ -# ca-certificates \ -# libpq5 \ -# && rm -rf /var/lib/apt/lists/* +# Install runtime dependencies +RUN apt-get update && apt-get install -y \ + ca-certificates \ + libpq5 \ + && rm -rf /var/lib/apt/lists/* -# # Copy the binary from builder -# COPY --from=builder /usr/local/bin/forge /usr/local/bin/forge +# Copy the binary from builder +COPY --from=builder /usr/local/bin/forge /usr/local/bin/forge +# Copy ffmpeg +COPY --from=jrottenberg/ffmpeg:7.1-ubuntu2404-edge /usr/local/bin/ffmpeg /usr/local/bin/ffmpeg -# # Expose the health check server -# EXPOSE 8080 +# Expose the health check server +EXPOSE 8080 -# # Set the entrypoint -# ENTRYPOINT ["/usr/local/bin/forge"] +# Set the entrypoint +ENTRYPOINT ["/usr/local/bin/forge"] From db65411805aeaaac0e85d133ca17c09c043c2493 Mon Sep 17 00:00:00 2001 From: Zachary Corvidae Date: Thu, 30 Jan 2025 22:37:11 -0800 Subject: [PATCH 11/16] Fix queue location --- config/queue.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/queue.Dockerfile b/config/queue.Dockerfile index 11d34aa..b5f9b3d 100644 --- a/config/queue.Dockerfile +++ b/config/queue.Dockerfile @@ -38,7 +38,7 @@ RUN apt-get update && apt-get install -y \ # Copy the binary from builder COPY --from=builder /usr/local/bin/forge /usr/local/bin/forge # Copy ffmpeg -COPY --from=jrottenberg/ffmpeg:7.1-ubuntu2404-edge /usr/local/bin/ffmpeg /usr/local/bin/ffmpeg +COPY --from=jrottenberg/ffmpeg:7.1-ubuntu2404-edge /usr/local/bin/ffmpeg /usr/bin/ffmpeg # Expose the health check server EXPOSE 8080 From 8375bbacab22287957498232941a3329783e40f2 Mon Sep 17 00:00:00 2001 From: Zachary Corvidae Date: Thu, 30 Jan 2025 22:42:01 -0800 Subject: [PATCH 12/16] hail mary copy ffmprobe --- config/queue.Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/queue.Dockerfile b/config/queue.Dockerfile index b5f9b3d..393cf4e 100644 --- a/config/queue.Dockerfile +++ b/config/queue.Dockerfile @@ -39,6 +39,8 @@ RUN apt-get update && apt-get install -y \ COPY --from=builder /usr/local/bin/forge /usr/local/bin/forge # Copy ffmpeg COPY --from=jrottenberg/ffmpeg:7.1-ubuntu2404-edge /usr/local/bin/ffmpeg /usr/bin/ffmpeg +# Copy ffprobe +COPY --from=jrottenberg/ffmpeg:7.1-ubuntu2404-edge /usr/local/bin/ffprobe /usr/bin/ffprobe # Expose the health check server EXPOSE 8080 From e883952d6cdde3d9f82b24b74a6b34bdfe3f8da0 Mon Sep 17 00:00:00 2001 From: Zachary Corvidae Date: Thu, 30 Jan 2025 22:48:21 -0800 Subject: [PATCH 13/16] Add debug command --- packages/vod/src/stream.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/vod/src/stream.rs b/packages/vod/src/stream.rs index 56bbef4..dc158e8 100644 --- a/packages/vod/src/stream.rs +++ b/packages/vod/src/stream.rs @@ -84,6 +84,7 @@ impl Quality { impl HLSConverter { fn get_video_dimensions(&self, input_path: &Path) -> Result<(u32, u32)> { + debug!("Getting dimensions for {:?}", input_path); let output = Command::new(&self.ffmpeg_path) .arg("-i") .arg(input_path) From a1ad38bdbf272220632587bba06da4b5f04b3b0e Mon Sep 17 00:00:00 2001 From: Zachary Corvidae Date: Thu, 30 Jan 2025 22:49:30 -0800 Subject: [PATCH 14/16] Add vod debug logs --- k8s/base/queue/configmap.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s/base/queue/configmap.yaml b/k8s/base/queue/configmap.yaml index eba7c50..4595817 100644 --- a/k8s/base/queue/configmap.yaml +++ b/k8s/base/queue/configmap.yaml @@ -3,6 +3,6 @@ kind: ConfigMap metadata: name: farmhand-queue-config data: - RUST_LOG: "api=debug,db=debug,queue=debug,tower_http=debug,axum::rejection=trace" + RUST_LOG: "api=debug,db=debug,queue=debug,vod=debug,tower_http=debug,axum::rejection=trace" STORAGE: "videos/staging" UPLOAD_BUCKET: "farmhand" From a3e1df5e20aac9d24b026d46d08f5f720f90b570 Mon Sep 17 00:00:00 2001 From: Zachary Corvidae Date: Sat, 1 Feb 2025 13:30:35 -0800 Subject: [PATCH 15/16] Try changing the entrypoint --- config/queue.Dockerfile | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/config/queue.Dockerfile b/config/queue.Dockerfile index 393cf4e..02e917f 100644 --- a/config/queue.Dockerfile +++ b/config/queue.Dockerfile @@ -27,7 +27,7 @@ RUN --mount=type=cache,target=/usr/local/cargo/registry \ # Runtime stage -FROM --platform=$TARGETPLATFORM debian:bullseye-slim +FROM jrottenberg/ffmpeg:7.1-ubuntu2404-edge # Install runtime dependencies RUN apt-get update && apt-get install -y \ @@ -37,10 +37,6 @@ RUN apt-get update && apt-get install -y \ # Copy the binary from builder COPY --from=builder /usr/local/bin/forge /usr/local/bin/forge -# Copy ffmpeg -COPY --from=jrottenberg/ffmpeg:7.1-ubuntu2404-edge /usr/local/bin/ffmpeg /usr/bin/ffmpeg -# Copy ffprobe -COPY --from=jrottenberg/ffmpeg:7.1-ubuntu2404-edge /usr/local/bin/ffprobe /usr/bin/ffprobe # Expose the health check server EXPOSE 8080 From 56745b409a525c21a4b6290286db6feacfd1e15d Mon Sep 17 00:00:00 2001 From: Zachary Corvidae Date: Sat, 1 Feb 2025 13:39:56 -0800 Subject: [PATCH 16/16] Define ffmpeg location --- k8s/base/queue/configmap.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/k8s/base/queue/configmap.yaml b/k8s/base/queue/configmap.yaml index 4595817..3c2003b 100644 --- a/k8s/base/queue/configmap.yaml +++ b/k8s/base/queue/configmap.yaml @@ -6,3 +6,4 @@ data: RUST_LOG: "api=debug,db=debug,queue=debug,vod=debug,tower_http=debug,axum::rejection=trace" STORAGE: "videos/staging" UPLOAD_BUCKET: "farmhand" + FFMPEG_LOCATION: "/usr/local/bin/ffmpeg"