1
0

Updated container to isolate solution components and try and get it building

Signed-off-by: James Ketrenos <james.p.ketrenos@intel.com>
This commit is contained in:
James Ketrenos 2019-09-17 11:58:28 -07:00
parent 6ebca6317c
commit 4f66be365b
5 changed files with 121 additions and 46 deletions

View File

@ -19,7 +19,7 @@
# Derivatives include -dev variation which adds git, build-essentials, # Derivatives include -dev variation which adds git, build-essentials,
# source repos, etc. # source repos, etc.
# #
FROM amr-registry.caas.intel.com/vtt-osgc/os/osgc-ubuntu:eoan FROM amr-registry.caas.intel.com/vtt-osgc/os/osgc-ubuntu:disco
# #
# Template begins here (from templates/templates/05-intel-proxy.in) # Template begins here (from templates/templates/05-intel-proxy.in)
@ -94,9 +94,9 @@ RUN apt-add-repository "deb [arch=amd64] http://osgc.jf.intel.com/packages/agama
# Update and install the Mesa, OpenCL, and Media from Agama # Update and install the Mesa, OpenCL, and Media from Agama
RUN apt-get -q update \ RUN apt-get -q update \
&& DEBIAN_FRONTEND=noninteractive apt-get --no-install-recommends -q -y install \ && DEBIAN_FRONTEND=noninteractive apt-get --no-install-recommends -q -y install \
libgl1-mesa-glx=19.1.0.agama-109 libgl1-mesa-dri=19.1.0.agama-109 \ libgl1-mesa-glx=19.1.0.agama-169 libgl1-mesa-dri=19.1.0.agama-169 \
intel-opencl=19.32.109 \ intel-opencl=19.38.169 \
intel-media=2.10.109 libva2=2.4.0.agama-109 \ intel-media=2.10.169 libva2=2.6.0.agama-169 \
ocl-icd-libopencl1 \ ocl-icd-libopencl1 \
&& apt-get clean \ && apt-get clean \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
@ -105,25 +105,59 @@ RUN apt-get -q update \
# #
# Solution begins here (from Dockerfile.solution) # Solution begins here (from Dockerfile.solution)
# #
# Fetch build tools and source for clinfo, then build it #
# Docker.solution based on the Intel-Media-SDK instructions available here:
#
# https://github.com/Intel-Media-SDK/MediaSDK/wiki/Build-and-use-ffmpeg-with-MediaSDK
# #
# This should really be part of a multi-stage build so the final # This should really be part of a multi-stage build so the final
# image isn't polluted with build artifacts # image isn't polluted with build artifacts
# #
# NOTE: This image will only work with Ubuntu 19.04 (disco) and newer
# Install git and build tools, clone ffmpeg, and get ready to build it
RUN apt-get update \ RUN apt-get update \
&& apt-get remove -y clinfo \ && DEBIAN_FRONTEND=noninteractive apt-get -q -y install \
&& DEBIAN_FRONTEND=noninteractive apt-get --no-install-recommends -q -y install \ git build-essential
git build-essential opencl-c-headers \
# Clone ffmpeg
# NOTE: This explicitly clones the FFMPEG_TAG_VERSION (see SOLUTIONS)
RUN git clone --depth 1 --branch n4.2.1 https://github.com/ffmpeg/ffmpeg /home/agama/ffmpeg
# Install all required common packages:
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get -q -y install \
libva-dev=2.6.0.agama-169 \
libmfx-dev=19.2.pre3.agama-169 \
libmfx1=19.2.pre3.agama-169 \
&& apt-get clean \ && apt-get clean \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
WORKDIR /home/agama RUN apt-cache policy libmfx1 \
&& apt-cache policy libmfx-dev \
&& apt-cache search libmfx
RUN git clone https://gitlab.devtools.intel.com/jketreno/clinfo.git \ ENV LIBVA_DRIVER_NAME=iHD
&& cd clinfo \
&& make
RUN DEBIAN_FRONTEND=noninteractive apt-get remove -q -y git build-essential opencl-c-headers # Build FFmpeg
WORKDIR /home/agama/ffmpeg
CMD [ "/home/agama/clinfo/clinfo" ] RUN ./configure --arch=x86_64 --disable-yasm --enable-vaapi --enable-libmfx \
&& make \
&& make install
#
# Standard ending begins here (from templates/ending.in)
#
# NOTE: This should be added as the last template entry
# as it will always modify a layer (since the Dockerfile
# changes,) causing all subsequent layers to be
# regenerated.
# Ensure that each Docker container self-documents the
# versions included in it
ENV AGAMA_VERSION=169
COPY MANIFEST SOLUTION Dockerfile /assets/

View File

@ -1,22 +1,41 @@
# Fetch build tools and source for clinfo, then build it #
# Docker.solution based on the Intel-Media-SDK instructions available here:
#
# https://github.com/Intel-Media-SDK/MediaSDK/wiki/Build-and-use-ffmpeg-with-MediaSDK
# #
# This should really be part of a multi-stage build so the final # This should really be part of a multi-stage build so the final
# image isn't polluted with build artifacts # image isn't polluted with build artifacts
# #
# NOTE: This image will only work with Ubuntu 19.04 (disco) and newer
# Install git and build tools, clone ffmpeg, and get ready to build it
RUN apt-get update \ RUN apt-get update \
&& apt-get remove -y clinfo \ && DEBIAN_FRONTEND=noninteractive apt-get -q -y install \
&& DEBIAN_FRONTEND=noninteractive apt-get --no-install-recommends -q -y install \ git build-essential
git build-essential opencl-c-headers \
# Clone ffmpeg
# NOTE: This explicitly clones the FFMPEG_TAG_VERSION (see SOLUTIONS)
RUN git clone --depth 1 --branch $FFMPEG_TAG_VERSION https://github.com/ffmpeg/ffmpeg /home/agama/ffmpeg
# Install all required common packages:
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get -q -y install \
libva-dev=$LIBVA_DEV_VERSION \
libmfx-dev=$LIBMFX_DEV_VERSION \
libmfx1=$LIBMFX1_VERSION \
&& apt-get clean \ && apt-get clean \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
WORKDIR /home/agama RUN apt-cache policy libmfx1 \
&& apt-cache policy libmfx-dev \
&& apt-cache search libmfx
RUN git clone https://gitlab.devtools.intel.com/jketreno/clinfo.git \ ENV LIBVA_DRIVER_NAME=iHD
&& cd clinfo \
&& make
RUN DEBIAN_FRONTEND=noninteractive apt-get remove -q -y git build-essential opencl-c-headers # Build FFmpeg
WORKDIR /home/agama/ffmpeg
CMD [ "/home/agama/clinfo/clinfo" ]
RUN ./configure --arch=x86_64 --disable-yasm --enable-vaapi --enable-libmfx \
&& make \
&& make install

View File

@ -46,13 +46,13 @@ Solution specific definitions:
CONTAINER_IMAGE is used as the container tag name CONTAINER_IMAGE is used as the container tag name
OS_DISTRO is used as the base OS distribution. Possible values: ubuntu OS_DISTRO is used as the base OS distribution. Possible values: ubuntu
OS_VERSION is used as the OS version. Possible values: disco, eoan OS_RELEASE is used as the OS version. Possible values: disco, eoan
## MANIFEST ## MANIFEST
The version of MANIFEST was hard coded by reading the set of Agama packages The version of MANIFEST is created by the set of Agama packages from the Agama
on my local disk, sorting, and name-mangling them to be VERSION declarations. repository and name-mangling them to be a VERSION declaration:
For example: For example:
@ -62,6 +62,25 @@ is changed to:
LIBGL1_MESA_GLX_VERSION=19.0.1-agama-109 LIBGL1_MESA_GLX_VERSION=19.0.1-agama-109
The script you can use to recreate the OS_RELEASE defined in SOLUTION is:
NOTE: This only works on the Ubuntu releases.
```bash
AGAMA_VERSION=169
. SOLUTION
echo "AGAMA_VERSION=${AGAMA_VERSION}" > MANIFEST
wget -q -O - \
https://osgc.jf.intel.com/packages/agama/ubuntu/dists/${OS_RELEASE}/main/binary-amd64/Packages.bz2 |
bunzip2 |
sed -nE 's/^(Package|Version): (.*)/\2/p' |
paste -s -d' \n' |
while read package version rest; do
package=$(echo $package | sed -E -e s#-#_#g -e 's#(.*)#\U\1#g')_VERSION
echo $package=$version
done | grep ${AGAMA_VERSION}\$ >> MANIFEST
```
This allows the Dockerfile templates to then version pin Agama packages: This allows the Dockerfile templates to then version pin Agama packages:
```Dockerfile ```Dockerfile
@ -72,23 +91,6 @@ The `scripts/build-dockerfile` loads MANIFEST, which defines
LIBGL1_MESA_GLX_VERSION. That is then subsituted for the version in LIBGL1_MESA_GLX_VERSION. That is then subsituted for the version in
the above Dockerfile snippet when being placed into the main Dockerfile. the above Dockerfile snippet when being placed into the main Dockerfile.
The generic script I ran to generate these names is below, although
it doesn't quite work and a few entries were modified by hand. This should
be replaced by a tool that is actually querying the .deb packages and
building the manifest.
```bash
echo "AGAMA_VERSION=109"
find /var/www/packages/ -path '*public*' -name '*deb' -printf '%f\n' |
sort |
uniq |
sed -E \
-e s,_,=,g \
-e 's,=all\.deb|\.x86_64\.deb|=amd64\.deb,_VERSION,g' \
-e s,-\([^0-9]\),_\\1,g \
-e 's,^([^=]*),\U\1,'
```
# Tagging # Tagging
If the build succeeds, we want to be able to tag the git project If the build succeeds, we want to be able to tag the git project

View File

@ -25,7 +25,7 @@ cat << EOM > Dockerfile
# #
EOM EOM
for snippet in templates/*.in; do for snippet in templates/??-*.in; do
cat << EOM >> Dockerfile cat << EOM >> Dockerfile
# #
@ -44,6 +44,15 @@ EOM
envsubst < Dockerfile.solution >> Dockerfile envsubst < Dockerfile.solution >> Dockerfile
cat << EOM >> Dockerfile
#
# Standard ending begins here (from templates/ending.in)
#
EOM
envsubst < templates/ending.in >> Dockerfile
docker build . -t $CONTAINER:agama-${AGAMA_VERSION} docker build . -t $CONTAINER:agama-${AGAMA_VERSION}
cat << EOM cat << EOM

11
templates/ending.in Normal file
View File

@ -0,0 +1,11 @@
# NOTE: This should be added as the last template entry
# as it will always modify a layer (since the Dockerfile
# changes,) causing all subsequent layers to be
# regenerated.
# Ensure that each Docker container self-documents the
# versions included in it
ENV AGAMA_VERSION=${AGAMA_VERSION}
COPY MANIFEST SOLUTION Dockerfile /assets/