Skip to content

Commit

Permalink
clean up of Docker images
Browse files Browse the repository at this point in the history
  • Loading branch information
gfursin committed Jun 1, 2021
1 parent 68066ee commit 3d46688
Show file tree
Hide file tree
Showing 52 changed files with 340 additions and 1,354 deletions.
3 changes: 3 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
20210601:
* major clean up of testing of all Docker images

20210521:
* regular update of stable components

Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion docker/.cm/alias-u-4696e4c4f2198fc3

This file was deleted.

6 changes: 4 additions & 2 deletions docker/ck-ai/.cm/meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
}
},
"docker_tags": [
"ubuntu-20.04"
"ubuntu-20.04",
"ubuntu-18.04",
"centos-7"
],
"tags": [
"adaptive-container",
Expand All @@ -23,7 +25,7 @@
"tested": [
{
"email": "grigori@octoml.ai",
"iso_datetime": "2021-05-26T09:46:25.175776",
"iso_datetime": "2021-05-26T09:46:49.839336",
"name": "Grigori Fursin"
}
]
Expand Down
75 changes: 75 additions & 0 deletions docker/ck-ai/Dockerfile.centos-7
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Adaptive container with the CK interface
# Concept: https://arxiv.org/abs/2011.01149

FROM centos:7

# Contact
LABEL maintainer="Grigori Fursin <grigori@octoml.ai>"

# Shell info
SHELL ["/bin/bash", "-c"]
ENTRYPOINT ["/bin/bash", "-c"]

# Set noninteractive mode for apt (do not use ENV)
ARG DEBIAN_FRONTEND=noninteractive

# Notes: https://runnable.com/blog/9-common-dockerfile-mistakes
# Install system dependencies with gcc-9 (gcc-8 doesn't compile loadgen)
RUN yum update -y && \
yum install -y centos-release-scl && \
yum install -y devtoolset-9 \
yum install -y git wget zip bzip2 libz-dev libbz2-dev cmake curl unzip \
openssh-client vim mc tree \
gcc gcc-c++ autoconf autogen libtool make \
libffi-devel \
python3 python3-pip python3-devel \
sudo dnf

# Unavailable?:
# libc6-dev libssl-dev libbz2-dev \

# Prepare a user with a user group with a random id
RUN groupadd -g 1111 ckuser
RUN useradd -u 2222 -g ckuser --create-home --shell /bin/bash ckuser
RUN echo "ckuser:ckuser" | chpasswd
RUN echo "ckuser ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers

# Set user
USER ckuser:ckuser
WORKDIR /home/ckuser
ENV PATH="/home/ckuser/.local/bin:${PATH}"
RUN mkdir .ssh

RUN python3 --version

# Set the CK web service defaults.
ENV CK_PORT=3344 \
WFE_PORT=3344

EXPOSE ${CK_PORT}

# Switch to gcc-9 for a user
#RUN source /opt/rh/devtoolset-9/enable
ENV PATH=/opt/rh/devtoolset-9/root/bin:$PATH
RUN gcc --version
RUN g++ --version

# Install CK
RUN export DUMMY_CK=A
RUN ${DUMMY_CK} python3 -m pip install ck --user
RUN ${DUMMY_CK} python3 -m pip install wheel --user

# Clone ai repo
RUN ck pull repo:ai

# Install packages to CK env entries
RUN ck setup kernel --var.install_to_env=yes

RUN ck detect platform.os --platform_init_uoa=generic-linux-dummy
RUN ck detect soft:compiler.python --full_path=/usr/bin/python3
RUN ck detect soft:compiler.gcc --full_path=`which gcc`

# Install CK packages (CK automation 271a9004c9799191)

# Start bash
CMD bash
67 changes: 67 additions & 0 deletions docker/ck-ai/Dockerfile.ubuntu-18.04
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Adaptive container with the CK interface
# Concept: https://arxiv.org/abs/2011.01149

# (CK automation 6ab9df569d0d1e6b)
FROM ubuntu:18.04

LABEL maintainer="Grigori Fursin <grigori@octoml.ai>"

SHELL ["/bin/bash", "-c"]
ENTRYPOINT ["/bin/bash", "-c"]

ARG DEBIAN_FRONTEND=noninteractive

# (CK automation ee47d84311b9373d)
# Notes: https://runnable.com/blog/9-common-dockerfile-mistakes
# Install system dependencies
RUN apt update && \
apt install -y --no-install-recommends \
apt-utils \
git wget zip bzip2 libz-dev libbz2-dev cmake curl unzip \
openssh-client vim mc tree \
gcc g++ autoconf autogen libtool make libc6-dev \
libssl-dev libbz2-dev libffi-dev \
python3 python3-pip python3-dev \
sudo

# Prepare a user with a user group with a random id (CK automation 7b3ec2b6534f3394)
RUN groupadd -g 1111 ckuser
RUN useradd -u 2222 -g ckuser --create-home --shell /bin/bash ckuser
RUN echo "ckuser:ckuser" | chpasswd
RUN adduser ckuser sudo
RUN echo "ckuser ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers

# Set user (CK automation 8b8944a9b2c1f341)
USER ckuser:ckuser
WORKDIR /home/ckuser
ENV PATH="/home/ckuser/.local/bin:${PATH}"
RUN mkdir .ssh

# Set the CK web service defaults.
ENV CK_PORT=3344 \
WFE_PORT=3344

EXPOSE ${CK_PORT}

# Install CK (CK automation f49f20744aba90e2)
# We need to install new pip and setuptools otherwise there is a conflict
# with the local CK installation of Python packages ...
RUN export DUMMY_CK=B
RUN ${DUMMY_CK} python3 -m pip install --ignore-installed pip setuptools wheel --user
RUN ${DUMMY_CK} python3 -m pip install virtualenv --user
RUN ${DUMMY_CK} python3 -m pip install ck --user

# Clone CK repo(s) or pull them from Zenodo (CK automation f49f20744aba90e2)
RUN ck pull repo:ai

# Configure CK (CK automation ddea4415c4133ef9)
RUN ck setup kernel --var.install_to_env=yes

RUN ck detect platform.os --platform_init_uoa=generic-linux-dummy
RUN ck detect soft:compiler.python --full_path=/usr/bin/python3
RUN ck detect soft:compiler.gcc --full_path=`which gcc`

# Install CK packages (CK automation 271a9004c9799191)

# Start bash
CMD bash
126 changes: 47 additions & 79 deletions docker/ck-ai/Dockerfile.ubuntu-20.04
Original file line number Diff line number Diff line change
@@ -1,97 +1,65 @@
FROM ubuntu:20.04
# Adaptive container with the CK interface
# Concept: https://arxiv.org/abs/2011.01149

LABEL maintainer="Grigori Fursin <gfursin@cknowledge.io>"
# (CK automation 6ab9df569d0d1e6b)
FROM ubuntu:20.04

# Based on docker:mlperf-inference-v0.7.openvino
LABEL maintainer="Grigori Fursin <grigori@octoml.ai>"

# Use the Bash shell.
SHELL ["/bin/bash", "-c"]

# Allow stepping into the Bash shell interactively.
ENTRYPOINT ["/bin/bash", "-c"]

# Install known system dependencies and immediately clean up to make the image smaller.
# CK needs: git, wget, zip.
# cv2 needs: libgthread-2.0.
# Python 3.7 needs: libssl, libbz2, libffi.
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update -y\
&& apt install -y apt-utils\
&& apt upgrade -y\
&& apt install -y\
python3-all \
python3-pip \
libglib2.0-0 libsm6\
git wget bzip2 zip libz-dev\
cmake\
libgtk2.0-dev\
libssl-dev libbz2-dev libffi-dev\
mc\
vim tree\
&& apt clean

## Install Python 3.7 (needed to install TensorFlow 1.15.2 via pip).
#RUN cd /tmp \
# && wget https://www.python.org/ftp/python/3.7.8/Python-3.7.8.tgz \
# && tar xvf Python-3.7.8.tgz \
# && cd Python-3.7.8 \
# && ./configure --enable-optimizations --enable-shared --with-ensurepip=install \
# && make -j20 \
# && make altinstall \
# && rm -rf /tmp/*

# Create a non-root user with a fixed group id 1500 and a fixed user id 2000
# (hopefully distinct from any host user id for security reasons).
# See the README for the gory details.
RUN groupadd -g 1500 ckg
RUN useradd -u 2000 -g ckg --create-home --shell /bin/bash ck
USER ck:ckg
WORKDIR /home/ck
ARG DEBIAN_FRONTEND=noninteractive

# (CK automation ee47d84311b9373d)
# Notes: https://runnable.com/blog/9-common-dockerfile-mistakes
# Install system dependencies
RUN apt update && \
apt install -y --no-install-recommends \
apt-utils \
git wget zip bzip2 libz-dev libbz2-dev cmake curl unzip \
openssh-client vim mc tree \
gcc g++ autoconf autogen libtool make libc6-dev \
libssl-dev libbz2-dev libffi-dev \
python3 python3-pip python3-dev \
sudo

# Prepare a user with a user group with a random id (CK automation 7b3ec2b6534f3394)
RUN groupadd -g 1111 ckuser
RUN useradd -u 2222 -g ckuser --create-home --shell /bin/bash ckuser
RUN echo "ckuser:ckuser" | chpasswd
RUN adduser ckuser sudo
RUN echo "ckuser ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers

# Set user (CK automation 8b8944a9b2c1f341)
USER ckuser:ckuser
WORKDIR /home/ckuser
ENV PATH="/home/ckuser/.local/bin:${PATH}"
RUN mkdir .ssh

# Install Collective Knowledge (CK). Make it group-executable.
ENV CK_ROOT=/home/ck/CK \
CK_REPOS=/home/ck/CK_REPOS \
CK_TOOLS=/home/ck/CK_TOOLS \
PATH=${CK_ROOT}/bin:/home/ck/.local/bin:${PATH} \
LD_LIBRARY_PATH=/usr/local/lib \
CK_CC=gcc \
CK_PYTHON=python3.8 \
GIT_USER="ctuning" \
GIT_EMAIL="admin@ctuning.org" \
LANG=C.UTF-8
# Set the CK web service defaults.
ENV CK_PORT=3344 \
WFE_PORT=3344

RUN mkdir -p ${CK_ROOT} ${CK_REPOS} ${CK_TOOLS}
EXPOSE ${CK_PORT}

# Install CK (CK automation f49f20744aba90e2)
# We need to install new pip and setuptools otherwise there is a conflict
# with the local CK installation of Python packages ...
RUN export DUMMY_CK=A
RUN ${CK_PYTHON} --version
RUN ${DUMMY_CK} ${CK_PYTHON} -m pip install --ignore-installed pip setuptools wheel --user
RUN ${DUMMY_CK} ${CK_PYTHON} -m pip install pyyaml virtualenv --user
RUN ${DUMMY_CK} ${CK_PYTHON} -m pip install ck --user
RUN export DUMMY_CK=B
RUN ${DUMMY_CK} python3 -m pip install setuptools
RUN ${DUMMY_CK} python3 -m pip install virtualenv
RUN ${DUMMY_CK} python3 -m pip install ck

# Pull CK AI repository
# Clone CK repo(s) or pull them from Zenodo (CK automation f49f20744aba90e2)
RUN ck pull repo:ai

# Use generic Linux settings with dummy frequency setting scripts.
RUN ck detect platform.os --platform_init_uoa=generic-linux-dummy

# Detect C/C++ compiler (gcc).
RUN ck detect soft:compiler.gcc --full_path=`which ${CK_CC}`

# Detect CMake build tool.
RUN ck detect soft --tags=cmake --full_path=`which cmake`
# Configure CK (CK automation ddea4415c4133ef9)
RUN ck setup kernel --var.install_to_env=yes

# Detect Python.
RUN ck detect soft --tags=compiler,python --full_path=`which ${CK_PYTHON}`

# Set the CK web service defaults.
ENV CK_PORT=3344 \
WFE_PORT=3344
RUN ck detect platform.os --platform_init_uoa=generic-linux-dummy
RUN ck detect soft:compiler.python --full_path=/usr/bin/python3
RUN ck detect soft:compiler.gcc --full_path=`which gcc`

# Expose CK port
EXPOSE ${CK_PORT}
# Install CK packages (CK automation 271a9004c9799191)

# Start bash
CMD bash
2 changes: 1 addition & 1 deletion docker/ck-crowdtune/Dockerfile.ubuntu-20.04-gcc
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ RUN ${DUMMY_CK} python3 -m pip install virtualenv
RUN ${DUMMY_CK} python3 -m pip install ck

# Clone CK repo(s) or pull them from Zenodo (CK automation f49f20744aba90e2)
RUN ck pull repo:ck-ml
RUN ck pull repo:ai

# Configure CK (CK automation ddea4415c4133ef9)
RUN ck setup kernel --var.install_to_env=yes
Expand Down
2 changes: 1 addition & 1 deletion docker/ck-crowdtune/Dockerfile.ubuntu-20.04-llvm-12
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ RUN ${DUMMY_CK} python3 -m pip install virtualenv
RUN ${DUMMY_CK} python3 -m pip install ck

# Clone CK repo(s) or pull them from Zenodo (CK automation f49f20744aba90e2)
RUN ck pull repo:ck-ml
RUN ck pull repo:ai

# Configure CK (CK automation ddea4415c4133ef9)
RUN ck setup kernel --var.install_to_env=yes
Expand Down
4 changes: 2 additions & 2 deletions docker/ck-web-server/Dockerfile.centos-7
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ RUN export DUMMY_CK=A
RUN ${DUMMY_CK} python3 -m pip install ck --user
RUN ${DUMMY_CK} python3 -m pip install wheel --user

# Clone ck-ml repo
RUN ck pull repo:ck-ml
# Clone ai repo
RUN ck pull repo:ai

# Install packages to CK env entries
RUN ck setup kernel --var.install_to_env=yes
Expand Down
2 changes: 1 addition & 1 deletion docker/ck-web-server/Dockerfile.ubuntu-18.04
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ RUN ${DUMMY_CK} python3 -m pip install virtualenv --user
RUN ${DUMMY_CK} python3 -m pip install ck --user

# Clone CK repo(s) or pull them from Zenodo (CK automation f49f20744aba90e2)
RUN ck pull repo:ck-ml
RUN ck pull repo:ai

# Configure CK (CK automation ddea4415c4133ef9)
RUN ck setup kernel --var.install_to_env=yes
Expand Down
2 changes: 1 addition & 1 deletion docker/ck-web-server/Dockerfile.ubuntu-20.04
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ RUN ${DUMMY_CK} python3 -m pip install virtualenv
RUN ${DUMMY_CK} python3 -m pip install ck

# Clone CK repo(s) or pull them from Zenodo (CK automation f49f20744aba90e2)
RUN ck pull repo:ck-ml
RUN ck pull repo:ai

# Configure CK (CK automation ddea4415c4133ef9)
RUN ck setup kernel --var.install_to_env=yes
Expand Down
2 changes: 1 addition & 1 deletion docker/ck/Dockerfile.centos-7
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ RUN ${DUMMY_CK} python3 -m pip install ck --user
RUN ${DUMMY_CK} python3 -m pip install wheel --user

# Clone ck-ml repo
RUN ck pull repo:ck-ml
RUN ck pull repo:ai

# Install packages to CK env entries
RUN ck setup kernel --var.install_to_env=yes
Expand Down
2 changes: 1 addition & 1 deletion docker/ck/Dockerfile.ubuntu-18.04
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ RUN ${DUMMY_CK} python3 -m pip install virtualenv --user
RUN ${DUMMY_CK} python3 -m pip install ck --user

# Clone CK repo(s) or pull them from Zenodo (CK automation f49f20744aba90e2)
RUN ck pull repo:ck-ml
RUN ck pull repo:ai

# Configure CK (CK automation ddea4415c4133ef9)
RUN ck setup kernel --var.install_to_env=yes
Expand Down
2 changes: 1 addition & 1 deletion docker/ck/Dockerfile.ubuntu-20.04
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ RUN ${DUMMY_CK} python3 -m pip install virtualenv
RUN ${DUMMY_CK} python3 -m pip install ck

# Clone CK repo(s) or pull them from Zenodo (CK automation f49f20744aba90e2)
RUN ck pull repo:ck-ml
RUN ck pull repo:ai

# Configure CK (CK automation ddea4415c4133ef9)
RUN ck setup kernel --var.install_to_env=yes
Expand Down
Loading

0 comments on commit 3d46688

Please sign in to comment.