Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
c70703f6
Commit
c70703f6
authored
Apr 23, 2018
by
Paul
Browse files
Add docker and jenkins file
parent
8f0108f8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
158 additions
and
1 deletion
+158
-1
Dockerfile
Dockerfile
+50
-0
Jenkinsfile
Jenkinsfile
+107
-0
requirements.txt
requirements.txt
+1
-1
No files found.
Dockerfile
0 → 100644
View file @
c70703f6
FROM
ubuntu:16.04
ARG
PREFIX=/opt/rocm
# Support multiarch
RUN
dpkg
--add-architecture
i386
# Add rocm repository
RUN
apt-get update
&&
DEBIAN_FRONTEND
=
noninteractive apt-get
install
-y
curl apt-utils wget
RUN
curl https://raw.githubusercontent.com/RadeonOpenCompute/ROCm-docker/develop/add-rocm.sh | bash
# Install dependencies
RUN
apt-get update
&&
DEBIAN_FRONTEND
=
noninteractive apt-get
install
-y
--allow-unauthenticated
\
apt-utils
\
build-essential
\
clang-5.0
\
clang-format-5.0
\
clang-tidy-5.0
\
cmake
\
curl
\
doxygen
\
git
\
hcc
\
lcov
\
libnuma-dev
\
python
\
python-dev
\
python-pip
\
rocm-opencl
\
rocm-opencl-dev
\
software-properties-common
\
wget
&&
\
apt-get clean
&&
\
rm
-rf
/var/lib/apt/lists/
*
# Install cget
RUN
pip
install
cget
# Install cppcheck
RUN
cget
-p
$PREFIX
install
danmar/cppcheck@ab02595be1b17035b534db655f9e119080a368bc
RUN
cget
-p
$PREFIX
install
pfultz2/rocm-recipes
# Install dependencies
ADD
requirements.txt /requirements.txt
RUN
cget
-p
$PREFIX
install
-f
/requirements.txt
# Install doc requirements
# ADD doc/requirements.txt /doc-requirements.txt
# RUN pip install -r /doc-requirements.txt
Jenkinsfile
0 → 100644
View file @
c70703f6
def
rocmtestnode
(
variant
,
name
,
body
)
{
def
image
=
'miopen'
def
cmake_build
=
{
compiler
,
flags
->
def
cmd
=
"""
rm -rf build
mkdir build
cd build
CXX=${compiler} CXXFLAGS='-Werror' cmake -DCMAKE_CXX_FLAGS_DEBUG='-g -fno-omit-frame-pointer -fsanitize=undefined -fno-sanitize-recover=undefined' ${flags} ..
CTEST_PARALLEL_LEVEL=32 make -j32 check
"""
echo
cmd
sh
cmd
}
node
(
name
)
{
stage
(
"checkout ${variant}"
)
{
env
.
HSA_ENABLE_SDMA
=
0
checkout
scm
}
stage
(
"image ${variant}"
)
{
try
{
docker
.
build
(
"${image}"
,
"--build-arg ."
)
}
catch
(
Exception
ex
)
{
docker
.
build
(
"${image}"
,
"--build-arg --no-cache ."
)
}
}
withDockerContainer
(
image:
image
,
args:
'--device=/dev/kfd --device=/dev/dri --group-add video'
)
{
timeout
(
time:
1
,
unit:
'HOURS'
)
{
body
(
cmake_build
)
}
}
}
}
@NonCPS
def
rocmtest
(
m
)
{
def
builders
=
[:]
for
(
e
in
m
)
{
def
label
=
e
.
key
;
def
action
=
e
.
value
;
builders
[
label
]
=
{
action
(
label
)
}
}
parallel
builders
}
@NonCPS
def
rocmnode
(
name
,
body
)
{
def
node_name
=
'rocmtest || rocm'
if
(
name
==
'fiji'
)
{
node_name
=
'rocmtest && fiji'
;
}
else
if
(
name
==
'vega'
)
{
node_name
=
'rocmtest && vega'
;
}
else
{
node_name
=
name
}
return
{
label
->
rocmtestnode
(
label
,
node_name
,
body
)
}
}
@NonCPS
def
rocmnode
(
body
)
{
rocmnode
(
'rocmtest || rocm'
,
body
)
}
// Static checks
rocmtest
tidy:
rocmnode
(
'rocm'
)
{
cmake_build
->
stage
(
'Clang Tidy'
)
{
sh
'''
rm -rf build
mkdir build
cd build
CXX='clang++-5.0' cmake ..
make -j8 -k analyze
'''
}
},
format:
rocmnode
(
'rocm'
)
{
cmake_build
->
stage
(
'Clang Format'
)
{
sh
'''
find . -iname \'*.h\' \
-o -iname \'*.hpp\' \
-o -iname \'*.cpp\' \
-o -iname \'*.h.in\' \
-o -iname \'*.hpp.in\' \
-o -iname \'*.cpp.in\' \
-o -iname \'*.cl\' \
| grep -v 'build/' \
| xargs -n 1 -P 1 -I{} -t sh -c \'clang-format-5.0 -style=file {} | diff - {}\'
'''
}
},
clang:
rocmnode
(
'rocm'
)
{
cmake_build
->
stage
(
'Clang Debug'
)
{
cmake_build
(
'clang++-5.0'
,
'-DCMAKE_BUILD_TYPE=debug'
)
}
stage
(
'Clang Release'
)
{
cmake_build
(
'clang++-5.0'
,
'-DCMAKE_BUILD_TYPE=release'
)
}
},
gcc:
rocmnode
(
'rocm'
)
{
cmake_build
->
stage
(
'GCC Debug'
)
{
cmake_build
(
'g++-5'
,
'-DCMAKE_BUILD_TYPE=debug'
)
}
stage
(
'GCC Release'
)
{
cmake_build
(
'g++-5'
,
'-DCMAKE_BUILD_TYPE=release'
)
}
}
requirements.txt
View file @
c70703f6
pfultz2/cget-recipes
RadeonOpenCompute/rocm-cmake@9e0a59ab3ca82d5fed6d5acaa5a5d891a4a65c86
google/protobuf
google/protobuf
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment