diff --git a/.reuse/dep5 b/.reuse/dep5 index 05f68413eb2d428615a2d2f4cab2c70fe2156068..61959fd31e4e596127e217b43bf583a7d3c6e231 100644 --- a/.reuse/dep5 +++ b/.reuse/dep5 @@ -6,3 +6,7 @@ Source: Files: doc/* Copyright: 2020 Intel Corporation License: CC-BY-4.0 + +Files: img/* +Copyright: 2021 Intel Corporation +License: CC-BY-4.0 diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000000000000000000000000000000000000..af8dd51dff1d12a7180b32820205d0058ba7a61e --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,47 @@ +// SPDX-FileCopyrightText: 2021 Intel Corporation +// +// SPDX-License-Identifier: MIT + +def SAMPLES_REPO = "https://github.com/oneapi-src/oneAPI-samples.git" +def SAMPLES_TAG = "2021.3.0" + +pipeline { + agent { docker { image 'intel/oneapi-hpckit' } } + stages { + stage('checkout samples') { + steps { + dir("oneAPI-samples") { + checkout scm: [$class: 'GitSCM', + userRemoteConfigs: [[url: "${SAMPLES_REPO}"]], + branches: [[name: "${SAMPLES_TAG}"]]], + poll: false + } + } + } + stage ('build') { + parallel { + stage('build DPC++') { + steps { + dir ("oneAPI-samples/DirectProgramming/DPC++/DenseLinearAlgebra/vector-add") { + sh "make all && make run" + } + } + } + stage('build C++') { + steps { + dir ("oneAPI-samples/DirectProgramming/C++/CompilerInfrastructure/Intrinsics") { + sh "make && make run && make clean && make CC='icx -msse3' && make run" + } + } + } + stage('build Fortran') { + steps { + dir ("oneAPI-samples/DirectProgramming/Fortran/CombinationalLogic/openmp-primes") { + sh "make && make run && make clean && make FC=ifx && make run" + } + } + } + } + } + } +} diff --git a/README.rst b/README.rst index 2cedd3bf71a4990cfb38c58a808458244e29a738..2af6245307177071a528a7dbc50bfbbec5d9100b 100644 --- a/README.rst +++ b/README.rst @@ -23,7 +23,7 @@ Install methods Intel installer, apt, dnf, docker container, CI cache =============== =========================================== The config files are intended to be samples that demonstrate a wide -variety of use cases. For you own use, select the parts that you +variety of use cases. For your own use, select the parts that you need. You may also want to customize the set of compilers and libraries that are installed. See `component listings`_ for the component names to use in the scripts. @@ -56,6 +56,7 @@ Circle |c| |c| |c| |c| |c| |x| AppVeyor |c| |x| |x| |c| |c| |c| GitLab |c| |c| |x| |c| |c| |x| Azure |c| |c| |c| |c| |c| |c| +Jenkins |x| |x| |c| |x| |x| |x| ======== ========= ========= ============ ===== ======= =========== @@ -66,6 +67,36 @@ Some of the oneAPI components are large and can take a few minutes to download install. To accelerate install, we demonstrate the use of caching. + +Using oneAPI in Jenkins pipelines +================================= + +There are multiple ways to add oneAPI tools to a Jenkins pipeline: + +#. setup the tools on Jenkins agent directly, or create custom + container with the tools you need + + * refer to `Intel® oneAPI Toolkits Installation Guides`_ for + details + * explore installation scripts in this repo for examples +#. use optimized containers from `Intel oneContainer Portal`_ + +The Jenkinsfile in this repo demonstrates building DPC++, C++ and +Fortran samples in intel/oneapi-hpckit container in Jenkins. + +To give it a try: + +#. Follow `Jenkins Install Guide`_ to setup Jenkins, or use your + existing setup. +#. Install Docker and Docker Pipeline plugins. +#. Create new pipeline for this repository using + New Item -> Pipeline. +#. Build the pipeline. +#. The result will look like this in Blue Ocean. + +|Jenkins Pipeline Example| + + See also ======== @@ -102,6 +133,9 @@ See `security guidelines`_. .. _contributing: CONTRIBUTING.rst .. _`security guidelines`: https://www.intel.com/content/www/us/en/security-center/default.html .. _`Enabling Performance Profiling in GitLab* CI`: https://software.intel.com/content/www/us/en/develop/documentation/vtune-cookbook/top/configuration-recipes/performance-profiling-in-gitlab-ci.html +.. _`Intel® oneAPI Toolkits Installation Guides`: https://software.intel.com/content/www/us/en/develop/articles/installation-guide-for-intel-oneapi-toolkits.html +.. _`Jenkins Install Guide`: https://www.jenkins.io/doc/book/installing/ +.. _`Intel oneContainer Portal`: https://software.intel.com/content/www/us/en/develop/tools/containers/get-started.html .. _`.github/workflows/build_all.yml`: .github/workflows/build_all.yml .. _`.circleci/config.yml`: .circleci/config.yml @@ -127,6 +161,8 @@ See `security guidelines`_. .. |ListComponentsStatus| image:: https://github.com/oneapi-src/oneapi-ci/workflows/list_components/badge.svg :target: https://github.com/oneapi-src/oneapi-ci/actions?query=workflow%3Alist_components :alt: Build status +.. |Jenkins Pipeline Example| image:: img/jenkins_pipeline_example.png + :alt: Jenkins Pipeline Example .. |r| unicode:: U+000AE .. |c| unicode:: U+2714 diff --git a/img/jenkins_pipeline_example.png b/img/jenkins_pipeline_example.png new file mode 100644 index 0000000000000000000000000000000000000000..f2f6bb59498cf67258e37422fb5daa6d02be5d6d Binary files /dev/null and b/img/jenkins_pipeline_example.png differ