Commit 16402e96 authored by illsilin's avatar illsilin
Browse files

use the new sccache redis server

parent bf52b430
...@@ -65,10 +65,10 @@ def getDockerImageName(){ ...@@ -65,10 +65,10 @@ def getDockerImageName(){
} }
def check_host() { def check_host() {
if ("${env.CK_CCACHE}" != "null"){ if ("${env.CK_SCCACHE}" != "null"){
def CCACHE_SERVER="${env.CK_CCACHE.split(':')[0]}" def SCCACHE_SERVER="${env.CK_SCCACHE.split(':')[0]}"
echo "ccache server: ${CCACHE_SERVER}" echo "ccache server: ${SCCACHE_SERVER}"
sh '''ping -c 1 -p 6379 "${CCACHE_SERVER}" | echo $? > tmp.txt''' sh '''ping -c 1 -p 6379 "${SCCACHE_SERVER}" | echo $? > tmp.txt'''
def output = readFile(file: "tmp.txt") def output = readFile(file: "tmp.txt")
echo "tmp.txt contents: \$output" echo "tmp.txt contents: \$output"
return (output != "0") return (output != "0")
...@@ -99,20 +99,20 @@ def getDockerImage(Map conf=[:]){ ...@@ -99,20 +99,20 @@ def getDockerImage(Map conf=[:]){
def prefixpath = conf.get("prefixpath", "/opt/rocm") // prefix:/opt/rocm def prefixpath = conf.get("prefixpath", "/opt/rocm") // prefix:/opt/rocm
def no_cache = conf.get("no_cache", false) def no_cache = conf.get("no_cache", false)
def dockerArgs = "--build-arg BUILDKIT_INLINE_CACHE=1 --build-arg PREFIX=${prefixpath} --build-arg compiler_version='${params.COMPILER_VERSION}' --build-arg compiler_commit='${params.COMPILER_COMMIT}' --build-arg ROCMVERSION='${params.ROCMVERSION}' " def dockerArgs = "--build-arg BUILDKIT_INLINE_CACHE=1 --build-arg PREFIX=${prefixpath} --build-arg compiler_version='${params.COMPILER_VERSION}' --build-arg compiler_commit='${params.COMPILER_COMMIT}' --build-arg ROCMVERSION='${params.ROCMVERSION}' "
echo "ccache server: ${env.CK_CCACHE}" echo "ccache server: ${env.CK_SCCACHE}"
if(env.CK_CCACHE) if(env.CK_SCCACHE)
{ {
if(check_host()) if(check_host())
{ {
echo "FOUND CCACHE SERVER: ${env.CK_CCACHE}" echo "FOUND SCCACHE SERVER: ${env.CK_SCCACHE}"
} }
else else
{ {
echo "CCACHE SERVER: ${env.CK_CCACHE} NOT FOUND, got ${check_host} response" echo "SCCACHE SERVER: ${env.CK_SCCACHE} NOT FOUND, got ${check_host} response"
} }
dockerArgs = dockerArgs + " --build-arg CCACHE_SECONDARY_STORAGE='redis://${env.CK_CCACHE}' --build-arg COMPILER_LAUNCHER='sccache' " dockerArgs = dockerArgs + " --build-arg SCCACHE_SECONDARY_STORAGE='redis://${env.CK_SCCACHE}' --build-arg COMPILER_LAUNCHER='sccache' "
env.CCACHE_DIR = """/tmp/ccache_store""" env.CCACHE_DIR = """/tmp/.sccache"""
env.CCACHE_SECONDARY_STORAGE="""redis://${env.CK_CCACHE}""" env.CCACHE_SECONDARY_STORAGE="""redis://${env.CK_SCCACHE}"""
} }
if(no_cache) if(no_cache)
{ {
...@@ -142,20 +142,20 @@ def buildDocker(install_prefix){ ...@@ -142,20 +142,20 @@ def buildDocker(install_prefix){
def image_name = getDockerImageName() def image_name = getDockerImageName()
echo "Building Docker for ${image_name}" echo "Building Docker for ${image_name}"
def dockerArgs = "--build-arg BUILDKIT_INLINE_CACHE=1 --build-arg PREFIX=${install_prefix} --build-arg compiler_version='${params.COMPILER_VERSION}' --build-arg compiler_commit='${params.COMPILER_COMMIT}' --build-arg ROCMVERSION='${params.ROCMVERSION}' " def dockerArgs = "--build-arg BUILDKIT_INLINE_CACHE=1 --build-arg PREFIX=${install_prefix} --build-arg compiler_version='${params.COMPILER_VERSION}' --build-arg compiler_commit='${params.COMPILER_COMMIT}' --build-arg ROCMVERSION='${params.ROCMVERSION}' "
echo "ccache server: ${env.CK_CCACHE}" echo "ccache server: ${env.CK_SCCACHE}"
if(env.CK_CCACHE) if(env.CK_SCCACHE)
{ {
if(check_host()) if(check_host())
{ {
echo "FOUND CCACHE SERVER: ${env.CK_CCACHE}" echo "FOUND SCCACHE SERVER: ${env.CK_SCCACHE}"
} }
else else
{ {
echo "CCACHE SERVER: ${env.CK_CCACHE} NOT FOUND, got ${check_host} response" echo "SCCACHE SERVER: ${env.CK_SCCACHE} NOT FOUND, got ${check_host} response"
} }
dockerArgs = dockerArgs + " --build-arg CCACHE_SECONDARY_STORAGE='redis://${env.CK_CCACHE}' --build-arg COMPILER_LAUNCHER='sccache' " dockerArgs = dockerArgs + " --build-arg SCCACHE_SECONDARY_STORAGE='redis://${env.CK_SCCACHE}' --build-arg COMPILER_LAUNCHER='sccache' "
env.CCACHE_DIR = """/tmp/.sccache""" env.CCACHE_DIR = """/tmp/.sccache"""
env.CCACHE_SECONDARY_STORAGE="""redis://${env.CK_CCACHE}""" env.CCACHE_SECONDARY_STORAGE="""redis://${env.CK_SCCACHE}"""
} }
echo "Build Args: ${dockerArgs}" echo "Build Args: ${dockerArgs}"
...@@ -219,11 +219,11 @@ def cmake_build(Map conf=[:]){ ...@@ -219,11 +219,11 @@ def cmake_build(Map conf=[:]){
}else{ }else{
setup_args = " -DCMAKE_BUILD_TYPE=release" + setup_args setup_args = " -DCMAKE_BUILD_TYPE=release" + setup_args
} }
if(env.CK_CCACHE) if(env.CK_SCCACHE)
{ {
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
} }
echo "ccache server: ${env.CK_CCACHE}" echo "ccache server: ${env.CK_SCCACHE}"
def pre_setup_cmd = """ def pre_setup_cmd = """
echo \$HSA_ENABLE_SDMA echo \$HSA_ENABLE_SDMA
...@@ -233,7 +233,7 @@ def cmake_build(Map conf=[:]){ ...@@ -233,7 +233,7 @@ def cmake_build(Map conf=[:]){
rm -rf install rm -rf install
mkdir install mkdir install
cd build cd build
if [ "${env.CK_CCACHE}" != "null" ]; then \ if [ "${env.CK_SCCACHE}" != "null" ]; then \
export ROCM_PATH=/opt/rocm export ROCM_PATH=/opt/rocm
export SCCACHE_ENABLED=true export SCCACHE_ENABLED=true
export SCCACHE_LOG_LEVEL=debug export SCCACHE_LOG_LEVEL=debug
...@@ -241,8 +241,8 @@ def cmake_build(Map conf=[:]){ ...@@ -241,8 +241,8 @@ def cmake_build(Map conf=[:]){
export COMPILERS_HASH_DIR=/tmp/.sccache export COMPILERS_HASH_DIR=/tmp/.sccache
export SCCACHE_BIN=/usr/local/.cargo/bin/sccache export SCCACHE_BIN=/usr/local/.cargo/bin/sccache
export SCCACHE_EXTRAFILES=/tmp/.sccache/rocm_compilers_hash_file export SCCACHE_EXTRAFILES=/tmp/.sccache/rocm_compilers_hash_file
export SCCACHE_REDIS="redis://${env.CK_CCACHE}" export SCCACHE_REDIS="redis://${env.CK_SCCACHE}"
export SCCACHE_SERVER_PORT=6379
../script/sccache_wrapper.sh --enforce_redis ../script/sccache_wrapper.sh --enforce_redis
fi fi
""" """
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment