Skip to content

Commit 21e9bf6

Browse files
committed
Added caching in Circle CI
1 parent a287f7c commit 21e9bf6

File tree

2 files changed

+134
-6
lines changed

2 files changed

+134
-6
lines changed

.circleci/config.yml

Lines changed: 124 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,40 @@
33
# SPDX-License-Identifier: MIT
44

55
version: 2.1
6+
parameters:
7+
WINDOWS_BASEKIT_URL:
8+
type: string
9+
default: "https://registrationcenter-download.intel.com/akdlm/irc_nas/17191/w_BaseKit_b_2021.1.10.2260_offline.exe"
10+
WINDOWS_HPCKIT_URL:
11+
type: string
12+
default: "https://registrationcenter-download.intel.com/akdlm/irc_nas/17163/w_HPCKit_b_2021.1.10.2266_offline.exe"
13+
MACOS_HPCKIT_URL:
14+
type: string
15+
default: "https://registrationcenter-download.intel.com/akdlm/irc_nas/17230/m_HPCKit_b_2021.1.10.2260.dmg"
16+
WINDOWS_CPP_COMPONENTS:
17+
type: string
18+
default: "intel.oneapi.win.cpp-compiler"
19+
WINDOWS_FORTRAN_COMPONENTS:
20+
type: string
21+
default: "intel.oneapi.win.ifort-compiler"
22+
WINDOWS_DPCPP_COMPONENTS:
23+
type: string
24+
default: "intel.oneapi.win.dpcpp-compiler"
25+
LINUX_CPP_COMPONENTS:
26+
type: string
27+
default: "intel-oneapi-dpcpp-cpp-compiler-pro"
28+
LINUX_FORTRAN_COMPONENTS:
29+
type: string
30+
default: "intel-oneapi-ifort"
31+
LINUX_DPCPP_COMPONENTS:
32+
type: string
33+
default: "intel-oneapi-dpcpp-cpp-compiler"
34+
MACOS_CPP_COMPONENTS:
35+
type: string
36+
default: "intel.oneapi.mac.cpp-compiler"
37+
MACOS_FORTRAN_COMPONENTS:
38+
type: string
39+
default: "intel.oneapi.mac.ifort-compiler"
640

741
orbs:
842
win: circleci/[email protected]
@@ -14,12 +48,24 @@ jobs:
1448
shell: bash.exe
1549
steps:
1650
- checkout
51+
- restore_cache:
52+
keys:
53+
- install-<< pipeline.parameters.WINDOWS_HPCKIT_URL >>-<< pipeline.parameters.WINDOWS_CPP_COMPONENTS >>-compiler-{{ checksum "scripts/cache_exclude_windows.sh" }}
1754
- run:
1855
name: install
19-
command: scripts/install_windows.bat https://registrationcenter-download.intel.com/akdlm/irc_nas/17163/w_HPCKit_b_2021.1.10.2266_offline.exe intel.oneapi.win.cpp-compiler
56+
command: |
57+
[ -d "C:\Program Files (x86)\Intel\oneAPI\compiler" ] && exit 0
58+
scripts/install_windows.bat << pipeline.parameters.WINDOWS_HPCKIT_URL >> << pipeline.parameters.WINDOWS_CPP_COMPONENTS >>
2059
- run:
2160
name: build
2261
command: scripts/build_windows.bat c++ 2017_build_tools
62+
- run:
63+
name: exclude unused files from cache
64+
command: scripts/cache_exclude_windows.sh
65+
- save_cache:
66+
key: install-<< pipeline.parameters.WINDOWS_HPCKIT_URL >>-<< pipeline.parameters.WINDOWS_CPP_COMPONENTS >>-compiler-{{ checksum "scripts/cache_exclude_windows.sh" }}
67+
paths:
68+
- C:\Program Files (x86)\Intel\oneAPI\compiler
2369

2470
# Delete the following if you don't want to save install logs
2571
- run:
@@ -36,12 +82,24 @@ jobs:
3682
shell: bash.exe
3783
steps:
3884
- checkout
85+
- restore_cache:
86+
keys:
87+
- install-<< pipeline.parameters.WINDOWS_HPCKIT_URL >>-<< pipeline.parameters.WINDOWS_FORTRAN_COMPONENTS >>-compiler-{{ checksum "scripts/cache_exclude_windows.sh" }}
3988
- run:
4089
name: install
41-
command: scripts/install_windows.bat https://registrationcenter-download.intel.com/akdlm/irc_nas/17163/w_HPCKit_b_2021.1.10.2266_offline.exe intel.oneapi.win.ifort-compiler
90+
command: |
91+
[ -d "C:\Program Files (x86)\Intel\oneAPI\compiler" ] && exit 0
92+
scripts/install_windows.bat << pipeline.parameters.WINDOWS_HPCKIT_URL >> << pipeline.parameters.WINDOWS_FORTRAN_COMPONENTS >>
4293
- run:
4394
name: build
4495
command: scripts/build_windows.bat fortran 2017_build_tools
96+
- run:
97+
name: exclude unused files from cache
98+
command: scripts/cache_exclude_windows.sh
99+
- save_cache:
100+
key: install-<< pipeline.parameters.WINDOWS_HPCKIT_URL >>-<< pipeline.parameters.WINDOWS_FORTRAN_COMPONENTS >>-compiler-{{ checksum "scripts/cache_exclude_windows.sh" }}
101+
paths:
102+
- C:\Program Files (x86)\Intel\oneAPI\compiler
45103

46104
# Delete the following if you don't want to save install logs
47105
- run:
@@ -58,12 +116,26 @@ jobs:
58116
shell: bash.exe
59117
steps:
60118
- checkout
119+
- restore_cache:
120+
keys:
121+
- install-<< pipeline.parameters.WINDOWS_BASEKIT_URL >>-<< pipeline.parameters.WINDOWS_DPCPP_COMPONENTS >>-compiler-{{ checksum "scripts/cache_exclude_windows.sh" }}
61122
- run:
62123
name: install
63-
command: scripts/install_windows.bat https://registrationcenter-download.intel.com/akdlm/irc_nas/17191/w_BaseKit_b_2021.1.10.2260_offline.exe intel.oneapi.win.dpcpp-compiler
124+
command: |
125+
[ -d "C:\Program Files (x86)\Intel\oneAPI\compiler" ] && exit 0
126+
scripts/install_windows.bat << pipeline.parameters.WINDOWS_BASEKIT_URL >> << pipeline.parameters.WINDOWS_DPCPP_COMPONENTS >>
64127
- run:
65128
name: build
66129
command: scripts/build_windows.bat dpc++ 2017_build_tools
130+
- run:
131+
name: exclude unused files from cache
132+
command: scripts/cache_exclude_windows.sh
133+
- save_cache:
134+
key: install-<< pipeline.parameters.WINDOWS_BASEKIT_URL >>-<< pipeline.parameters.WINDOWS_DPCPP_COMPONENTS >>-compiler-{{ checksum "scripts/cache_exclude_windows.sh" }}
135+
paths:
136+
- C:\Program Files (x86)\Intel\oneAPI\compiler
137+
- C:\Program Files (x86)\Intel\oneAPI\tbb
138+
- C:\Windows\System32\OpenCL.dll
67139

68140
# Delete the following if you don't want to save install logs
69141
- run:
@@ -85,12 +157,27 @@ jobs:
85157
- run:
86158
name: setup apt repo
87159
command: . scripts/setup_apt_repo_linux_no_sudo.sh
160+
- run:
161+
name: collect versioned dependencies of apt packages
162+
command: . scripts/apt_depends.sh << pipeline.parameters.LINUX_CPP_COMPONENTS >> | tee depends.txt
163+
- restore_cache:
164+
keys:
165+
- install-<< pipeline.parameters.LINUX_CPP_COMPONENTS >>-{{ checksum "depends.txt" }}-compiler-${{ checksum "scripts/cache_exclude_linux_no_sudo.sh" }}
88166
- run:
89167
name: install
90-
command: . scripts/install_linux_apt_no_sudo.sh intel-oneapi-dpcpp-cpp-compiler-pro
168+
command: |
169+
[ -d /opt/intel/oneapi/compiler ] && exit 0
170+
. scripts/install_linux_apt_no_sudo.sh << pipeline.parameters.LINUX_CPP_COMPONENTS >>
91171
- run:
92172
name: build
93173
command: scripts/build_linux.sh c++
174+
- run:
175+
name: exclude unused files from cache
176+
command: . scripts/cache_exclude_linux_no_sudo.sh
177+
- save_cache:
178+
key: install-<< pipeline.parameters.LINUX_CPP_COMPONENTS >>-{{ checksum "depends.txt" }}-compiler-${{ checksum "scripts/cache_exclude_linux_no_sudo.sh" }}
179+
paths:
180+
- /opt/intel/oneapi/compiler
94181

95182
build_linux_apt_fortran:
96183
docker:
@@ -103,12 +190,27 @@ jobs:
103190
- run:
104191
name: setup apt repo
105192
command: . scripts/setup_apt_repo_linux_no_sudo.sh
193+
- run:
194+
name: collect versioned dependencies of apt packages
195+
command: . scripts/apt_depends.sh << pipeline.parameters.LINUX_FORTRAN_COMPONENTS >> | tee depends.txt
196+
- restore_cache:
197+
keys:
198+
- install-<< pipeline.parameters.LINUX_FORTRAN_COMPONENTS >>-{{ checksum "depends.txt" }}-compiler-${{ checksum "scripts/cache_exclude_linux_no_sudo.sh" }}
106199
- run:
107200
name: install
108-
command: . scripts/install_linux_apt_no_sudo.sh intel-oneapi-ifort
201+
command: |
202+
[ -d /opt/intel/oneapi/compiler ] && exit 0
203+
. scripts/install_linux_apt_no_sudo.sh << pipeline.parameters.LINUX_FORTRAN_COMPONENTS >>
109204
- run:
110205
name: build
111206
command: scripts/build_linux.sh fortran
207+
- run:
208+
name: exclude unused files from cache
209+
command: . scripts/cache_exclude_linux_no_sudo.sh
210+
- save_cache:
211+
key: install-<< pipeline.parameters.LINUX_FORTRAN_COMPONENTS >>-{{ checksum "depends.txt" }}-compiler-${{ checksum "scripts/cache_exclude_linux_no_sudo.sh" }}
212+
paths:
213+
- /opt/intel/oneapi/compiler
112214

113215
build_linux_apt_dpcpp:
114216
docker:
@@ -121,12 +223,28 @@ jobs:
121223
- run:
122224
name: setup apt repo
123225
command: . scripts/setup_apt_repo_linux_no_sudo.sh
226+
- run:
227+
name: collect versioned dependencies of apt packages
228+
command: . scripts/apt_depends.sh << pipeline.parameters.LINUX_DPCPP_COMPONENTS >> | tee depends.txt
229+
- restore_cache:
230+
keys:
231+
- install-<< pipeline.parameters.LINUX_DPCPP_COMPONENTS >>-{{ checksum "depends.txt" }}-compiler-${{ checksum "scripts/cache_exclude_linux_no_sudo.sh" }}
124232
- run:
125233
name: install
126-
command: . scripts/install_linux_apt_no_sudo.sh intel-oneapi-dpcpp-cpp-compiler
234+
command: |
235+
[ -d /opt/intel/oneapi/compiler ] && exit 0
236+
. scripts/install_linux_apt_no_sudo.sh << pipeline.parameters.LINUX_DPCPP_COMPONENTS >>
127237
- run:
128238
name: build
129239
command: scripts/build_linux.sh dpc++
240+
- run:
241+
name: exclude unused files from cache
242+
command: . scripts/cache_exclude_linux_no_sudo.sh
243+
- save_cache:
244+
key: install-<< pipeline.parameters.LINUX_DPCPP_COMPONENTS >>-{{ checksum "depends.txt" }}-compiler-${{ checksum "scripts/cache_exclude_linux_no_sudo.sh" }}
245+
paths:
246+
- /opt/intel/oneapi/compiler
247+
- /opt/intel/oneapi/tbb
130248

131249
build_linux_container_cpp:
132250
docker:
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
# SPDX-FileCopyrightText: 2020 Intel Corporation
4+
#
5+
# SPDX-License-Identifier: MIT
6+
7+
rm -rf /opt/intel/oneapi/compiler/2021.1-beta10/linux/compiler/lib/ia32_lin
8+
rm -rf /opt/intel/oneapi/compiler/2021.1-beta10/linux/bin/ia32
9+
rm -rf /opt/intel/oneapi/compiler/2021.1-beta10/linux/lib/emu
10+
rm -rf /opt/intel/oneapi/compiler/2021.1-beta10/linux/lib/oclfpga

0 commit comments

Comments
 (0)