Skip to content

Commit 1b6611b

Browse files
committed
Fix runtime sync trigger and Docker setup retries
1 parent 4742eab commit 1b6611b

3 files changed

Lines changed: 65 additions & 8 deletions

File tree

.github/workflows/build-nabla.yml

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,35 @@ jobs:
5050
Set-MpPreference -DisableArchiveScanning $true
5151
Set-MpPreference -DisableScanningMappedNetworkDrivesForFullScan $true
5252
53-
if (-not (docker network ls --format '{{.Name}}' | Where-Object { $_ -eq 'docker_default' })) {
54-
docker network create --driver nat docker_default
55-
if ($LASTEXITCODE -ne 0) { exit 1 }
53+
$maxAttempts = 12
54+
$delaySeconds = 5
55+
$dockerReady = $false
56+
57+
for ($attempt = 1; $attempt -le $maxAttempts; $attempt++) {
58+
$networkNames = docker network ls --format '{{.Name}}'
59+
if ($LASTEXITCODE -eq 0) {
60+
if (-not ($networkNames | Where-Object { $_ -eq 'docker_default' })) {
61+
docker network create --driver nat docker_default
62+
if ($LASTEXITCODE -eq 0) {
63+
$dockerReady = $true
64+
break
65+
}
66+
}
67+
else {
68+
$dockerReady = $true
69+
break
70+
}
71+
}
72+
73+
if ($attempt -lt $maxAttempts) {
74+
Write-Host "Docker not ready yet (attempt $attempt/$maxAttempts), retry in ${delaySeconds}s..."
75+
Start-Sleep -Seconds $delaySeconds
76+
}
77+
}
78+
79+
if (-not $dockerReady) {
80+
Write-Error "Docker was not ready after $($maxAttempts*$delaySeconds)s total wait"
81+
exit 1
5682
}
5783
5884
- name: Set prefix

.github/workflows/run-nsc.yml

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,35 @@ jobs:
5151
Set-MpPreference -DisableArchiveScanning $true
5252
Set-MpPreference -DisableScanningMappedNetworkDrivesForFullScan $true
5353
54-
if (-not (docker network ls --format '{{.Name}}' | Where-Object { $_ -eq 'docker_default' })) {
55-
docker network create --driver nat docker_default
56-
if ($LASTEXITCODE -ne 0) { exit 1 }
54+
$maxAttempts = 12
55+
$delaySeconds = 5
56+
$dockerReady = $false
57+
58+
for ($attempt = 1; $attempt -le $maxAttempts; $attempt++) {
59+
$networkNames = docker network ls --format '{{.Name}}'
60+
if ($LASTEXITCODE -eq 0) {
61+
if (-not ($networkNames | Where-Object { $_ -eq 'docker_default' })) {
62+
docker network create --driver nat docker_default
63+
if ($LASTEXITCODE -eq 0) {
64+
$dockerReady = $true
65+
break
66+
}
67+
}
68+
else {
69+
$dockerReady = $true
70+
break
71+
}
72+
}
73+
74+
if ($attempt -lt $maxAttempts) {
75+
Write-Host "Docker not ready yet (attempt $attempt/$maxAttempts), retry in ${delaySeconds}s..."
76+
Start-Sleep -Seconds $delaySeconds
77+
}
78+
}
79+
80+
if (-not $dockerReady) {
81+
Write-Error "Docker was not ready after $($maxAttempts*$delaySeconds)s total wait"
82+
exit 1
5783
}
5884
5985
$sendDiscord = "${{ inputs.withDiscordMSG }}" -eq "true"

cmake/NablaConfig.cmake.in

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,13 +286,18 @@ function(_nbl_runtime_modules_add_configure_sync_rule_for_pairs _CFG_DST_PAIRS _
286286
287287
cmake_path(GET _nabla_runtime_file FILENAME _nabla_runtime_name)
288288
cmake_path(GET _dxc_runtime_file FILENAME _dxc_runtime_name)
289-
file(COPY_FILE "${_nabla_runtime_file}" "${_runtime_modules_dst}/${_nabla_runtime_name}" ONLY_IF_DIFFERENT INPUT_MAY_BE_RECENT)
290-
file(COPY_FILE "${_dxc_runtime_file}" "${_runtime_modules_dst}/${_dxc_runtime_name}" ONLY_IF_DIFFERENT INPUT_MAY_BE_RECENT)
289+
set(_nabla_runtime_dst "${_runtime_modules_dst}/${_nabla_runtime_name}")
290+
set(_dxc_runtime_dst "${_runtime_modules_dst}/${_dxc_runtime_name}")
291+
292+
file(COPY_FILE "${_nabla_runtime_file}" "${_nabla_runtime_dst}" ONLY_IF_DIFFERENT INPUT_MAY_BE_RECENT)
293+
file(COPY_FILE "${_dxc_runtime_file}" "${_dxc_runtime_dst}" ONLY_IF_DIFFERENT INPUT_MAY_BE_RECENT)
291294
292295
if(_ENABLE_CONFIGURE_DEPENDS)
293296
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS
294297
"${_nabla_runtime_file}"
295298
"${_dxc_runtime_file}"
299+
"${_nabla_runtime_dst}"
300+
"${_dxc_runtime_dst}"
296301
)
297302
endif()
298303

0 commit comments

Comments
 (0)