Skip to content

Commit 764d662

Browse files
authored
Merge pull request #88 from JuliaCI/tb/macos_upgrade
macOS: Upgrade to Sandbox v2+, upgrade buildkite-agent
2 parents 2a413ab + bae672c commit 764d662

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

macos-seatbelt/common.jl

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ function generate_launchctl_script(io::IO, brg::BuildkiteRunnerGroup;
178178
""")
179179

180180
for path in host_paths_to_cleanup(temp_path, cache_path)
181+
println(w_io, "chmod -R u+w $(path)")
181182
println(w_io, "rm -rf $(path)")
182183
end
183184

@@ -196,9 +197,10 @@ function generate_launchctl_script(io::IO, brg::BuildkiteRunnerGroup;
196197
# Invoke agent inside of sandbox
197198
sandbox-exec -f $(sb_path) $(agent_path) start \\
198199
--disconnect-after-job \\
200+
--sockets-path=$(temp_path) \\
199201
--hooks-path=$(hooks_path) \\
200202
--build-path=$(cache_path)/build \\
201-
--experiment=git-mirrors,output-redactor,ansi-timestamps,resolve-commit-after-checkout \\
203+
--experiment=resolve-commit-after-checkout \\
202204
--git-mirrors-path=$(cache_path)/repos \\
203205
--tags=$(join(tags_with_queues, ",")) \\
204206
--name=$(agent_name)
@@ -208,6 +210,7 @@ function generate_launchctl_script(io::IO, brg::BuildkiteRunnerGroup;
208210
# Cleanup host paths
209211
""")
210212
for path in host_paths_to_cleanup(temp_path, cache_path)
213+
println(w_io, "chmod -R u+w $(path)")
211214
println(w_io, "rm -rf $(path)")
212215
end
213216

@@ -218,6 +221,10 @@ function generate_launchctl_script(io::IO, brg::BuildkiteRunnerGroup;
218221
219222
if ((ts_now - ts_boot > 24*60*60)); then
220223
sudo -n /sbin/shutdown -r now
224+
225+
# Give the system the time to shut down,
226+
# preventing a new job from getting picked up
227+
sleep 30
221228
fi
222229
""")
223230
end
@@ -357,7 +364,7 @@ function seatbelt_setup(f::Function, brg::BuildkiteRunnerGroup;
357364
end
358365
finally
359366
force_delete.(host_paths_to_cleanup(temp_path, cache_path))
360-
end
367+
end
361368
end
362369

363370
function debug_shell(brg::BuildkiteRunnerGroup; kwargs...)
@@ -383,7 +390,6 @@ function run_buildkite_agent(brg::BuildkiteRunnerGroup;
383390
--disconnect-after-job
384391
--hooks-path=$(hooks_path)
385392
--build-path=$(cache_path)/build
386-
--experiment=git-mirrors,output-redactor
387393
--git-mirrors-path=$(cache_path)/repos
388394
--git-fetch-flags="-v --prune --tags"
389395
--tags=$(join(tags_with_queues, ","))

0 commit comments

Comments
 (0)