Skip to content

Commit 700df61

Browse files
machulavGitHub Actions
and
GitHub Actions
authored
Fix issue with ARM64, refactor info messages (#41)
* Fix issue with ARM64, refactor info messages * Update runner version to the latest * Update dist Co-authored-by: GitHub Actions <runner@fv-az90-102.oknmvzgco44exlvyi5fejcivhg.gx.internal.cloudapp.net>
1 parent 649ba91 commit 700df61

File tree

4 files changed

+26
-24
lines changed

4 files changed

+26
-24
lines changed

dist/index.js

+13-12
Original file line numberDiff line numberDiff line change
@@ -55094,9 +55094,10 @@ async function startEc2Instance(label, githubRegistrationToken) {
5509455094
'#!/bin/bash',
5509555095
'mkdir actions-runner && cd actions-runner',
5509655096
'case $(uname -m) in aarch64) ARCH="arm64" ;; amd64|x86_64) ARCH="x64" ;; esac && export RUNNER_ARCH=${ARCH}',
55097-
'curl -O -L https://github.com/actions/runner/releases/download/v2.277.1/actions-runner-linux-${RUNNER_ARCH}-2.277.1.tar.gz',
55098-
'tar xzf ./actions-runner-linux-${RUNNER_ARCH}-2.277.1.tar.gz',
55097+
'curl -O -L https://github.com/actions/runner/releases/download/v2.278.0/actions-runner-linux-${RUNNER_ARCH}-2.278.0.tar.gz',
55098+
'tar xzf ./actions-runner-linux-${RUNNER_ARCH}-2.278.0.tar.gz',
5509955099
'export RUNNER_ALLOW_RUNASROOT=1',
55100+
'export DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1',
5510055101
`./config.sh --url https://github.com/${config.githubContext.owner}/${config.githubContext.repo} --token ${githubRegistrationToken} --labels ${label}`,
5510155102
'./run.sh',
5510255103
];
@@ -55153,7 +55154,7 @@ async function waitForInstanceRunning(ec2InstanceId) {
5515355154
core.info(`AWS EC2 instance ${ec2InstanceId} is up and running`);
5515455155
return;
5515555156
} catch (error) {
55156-
core.error(`AWS EC2 instance ${ec2InstanceId} init error`);
55157+
core.error(`AWS EC2 instance ${ec2InstanceId} initialization error`);
5515755158
throw error;
5515855159
}
5515955160
}
@@ -55297,33 +55298,33 @@ async function removeRunner() {
5529755298
}
5529855299
}
5529955300

55300-
async function waitForRunnerCreated(label) {
55301+
async function waitForRunnerRegistered(label) {
5530155302
const timeoutMinutes = 5;
5530255303
const retryIntervalSeconds = 10;
5530355304
const quietPeriodSeconds = 30;
5530455305
let waitSeconds = 0;
5530555306

55306-
core.info(`Waiting ${quietPeriodSeconds}s before polling for runner`);
55307+
core.info(`Waiting ${quietPeriodSeconds}s for the AWS EC2 instance to be registered in GitHub as a new self-hosted runner`);
5530755308
await new Promise(r => setTimeout(r, quietPeriodSeconds * 1000));
55308-
core.info(`Polling for runner every ${retryIntervalSeconds}s`);
55309+
core.info(`Checking every ${retryIntervalSeconds}s if the GitHub self-hosted runner is registered`);
5530955310

5531055311
return new Promise((resolve, reject) => {
5531155312
const interval = setInterval(async () => {
5531255313
const runner = await getRunner(label);
5531355314

5531455315
if (waitSeconds > timeoutMinutes * 60) {
55315-
core.error('GitHub self-hosted runner creation error');
55316+
core.error('GitHub self-hosted runner registration error');
5531655317
clearInterval(interval);
55317-
reject(`A timeout of ${timeoutMinutes} minutes is exceeded. Please ensure your EC2 instance has access to the Internet.`);
55318+
reject(`A timeout of ${timeoutMinutes} minutes is exceeded. Your AWS EC2 instance was not able to register itself in GitHub as a new self-hosted runner.`);
5531855319
}
5531955320

5532055321
if (runner && runner.status === 'online') {
55321-
core.info(`GitHub self-hosted runner ${runner.name} is created and ready to use`);
55322+
core.info(`GitHub self-hosted runner ${runner.name} is registered and ready to use`);
5532255323
clearInterval(interval);
5532355324
resolve();
5532455325
} else {
5532555326
waitSeconds += retryIntervalSeconds;
55326-
core.info('Waiting...');
55327+
core.info('Checking...');
5532755328
}
5532855329
}, retryIntervalSeconds * 1000);
5532955330
});
@@ -55332,7 +55333,7 @@ async function waitForRunnerCreated(label) {
5533255333
module.exports = {
5533355334
getRegistrationToken,
5533455335
removeRunner,
55335-
waitForRunnerCreated,
55336+
waitForRunnerRegistered,
5533655337
};
5533755338

5533855339

@@ -55357,7 +55358,7 @@ async function start() {
5535755358
const ec2InstanceId = await aws.startEc2Instance(label, githubRegistrationToken);
5535855359
setOutput(label, ec2InstanceId);
5535955360
await aws.waitForInstanceRunning(ec2InstanceId);
55360-
await gh.waitForRunnerCreated(label);
55361+
await gh.waitForRunnerRegistered(label);
5536155362
}
5536255363

5536355364
async function stop() {

src/aws.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ async function startEc2Instance(label, githubRegistrationToken) {
1111
'#!/bin/bash',
1212
'mkdir actions-runner && cd actions-runner',
1313
'case $(uname -m) in aarch64) ARCH="arm64" ;; amd64|x86_64) ARCH="x64" ;; esac && export RUNNER_ARCH=${ARCH}',
14-
'curl -O -L https://github.com/actions/runner/releases/download/v2.277.1/actions-runner-linux-${RUNNER_ARCH}-2.277.1.tar.gz',
15-
'tar xzf ./actions-runner-linux-${RUNNER_ARCH}-2.277.1.tar.gz',
14+
'curl -O -L https://github.com/actions/runner/releases/download/v2.278.0/actions-runner-linux-${RUNNER_ARCH}-2.278.0.tar.gz',
15+
'tar xzf ./actions-runner-linux-${RUNNER_ARCH}-2.278.0.tar.gz',
1616
'export RUNNER_ALLOW_RUNASROOT=1',
17+
'export DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1',
1718
`./config.sh --url https://github.com/${config.githubContext.owner}/${config.githubContext.repo} --token ${githubRegistrationToken} --labels ${label}`,
1819
'./run.sh',
1920
];
@@ -70,7 +71,7 @@ async function waitForInstanceRunning(ec2InstanceId) {
7071
core.info(`AWS EC2 instance ${ec2InstanceId} is up and running`);
7172
return;
7273
} catch (error) {
73-
core.error(`AWS EC2 instance ${ec2InstanceId} init error`);
74+
core.error(`AWS EC2 instance ${ec2InstanceId} initialization error`);
7475
throw error;
7576
}
7677
}

src/gh.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -51,33 +51,33 @@ async function removeRunner() {
5151
}
5252
}
5353

54-
async function waitForRunnerCreated(label) {
54+
async function waitForRunnerRegistered(label) {
5555
const timeoutMinutes = 5;
5656
const retryIntervalSeconds = 10;
5757
const quietPeriodSeconds = 30;
5858
let waitSeconds = 0;
5959

60-
core.info(`Waiting ${quietPeriodSeconds}s before polling for runner`);
60+
core.info(`Waiting ${quietPeriodSeconds}s for the AWS EC2 instance to be registered in GitHub as a new self-hosted runner`);
6161
await new Promise(r => setTimeout(r, quietPeriodSeconds * 1000));
62-
core.info(`Polling for runner every ${retryIntervalSeconds}s`);
62+
core.info(`Checking every ${retryIntervalSeconds}s if the GitHub self-hosted runner is registered`);
6363

6464
return new Promise((resolve, reject) => {
6565
const interval = setInterval(async () => {
6666
const runner = await getRunner(label);
6767

6868
if (waitSeconds > timeoutMinutes * 60) {
69-
core.error('GitHub self-hosted runner creation error');
69+
core.error('GitHub self-hosted runner registration error');
7070
clearInterval(interval);
71-
reject(`A timeout of ${timeoutMinutes} minutes is exceeded. Please ensure your EC2 instance has access to the Internet.`);
71+
reject(`A timeout of ${timeoutMinutes} minutes is exceeded. Your AWS EC2 instance was not able to register itself in GitHub as a new self-hosted runner.`);
7272
}
7373

7474
if (runner && runner.status === 'online') {
75-
core.info(`GitHub self-hosted runner ${runner.name} is created and ready to use`);
75+
core.info(`GitHub self-hosted runner ${runner.name} is registered and ready to use`);
7676
clearInterval(interval);
7777
resolve();
7878
} else {
7979
waitSeconds += retryIntervalSeconds;
80-
core.info('Waiting...');
80+
core.info('Checking...');
8181
}
8282
}, retryIntervalSeconds * 1000);
8383
});
@@ -86,5 +86,5 @@ async function waitForRunnerCreated(label) {
8686
module.exports = {
8787
getRegistrationToken,
8888
removeRunner,
89-
waitForRunnerCreated,
89+
waitForRunnerRegistered,
9090
};

src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ async function start() {
1414
const ec2InstanceId = await aws.startEc2Instance(label, githubRegistrationToken);
1515
setOutput(label, ec2InstanceId);
1616
await aws.waitForInstanceRunning(ec2InstanceId);
17-
await gh.waitForRunnerCreated(label);
17+
await gh.waitForRunnerRegistered(label);
1818
}
1919

2020
async function stop() {

0 commit comments

Comments
 (0)