Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
composable_kernel
Commits
1c64ff20
Commit
1c64ff20
authored
Oct 30, 2023
by
illsilin
Browse files
hande the connection to redis server with try-catch
parent
3130775c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
12 deletions
+27
-12
Jenkinsfile
Jenkinsfile
+27
-12
No files found.
Jenkinsfile
View file @
1c64ff20
...
@@ -139,7 +139,7 @@ def buildDocker(install_prefix){
...
@@ -139,7 +139,7 @@ def buildDocker(install_prefix){
else
{
else
{
echo
"Checking for image: ${image_name}"
echo
"Checking for image: ${image_name}"
sh
"docker manifest inspect --insecure ${image_name}"
sh
"docker manifest inspect --insecure ${image_name}"
echo
"Image: ${image_name} found!
!
Skipping building image"
echo
"Image: ${image_name} found! Skipping building image"
}
}
}
}
catch
(
Exception
ex
){
catch
(
Exception
ex
){
...
@@ -213,8 +213,9 @@ def cmake_build(Map conf=[:]){
...
@@ -213,8 +213,9 @@ def cmake_build(Map conf=[:]){
if
(
setup_args
.
contains
(
"gfx94"
)){
if
(
setup_args
.
contains
(
"gfx94"
)){
invocation_tag
=
"gfx94"
invocation_tag
=
"gfx94"
}
}
local_pre_setup_cmd
=
pre_setup_cmd
if
(
check_host
()
&&
params
.
USE_SCCACHE
&&
"${env.CK_SCCACHE}"
!=
"null"
&&
"${invocation_tag}"
!=
""
)
{
if
(
check_host
()
&&
params
.
USE_SCCACHE
&&
"${env.CK_SCCACHE}"
!=
"null"
&&
"${invocation_tag}"
!=
""
)
{
pre_setup_cmd
=
pre_setup_cmd
+
"""
redis_
pre_setup_cmd
=
pre_setup_cmd
+
"""
#!/bin/bash
#!/bin/bash
export ROCM_PATH=/opt/rocm
export ROCM_PATH=/opt/rocm
export SCCACHE_ENABLED=true
export SCCACHE_ENABLED=true
...
@@ -228,15 +229,23 @@ def cmake_build(Map conf=[:]){
...
@@ -228,15 +229,23 @@ def cmake_build(Map conf=[:]){
export SCCACHE_C_CUSTOM_CACHE_BUSTER="${invocation_tag}"
export SCCACHE_C_CUSTOM_CACHE_BUSTER="${invocation_tag}"
echo \$SCCACHE_C_CUSTOM_CACHE_BUSTER
echo \$SCCACHE_C_CUSTOM_CACHE_BUSTER
stunnel ../script/redis-cli.conf
stunnel ../script/redis-cli.conf
(
../script/sccache_wrapper.sh --enforce_redis
set -e
"""
../script/sccache_wrapper.sh --enforce_redis
local_pre_setup_cmd
=
pre_setup_cmd
+
"""
)
#!/bin/bash
error_code=\$?
export ROCM_PATH=/opt/rocm
if [ \$error_code -ne 0 ]; then
export SCCACHE_ENABLED=true
echo "could not connect to the redis server. using sccache locally."
export SCCACHE_LOG_LEVEL=debug
../script/sccache_wrapper.sh
export SCCACHE_IDLE_TIMEOUT=14400
fi
export COMPILERS_HASH_DIR=/tmp/.sccache
export SCCACHE_BIN=/usr/local/.cargo/bin/sccache
export SCCACHE_EXTRAFILES=/tmp/.sccache/rocm_compilers_hash_file
export SCCACHE_REDIS="redis://${env.CK_SCCACHE}"
echo "connect = ${env.CK_SCCACHE}" >> ../script/redis-cli.conf
export SCCACHE_C_CUSTOM_CACHE_BUSTER="${invocation_tag}"
echo \$SCCACHE_C_CUSTOM_CACHE_BUSTER
stunnel ../script/redis-cli.conf
../script/sccache_wrapper.sh
"""
"""
setup_args
=
" -DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DCMAKE_C_COMPILER_LAUNCHER=sccache "
+
setup_args
setup_args
=
" -DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DCMAKE_C_COMPILER_LAUNCHER=sccache "
+
setup_args
}
}
...
@@ -247,13 +256,19 @@ def cmake_build(Map conf=[:]){
...
@@ -247,13 +256,19 @@ def cmake_build(Map conf=[:]){
def
execute_cmd
=
conf
.
get
(
"execute_cmd"
,
""
)
def
execute_cmd
=
conf
.
get
(
"execute_cmd"
,
""
)
def
cmd
=
conf
.
get
(
"cmd"
,
"""
def
cmd
=
conf
.
get
(
"cmd"
,
"""
${pre_setup_cmd}
${setup_cmd}
${setup_cmd}
${build_cmd}
${build_cmd}
${execute_cmd}
${execute_cmd}
"""
)
"""
)
echo
cmd
echo
cmd
try
{
sh
"${redis_pre_setup_cmd}"
}
catch
(
err
){
echo
"could not connect to redis server. using local sccache."
sh
"${local_pre_setup_cmd}"
}
sh
cmd
sh
cmd
// Only archive from master or develop
// Only archive from master or develop
...
...
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