Skip to content

Commit 9273beb

Browse files
authored
Merge pull request #12 from dfinity/releases/dind-network-host-patch-v2.320.0
Upgrade dind-network-host-patch to v2.320.0
2 parents ac9c335 + 46b793a commit 9273beb

25 files changed

+358
-73
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ jobs:
7575
# Upload runner package tar.gz/zip as artifact
7676
- name: Publish Artifact
7777
if: github.event_name != 'pull_request'
78-
uses: actions/upload-artifact@v2
78+
uses: actions/upload-artifact@v4
7979
with:
8080
name: runner-package-${{ matrix.runtime }}
8181
path: |

.github/workflows/release.yml

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,11 @@ jobs:
117117
working-directory: _package
118118
119119
# Upload runner package tar.gz/zip as artifact.
120-
# Since each package name is unique, so we don't need to put ${{matrix}} info into artifact name
121120
- name: Publish Artifact
122121
if: github.event_name != 'pull_request'
123-
uses: actions/upload-artifact@v2
122+
uses: actions/upload-artifact@v4
124123
with:
125-
name: runner-packages
124+
name: runner-packages-${{ matrix.runtime }}
126125
path: |
127126
_package
128127
@@ -134,10 +133,40 @@ jobs:
134133
- uses: actions/checkout@v3
135134

136135
# Download runner package tar.gz/zip produced by 'build' job
137-
- name: Download Artifact
138-
uses: actions/download-artifact@v1
136+
- name: Download Artifact (win-x64)
137+
uses: actions/download-artifact@v4
139138
with:
140-
name: runner-packages
139+
name: runner-packages-win-x64
140+
path: ./
141+
- name: Download Artifact (win-arm64)
142+
uses: actions/download-artifact@v4
143+
with:
144+
name: runner-packages-win-arm64
145+
path: ./
146+
- name: Download Artifact (osx-x64)
147+
uses: actions/download-artifact@v4
148+
with:
149+
name: runner-packages-osx-x64
150+
path: ./
151+
- name: Download Artifact (osx-arm64)
152+
uses: actions/download-artifact@v4
153+
with:
154+
name: runner-packages-osx-arm64
155+
path: ./
156+
- name: Download Artifact (linux-x64)
157+
uses: actions/download-artifact@v4
158+
with:
159+
name: runner-packages-linux-x64
160+
path: ./
161+
- name: Download Artifact (linux-arm)
162+
uses: actions/download-artifact@v4
163+
with:
164+
name: runner-packages-linux-arm
165+
path: ./
166+
- name: Download Artifact (linux-arm64)
167+
uses: actions/download-artifact@v4
168+
with:
169+
name: runner-packages-linux-arm64
141170
path: ./
142171

143172
# Create ReleaseNote file

images/Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,13 @@ ENV ImageOS=ubuntu22
4141

4242
# 'gpg-agent' and 'software-properties-common' are needed for the 'add-apt-repository' command that follows
4343
RUN apt update -y \
44-
&& apt install -y --no-install-recommends sudo lsb-release gpg-agent software-properties-common \
44+
&& apt install -y --no-install-recommends sudo lsb-release gpg-agent software-properties-common curl jq unzip \
4545
&& rm -rf /var/lib/apt/lists/*
4646

4747
# Configure git-core/ppa based on guidance here: https://git-scm.com/download/linux
4848
RUN add-apt-repository ppa:git-core/ppa \
49-
&& apt update -y
49+
&& apt update -y \
50+
&& apt install -y --no-install-recommends git
5051

5152
RUN adduser --disabled-password --gecos "" --uid 1001 runner \
5253
&& groupadd docker --gid 123 \

releaseNote.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
## What's Changed
22

3-
- .NET 8 OS compatibility test https://github.com/actions/runner/pull/3422
4-
- Ignore ssl cert on websocket client https://github.com/actions/runner/pull/3423
5-
- Revert "Bump runner to dotnet 8" https://github.com/actions/runner/pull/3412
6-
7-
**Full Changelog**: https://github.com/actions/runner/compare/v2.318.0...v2.319.0
3+
- Adding Snapshot additional mapping tokens https://github.com/actions/runner/pull/3468
4+
- Create launch httpclient using the right handler and setting https://github.com/actions/runner/pull/3476
5+
- Fix missing default user-agent for jitconfig runner https://github.com/actions/runner/pull/3473
6+
- Cleanup back-compat code for interpreting Run Service status codes https://github.com/actions/runner/pull/3456
7+
- Add runner or worker to the useragent https://github.com/actions/runner/pull/3457
8+
- Handle Error Body in Responses from Broker https://github.com/actions/runner/pull/3454
9+
- Fix issues for composite actions (Run Service flow) https://github.com/actions/runner/pull/3446
10+
- Trace GitHub RequestId to log https://github.com/actions/runner/pull/3442
11+
- Add `jq`, `git`, `unzip` and `curl` to default packages installed https://github.com/actions/runner/pull/3056
12+
- Add pid to user-agent and session owner https://github.com/actions/runner/pull/3432
13+
14+
**Full Changelog**: https://github.com/actions/runner/compare/v2.319.1...v2.320.0
815

916
_Note: Actions Runner follows a progressive release policy, so the latest release might not be available to your enterprise, organization, or repository yet.
1017
To confirm which version of the Actions Runner you should expect, please view the download instructions for your enterprise, organization, or repository.

releaseVersion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<Update to ./src/runnerversion when creating release>
1+
2.320.0

src/Runner.Common/BrokerServer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public Task ForceRefreshConnection(VssCredentials credentials)
9292

9393
public bool ShouldRetryException(Exception ex)
9494
{
95-
if (ex is AccessDeniedException ade && ade.ErrorCode == 1)
95+
if (ex is AccessDeniedException ade)
9696
{
9797
return false;
9898
}

src/Runner.Common/HostContext.cs

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public interface IHostContext : IDisposable
3636
event EventHandler Unloading;
3737
void ShutdownRunner(ShutdownReason reason);
3838
void WritePerfCounter(string counter);
39+
void LoadDefaultUserAgents();
3940
}
4041

4142
public enum StartupType
@@ -67,6 +68,7 @@ public sealed class HostContext : EventListener, IObserver<DiagnosticListener>,
6768
private StartupType _startupType;
6869
private string _perfFile;
6970
private RunnerWebProxy _webProxy = new();
71+
private string _hostType = string.Empty;
7072

7173
public event EventHandler Unloading;
7274
public CancellationToken RunnerShutdownToken => _runnerShutdownTokenSource.Token;
@@ -78,6 +80,7 @@ public HostContext(string hostType, string logFile = null)
7880
{
7981
// Validate args.
8082
ArgUtil.NotNullOrEmpty(hostType, nameof(hostType));
83+
_hostType = hostType;
8184

8285
_loadContext = AssemblyLoadContext.GetLoadContext(typeof(HostContext).GetTypeInfo().Assembly);
8386
_loadContext.Unloading += LoadContext_Unloading;
@@ -196,6 +199,16 @@ public HostContext(string hostType, string logFile = null)
196199
}
197200
}
198201

202+
if (StringUtil.ConvertToBoolean(Environment.GetEnvironmentVariable("GITHUB_ACTIONS_RUNNER_TLS_NO_VERIFY")))
203+
{
204+
_trace.Warning($"Runner is running under insecure mode: HTTPS server certificate validation has been turned off by GITHUB_ACTIONS_RUNNER_TLS_NO_VERIFY environment variable.");
205+
}
206+
207+
LoadDefaultUserAgents();
208+
}
209+
210+
public void LoadDefaultUserAgents()
211+
{
199212
if (string.IsNullOrEmpty(WebProxy.HttpProxyAddress) && string.IsNullOrEmpty(WebProxy.HttpsProxyAddress))
200213
{
201214
_trace.Info($"No proxy settings were found based on environmental variables (http_proxy/https_proxy/HTTP_PROXY/HTTPS_PROXY)");
@@ -205,11 +218,6 @@ public HostContext(string hostType, string logFile = null)
205218
_userAgents.Add(new ProductInfoHeaderValue("HttpProxyConfigured", bool.TrueString));
206219
}
207220

208-
if (StringUtil.ConvertToBoolean(Environment.GetEnvironmentVariable("GITHUB_ACTIONS_RUNNER_TLS_NO_VERIFY")))
209-
{
210-
_trace.Warning($"Runner is running under insecure mode: HTTPS server certificate validation has been turned off by GITHUB_ACTIONS_RUNNER_TLS_NO_VERIFY environment variable.");
211-
}
212-
213221
var credFile = GetConfigFile(WellKnownConfigFile.Credentials);
214222
if (File.Exists(credFile))
215223
{
@@ -248,6 +256,7 @@ public HostContext(string hostType, string logFile = null)
248256
var currentProcess = Process.GetCurrentProcess();
249257
_userAgents.Add(new ProductInfoHeaderValue("Pid", currentProcess.Id.ToString()));
250258
_userAgents.Add(new ProductInfoHeaderValue("CreationTime", Uri.EscapeDataString(DateTime.UtcNow.ToString("O"))));
259+
_userAgents.Add(new ProductInfoHeaderValue($"({_hostType})"));
251260
}
252261

253262
public string GetDirectory(WellKnownDirectory directory)

src/Runner.Common/LaunchServer.cs

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
using System;
22
using System.Collections.Generic;
3-
using System.Linq;
3+
using System.Net.Http;
44
using System.Threading;
55
using System.Threading.Tasks;
66
using GitHub.DistributedTask.WebApi;
7+
using GitHub.Runner.Sdk;
8+
using GitHub.Services.Common;
79
using GitHub.Services.Launch.Client;
8-
using GitHub.Services.WebApi;
910

1011
namespace GitHub.Runner.Common
1112
{
@@ -23,8 +24,21 @@ public sealed class LaunchServer : RunnerService, ILaunchServer
2324

2425
public void InitializeLaunchClient(Uri uri, string token)
2526
{
26-
var httpMessageHandler = HostContext.CreateHttpClientHandler();
27-
this._launchClient = new LaunchHttpClient(uri, httpMessageHandler, token, disposeHandler: true);
27+
// Using default 100 timeout
28+
RawClientHttpRequestSettings settings = VssUtil.GetHttpRequestSettings(null);
29+
30+
// Create retry handler
31+
IEnumerable<DelegatingHandler> delegatingHandlers = new List<DelegatingHandler>();
32+
if (settings.MaxRetryRequest > 0)
33+
{
34+
delegatingHandlers = new DelegatingHandler[] { new VssHttpRetryMessageHandler(settings.MaxRetryRequest) };
35+
}
36+
37+
// Setup RawHttpMessageHandler without credentials
38+
var httpMessageHandler = new RawHttpMessageHandler(new NoOpCredentials(null), settings);
39+
var pipeline = HttpClientFactory.CreatePipeline(httpMessageHandler, delegatingHandlers);
40+
41+
this._launchClient = new LaunchHttpClient(uri, pipeline, token, disposeHandler: true);
2842
}
2943

3044
public Task<ActionDownloadInfoCollection> ResolveActionsDownloadInfoAsync(Guid planId, Guid jobId, ActionReferenceList actionReferenceList,

src/Runner.Listener/Runner.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,10 @@ public async Task<int> ExecuteCommand(CommandSettings command)
237237
File.SetAttributes(configFile, File.GetAttributes(configFile) | FileAttributes.Hidden);
238238
Trace.Info($"Saved {configContent.Length} bytes to '{configFile}'.");
239239
}
240+
241+
// make sure we have the right user agent data added from the jitconfig
242+
HostContext.LoadDefaultUserAgents();
243+
VssUtil.InitializeVssClientSettings(HostContext.UserAgents, HostContext.WebProxy);
240244
}
241245
catch (Exception ex)
242246
{

src/Runner.Worker/ActionManager.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,6 +1102,7 @@ private async Task DownloadRepositoryArchive(IExecutionContext executionContext,
11021102
int timeoutSeconds = 20 * 60;
11031103
while (retryCount < 3)
11041104
{
1105+
string requestId = string.Empty;
11051106
using (var actionDownloadTimeout = new CancellationTokenSource(TimeSpan.FromSeconds(timeoutSeconds)))
11061107
using (var actionDownloadCancellation = CancellationTokenSource.CreateLinkedTokenSource(actionDownloadTimeout.Token, executionContext.CancellationToken))
11071108
{
@@ -1117,7 +1118,7 @@ private async Task DownloadRepositoryArchive(IExecutionContext executionContext,
11171118
httpClient.DefaultRequestHeaders.UserAgent.AddRange(HostContext.UserAgents);
11181119
using (var response = await httpClient.GetAsync(downloadUrl))
11191120
{
1120-
var requestId = UrlUtil.GetGitHubRequestId(response.Headers);
1121+
requestId = UrlUtil.GetGitHubRequestId(response.Headers);
11211122
if (!string.IsNullOrEmpty(requestId))
11221123
{
11231124
Trace.Info($"Request URL: {downloadUrl} X-GitHub-Request-Id: {requestId} Http Status: {response.StatusCode}");
@@ -1155,7 +1156,7 @@ private async Task DownloadRepositoryArchive(IExecutionContext executionContext,
11551156
catch (OperationCanceledException ex) when (!executionContext.CancellationToken.IsCancellationRequested && retryCount >= 2)
11561157
{
11571158
Trace.Info($"Action download final retry timeout after {timeoutSeconds} seconds.");
1158-
throw new TimeoutException($"Action '{downloadUrl}' download has timed out. Error: {ex.Message}");
1159+
throw new TimeoutException($"Action '{downloadUrl}' download has timed out. Error: {ex.Message} {requestId}");
11591160
}
11601161
catch (ActionNotFoundException)
11611162
{
@@ -1170,11 +1171,11 @@ private async Task DownloadRepositoryArchive(IExecutionContext executionContext,
11701171
if (actionDownloadTimeout.Token.IsCancellationRequested)
11711172
{
11721173
// action download didn't finish within timeout
1173-
executionContext.Warning($"Action '{downloadUrl}' didn't finish download within {timeoutSeconds} seconds.");
1174+
executionContext.Warning($"Action '{downloadUrl}' didn't finish download within {timeoutSeconds} seconds. {requestId}");
11741175
}
11751176
else
11761177
{
1177-
executionContext.Warning($"Failed to download action '{downloadUrl}'. Error: {ex.Message}");
1178+
executionContext.Warning($"Failed to download action '{downloadUrl}'. Error: {ex.Message} {requestId}");
11781179
}
11791180
}
11801181
}

0 commit comments

Comments
 (0)