Skip to content

Commit

Permalink
Update docker build script
Browse files Browse the repository at this point in the history
  • Loading branch information
eritpchy committed Oct 12, 2023
1 parent 9216dfe commit 6107204
Show file tree
Hide file tree
Showing 12 changed files with 51 additions and 25 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/build-cpu-linux-x64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true
-
name: Get current date
id: date
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/build-cpu-static-linux-x64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true
-
name: Get current date
id: date
Expand All @@ -56,6 +58,7 @@ jobs:
name: videosubfinder-cli-cpu-linux-x64.tar.gz
path: |
./Build/Docker/cpu_static/out/videosubfinder-cli-cpu-static-linux-x64.tar.gz
./Build/Docker/cpu_static/out/videosubfinder-cli-cpu-static-upx-linux-x64.tar.gz
-
name: Release draft
uses: softprops/action-gh-release@v1
Expand All @@ -65,4 +68,5 @@ jobs:
tag_name: "${{ env.release_version }}-ci"
files: |
./Build/Docker/cpu_static/out/videosubfinder-cli-cpu-static-linux-x64.tar.gz
./Build/Docker/cpu_static/out/videosubfinder-cli-cpu-static-upx-linux-x64.tar.gz
body: "[Github Action](https://github.com/${{github.repository}}/actions/runs/${{github.run_id}})"
4 changes: 3 additions & 1 deletion .github/workflows/build-cuda-linux-x64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true
-
name: Get current date
id: date
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/build-darwin-x64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ jobs:
steps:
-
name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true
-
name: Get current date
id: date
Expand Down
6 changes: 3 additions & 3 deletions Build/Docker/cpu/base.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM ubuntu:20.04 as builder
# Allow ubuntu to cache package downloads
RUN rm -f /etc/apt/apt.conf.d/docker-clean
RUN --mount=type=cache,target=/var/cache/apt \
apt update
RUN --mount=type=cache,target=/var/cache/apt \
RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
echo 1; apt update
RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
DEBIAN_FRONTEND=noninteractive apt install -y git cmake wget libtbb-dev \
libavcodec-dev libgtk-3-dev libavformat-dev libswscale-dev libavfilter-dev build-essential \
&& if [[ "USE_GUI" = "1" ]] ; then DEBIAN_FRONTEND=noninteractive apt install -y \
Expand Down
7 changes: 5 additions & 2 deletions Build/Docker/cpu/build_base.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash
set -e
cd ${0%/*}
docker build -t eritpchy/videosubfinder-build:base -f base.Dockerfile ../..
docker push eritpchy/videosubfinder-build:base
docker buildx build \
--platform linux/amd64,linux/arm64 \
--push \
-t eritpchy/videosubfinder-build:base \
-f base.Dockerfile ../..
19 changes: 12 additions & 7 deletions Build/Docker/cpu_static/base.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,25 @@ FROM ubuntu:20.04 as builder
# Allow ubuntu to cache package downloads
RUN rm -f /etc/apt/apt.conf.d/docker-clean
ARG USE_GUI=0
RUN --mount=type=cache,target=/var/cache/apt \
RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
apt update
RUN --mount=type=cache,target=/var/cache/apt \
RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
DEBIAN_FRONTEND=noninteractive apt install -y ccache build-essential curl git
ENV PATH="/usr/lib/ccache:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/tmp/work/ffmpeg-build-script/workspace/bin"
RUN mkdir -p /tmp/work
RUN --mount=type=cache,target=/root/.ccache \
RUN --mount=type=cache,target=/var/cache/apt,sharing=private \
DEBIAN_FRONTEND=noninteractive apt install -y cmake
RUN --mount=type=cache,target=/root/.ccache,sharing=private \
cd /tmp/work/ \
&& git clone https://github.com/markus-perl/ffmpeg-build-script.git -b master --depth=1 \
&& git clone https://github.com/markus-perl/ffmpeg-build-script.git -b v1.46 --depth=1 \
&& cd ffmpeg-build-script \
&& bash -c '([[ "aarch64" == "$(uname -m)" ]] && sed -i "s|https://github.com/videolan/x265/archive/Release_3.5.tar.gz|https://bitbucket.org/multicoreware/x265_git/get/931178347b3f73e40798fd5180209654536bbaa5.tar.gz|g" ./build-ffmpeg || true)' \
&& bash -c '([[ "aarch64" == "$(uname -m)" ]] && sed -i "s|https://github.com/georgmartius/vid.stab/archive/v1.1.0.tar.gz|https://github.com/meneguzzi/vid.stab/archive/refs/heads/sse2neon.tar.gz|g" ./build-ffmpeg || true)' \
&& sed -i "s|netactuate|onboardcloud|g" ./build-ffmpeg \
&& sed -i "s|netcologne|onboardcloud|g" ./build-ffmpeg \
&& AUTOINSTALL="yes" ./build-ffmpeg --enable-gpl-and-non-free --build --full-static \
&& true
RUN --mount=type=cache,target=/root/.ccache \
RUN --mount=type=cache,target=/root/.ccache,sharing=private \
cd /tmp/work \
&& git clone https://github.com/wxWidgets/wxWidgets.git -b v3.2.2.1 --depth=1 --recurse-submodules -j8 \
&& cd wxWidgets/ \
Expand All @@ -26,7 +31,7 @@ RUN --mount=type=cache,target=/root/.ccache \
&& make install \
&& rm -rf /tmp/work/wxWidgets \
&& true
RUN --mount=type=cache,target=/root/.ccache \
RUN --mount=type=cache,target=/root/.ccache,sharing=private \
cd /tmp/work \
&& git clone https://github.com/opencv/opencv.git -b 4.8.0 --depth=1 \
&& cd opencv \
Expand All @@ -42,7 +47,7 @@ RUN --mount=type=cache,target=/root/.ccache \
# OpenCV full staitc library
RUN grep -R -l "\.so" /usr/local/lib/cmake/opencv4/*.cmake | xargs -I{} sed -i 's/\.so/.a/g' {}

RUN --mount=type=cache,target=/root/.ccache \
RUN --mount=type=cache,target=/root/.ccache,sharing=private \
cd /tmp/work \
&& git clone https://github.com/oneapi-src/oneTBB.git -b v2020.3.3 --depth=1 \
&& cd oneTBB \
Expand Down
4 changes: 1 addition & 3 deletions Build/Docker/cpu_static/build.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,5 @@ RUN cd /tmp/work/videosubfinder-src \
RUN --mount=type=cache,target=/var/cache/apt \
DEBIAN_FRONTEND=noninteractive apt install -y upx-ucl \
&& cd /tmp/work \
&& mv ./VideoSubFinderCli ./VideoSubFinderCli.1 \
&& upx -f -o ./VideoSubFinderCli ./VideoSubFinderCli.1 \
&& rm -fv ./VideoSubFinderCli.1 \
&& upx -f -o ./VideoSubFinderCli.upx ./VideoSubFinderCli \
&& true
11 changes: 9 additions & 2 deletions Build/Docker/cpu_static/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,12 @@ else
fi
mkdir -p out
docker run --rm -v $PWD/out:$PWD/out videosubfinder-build:cpu-static \
bash -c "cd /tmp/work/ && tar cvzf $PWD/out/videosubfinder-cli-cpu-static-linux-x64.tar.gz \
VideoSubFinderCli VideoSubFinderCli.run settings"
bash -c "ARCH=\$(uname -m) \
&& ARCH=\${ARCH/x86_64/x64} \
&& cd /tmp/work/ \
&& tar cvzf $PWD/out/videosubfinder-cli-cpu-static-linux-\$ARCH.tar.gz \
VideoSubFinderCli VideoSubFinderCli.run settings \
&& mv -fv ./VideoSubFinderCli.upx ./VideoSubFinderCli \
&& tar cvzf $PWD/out/videosubfinder-cli-cpu-static-upx-linux-\$ARCH.tar.gz \
VideoSubFinderCli VideoSubFinderCli.run settings \
"
7 changes: 5 additions & 2 deletions Build/Docker/cpu_static/build_base.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash
set -e
cd ${0%/*}
docker build -t eritpchy/videosubfinder-build:base-cpu-static -f base.Dockerfile ../..
docker push eritpchy/videosubfinder-build:base-cpu-static
docker buildx build \
--platform linux/amd64,linux/arm64 \
--push \
-t eritpchy/videosubfinder-build:base-cpu-static \
-f base.Dockerfile ../..
2 changes: 1 addition & 1 deletion Build/Docker/cpu_static/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -e
cd ${0%/*}
docker run --rm -v $PWD/../test_en.mp4:/test_en.mp4:ro -v $PWD/out:$PWD/out:ro alpine \
sh -c "mkdir /tmp/work;cd /tmp/work/ && tar xvf $PWD/out/videosubfinder-cli-cpu-static-linux-x64.tar.gz \
sh -c "mkdir /tmp/work;cd /tmp/work/ && tar xvf $PWD/out/videosubfinder-cli-cpu-static-linux-\$(uname -m|sed 's|x86_64|x64|g').tar.gz \
&& time ./VideoSubFinderCli -i /test_en.mp4 -r -c -te 1 -be 0 -le 0 -re 1 \
&& (ls RGBImages/*.jpeg && echo TEST SUCCESS || TEST FAIL) \
"
2 changes: 1 addition & 1 deletion Components/IPAlgorithms/SSAlgorithms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ class RunSearch
int ymax = m_ymax;
bool convert_to_lab = m_convert_to_lab;

m_thrs_save_images.push(([ImFrameData, ImBGR, ImISA, ImILA, name, w, h, W, H, xmin, xmax, ymin, ymax, convert_to_lab](int id) mutable {
m_thrs_save_images.push(([ImBGR, ImISA, ImILA, name, w, h, W, H, xmin, xmax, ymin, ymax, convert_to_lab](int id) mutable {
g_file_names_vector.push_back(name);
fprintf(stderr, "Frame: %s\n", name.ToStdString().c_str());
fflush(stderr);
Expand Down

0 comments on commit 6107204

Please sign in to comment.