From 2897713437533604d76766b36b1a82ba6249e267 Mon Sep 17 00:00:00 2001 From: Hector Alfaro Date: Thu, 30 Jan 2025 14:35:57 -0500 Subject: [PATCH 1/2] Remove unused things, mostly Azure-related (#54192) Co-authored-by: Kevin Heis Co-authored-by: Evan Bonsignori --- .github/workflows/codeql.yml | 3 - .prettierignore | 1 - package.json | 2 - src/bookmarklets/README.md | 8 -- src/frame/middleware/healthcheck.ts | 2 +- src/frame/middleware/index.ts | 5 +- src/frame/tests/robots-txt.ts | 4 +- src/languages/README.md | 2 +- .../scripts/update-developer-site-links.ts | 74 ------------- src/observability/lib/statsd.js | 1 - src/open-source/README.md | 3 - src/open-source/scripts/add-pr-links.js | 1 - .../scripts/find-unicorn-action-shas.js | 87 --------------- src/open-source/scripts/pr-link-source.js | 92 ---------------- src/shielding/README.md | 4 +- src/shielding/middleware/rate-limit.ts | 6 +- src/workflows/azure-preview-env-template.json | 103 ------------------ src/workflows/wait-until-url-is-healthy.ts | 22 ---- 18 files changed, 11 insertions(+), 409 deletions(-) delete mode 100755 src/links/scripts/update-developer-site-links.ts delete mode 100644 src/open-source/README.md delete mode 100644 src/open-source/scripts/add-pr-links.js delete mode 100755 src/open-source/scripts/find-unicorn-action-shas.js delete mode 100644 src/open-source/scripts/pr-link-source.js delete mode 100644 src/workflows/azure-preview-env-template.json delete mode 100644 src/workflows/wait-until-url-is-healthy.ts diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 67fdbd0d6702..a6755462136c 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -39,9 +39,6 @@ jobs: - uses: github/codeql-action/init@eb055d739abdc2e8de2e5f4ba1a8b246daa779aa # v3.26.0 with: languages: javascript # comma separated list of values from {go, python, javascript, java, cpp, csharp, ruby} - config: | - paths-ignore: - - 'src/open-source/scripts/add-pr-links.js' - uses: github/codeql-action/analyze@eb055d739abdc2e8de2e5f4ba1a8b246daa779aa # v3.26.0 continue-on-error: true diff --git a/.prettierignore b/.prettierignore index c500b9890c7e..4a5ab8409d53 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,6 +1,5 @@ data/release-notes/ src/bookmarklets/ -src/open-source/scripts/add-pr-links.js /.next/ /.coverage diff --git a/package.json b/package.json index 15f3c9f94664..8135300b3ac9 100644 --- a/package.json +++ b/package.json @@ -232,8 +232,6 @@ "!/.*", "/.next/", "src/bookmarklets/*", - "src/open-source/scripts/add-pr-links.js", - "src/open-source/scripts/pr-link-source.js", "rest-api-description/", "docs-internal-data/", "src/code-scanning/scripts/generate-code-scanning-query-list.ts" diff --git a/src/bookmarklets/README.md b/src/bookmarklets/README.md index 1283b1170177..1ea8478ee9db 100644 --- a/src/bookmarklets/README.md +++ b/src/bookmarklets/README.md @@ -39,11 +39,3 @@ The installation requires a few steps: 1. Paste the path in place of where it says `REPLACE_ME` in line 1 (make sure to leave the single quotes around it). 1. Change the title to something like `Open in VSC`. 1. Drag the generated link onto your bookmarks bar. - -## Add preview links to PRs - -[`src/bookmarklets/add-pr-links.js`](./add-pr-links.js) - -This bookmarklet modifies the `Files changed` page of a GitHub pull request that has a current staging deployment. For each Markdown file in the diff view, it adds links to the preview deployment of the file for each version: `FPT / GHEC / GHES / AE`. (Some of these may redirect to another version or 404 if that version of the page doesn't exist.) - -Note: readable JavaScript source lives in `src/bookmarklets/pr-link-source.js`. The bookmarklet code was generated via https://chriszarate.github.io/bookmarkleter. diff --git a/src/frame/middleware/healthcheck.ts b/src/frame/middleware/healthcheck.ts index e3f8e5b9ff13..da828963cee0 100644 --- a/src/frame/middleware/healthcheck.ts +++ b/src/frame/middleware/healthcheck.ts @@ -5,7 +5,7 @@ const router = express.Router() /** * Returns the healthiness of the service. - * This may be used by azure app service (forthcoming) to determine whether this + * This may be used by Moda to determine whether this * instance remains in the pool to handle requests * For example: if we have a failing database connection we may return a 500 status here. */ diff --git a/src/frame/middleware/index.ts b/src/frame/middleware/index.ts index 9e2c574f48c4..8a4cc79753a2 100644 --- a/src/frame/middleware/index.ts +++ b/src/frame/middleware/index.ts @@ -115,9 +115,8 @@ export default function (app: Express) { app.use(datadog) } - // Put this early to make it as fast as possible because it's used, - // and used very often, by the Azure load balancer to check the - // health of each node. + // Put this early to make it as fast as possible because it's used + // to check the health of each cluster. app.use('/healthcheck', healthcheck) // Must appear before static assets and all other requests diff --git a/src/frame/tests/robots-txt.ts b/src/frame/tests/robots-txt.ts index a8bc0aca9dae..f785d4b1ab8b 100644 --- a/src/frame/tests/robots-txt.ts +++ b/src/frame/tests/robots-txt.ts @@ -30,10 +30,10 @@ describe('robots.txt', () => { ).toBe(true) }) - test('disallows indexing of azurecontainer.io domains', async () => { + test('disallows indexing of internal domains', async () => { const res = await get('/robots.txt', { headers: { - host: 'docs-internal-preview-12345-asdfz.azurecontainer.io', + host: 'docs-internal.github.com', }, }) expect(res.body).toEqual('User-agent: *\nDisallow: /') diff --git a/src/languages/README.md b/src/languages/README.md index a41e6f654b52..4ae7387bd00e 100644 --- a/src/languages/README.md +++ b/src/languages/README.md @@ -26,7 +26,7 @@ Periodically, translators read the `content/**` and `data/**` directories from ` ## Deployment of translated content -In the deployment workflow, we [checkout](https://github.com/github/docs-internal/blob/a8e52aad1a6b67f41da92d314bd7fd8cd84193a4/.github/workflows/azure-prod-build-deploy.yml#L90-L92) each and every translation repo and put their contents into the `translations/` directory. +During the build step of our deployment, we checkout every translation repo into the `translations/` directory. The enabled languages and their source directories are interpreted in [`src/languages/lib/languages.js`](https://github.com/github/docs-internal/blob/a8e52aad1a6b67f41da92d314bd7fd8cd84193a4/src/languages/lib/languages.js), which ensures English and translated content are in the same Docker image we deploy. diff --git a/src/links/scripts/update-developer-site-links.ts b/src/links/scripts/update-developer-site-links.ts deleted file mode 100755 index e19a6c8dfce1..000000000000 --- a/src/links/scripts/update-developer-site-links.ts +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/env node - -import fs from 'fs' -import path from 'path' -import walk from 'walk-sync' -import frontmatter from 'src/frame/lib/read-frontmatter.js' -import { loadPages } from 'src/frame/lib/page-data.js' -import patterns from 'src/frame/lib/patterns.js' -import loadRedirects from 'src/redirects/lib/precompile.js' -import { allVersionKeys } from 'src/versions/lib/all-versions.js' - -// get all content and data files -const files = ['content', 'data'] - .map((dir) => { - return walk(path.join(process.cwd(), dir), { - includeBasePath: true, - directories: false, - }).filter((file) => file.endsWith('.md') && !file.endsWith('README.md')) - }) - .flat() - -// match [foo](/v3) and [bar](/v4) Markdown links -const linkRegex = /\(\/v[34].*?\)/g - -main() - -async function main() { - // we need to load the pages so we can get the redirects - const englishPages = (await loadPages()).filter((p) => p.languageCode === 'en') - const redirects = await loadRedirects(englishPages) - - for (const file of files) { - const { data, content } = frontmatter(fs.readFileSync(file, 'utf8')) - - const links = content?.match(linkRegex) - if (!links) continue - - // remove parentheses: (/v3) -> /v3 - // also remove trailing slash before closing parens if there is one - const devLinks = links.map((link) => link.replace('(', '').replace(/\/?\)/, '')) - - let newContent = content - - for (const devLink of devLinks) { - const [link, fragment] = devLink.split(/\/?#/) - - let redirect = redirects[link] - - if (!redirect) { - console.log(`no redirect found for ${devLink} in ${file}`) - continue - } - - // do some cleanup - redirect = redirect - // remove language code segment - .replace(patterns.getLanguageCode, '') - // remove version segment - .replace(new RegExp(`/(${allVersionKeys.join('|')})`), '') - - // re-add the fragment after removing any fragment added via the redirect - // otherwise /v3/git/refs/#create-a-reference will become /rest/reference/git#refs#create-a-reference - // we want to preserve the #create-a-reference fragment, not #refs - const newLink = fragment ? redirect.replace(/#.+?$/, '') + '#' + fragment : redirect - - // first replace the old link with the new link - // then remove any trailing slashes - newContent = newContent?.replace(new RegExp(`${devLink}/?(?=\\))`), newLink) - } - - fs.writeFileSync(file, frontmatter.stringify(newContent || '', data || {})) - } - console.log('Done!') -} diff --git a/src/observability/lib/statsd.js b/src/observability/lib/statsd.js index 1b2aaeb7551f..63a5f150a2b6 100644 --- a/src/observability/lib/statsd.js +++ b/src/observability/lib/statsd.js @@ -24,7 +24,6 @@ export default new StatsD({ // DD_AGENT_HOST and DD_DOGSTATSD_PORT environment variables. // If undefined, the host will default to 'localhost' and the port // will default to 8125. - // Azure docker templates configure DD_AGENT_HOST but not DD_DOGSTATSD_PORT. // Moda configuration defines DD_DOGSTATSD_PORT but not DD_AGENT_HOST. // For Moda, the host must be set to the Kubernetes node name, which is // set in KUBE_NODE_HOSTNAME. diff --git a/src/open-source/README.md b/src/open-source/README.md deleted file mode 100644 index 8c39d7d32c87..000000000000 --- a/src/open-source/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Open source - -The open source subject folder contains files that relate to the github/docs repository, so that we can support open source contributors to docs.github.com. diff --git a/src/open-source/scripts/add-pr-links.js b/src/open-source/scripts/add-pr-links.js deleted file mode 100644 index f71a8ff7d809..000000000000 --- a/src/open-source/scripts/add-pr-links.js +++ /dev/null @@ -1 +0,0 @@ -javascript:void%20function(){!async%20function(){function%20a(a,b,c){var%20d=document.createElement(%22A%22);return%20d.innerHTML=b,d.href=c,d.target=%22_blank%22,a.appendChild(d),a}const%20b=/https:\/\/github.com\/github\/([^\/]*)\/pull\/\d*\/files/;if(!window.location.href.match(b))return%20void%20window.alert(%22You're%20not%20on%20a%20PR%20'Files%20changed'%20page.%20\uD83D\uDE43%22);let%20c=window.location.href.replace(/files.*/g,%22%22),d=await%20fetch(c).then(function(a){return%20a.text()}).then(function(a){for(var%20b=new%20DOMParser,c=b.parseFromString(a,%22text/html%22),d=c.getElementsByClassName(%22TimelineItem%22),e=0;e%3Cd.length;e++)for(var%20f,g=d[e],h=g.getElementsByTagName(%22a%22),k=0;k%3Ch.length;k++)if(f=h[k],f.innerText.match(/View%20deployment/))var%20l=f.getAttribute(%22href%22);return%20l});if(null==d)return%20void%20window.alert(%22No%20preview%20deployment%20found!%20\uD83D\uDE2D%22);d=d.replace(/\/$/,%22%22);var%20e=d+%22/en%22,f=d+%22/en/enterprise-cloud%40latest%22,g=d+%22/en/enterprise-server%40latest%22,h=d+%22/en/github-ae%40latest%22;const%20j=document.querySelectorAll(%22div.file-info%22);for(var%20k,l=0;l%3Cj.length;l++)if(k=j[l].querySelector(%22a%22).title,0===k.search(%22data/%22))continue;else{var%20m=/\.md$/,n=0%3C=k.search(m);if(n){console.log(%22link:%20%22+k),k=k.replace(m,%22%22),k=k.replace(/^content/,%22%22),k=k.replace(/\/index/,%22%22);var%20o=document.createElement(%22SPAN%22);o.style.fontFamily=%22-apple-system,BlinkMacSystemFont,Segoe%20UI,Helvetica,Arial,sans-serif%22,o.innerHTML=%22%26nbsp;%20View:%20%22,o=a(o,%22FPT%22,e+k),o.innerHTML+=%22%20/%20%22,o=a(o,%22GHEC%22,f+k),o.innerHTML+=%22%20/%20%22,o=a(o,%22GHES%22,g+k),o.innerHTML+=%22%20/%20%22,o=a(o,%22AE%22,h+k),j[l].appendChild(o)}}}()}(); diff --git a/src/open-source/scripts/find-unicorn-action-shas.js b/src/open-source/scripts/find-unicorn-action-shas.js deleted file mode 100755 index 11cd33dea347..000000000000 --- a/src/open-source/scripts/find-unicorn-action-shas.js +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/env node - -// [start-readme] -// -// In the .github/workflows, We use... -// -// uses: some/action@95cb08cb2672c73d4ffd2f422e6d11953d2a9c70 -// -// But sometimes we fail to update the uniformly. This script -// is for finding these unicorns. -// -// [end-readme] -// -// - -import fs from 'fs' - -import { program } from 'commander' -import walk from 'walk-sync' -import chalk from 'chalk' - -program - .description('Finds action shas that are unusual') - .option('-v, --verbose', 'Verbose outputs') - .parse(process.argv) - -main(program.opts(), program.args) - -async function main(opts, args) { - const files = walk('.github/workflows', { globs: ['*.yml'], includeBasePath: true }) - const counts = {} - const places = {} - - for (const file of files) { - const content = fs.readFileSync(file, 'utf-8') - let lineNo = 0 - for (const line of content.split(/\n/g)) { - lineNo++ - if (line.includes('uses:') && /@[a-f0-9]{40}/.test(line)) { - const match = line.match(/\b(?[\w/-]+)@(?[a-f0-9]{40})/) - const whole = match[0] - if (!places[whole]) { - places[whole] = [] - } - places[whole].push({ file, line, lineNo }) - const { name, sha } = match.groups - if (!counts[name]) { - counts[name] = {} - } - counts[name][sha] = 1 + (counts[name][sha] || 0) - } - } - } - const suspects = Object.fromEntries( - Object.entries(counts).filter(([, shas]) => Object.keys(shas).length > 1), - ) - - const countSuspects = Object.keys(suspects).length - if (countSuspects) { - console.log(chalk.yellow(`Found ${countSuspects} suspect${countSuspects === 1 ? '' : 's'}\n`)) - - for (const [action, shas] of Object.entries(suspects)) { - const total = Object.values(shas).reduce((a, b) => a + b, 0) - const flat = Object.entries(shas) - .map(([sha, count]) => [count, sha]) - .sort((a, b) => b[0] - a[0]) - - const mostPopular = flat[0] - for (const [count, sha] of flat.slice(1)) { - console.log(chalk.bold('Suspect:'), `${action}@${chalk.yellow(sha)}`) - console.log( - `is only used ${count} time${count === 1 ? '' : 's'} (${((100 * count) / total).toFixed( - 1, - )}%) compared to ${mostPopular[1]} (used ${mostPopular[0]} times)`, - ) - console.log(chalk.bold(`Consider changing to ${action}@${mostPopular[1]}`)) - console.log('in...') - for (const { file, lineNo } of places[`${action}@${sha}`]) { - console.log(`\t${file} (line ${lineNo})`) - } - console.log('\n') - } - } - } else { - console.log(chalk.green('All good! No suspects found 😎')) - } -} diff --git a/src/open-source/scripts/pr-link-source.js b/src/open-source/scripts/pr-link-source.js deleted file mode 100644 index 7c85dc28c4a1..000000000000 --- a/src/open-source/scripts/pr-link-source.js +++ /dev/null @@ -1,92 +0,0 @@ -!(async function () { - const regexp = /https:\/\/github.com\/github\/([^\/]*)\/pull\/\d*\/files/ - - if (!window.location.href.match(regexp)) { - window.alert("You're not on a PR 'Files changed' page. 🙃") - return - } - - let conversation_url = window.location.href.replace(/files.*/g, '') - - // get the preview deployment URL by loading the 'Conversation' page, and searching for the 'View deployment' link - let deployment_url = await fetch(conversation_url) - .then(function (response) { - return response.text() - }) - .then(function (html) { - // Convert the HTML string into a document object - var parser = new DOMParser() - var doc = parser.parseFromString(html, 'text/html') - - var elements = doc.getElementsByClassName('TimelineItem') - // Find the element that is a link that contains the text "View deployment" - for (var i = 0; i < elements.length; i++) { - var element = elements[i] - var links = element.getElementsByTagName('a') - for (var j = 0; j < links.length; j++) { - var link = links[j] - if (link.innerText.match(/View deployment/)) { - // Get the href of the link - var deployment_url = link.getAttribute('href') - } - } - } - // This should return the last link that contains the text "View deployment" (there might be multiple ones if there are multiple deployments) - return deployment_url - }) - if (deployment_url == null) { - window.alert('No preview deployment found! 😭') - return - } - // strip any trailing slash from deployment_url - deployment_url = deployment_url.replace(/\/$/, '') - - var url_fpt = deployment_url + '/en' - var url_ghec = deployment_url + '/en/enterprise-cloud@latest' - var url_ghes = deployment_url + '/en/enterprise-server@latest' - var url_ae = deployment_url + '/en/github-ae@latest' - var fpt = 'FPT' - var ghes = 'GHES' - var ghec = 'GHEC' - var ae = 'AE' - - const file_info = document.querySelectorAll('div.file-info') - for (var i = 0; i < file_info.length; i++) { - var link = file_info[i].querySelector('a').title - if (link.search('data/') === 0) { - continue - } else { - var regex = /\.md$/ - var markdownfile = link.search(regex) >= 0 - if (markdownfile) { - console.log('link: ' + link) - link = link.replace(regex, '') - link = link.replace(/^content/, '') - link = link.replace(/\/index/, '') - var span = document.createElement('SPAN') - span.style.fontFamily = - '-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif' - span.innerHTML = '  View: ' - - span = addLink(span, fpt, url_fpt + link) - span.innerHTML += ' / ' - span = addLink(span, ghec, url_ghec + link) - span.innerHTML += ' / ' - span = addLink(span, ghes, url_ghes + link) - span.innerHTML += ' / ' - span = addLink(span, ae, url_ae + link) - - file_info[i].appendChild(span) - } - } - } - - function addLink(span, link_name, link_href) { - var anchor = document.createElement('A') - anchor.innerHTML = link_name - anchor.href = link_href - anchor.target = '_blank' - span.appendChild(anchor) - return span - } -})() diff --git a/src/shielding/README.md b/src/shielding/README.md index b7fe08c4993f..2907827a053c 100644 --- a/src/shielding/README.md +++ b/src/shielding/README.md @@ -23,13 +23,13 @@ At its root, the `src/shielding/frame/middleware/index.js` is injected into our Express server. From there, it loads all its individual middleware handlers. Each middleware is one file that focuses on a single use-case. The -use-cases are borne from studying log files (CDN and Azure App Service) to +use-cases are borne from studying log files to spot patterns of request abuse. ## Notes - The best place to do shielding is as close to the client(s) as possible, -i.e. in the CDN or in Azure Frontdoor. Having the code in our own backend +i.e. in the CDN. Having the code in our own backend has the advantage that it's easier to write custom business logic along with end-to-end tests. - Some shielding "tricks" appear in other places throughout the code diff --git a/src/shielding/middleware/rate-limit.ts b/src/shielding/middleware/rate-limit.ts index 0c7f6b92165c..8f911b9d2c0c 100644 --- a/src/shielding/middleware/rate-limit.ts +++ b/src/shielding/middleware/rate-limit.ts @@ -19,8 +19,8 @@ export function createRateLimiter(max = MAX) { // 1 minute windowMs: EXPIRES_IN_AS_SECONDS * 1000, // limit each IP to X requests per windowMs - // We currently have about 25 instances in production. That's routed - // in Azure to spread the requests to each healthy instance. + // We currently have about 12 instances in production. That's routed + // in Moda to spread the requests to each healthy instance. // So, the true rate limit, per `windowMs`, is this number multiplied // by the current number of instances. max: max, @@ -32,7 +32,7 @@ export function createRateLimiter(max = MAX) { keyGenerator: (req) => { let { ip } = req - // In our Azure preview environment, with the way the proxying works, + // In our previous environments, with the way the proxying works, // the `x-forwarded-for` is always the origin IP with a port number // attached. E.g. `75.40.90.27:56675, 169.254.129.1` // This port number portion changes with every request, so we strip it. diff --git a/src/workflows/azure-preview-env-template.json b/src/workflows/azure-preview-env-template.json deleted file mode 100644 index a57aa01de73e..000000000000 --- a/src/workflows/azure-preview-env-template.json +++ /dev/null @@ -1,103 +0,0 @@ -{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": { - "appName": { - "defaultValue": null, - "type": "string", - "minLength": 5, - "maxLength": 63, - "metadata": { - "description": "A unique name for the app" - } - }, - "containerImage": { - "type": "string", - "defaultValue": null, - "metadata": { - "description": "Container image to deploy" - } - }, - "dockerRegistryUrl": { - "type": "String", - "metadata": { - "description": "Should be a valid host name without protocol" - } - }, - "dockerRegistryUsername": { - "type": "String" - }, - "dockerRegistryPassword": { - "type": "SecureString" - } - }, - "resources": [ - { - "type": "Microsoft.ContainerInstance/containerGroups", - "name": "[parameters('appName')]", - "apiVersion": "2021-07-01", - "location": "[resourceGroup().location]", - "properties": { - "containers": [ - { - "name": "app", - "properties": { - "image": "[parameters('containerImage')]", - "ports": [ - { - "protocol": "TCP", - "port": 4000 - } - ], - "environmentVariables": [ - { - "name": "PORT", - "value": "4000" - }, - { - "name": "NODE_ENV", - "value": "production" - }, - { - "name": "WEB_CONCURRENCY", - "value": "1" - } - ], - "resources": { - "requests": { - "memoryInGB": 4, - "cpu": 1 - } - } - } - } - ], - "imageRegistryCredentials": [ - { - "server": "[parameters('dockerRegistryUrl')]", - "username": "[parameters('dockerRegistryUsername')]", - "password": "[parameters('dockerRegistryPassword')]" - } - ], - "restartPolicy": "Always", - "ipAddress": { - "ports": [ - { - "protocol": "TCP", - "port": 4000 - } - ], - "type": "Public", - "dnsNameLabel": "[parameters('appName')]" - }, - "osType": "Linux" - } - } - ], - "outputs": { - "defaultHostName": { - "value": "[reference(resourceId('Microsoft.ContainerInstance/containerGroups', parameters('appName'))).ipAddress.fqdn]", - "type": "string" - } - } -} diff --git a/src/workflows/wait-until-url-is-healthy.ts b/src/workflows/wait-until-url-is-healthy.ts deleted file mode 100644 index efed9e05295f..000000000000 --- a/src/workflows/wait-until-url-is-healthy.ts +++ /dev/null @@ -1,22 +0,0 @@ -import got from 'got' - -// Will try for 20 minutes, (15 * 80) seconds / 60 [seconds] -const RETRIES = 80 -const DELAY_SECONDS = 15 - -/* - * Promise resolves once url is healthy or fails if timeout has passed - * @param {string} url - health url, e.g. docs.com/healthcheck - */ -export async function waitUntilUrlIsHealthy(url: string) { - try { - await got.head(url, { - retry: { - limit: RETRIES, - calculateDelay: ({ computedValue }) => Math.min(computedValue, DELAY_SECONDS * 1000), - }, - }) - return true - } catch {} - return false -} From 74db90a6cb7d81402dd293f070b4fba43933b3f7 Mon Sep 17 00:00:00 2001 From: Larissa Fortuna <56982181+lkfortuna@users.noreply.github.com> Date: Thu, 30 Jan 2025 12:55:23 -0800 Subject: [PATCH 2/2] Edit a larger runner changes (#54101) --- .../about-larger-runners.md | 2 +- .../managing-larger-runners.md | 30 +++++++++++++++++++ .../reusables/actions/resize-larger-runner.md | 2 ++ 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 data/reusables/actions/resize-larger-runner.md diff --git a/content/actions/using-github-hosted-runners/using-larger-runners/about-larger-runners.md b/content/actions/using-github-hosted-runners/using-larger-runners/about-larger-runners.md index c006e8f68091..7a40bf7f7c98 100644 --- a/content/actions/using-github-hosted-runners/using-larger-runners/about-larger-runners.md +++ b/content/actions/using-github-hosted-runners/using-larger-runners/about-larger-runners.md @@ -87,7 +87,7 @@ You can choose from several specifications for {% data variables.actions.hosted_ | 64 | 208 GB | 2040 GB | arm64 | Ubuntu, Windows | | 64 | 256 GB | 2040 GB | x64 | Ubuntu, Windows | ->[!NOTE] The 4-vCPU Windows runner only works with the Windows 11 Desktop image. +>[!NOTE] The 4-vCPU Windows runner only works with the Windows Server 2025 or Windows 11 Desktop image. ### Specifications for GPU {% data variables.actions.hosted_runners %} diff --git a/content/actions/using-github-hosted-runners/using-larger-runners/managing-larger-runners.md b/content/actions/using-github-hosted-runners/using-larger-runners/managing-larger-runners.md index 7a2d78ddbcc9..11c872eb3821 100644 --- a/content/actions/using-github-hosted-runners/using-larger-runners/managing-larger-runners.md +++ b/content/actions/using-github-hosted-runners/using-larger-runners/managing-larger-runners.md @@ -93,6 +93,36 @@ You can edit the name of your {% data variables.actions.hosted_runner %}s. {% data reusables.actions.rename-larger-runner %} {% endif %} +## Changing the size of a {% data variables.actions.hosted_runner %} + +{% ifversion ghec %} +You can edit the size of your {% data variables.actions.hosted_runner %}s. + +* [Changing the size of an organization runner](#changing-the-size-of-an-organization-runner) +* [Changing the size of an enterprise runner](#changing-the-size-of-an-enterprise-runner) + +### Changing the size of an organization runner + +{% endif %} + +{% data reusables.organizations.navigate-to-org %} +{% data reusables.organizations.org_settings %} +{% data reusables.organizations.settings-sidebar-actions-runners %} +{% data reusables.actions.select-a-larger-runner %} +{% data reusables.actions.resize-larger-runner %} + +{% ifversion ghec %} + +### Changing the size of an enterprise runner + +{% data reusables.enterprise-accounts.access-enterprise %} +{% data reusables.enterprise-accounts.policies-tab %} +{% data reusables.enterprise-accounts.actions-tab %} +{% data reusables.enterprise-accounts.actions-runners-tab %} +{% data reusables.actions.select-a-larger-runner %} +{% data reusables.actions.resize-larger-runner %} +{% endif %} + ## Configuring autoscaling for {% data variables.actions.hosted_runner %}s You can control the maximum number of jobs allowed to run concurrently for specific runner sets. Setting this field to a higher value can help prevent workflows being blocked due to parallelism. diff --git a/data/reusables/actions/resize-larger-runner.md b/data/reusables/actions/resize-larger-runner.md new file mode 100644 index 000000000000..bb1098fe57bf --- /dev/null +++ b/data/reusables/actions/resize-larger-runner.md @@ -0,0 +1,2 @@ +1. Select a new size for the runner from the list of available options under "Size." The available sizes depend on the image that is installed on the runner. +1. Click **Save**.