@@ -65,6 +65,8 @@ PACKAGE_VERSION,$env:PKG_VERSION
6565 Out-File - FilePath " $env: KOKORO_ARTIFACTS_DIR /custom_sponge_config.csv" - Encoding ascii
6666
6767Invoke-Program git submodule update -- init
68+ # TODO(b/502920890): disable cache until we root cause
69+ $use_docker_cache = $false
6870$artifact_registry = ' us-docker.pkg.dev'
6971Invoke-Program docker- credential- gcr configure- docker -- registries= " $artifact_registry "
7072$arch = Invoke-Program docker info -- format ' {{.Architecture}}'
@@ -75,8 +77,14 @@ if ($env:KOKORO_JOB_TYPE -eq 'RELEASE') {
7577 $suffix = ' -release'
7678}
7779$cache_location = " ${artifact_registry} /stackdriver-test-143416/google-cloud-ops-agent-build-cache/ops-agent-cache:windows-${arch}${suffix} "
78- Invoke-Program docker pull $cache_location
79- Invoke-Program docker build -- cache- from= " ${cache_location} " -- build-arg PACKAGE= " $env: PACKAGE " - t $tag -f ' ./Dockerfile.windows' .
80+
81+ if ($use_docker_cache ) {
82+ Invoke-Program docker pull $cache_location
83+ Invoke-Program docker build -- cache- from= " ${cache_location} " -- build-arg PACKAGE= " $env: PACKAGE " - t $tag -f ' ./Dockerfile.windows' .
84+ } else {
85+ Invoke-Program docker build -- build-arg PACKAGE= " $env: PACKAGE " - t $tag -f ' ./Dockerfile.windows' .
86+ }
87+
8088Invoke-Program docker create -- name $name $tag
8189Invoke-Program docker cp " ${name} :/work/out" $env: KOKORO_ARTIFACTS_DIR
8290
@@ -85,7 +93,7 @@ Invoke-Program docker cp "${name}:/work/out" $env:KOKORO_ARTIFACTS_DIR
8593# Our presubmits do not write to any kind of cache, for example a per-PR cache,
8694# because the push takes a few minutes and adds little value over just using
8795# the continuous build's cache.
88- if (( $env: KOKORO_ROOT_JOB_TYPE -eq ' CONTINUOUS_INTEGRATION' ) -or ($env: KOKORO_JOB_TYPE -eq ' RELEASE' )) {
96+ if ($use_docker_cache -and (( $env: KOKORO_ROOT_JOB_TYPE -eq ' CONTINUOUS_INTEGRATION' ) -or ($env: KOKORO_JOB_TYPE -eq ' RELEASE' ) )) {
8997 Invoke-Program docker image tag $tag $cache_location
9098 Invoke-Program docker push $cache_location
9199}
0 commit comments