Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement new runner service name convention #193

Merged
merged 5 commits into from
Nov 27, 2019

Conversation

juliobbv
Copy link
Contributor

@juliobbv juliobbv commented Nov 11, 2019

Adopt new runner service name convention:

Linux/systemd: actions.runner.[org-repo|org].<runnername>.service
OSX/Darwin: actions.runner.[org-repo|org].<runnername>
Windows: actions.runner.[org-repo|org].<runnername>

Additionally, because [org-repo|org] and <runnername> can be long enough to create a service name that's longer than 80 characters, this PR adds code that sensibly trims each part to make everything fit inside 80 chars.

Fixes #187, #191

@TingluoHuang
Copy link
Member

I thought we had this in AZP, did we miss it when we fork the repo?

@thboop
Copy link
Collaborator

thboop commented Nov 11, 2019

I thought we had this in AZP, did we miss it when we fork the repo?

Yeah, currently we are limited to 7 characters for the name, which is really rough UX

@juliobbv
Copy link
Contributor Author

juliobbv commented Nov 11, 2019

Correct @TingluoHuang, the code exists in AZP, but we missed when we forked the repo. So this is a straight re-addition.

https://github.com/microsoft/azure-pipelines-agent/blob/master/src/Agent.Listener/Configuration/ServiceControlManager.cs

@thboop
Copy link
Collaborator

thboop commented Nov 11, 2019

Do we want to fix #187, if so we could do it here, if not we should mark as invalid.

Keep in mind if we fix #187 we will have to address the case of checking the old service name when configuring/removing

@thboop
Copy link
Collaborator

thboop commented Nov 11, 2019

Can we also fix the issue where the service says it is starting when it actually is not, otherwise can we go ahead and file another issue for that item

@thboop
Copy link
Collaborator

thboop commented Nov 11, 2019

Changes look good, lets add some tests!

@juliobbv
Copy link
Contributor Author

juliobbv commented Nov 11, 2019

I'm good with keeping runner service names consistent. I'll make it actionsrunner across every OS (if nobody objects 😄).

Edit: I'm going to defer making the service rename change with this PR, as it's not a bug and it's not pressing in any sort of way to get it merged.

Copy link
Collaborator

@thboop thboop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM clean

@bryanmacfarlane
Copy link
Member

What does a "generated" service name look like now?

@bryanmacfarlane
Copy link
Member

^^ I would also like to review the generated name and compare to linux and mac. It would be nice if the docs just said, a service name looks like xxx and it's the same.

@juliobbv
Copy link
Contributor Author

@bryanmacfarlane with my proposed PR changes, generated service names look like this:

<= 80 chars

Linux/systemd: actions.runner.<actionshostname>.<poolname>.<agentname>.service
OSX/Darwin: actions.runner.<actionshostname>.<poolname>.<agentname>
Windows: actionsrunner.<actionshostname>.<poolname>.<agentname>

Example (Windows): actionsrunner.o12j2bQOK6Ovig8NeZLyDbKac9njxpVLdqm77oiLduQePH7pxE.Default.MyAgentName

> 80 chars
Linux/systemd: actions.runner.<first 25 chars of actionshostname>.<first 25 chars of poolname>.<agentname, trimmed to fill in 80 chars name total>.service
OSX/Darwin: actions.runner.<first 25 chars of actionshostname>.<first 25 chars of poolname>.<agentname, trimmed to fill in 80 chars>
Windows: actionsrunner.<first 25 chars of actionshostname>.<first 25 chars of poolname>.<agentname, trimmed to fill in 80 chars>

Example (Windows): actionsrunner.o12j2bQOK6Ovig8NeZLyDbKac.thisisaverylongpoolnamewi.longmachinenam

@bryanmacfarlane
Copy link
Member

bryanmacfarlane commented Nov 18, 2019

We may want to run this by product because the hash is ugly and pool names are irrelevant in actions.

I think it should just be:

Linux/systemd: actions.runner.[repo|org].<agentname>.service
OSX/Darwin: actions.runner.[repo|org].<agentname>
Windows: actions.runner.[repo|org].<agentname>

The key is we want it to be clear but also avoid conflicts (thus the repo | org). The other option is to just tell folks to use distinct names and drops that. The hash should go. Also, the config file has the url and host so that doesn't need to be in the name

@chrispat @thejoebourneidentity

@juliobbv
Copy link
Contributor Author

Hey @bryanmacfarlane, are we good merging this PR? My focus was on fixing the >80 chars bug to keep the changes well-scoped.

We can discuss/implement the proposed naming changes with a separate issue/PR. What do you think?

@juliobbv
Copy link
Contributor Author

Spoke with @bryanmacfarlane and @thejoebourneidentity. We're going to re-purpose this PR to include the proposed service naming changes by Bryan.

@juliobbv juliobbv changed the title Limit service name to 80 characters New runner service name convention Nov 25, 2019
@juliobbv juliobbv changed the title New runner service name convention Implement new runner service name convention Nov 25, 2019
@juliobbv juliobbv force-pushed the users/juliobbv/limit80chars branch 2 times, most recently from 37ad3da to 446acd6 Compare November 25, 2019 22:57
@juliobbv juliobbv self-assigned this Nov 26, 2019
@juliobbv
Copy link
Contributor Author

Hey @lucascosti! FYI, this PR now implements a the service naming convention below:

Linux/systemd: actions.runner.[repo|org].<runnername>.service
OSX/Darwin: actions.runner.[repo|org].<runnername>
Windows: actions.runner.[repo|org].<runnername>

For example: if I'm setting up a service for a Linux/systemd runner that targets the juliobbv/test repo, with the runner name myrunnername, the generated service name will be:
actions.runner.juliobbv-test.myrunnername.service.

@juliobbv juliobbv requested a review from thboop November 26, 2019 16:18
@thboop
Copy link
Collaborator

thboop commented Nov 27, 2019

Hey @lucascosti! FYI, this PR now implements a the service naming convention below:

Linux/systemd: actions.runner.[repo|org].<runnername>.service
OSX/Darwin: actions.runner.[repo|org].<runnername>
Windows: actions.runner.[repo|org].<runnername>

For example: if I'm setting up a service for a Linux/systemd runner that targets the juliobbv/test repo, with the runner name myrunnername, the generated service name will be:
actions.runner.juliobbv-test.myrunnername.service.

We may want to consider doing {Org.Repo | Org} as two repos can have the same name in different orgs.

@juliobbv
Copy link
Contributor Author

juliobbv commented Nov 27, 2019

We may want to consider doing {Org.Repo | Org} as two repos can have the same name in different orgs.

@thboop The code is currently doing: [Org-Repo | Org]. So e.g. repos example/test and example2/test generate different service names. I updated my PR description to better reflect reality.

Copy link
Collaborator

@thboop thboop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor Code thoughts but LGTM

@juliobbv juliobbv merged commit 7a6d9dc into master Nov 27, 2019
@juliobbv juliobbv deleted the users/juliobbv/limit80chars branch November 27, 2019 19:44
@lucascosti
Copy link
Contributor

lucascosti commented Nov 28, 2019

Hey @lucascosti! FYI, this PR now implements a the service naming convention below:

Linux/systemd: actions.runner.[repo|org].<runnername>.service
OSX/Darwin: actions.runner.[repo|org].<runnername>
Windows: actions.runner.[repo|org].<runnername>

For example: if I'm setting up a service for a Linux/systemd runner that targets the juliobbv/test repo, with the runner name myrunnername, the generated service name will be:
actions.runner.juliobbv-test.myrunnername.service.

Thanks, @juliobbv! I have opened a docs issue for the change: https://github.com/github/help-docs/issues/11694. We are currently frozen for Thanksgiving, but I'll make the docs update early next week. 🚀

@lucascosti
Copy link
Contributor

@juliobbv are these changes public? I just tested it, and the Add runner modal currently has instructions for downloading https://githubassets.azureedge.net/runners/2.161.0/actions-runner-win-x64-2.161.0.zip, and that is still creating services with the old naming. Is the runner naming change supposed to be in that runner app version?

I have a docs change ready to go in https://github.com/github/help-docs/pull/11704, but I'll hold off on that until you confirm. 🙂

@juliobbv
Copy link
Contributor Author

juliobbv commented Dec 2, 2019

@lucascosti the service name changes will be effective with the next runner release (2.162.0), which is scheduled to happen later today (release was frozen due to Thanksgiving weekend). I'll let you know once the release is created so you can merge your PR.

AdamOlech pushed a commit to antmicro/runner that referenced this pull request Jan 28, 2021
* Limit service name to 80 characters
* Add L0 tests
* New service name convention
* Make RepoOrOrgName a computed property
* Add service name sanitizing logic with L0 test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Service name inconsistency on Windows vs. macOS/Linux
5 participants