mirror of
https://github.com/actions/runner.git
synced 2025-12-13 19:03:44 +00:00
Compare commits
2 Commits
thboop/tes
...
nikola-jok
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d37dfa565e | ||
|
|
7cb4e05e53 |
@@ -5,7 +5,7 @@ ARG TARGETOS
|
|||||||
ARG TARGETARCH
|
ARG TARGETARCH
|
||||||
ARG RUNNER_VERSION
|
ARG RUNNER_VERSION
|
||||||
ARG RUNNER_CONTAINER_HOOKS_VERSION=0.5.1
|
ARG RUNNER_CONTAINER_HOOKS_VERSION=0.5.1
|
||||||
ARG DOCKER_VERSION=25.0.2
|
ARG DOCKER_VERSION=25.0.3
|
||||||
ARG BUILDX_VERSION=0.12.1
|
ARG BUILDX_VERSION=0.12.1
|
||||||
|
|
||||||
RUN apt update -y && apt install curl unzip -y
|
RUN apt update -y && apt install curl unzip -y
|
||||||
@@ -25,7 +25,7 @@ RUN export RUNNER_ARCH=${TARGETARCH} \
|
|||||||
&& if [ "$RUNNER_ARCH" = "amd64" ]; then export DOCKER_ARCH=x86_64 ; fi \
|
&& if [ "$RUNNER_ARCH" = "amd64" ]; then export DOCKER_ARCH=x86_64 ; fi \
|
||||||
&& if [ "$RUNNER_ARCH" = "arm64" ]; then export DOCKER_ARCH=aarch64 ; fi \
|
&& if [ "$RUNNER_ARCH" = "arm64" ]; then export DOCKER_ARCH=aarch64 ; fi \
|
||||||
&& curl -fLo docker.tgz https://download.docker.com/${TARGETOS}/static/stable/${DOCKER_ARCH}/docker-${DOCKER_VERSION}.tgz \
|
&& curl -fLo docker.tgz https://download.docker.com/${TARGETOS}/static/stable/${DOCKER_ARCH}/docker-${DOCKER_VERSION}.tgz \
|
||||||
&& tar zxvf docker.tgz \
|
&& tar zxvf docker.tgz --strip 1 -C . docker/docker \
|
||||||
&& rm -rf docker.tgz \
|
&& rm -rf docker.tgz \
|
||||||
&& mkdir -p /usr/local/lib/docker/cli-plugins \
|
&& mkdir -p /usr/local/lib/docker/cli-plugins \
|
||||||
&& curl -fLo /usr/local/lib/docker/cli-plugins/docker-buildx \
|
&& curl -fLo /usr/local/lib/docker/cli-plugins/docker-buildx \
|
||||||
@@ -57,6 +57,6 @@ WORKDIR /home/runner
|
|||||||
COPY --chown=runner:docker --from=build /actions-runner .
|
COPY --chown=runner:docker --from=build /actions-runner .
|
||||||
COPY --from=build /usr/local/lib/docker/cli-plugins/docker-buildx /usr/local/lib/docker/cli-plugins/docker-buildx
|
COPY --from=build /usr/local/lib/docker/cli-plugins/docker-buildx /usr/local/lib/docker/cli-plugins/docker-buildx
|
||||||
|
|
||||||
RUN install -o root -g root -m 755 docker/* /usr/bin/ && rm -rf docker
|
RUN install -o root -g root -m 755 ./docker /usr/bin/ && rm -rf docker
|
||||||
|
|
||||||
USER runner
|
USER runner
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ using System.Threading.Tasks;
|
|||||||
using GitHub.Actions.RunService.WebApi;
|
using GitHub.Actions.RunService.WebApi;
|
||||||
using GitHub.DistributedTask.Pipelines;
|
using GitHub.DistributedTask.Pipelines;
|
||||||
using GitHub.DistributedTask.WebApi;
|
using GitHub.DistributedTask.WebApi;
|
||||||
using GitHub.Runner.Common.Util;
|
|
||||||
using GitHub.Runner.Sdk;
|
using GitHub.Runner.Sdk;
|
||||||
using GitHub.Services.Common;
|
using GitHub.Services.Common;
|
||||||
using Sdk.RSWebApi.Contracts;
|
using Sdk.RSWebApi.Contracts;
|
||||||
@@ -61,7 +60,7 @@ namespace GitHub.Runner.Common
|
|||||||
{
|
{
|
||||||
CheckConnection();
|
CheckConnection();
|
||||||
return RetryRequest<AgentJobRequestMessage>(
|
return RetryRequest<AgentJobRequestMessage>(
|
||||||
async () => await _runServiceHttpClient.GetJobMessageAsync(requestUri, id, VarUtil.OS, cancellationToken), cancellationToken,
|
async () => await _runServiceHttpClient.GetJobMessageAsync(requestUri, id, cancellationToken), cancellationToken,
|
||||||
shouldRetry: ex => ex is not TaskOrchestrationJobAlreadyAcquiredException);
|
shouldRetry: ex => ex is not TaskOrchestrationJobAlreadyAcquiredException);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -780,16 +780,6 @@ namespace GitHub.Runner.Worker
|
|||||||
Directory.CreateDirectory(destDirectory);
|
Directory.CreateDirectory(destDirectory);
|
||||||
executionContext.Output($"Download action repository '{downloadInfo.NameWithOwner}@{downloadInfo.Ref}' (SHA:{downloadInfo.ResolvedSha})");
|
executionContext.Output($"Download action repository '{downloadInfo.NameWithOwner}@{downloadInfo.Ref}' (SHA:{downloadInfo.ResolvedSha})");
|
||||||
}
|
}
|
||||||
// TODO We will want to make sure to feature flag this. We have the execution context easy to do.
|
|
||||||
// See "DistributedTask.UseActionArchiveCache" for how we can do that in this same function, requires server side changes
|
|
||||||
// TODO figure out the exact refs and sha's we care about.
|
|
||||||
// We can probably check if it starts with v1 or v2, and have an allowlist of a few shas.
|
|
||||||
if (downloadInfo.NameWithOwner == "actions/upload-artifact" &&
|
|
||||||
(downloadInfo.Ref.StartsWith("v1.") || (downloadInfo.Ref.StartsWith("v2.") // '.' is important to avoid v10 conflict
|
|
||||||
|| downloadInfo.Ref == "v1" || downloadInfo.Ref == "v2")))
|
|
||||||
{
|
|
||||||
executionContext.Warning($"'{downloadInfo.NameWithOwner}@{downloadInfo.Ref}' is deprecated and will be disabled on xyz. Please upgrade to 'v4'. For more information, see (blogpost here)");
|
|
||||||
}
|
|
||||||
|
|
||||||
//download and extract action in a temp folder and rename it on success
|
//download and extract action in a temp folder and rename it on success
|
||||||
string tempDirectory = Path.Combine(HostContext.GetDirectory(WellKnownDirectory.Actions), "_temp_" + Guid.NewGuid());
|
string tempDirectory = Path.Combine(HostContext.GetDirectory(WellKnownDirectory.Actions), "_temp_" + Guid.NewGuid());
|
||||||
|
|||||||
@@ -7,8 +7,5 @@ namespace GitHub.Actions.RunService.WebApi
|
|||||||
{
|
{
|
||||||
[DataMember(Name = "jobMessageId", EmitDefaultValue = false)]
|
[DataMember(Name = "jobMessageId", EmitDefaultValue = false)]
|
||||||
public string JobMessageId { get; set; }
|
public string JobMessageId { get; set; }
|
||||||
|
|
||||||
[DataMember(Name = "runnerOS", EmitDefaultValue = false)]
|
|
||||||
public string RunnerOS { get; set; }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,14 +59,12 @@ namespace GitHub.Actions.RunService.WebApi
|
|||||||
public async Task<AgentJobRequestMessage> GetJobMessageAsync(
|
public async Task<AgentJobRequestMessage> GetJobMessageAsync(
|
||||||
Uri requestUri,
|
Uri requestUri,
|
||||||
string messageId,
|
string messageId,
|
||||||
string runnerOS,
|
|
||||||
CancellationToken cancellationToken = default)
|
CancellationToken cancellationToken = default)
|
||||||
{
|
{
|
||||||
HttpMethod httpMethod = new HttpMethod("POST");
|
HttpMethod httpMethod = new HttpMethod("POST");
|
||||||
var payload = new AcquireJobRequest
|
var payload = new AcquireJobRequest
|
||||||
{
|
{
|
||||||
JobMessageId = messageId,
|
JobMessageId = messageId,
|
||||||
RunnerOS = runnerOS
|
|
||||||
};
|
};
|
||||||
|
|
||||||
requestUri = new Uri(requestUri, "acquirejob");
|
requestUri = new Uri(requestUri, "acquirejob");
|
||||||
|
|||||||
Reference in New Issue
Block a user