Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions .github/docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ development environment.

# How to build docker image

To build docker image on local machine execute:
To build docker image on local machine enter the root dir of the repository and execute:

```sh
docker build -t ur:ubuntu-22.04 -f ./ubuntu-22.04.Dockerfile .
docker build -t ur:ubuntu-22.04 -f .github/docker/ubuntu-22.04.Dockerfile .
```

To set any build time variable (e.g., an optional ARG from docker recipe), add to the command (after `build`), e.g.:
Expand Down Expand Up @@ -40,3 +40,9 @@ To set (or override) any docker environment variable, add to the command (after
```sh
-e ENV_VARIABLE=VALUE
```

To start as a non-root user, add to the command (after `run`):

```sh
--user user
```
9 changes: 3 additions & 6 deletions .github/docker/install_dpcpp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ if [ "${SKIP_DPCPP_BUILD}" ]; then
exit
fi

apt-get install -y --no-install-recommends \
libncurses5

mkdir -p ${DPCPP_PATH}
wget -O ${DPCPP_PATH}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/sycl-nightly%2F20230626/dpcpp-compiler.tar.gz
tar -xvf ${DPCPP_PATH}/dpcpp_compiler.tar.gz -C ${DPCPP_PATH}/
mkdir -p ${DPCPP_PATH}/dpcpp_compiler
wget -O ${DPCPP_PATH}/dpcpp_compiler.tar.gz https://github.com/intel/llvm/releases/download/nightly-2023-09-21/sycl_linux.tar.gz
tar -xvf ${DPCPP_PATH}/dpcpp_compiler.tar.gz -C ${DPCPP_PATH}/dpcpp_compiler
86 changes: 86 additions & 0 deletions .github/docker/opensuse-leap-15.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# Copyright (C) 2023-2024 Intel Corporation
# Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM Exceptions.
# See LICENSE.TXT
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

#
# Dockerfile - a 'recipe' for Docker to build an image of opensuse-leap-based
# environment for building the Unified Runtime project.
#

# Pull base image
FROM registry.hub.docker.com/opensuse/leap:15

# Set environment variables
ENV OS opensuse-leap
ENV OS_VER 15
ENV NOTTY 1

# Additional parameters to build docker without building components.
# These ARGs can be set in docker building phase and are used
# within bash scripts (executed within docker).
ARG SKIP_DPCPP_BUILD
ARG SKIP_LIBBACKTRACE_BUILD

# Base development packages
ARG BASE_DEPS="\
cmake \
gcc \
gcc-c++ \
git \
glibc-devel \
libstdc++-devel \
make"

# Unified Runtime's dependencies
ARG UR_DEPS="\
doxygen \
python3 \
python3-devel \
python3-pip"

# Miscellaneous for our builds/CI (optional)
ARG MISC_DEPS="\
clang \
gzip \
libncurses5 \
sudo \
tar \
wget"

# add openSUSE Leap 15.5 Oss repo
RUN zypper ar -f https://download.opensuse.org/distribution/leap/15.5/repo/oss/ oss

# Update and install required packages
RUN zypper update -y \
&& zypper install -y \
${BASE_DEPS} \
${UR_DEPS} \
${MISC_DEPS} \
&& zypper clean all

# Additional dependencies (installed via pip)
COPY third_party/requirements.txt /opt/ur/requirements.txt
RUN pip3 install --no-cache-dir -r /opt/ur/requirements.txt

# Install DPC++
COPY .github/docker/install_dpcpp.sh /opt/ur/install_dpcpp.sh
ENV DPCPP_PATH=/opt/dpcpp
RUN /opt/ur/install_dpcpp.sh

# Install libbacktrace
COPY .github/docker/install_libbacktrace.sh /ur/opt/install_libbacktrace.sh
RUN /ur/opt/install_libbacktrace.sh

# Add user
ENV USER user
ENV USERPASS pass
ENV PFILE ./password
RUN useradd -m ${USER} \
&& echo ${USERPASS} > ${PFILE} \
&& echo ${USERPASS} >> ${PFILE} \
&& passwd ${USER} < ${PFILE} \
&& rm -f ${PFILE} \
&& sed -i 's/# %wheel/%wheel/g' /etc/sudoers \
&& groupadd wheel \
&& gpasswd wheel -a ${USER}
92 changes: 92 additions & 0 deletions .github/docker/rockylinux-8.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# Copyright (C) 2023-2024 Intel Corporation
# Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM Exceptions.
# See LICENSE.TXT
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

#
# Dockerfile - a 'recipe' for Docker to build an image of rockylinux-based
# environment for building the Unified Runtime project.
#

# Pull base image
FROM registry.hub.docker.com/library/rockylinux:8

# Set environment variables
ENV OS rockylinux
ENV OS_VER 8
ENV NOTTY 1

# Additional parameters to build docker without building components.
# These ARGs can be set in docker building phase and are used
# within bash scripts (executed within docker).
ARG SKIP_DPCPP_BUILD
ARG SKIP_LIBBACKTRACE_BUILD

# Base development packages
ARG BASE_DEPS="\
cmake \
git \
glibc-devel \
libstdc++-devel \
make"

# Unified Runtime's dependencies
ARG UR_DEPS="\
doxygen \
python3 \
python3-pip"

# Packages required by requirements.txt
ARG PRE_PYTHON_DEPS="\
libjpeg-turbo-devel \
python3-devel \
python3-wheel \
zlib-devel"

# Miscellaneous for our builds/CI (optional)
ARG MISC_DEPS="\
clang \
ncurses-libs-6.1 \
passwd \
sudo \
wget"

# Update and install required packages
RUN dnf update -y \
&& dnf --enablerepo devel install -y \
${BASE_DEPS} \
${UR_DEPS} \
${PRE_PYTHON_DEPS} \
${MISC_DEPS} \
&& dnf clean all

# Prepare a dir (accessible by anyone)
RUN mkdir --mode 777 /opt/ur/

# Additional dependencies (installed via pip)
COPY third_party/requirements.txt /opt/ur/requirements.txt
# Comment out clang-format as it's not working properly on this distro
RUN sed -i 's/clang-format/# clang-format/g' /opt/ur/requirements.txt \
&& pip3 install --no-cache-dir -r /opt/ur/requirements.txt

# Install DPC++
COPY .github/docker/install_dpcpp.sh /opt/ur/install_dpcpp.sh
ENV DPCPP_PATH=/opt/dpcpp
RUN /opt/ur/install_dpcpp.sh

# Install libbacktrace
COPY .github/docker/install_libbacktrace.sh /ur/opt/install_libbacktrace.sh
RUN /ur/opt/install_libbacktrace.sh

# Add a new (non-root) 'user'
ENV USER user
ENV USERPASS pass
# Change shell to bash with safe pipe usage
SHELL [ "/bin/bash", "-o", "pipefail", "-c" ]
RUN useradd -m $USER \
&& echo "${USERPASS}" | passwd "${USER}" --stdin \
&& gpasswd wheel -a "${USER}" \
&& echo "%wheel ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers

# Change shell back to default
SHELL ["/bin/sh", "-c"]
82 changes: 82 additions & 0 deletions .github/docker/rockylinux-9.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Copyright (C) 2023-2024 Intel Corporation
# Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM Exceptions.
# See LICENSE.TXT
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

#
# Dockerfile - a 'recipe' for Docker to build an image of rockylinux-based
# environment for building the Unified Runtime project.
#

# Pull base image
FROM registry.hub.docker.com/library/rockylinux:9

# Set environment variables
ENV OS rockylinux
ENV OS_VER 9
ENV NOTTY 1

# Additional parameters to build docker without building components.
# These ARGs can be set in docker building phase and are used
# within bash scripts (executed within docker).
ARG SKIP_DPCPP_BUILD
ARG SKIP_LIBBACKTRACE_BUILD

# Base development packages
ARG BASE_DEPS="\
cmake \
git \
glibc-devel \
libstdc++-devel \
make"

# Unified Runtime's dependencies
ARG UR_DEPS="\
doxygen \
python3 \
python3-pip"

# Miscellaneous for our builds/CI (optional)
ARG MISC_DEPS="\
clang \
ncurses-libs-6.2 \
passwd \
sudo \
wget"

# Update and install required packages
RUN dnf update -y \
&& dnf --enablerepo devel install -y \
${BASE_DEPS} \
${UR_DEPS} \
${MISC_DEPS} \
&& dnf clean all

# Prepare a dir (accessible by anyone)
RUN mkdir --mode 777 /opt/ur/

# Additional dependencies (installed via pip)
COPY third_party/requirements.txt /opt/ur/requirements.txt
RUN pip3 install --no-cache-dir -r /opt/ur/requirements.txt

# Install DPC++
COPY .github/docker/install_dpcpp.sh /opt/ur/install_dpcpp.sh
ENV DPCPP_PATH=/opt/dpcpp
RUN /opt/ur/install_dpcpp.sh

# Install libbacktrace
COPY .github/docker/install_libbacktrace.sh /ur/opt/install_libbacktrace.sh
RUN /ur/opt/install_libbacktrace.sh

# Add a new (non-root) 'user'
ENV USER user
ENV USERPASS pass
# Change shell to bash with safe pipe usage
SHELL [ "/bin/bash", "-o", "pipefail", "-c" ]
RUN useradd -m $USER \
&& echo "${USERPASS}" | passwd "${USER}" --stdin \
&& gpasswd wheel -a "${USER}" \
&& echo "%wheel ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers

# Change shell back to default
SHELL ["/bin/sh", "-c"]
70 changes: 70 additions & 0 deletions .github/docker/ubuntu-20.04.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Copyright (C) 2023-2024 Intel Corporation
# Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM Exceptions.
# See LICENSE.TXT
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

#
# Dockerfile - a 'recipe' for Docker to build an image of ubuntu-based
# environment for building the Unified Runtime project.
#

# Pull base image
FROM registry.hub.docker.com/library/ubuntu:20.04

# Set environment variables
ENV OS ubuntu
ENV OS_VER 20.04
ENV NOTTY 1
ENV DEBIAN_FRONTEND noninteractive

# Additional parameters to build docker without building components.
# These ARGs can be set in docker building phase and are used
# within bash scripts (executed within docker).
ARG SKIP_DPCPP_BUILD
ARG SKIP_LIBBACKTRACE_BUILD

# Base development packages
ARG BASE_DEPS="\
build-essential \
cmake \
git"

# Unified Runtime's dependencies
ARG UR_DEPS="\
doxygen \
python3 \
python3-pip"

# Miscellaneous for our builds/CI (optional)
ARG MISC_DEPS="\
clang \
g++-7 \
libncurses5 \
sudo \
wget \
whois"

# Update and install required packages
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
${BASE_DEPS} \
${UR_DEPS} \
${MISC_DEPS} \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean all

# Prepare a dir (accessible by anyone)
RUN mkdir --mode 777 /opt/ur/

# Additional dependencies (installed via pip)
COPY third_party/requirements.txt /opt/ur/requirements.txt
RUN pip3 install --no-cache-dir -r /opt/ur/requirements.txt

# Install libbacktrace
COPY .github/docker/install_libbacktrace.sh /ur/opt/install_libbacktrace.sh
RUN /opt/ur/install_libbacktrace.sh

# Add a new (non-root) 'user'
ENV USER user
ENV USERPASS pass
RUN useradd -m "${USER}" -g sudo -p "$(mkpasswd ${USERPASS})"
Loading