Skip to content

Commit 82fd27d

Browse files
committed
Added Jenkins example and doc section
1 parent a4f803b commit 82fd27d

File tree

4 files changed

+88
-1
lines changed

4 files changed

+88
-1
lines changed

.reuse/dep5

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,7 @@ Source:
66
Files: doc/*
77
Copyright: 2020 Intel Corporation
88
License: CC-BY-4.0
9+
10+
Files: img/*
11+
Copyright: 2021 Intel Corporation
12+
License: CC-BY-4.0

Jenkinsfile

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// SPDX-FileCopyrightText: 2021 Intel Corporation
2+
//
3+
// SPDX-License-Identifier: MIT
4+
5+
def SAMPLES_REPO = "https://github.com/oneapi-src/oneAPI-samples.git"
6+
def SAMPLES_TAG = "2021.3.0"
7+
8+
pipeline {
9+
agent { docker { image 'intel/oneapi-hpckit' } }
10+
stages {
11+
stage('checkout samples') {
12+
steps {
13+
dir("oneAPI-samples") {
14+
checkout scm: [$class: 'GitSCM',
15+
userRemoteConfigs: [[url: "${SAMPLES_REPO}"]],
16+
branches: [[name: "${SAMPLES_TAG}"]]],
17+
poll: false
18+
}
19+
}
20+
}
21+
stage ('build') {
22+
parallel {
23+
stage('build DPC++') {
24+
steps {
25+
dir ("oneAPI-samples/DirectProgramming/DPC++/DenseLinearAlgebra/vector-add") {
26+
sh "make all && make run"
27+
}
28+
}
29+
}
30+
stage('build C++') {
31+
steps {
32+
dir ("oneAPI-samples/DirectProgramming/C++/CompilerInfrastructure/Intrinsics") {
33+
sh "make && make run && make clean && make CC='icx -msse3' && make run"
34+
}
35+
}
36+
}
37+
stage('build Fortran') {
38+
steps {
39+
dir ("oneAPI-samples/DirectProgramming/Fortran/CombinationalLogic/openmp-primes") {
40+
sh "make && make run && make clean && make FC=ifx && make run"
41+
}
42+
}
43+
}
44+
}
45+
}
46+
}
47+
}

README.rst

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Install methods Intel installer, apt, dnf, docker container, CI cache
2323
=============== ===========================================
2424

2525
The config files are intended to be samples that demonstrate a wide
26-
variety of use cases. For you own use, select the parts that you
26+
variety of use cases. For your own use, select the parts that you
2727
need. You may also want to customize the set of compilers and
2828
libraries that are installed. See `component listings`_ for the
2929
component names to use in the scripts.
@@ -56,6 +56,7 @@ Circle |c| |c| |c| |c| |c| |x|
5656
AppVeyor |c| |x| |x| |c| |c| |c|
5757
GitLab |c| |c| |x| |c| |c| |x|
5858
Azure |c| |c| |c| |c| |c| |c|
59+
Jenkins |x| |x| |c| |x| |x| |x|
5960
======== ========= ========= ============ ===== ======= ===========
6061

6162

@@ -66,6 +67,36 @@ Some of the oneAPI components are large and can take a few minutes to
6667
download install. To accelerate install, we demonstrate the use of
6768
caching.
6869

70+
71+
Using oneAPI in Jenkins pipelines
72+
=================================
73+
74+
There are multiple ways to add oneAPI tools to a Jenkins pipeline:
75+
76+
#. setup the tools on Jenkins agent directly, or create custom
77+
container with the tools you need
78+
79+
* refer to `Intel® oneAPI Toolkits Installation Guides`_ for
80+
details
81+
* explore installation scripts in this repo for examples
82+
#. use optimized containers from `Intel oneContainer Portal`_
83+
84+
The Jenkinsfile in this repo demonstrates building DPC++, C++ and
85+
Fortran samples in intel/oneapi-hpckit container in Jenkins.
86+
87+
To give it a try:
88+
89+
#. Follow `Jenkins Install Guide`_ to setup Jenkins, or use your
90+
existing setup.
91+
#. Install Docker and Docker Pipeline plugins.
92+
#. Create new pipeline for this repository using
93+
New Item -> Pipeline.
94+
#. Build the pipeline.
95+
#. The result will look like this in Blue Ocean.
96+
97+
|Jenkins Pipeline Example|
98+
99+
69100
See also
70101
========
71102

@@ -102,6 +133,9 @@ See `security guidelines`_.
102133
.. _contributing: CONTRIBUTING.rst
103134
.. _`security guidelines`: https://www.intel.com/content/www/us/en/security-center/default.html
104135
.. _`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
136+
.. _`Intel® oneAPI Toolkits Installation Guides`: https://software.intel.com/content/www/us/en/develop/articles/installation-guide-for-intel-oneapi-toolkits.html
137+
.. _`Jenkins Install Guide`: https://www.jenkins.io/doc/book/installing/
138+
.. _`Intel oneContainer Portal`: https://software.intel.com/content/www/us/en/develop/tools/containers/get-started.html
105139

106140
.. _`.github/workflows/build_all.yml`: .github/workflows/build_all.yml
107141
.. _`.circleci/config.yml`: .circleci/config.yml
@@ -127,6 +161,8 @@ See `security guidelines`_.
127161
.. |ListComponentsStatus| image:: https://github.com/oneapi-src/oneapi-ci/workflows/list_components/badge.svg
128162
:target: https://github.com/oneapi-src/oneapi-ci/actions?query=workflow%3Alist_components
129163
:alt: Build status
164+
.. |Jenkins Pipeline Example| image:: img/jenkins_pipeline_example.png
165+
:alt: Jenkins Pipeline Example
130166

131167
.. |r| unicode:: U+000AE
132168
.. |c| unicode:: U+2714

img/jenkins_pipeline_example.png

18 KB
Loading

0 commit comments

Comments
 (0)