diff --git a/Jenkinsfile b/Jenkinsfile index fba8cef39..4f326bf5d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -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 @@ -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) } @@ -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) } @@ -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) } - diff --git a/docker/dockerfile-build-centos b/docker/dockerfile-build-centos new file mode 100644 index 000000000..1bb0b2491 --- /dev/null +++ b/docker/dockerfile-build-centos @@ -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 + diff --git a/docker/dockerfile-build-ubuntu-rock b/docker/dockerfile-build-ubuntu-rock index e8a463361..75d893eb3 100644 --- a/docker/dockerfile-build-ubuntu-rock +++ b/docker/dockerfile-build-ubuntu-rock @@ -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 diff --git a/docker/dockerfile-install-centos b/docker/dockerfile-install-centos new file mode 100644 index 000000000..87c997489 --- /dev/null +++ b/docker/dockerfile-install-centos @@ -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 \ No newline at end of file diff --git a/docker/dockerfile-install-ubuntu b/docker/dockerfile-install-ubuntu index 45e329901..9f7920b35 100755 --- a/docker/dockerfile-install-ubuntu +++ b/docker/dockerfile-install-ubuntu @@ -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 diff --git a/install b/install index 8876ceeab..b99d32826 100755 --- a/install +++ b/install @@ -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)