Skip to content
Merged
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
96 changes: 74 additions & 22 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ rocprimCI:

def rocprim = new rocProject('rocprim')

def nodes = new dockerNodes(['gfx803', 'gfx900', 'gfx906'], rocprim)
def nodes = new dockerNodes(['gfx803 && ubuntu', 'gfx900 && ubuntu', 'gfx906 && ubuntu', 'gfx900 && centos7',
'gfx803 && ubuntu && hip-clang', 'gfx900 && ubuntu && hip-clang', 'gfx906 && ubuntu && hip-clang'], rocprim)

boolean formatCheck = false

Expand All @@ -20,11 +21,26 @@ rocprimCI:
platform, project->

project.paths.construct_build_prefix()
def command = """#!/usr/bin/env bash
set -x
cd ${project.paths.project_build_prefix}
LD_LIBRARY_PATH=/opt/rocm/hcc/lib CXX=${project.compiler.compiler_path} ${project.paths.build_command}

def command

if(platform.jenkinsLabel.contains('hip-clang'))
{
command = """#!/usr/bin/env bash
set -x
cd ${project.paths.project_build_prefix}
LD_LIBRARY_PATH=/opt/rocm/hcc/lib CXX=/opt/rocm/bin/hipcc ${project.paths.build_command} --hip-clang
"""
}
else
{
command = """#!/usr/bin/env bash
set -x
cd ${project.paths.project_build_prefix}
LD_LIBRARY_PATH=/opt/rocm/hcc/lib CXX=/opt/rocm/bin/hcc ${project.paths.build_command}
"""
}

platform.runCommand(this, command)
}

Expand All @@ -34,12 +50,26 @@ rocprimCI:

def testCommand = 'ctest --output-on-failure -E rocprim.hip.device_merge_sort'

def command = """#!/usr/bin/env bash
set -x
cd ${project.paths.project_build_prefix}
cd ${project.testDirectory}
LD_LIBRARY_PATH=/opt/rocm/hcc/lib ${testCommand}
"""
def command

if(platform.jenkinsLabel.contains('centos'))
{
command = """#!/usr/bin/env bash
set -x
cd ${project.paths.project_build_prefix}
cd ${project.testDirectory}
LD_LIBRARY_PATH=/opt/rocm/hcc/lib sudo ${testCommand}
"""
}
else
{
command = """#!/usr/bin/env bash
set -x
cd ${project.paths.project_build_prefix}
cd ${project.testDirectory}
LD_LIBRARY_PATH=/opt/rocm/hcc/lib ${testCommand}
"""
}

platform.runCommand(this, command)
}
Expand All @@ -48,21 +78,43 @@ rocprimCI:
{
platform, project->

def command = """
set -x
cd ${project.paths.project_build_prefix}/build
make package
rm -rf package && mkdir -p package
mv *.deb package/
dpkg -c package/*.deb
"""
def command

if(platform.jenkinsLabel.contains('centos'))
{
command = """
set -x
cd ${project.paths.project_build_prefix}/${project.testDirectory}
sudo make package
rm -rf package && mkdir -p package
mv *.rpm package/
rpm -qlp package/*.rpm
"""

platform.runCommand(this, command)
platform.archiveArtifacts(this, """${project.paths.project_build_prefix}/build/package/*.deb""")
platform.runCommand(this, command)
platform.archiveArtifacts(this, """${project.paths.project_build_prefix}/${project.testDirectory}/package/*.rpm""")
}
else if(platform.jenkinsLabel.contains('hip-clang'))
{
packageCommand = null
}
else
{
command = """
set -x
cd ${project.paths.project_build_prefix}/${project.testDirectory}
make package
rm -rf package && mkdir -p package
mv *.deb package/
dpkg -c package/*.deb
"""

platform.runCommand(this, command)
platform.archiveArtifacts(this, """${project.paths.project_build_prefix}/${project.testDirectory}/package/*.deb""")
}
}

buildProject(rocprim, formatCheck, nodes.dockerArray, compileCommand, testCommand, packageCommand)

}


39 changes: 39 additions & 0 deletions docker/dockerfile-build-centos
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Parameters related to building rocPRIM
ARG base_image

FROM ${base_image}
LABEL maintainer="rocprim-maintainer@amd.com"

USER root
ARG user_uid

RUN yum install -y \
sudo \
rock-dkms \
centos-release-scl \
devtoolset-7 \
ca-certificates \
git \
cmake3 \
make \
clang \
clang-devel \
gcc-c++ \
gcc-gfortran \
pkgconfig \
python27 \
PyYAML \
boost-devel \
numactl-libs \
rpm-build

RUN echo '#!/bin/bash' | tee /etc/profile.d/devtoolset7.sh && echo \
'source scl_source enable devtoolset-7' >>/etc/profile.d/devtoolset7.sh

# docker pipeline runs containers with particular uid
# create a jenkins user with this specific uid so it can use sudo priviledges
# Grant any member of sudo group password-less sudo privileges
RUN useradd --create-home -u ${user_uid} -o -G video --shell /bin/bash jenkins && \
echo '%video ALL=(ALL) NOPASSWD:ALL' | tee /etc/sudoers.d/sudo-nopasswd && \
chmod 400 /etc/sudoers.d/sudo-nopasswd

4 changes: 2 additions & 2 deletions docker/dockerfile-build-ubuntu-rock
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Parameters related to building hip
# Parameters related to building rocPRIM
ARG base_image

FROM ${base_image}
LABEL maintainer="kent.knox@amd"
LABEL maintainer="rocprim-maintainer@amd.com"

ARG user_uid

Expand Down
19 changes: 19 additions & 0 deletions docker/dockerfile-install-centos
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Parameters related to building rocprim
ARG base_image

FROM ${base_image}
LABEL maintainer="saad.rahim@amd.com"

# Copy the rpm package of rocprim into the container from host
COPY *.rpm /tmp/

# Install the rpm package, and print out contents of expected changed locations
RUN yum -y update && yum install -y\
/tmp/rocprim-*.rpm \
&& rm -f /tmp/*.rpm \
&& yum -y clean all \
&& rm -rf /var/lib/apt/lists/* \
&& printf "ls -la /etc/ld.so.conf.d/\n" && ls -la /etc/ld.so.conf.d/ \
&& printf "ls -la /opt/rocm/include\n" && ls -la /opt/rocm/include \
&& printf "ls -la /opt/rocm/lib\n" && ls -la /opt/rocm/lib \
&& printf "ls -la /opt/rocm/lib/cmake\n" && ls -la /opt/rocm/lib/cmake
53 changes: 14 additions & 39 deletions docker/dockerfile-install-ubuntu
Original file line number Diff line number Diff line change
@@ -1,44 +1,19 @@
# Parameters related to building hip
# Parameters related to building rocprim
ARG base_image

FROM ${base_image}
LABEL maintainer="kent.knox@amd"
LABEL maintainer="saad.rahim@amd.com"

ARG user_uid

# Install dependent packages
# Dependencies:
# * hcc-config.cmake: pkg-config
# * tensile: python2.7, python-yaml
# * rocblas-test: gfortran, googletest
# * rocblas-bench: libboost-program-options-dev
# * libhsakmt.so: libnuma1

USER root

RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
python2.7-minimal
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
sudo \
ca-certificates \
git \
make \
cmake \
clang-format-3.8 \
pkg-config \
python2.7 \
python-yaml \
gfortran \
libboost-program-options-dev \
libnuma1 \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# docker pipeline runs containers with particular uid
# create a jenkins user with this specific uid so it can use sudo priviledges
# Grant any member of sudo group password-less sudo privileges
RUN useradd --create-home -u ${user_uid} -o -G sudo --shell /bin/bash jenkins && \
mkdir -p /etc/sudoers.d/ && \
echo '%sudo ALL=(ALL) NOPASSWD:ALL' | tee /etc/sudoers.d/sudo-nopasswd
# Copy the deb package of rocprim into the container from host
COPY *.deb /tmp/

# Install the deb package, and print out contents of expected changed locations
RUN yum -y update && yum install -y\
/tmp/rocprim-*.deb \
&& rm -f /tmp/*.deb \
&& yum -y clean all \
&& rm -rf /var/lib/apt/lists/* \
&& printf "ls -la /etc/ld.so.conf.d/\n" && ls -la /etc/ld.so.conf.d/ \
&& printf "ls -la /opt/rocm/include\n" && ls -la /opt/rocm/include \
&& printf "ls -la /opt/rocm/lib\n" && ls -la /opt/rocm/lib \
&& printf "ls -la /opt/rocm/lib/cmake\n" && ls -la /opt/rocm/lib/cmake
6 changes: 5 additions & 1 deletion install
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,11 @@ if [[ "${build_hip_clang}" == true ]]; then
compiler="hipcc"
fi

CXX=$rocm_path/${compiler} cmake -DBUILD_BENCHMARK=ON ../../. # or cmake-gui ../.
if [ -e /etc/redhat-release ] ; then
CXX=$rocm_path/${compiler} cmake3 -DBUILD_BENCHMARK=ON ../../. # or cmake-gui ../.
else
CXX=$rocm_path/${compiler} cmake -DBUILD_BENCHMARK=ON ../../. # or cmake-gui ../.
fi

# Build
make -j$(nproc)
Expand Down