Skip to content

Commit

Permalink
more wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Zubnix committed Nov 2, 2023
1 parent d5cc293 commit 9f3d6f6
Show file tree
Hide file tree
Showing 8 changed files with 101 additions and 133 deletions.
34 changes: 31 additions & 3 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
.idea/
.github/
.git/
.gitattributes
.gitignore
LICENSE
README.md
.yarn/cache/
.yarn/install-state.gz
libs/xtsb/node_modules
libs/xtsb/dist
.idea
libs/compositor-proxy-generator/node_modules/
libs/compositor-proxy-generator/.gitignore
libs/compositor-proxy-generator/LICENSE
libs/xtsb/node_modules/
libs/xtsb/dist/
libs/xtsb/xcbgen/
libs/xtsb/test/
libs/xtsb/protocol/
libs/xtsb/.prettierrc.js
libs/xtsb/LICENSE
libs/xtsb/README.md
packages/compositor-proxy/build/
packages/compositor-proxy/dist/
packages/compositor-proxy/node_modules/
packages/compositor-proxy/types/
packages/compositor-proxy/.eslintrc.js
packages/compositor-proxy/.prettierrc.js
packages/compositor-proxy/jest.config.js
packages/compositor-proxy-cli/dist/
packages/compositor-proxy-cli/node_modules/
packages/compositor-proxy-cli/.eslintrc.js
packages/compositor-proxy-cli/.prettierrc.js
packages/compositor-proxy-cli/.gitignore
packages/compositor-proxy-cli/example-applications.json
11 changes: 0 additions & 11 deletions docker-build.sh

This file was deleted.

File renamed without changes.
109 changes: 55 additions & 54 deletions Dockerfile → docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
# syntax=docker/dockerfile:1
FROM debian:bookworm-20231009-slim as BUILD
FROM debian:bookworm-20231030-slim as BUILD

ENV NODE_VERSION="v20.9.0"
ENV NODE_DISTRO="linux-x64"

WORKDIR /app

COPY ["package.json", "yarn.lock", ".yarnrc.yml", "./"]
COPY [".yarn/", "./.yarn/"]
COPY ["libs/xtsb/package.json", "./libs/xtsb/package.json"]
COPY ["libs/compositor-proxy-generator/package.json", "./libs/compositor-proxy-generator/package.json"]
COPY ["packages/compositor-proxy/package.json", "./packages/compositor-proxy/package.json"]
COPY ["packages/compositor-proxy-cli/package.json", "./packages/compositor-proxy-cli/package.json"]

COPY ["libs/xtsb/tsconfig.json", "libs/xtsb/tsconfig.node.json", "./libs/xtsb/"]
COPY ["libs/xtsb/src/", "./libs/xtsb/src/"]

COPY ["packages/compositor-proxy/tsconfig.json", "packages/compositor-proxy/CMakeLists.txt", "./packages/compositor-proxy/"]
COPY ["packages/compositor-proxy/native/", "./packages/compositor-proxy/native/"]
COPY ["packages/compositor-proxy/src/", "./packages/compositor-proxy/src/"]

COPY ["packages/compositor-proxy-cli/tsconfig.json", "./packages/compositor-proxy-cli/"]
COPY ["packages/compositor-proxy-cli/src/", "./packages/compositor-proxy-cli/src/"]

RUN apt-get update && apt-get install -y --no-install-recommends \
cmake \
Expand Down Expand Up @@ -28,65 +50,44 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
pipx \
&& apt-get autoremove -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN git clone --depth 1 --branch 1.20 https://gitlab.freedesktop.org/gstreamer/gstreamer.git
RUN cd /gstreamer \
&& pipx run meson build \
--buildtype=release \
--strip \
-Dgpl=enabled \
-Dorc=enabled \
-Dbase=enabled \
-Dgood=enabled \
-Dbad=enabled \
-Dugly=enabled \
-Dauto_features=disabled \
-Dgst-plugins-base:app=enabled \
-Dgst-plugins-base:gl=enabled \
-Dgst-plugins-base:gl-graphene=enabled \
-Dgst-plugins-base:gl_winsys=egl \
-Dgst-plugins-base:gl_api=opengl \
-Dgst-plugins-bad:gl=enabled \
-Dgst-plugins-bad:nvcodec=enabled \
&& rm -rf /var/lib/apt/lists/* \
&& git clone --depth 1 --branch 1.20 https://gitlab.freedesktop.org/gstreamer/gstreamer.git \
&& cd gstreamer \
&& pipx run meson build \
--buildtype=release \
--strip \
-Dgpl=enabled \
-Dorc=enabled \
-Dbase=enabled \
-Dgood=enabled \
-Dbad=enabled \
-Dugly=enabled \
-Dauto_features=disabled \
-Dgst-plugins-base:app=enabled \
-Dgst-plugins-base:gl=enabled \
-Dgst-plugins-base:gl-graphene=enabled \
-Dgst-plugins-base:gl_winsys=egl \
-Dgst-plugins-base:gl_api=opengl \
-Dgst-plugins-bad:gl=enabled \
-Dgst-plugins-bad:nvcodec=enabled \
&& ninja -C build

ENV NODE_VERSION="v20.9.0"
ENV NODE_DISTRO="linux-x64"
RUN curl https://nodejs.org/dist/$NODE_VERSION/node-$NODE_VERSION-$NODE_DISTRO.tar.xz --output node-$NODE_VERSION-$NODE_DISTRO.tar.xz
RUN tar xvf node-$NODE_VERSION-$NODE_DISTRO.tar.xz
ENV PATH="/node-$NODE_VERSION-$NODE_DISTRO/bin:$PATH"
RUN corepack enable

WORKDIR /app
COPY ["package.json", "yarn.lock", ".yarnrc.yml", "./"]
COPY [".yarn/", "./.yarn/"]
COPY ["libs/xtsb/package.json", "./libs/xtsb/package.json"]
COPY ["libs/compositor-proxy-generator/package.json", "./libs/compositor-proxy-generator/package.json"]
COPY ["packages/compositor-proxy/package.json", "./packages/compositor-proxy/package.json"]
COPY ["packages/compositor-proxy-cli/package.json", "./packages/compositor-proxy-cli/package.json"]
RUN yarn install

COPY ["libs/xtsb/protocol", "libs/xtsb/tsconfig.json", "libs/xtsb/tsconfig.node.json", "./libs/xtsb/"]
COPY ["libs/xtsb/src/", "./libs/xtsb/src/"]
RUN yarn workspace @gfld/xtsb build

COPY ["packages/compositor-proxy/tsconfig.json", "packages/compositor-proxy/CMakeLists.txt", "./packages/compositor-proxy/"]
COPY ["packages/compositor-proxy/native/", "./packages/compositor-proxy/native/"]
COPY ["packages/compositor-proxy/src/", "./packages/compositor-proxy/src/"]
RUN yarn workspace @gfld/compositor-proxy build

COPY ["packages/compositor-proxy-cli/tsconfig.json", "./packages/compositor-proxy-cli/"]
COPY ["packages/compositor-proxy-cli/src/", "./packages/compositor-proxy-cli/src/"]
RUN yarn workspace @gfld/compositor-proxy-cli build
RUN yarn workspace @gfld/compositor-proxy-cli package
RUN curl https://nodejs.org/dist/$NODE_VERSION/node-$NODE_VERSION-$NODE_DISTRO.tar.xz --output node-$NODE_VERSION-$NODE_DISTRO.tar.xz \
&& tar xvf node-$NODE_VERSION-$NODE_DISTRO.tar.xz
ENV PATH="/app/node-$NODE_VERSION-$NODE_DISTRO/bin:$PATH"
RUN corepack enable \
&& yarn install \
&& yarn workspace @gfld/xtsb build \
&& yarn workspace @gfld/compositor-proxy build \
&& yarn workspace @gfld/compositor-proxy-cli build \
&& yarn workspace @gfld/compositor-proxy-cli package

FROM debian:bookworm-20231030-slim

COPY --from=BUILD /gstreamer/build/subprojects/gst-plugins-bad/sys/nvcodec/libgstnvcodec.so /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstnvcodec.so
COPY 10_nvidia.json /usr/share/glvnd/egl_vendor.d/10_nvidia.json
COPY --from=BUILD /app/gstreamer/build/subprojects/gst-plugins-bad/sys/nvcodec/libgstnvcodec.so /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstnvcodec.so
COPY docker/10_nvidia.json /usr/share/glvnd/egl_vendor.d/10_nvidia.json
WORKDIR /app
COPY --from=BUILD /app/packages/compositor-proxy-cli/package/* .
COPY docker-entrypoint.sh .
COPY docker/docker-entrypoint.sh .
COPY packages/compositor-proxy-cli/wait-until-ready.sh .

RUN sed -i'' -e 's/main$/main contrib non-free/g' /etc/apt/sources.list.d/debian.sources \
Expand Down
9 changes: 9 additions & 0 deletions docker/docker-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
set -e
set -x

tag_postfix=$(date +%Y%m%d)
tag="docker.io/udevbe/compositor-proxy-cli:${tag_postfix}"

docker build --pull .. -t "${tag}" -f Dockerfile
printf "Build complete %s\n" "${tag}"
12 changes: 6 additions & 6 deletions docker-compose.yml → docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
compositor-proxy:
# runtime: nvidia
build:
context: packages/compositor-proxy-cli
context: ../packages/compositor-proxy-cli
dockerfile: Dockerfile
command:
- --session-id=test123
Expand Down Expand Up @@ -35,7 +35,7 @@ services:
# runtime: nvidia
pid: 'service:compositor-proxy'
build:
context: examples/docker-apps/gtk3-demo
context: ../examples/docker-apps/gtk3-demo
dockerfile: packages/compositor-proxy-cli/example-apps/gtk3-demo/Dockerfile
privileged: false
user: "1000:1000"
Expand All @@ -53,7 +53,7 @@ services:
# runtime: nvidia
pid: 'service:compositor-proxy'
build:
context: examples/docker-apps/gtk4-demo
context: ../examples/docker-apps/gtk4-demo
dockerfile: packages/compositor-proxy-cli/example-apps/gtk4-demo/Dockerfile
privileged: false
user: "1000:1000"
Expand All @@ -71,7 +71,7 @@ services:
# runtime: nvidia
pid: 'service:compositor-proxy'
build:
context: examples/docker-apps/alacritty
context: ../examples/docker-apps/alacritty
dockerfile: packages/compositor-proxy-cli/example-apps/alacritty/Dockerfile
privileged: false
user: "1000:1000"
Expand All @@ -90,7 +90,7 @@ services:
# runtime: nvidia
pid: 'service:compositor-proxy'
build:
context: examples/docker-apps/xterm
context: ../examples/docker-apps/xterm
dockerfile: packages/compositor-proxy-cli/example-apps/xterm/Dockerfile
privileged: false
user: "1000:1000"
Expand All @@ -111,7 +111,7 @@ services:
# runtime: nvidia
pid: 'service:compositor-proxy'
build:
context: examples/docker-apps/glxgears
context: ../examples/docker-apps/glxgears
dockerfile: packages/compositor-proxy-cli/example-apps/glxgears/Dockerfile
ipc: host
privileged: false
Expand Down
File renamed without changes.
59 changes: 0 additions & 59 deletions packages/compositor-proxy/README.md

This file was deleted.

0 comments on commit 9f3d6f6

Please sign in to comment.