Skip to content

Commit c9bd77a

Browse files
authored
Merge pull request #44982 from github/repo-sync
Repo sync
2 parents 84db777 + 18df2c5 commit c9bd77a

19 files changed

Lines changed: 478 additions & 16 deletions

File tree

content/admin/administering-your-instance/administering-your-instance-from-the-command-line/command-line-utilities.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1443,6 +1443,27 @@ To install an upgrade package:
14431443
ghe-upgrade UPGRADE-PACKAGE-FILENAME
14441444
```
14451445
1446+
1447+
{% ifversion ghes > 3.20 %}
1448+
1449+
Beginning with upgrades in version 3.21 operators may run many of the upgrade operations without requiring a maintenance window using phased execution.
1450+
1451+
First run operations which do not require a maintenance window by triggering the pre-upgrade phase
1452+
1453+
```shell
1454+
ghe-upgrade --phase pre-upgrade UPGRADE-PACKAGE-FILENAME
1455+
```
1456+
1457+
Once that is complete operators may complete the upgrade by running the final steps after a maintenance window has been scheduled
1458+
1459+
```shell
1460+
ghe-upgrade --phase upgrade UPGRADE-PACKAGE-FILENAME
1461+
```
1462+
1463+
The upgraded {% data variables.product.prodname_enterprise %} host will be rebooted by this operation.
1464+
1465+
{% endif %}
1466+
14461467
{% data reusables.enterprise_installation.command-line-utilities-ghe-upgrade-rollback %}
14471468
14481469
### ghe-upgrade-scheduler
Lines changed: 305 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,305 @@
1+
---
2+
title: Enterprise Server Upgrade Automation
3+
intro: You can use the ghes-manage API or `es` plugin to automate upgrade operations in Enterprise Server environments.
4+
versions:
5+
ghes: '>= 3.21'
6+
shortTitle: Upgrade Enterprise Server
7+
contentType: how-tos
8+
---
9+
10+
You can upgrade a GitHub Enterprise Server instance using the Manage {% data variables.product.prodname_ghe_server %} API or the `gh es` CLI extension. These tools automate the process of downloading the upgrade package, running pre-upgrade checks, and applying the new version.
11+
12+
## Prerequisites
13+
14+
- Back up your data with [GitHub Enterprise Server Backup Utilities](https://github.com/github/backup-utils#readme).
15+
- Schedule a maintenance window for end users.
16+
- Ensure you have authentication credentials for the Manage {% data variables.product.prodname_ghe_server %} API. For more information, see [AUTOTITLE](/rest/enterprise-admin#authentication).
17+
18+
## Step 1: Download the upgrade package
19+
20+
Download the upgrade package to the instance.
21+
22+
### Using the CLI
23+
24+
```shell
25+
# Download a specific version
26+
gh es upgrade download --version VERSION
27+
28+
# Or download the latest available version
29+
gh es upgrade download
30+
```
31+
32+
### Using the API
33+
34+
```shell
35+
curl -L \
36+
-X POST \
37+
-u "api_key:ROOT-SITE-ADMINISTRATOR-PASSWORD" \
38+
-H "Content-Type: application/json" \
39+
https://HOSTNAME:8443/manage/v1/upgrade/download \
40+
-d '{"version":"VERSION"}'
41+
```
42+
43+
## Step 2: Monitor download progress
44+
45+
Confirm the download has completed before proceeding.
46+
47+
### Using the CLI
48+
49+
```shell
50+
gh es upgrade download status
51+
```
52+
53+
### Using the API
54+
55+
```shell
56+
curl -L \
57+
-u "api_key:ROOT-SITE-ADMINISTRATOR-PASSWORD" \
58+
-H "Content-Type: application/json" \
59+
https://HOSTNAME:8443/manage/v1/upgrade/download/status
60+
```
61+
62+
Wait until `status` shows `COMPLETED`.
63+
64+
## Step 3: Apply the upgrade's pre-upgrade phase
65+
66+
Apply the upgrade. This runs both the pre-upgrade and upgrade phases sequentially.
67+
68+
### Using the CLI
69+
70+
```shell
71+
gh es upgrade apply --version VERSION --phase pre-upgrade
72+
```
73+
74+
### Using the API
75+
76+
```shell
77+
curl -L \
78+
-X POST \
79+
-u "api_key:ROOT-SITE-ADMINISTRATOR-PASSWORD" \
80+
-H "Content-Type: application/json" \
81+
https://HOSTNAME:8443/manage/v1/upgrade/apply \
82+
-d '{"version":"VERSION", "phase":"pre-upgrade}'
83+
```
84+
85+
86+
## Step 4: Monitor pre-upgrade progress
87+
88+
Monitor the upgrade until it completes. The instance will reboot once the upgrade finishes.
89+
90+
### Using the CLI
91+
92+
```shell
93+
gh es upgrade status --verbose
94+
```
95+
96+
### Using the API
97+
98+
```shell
99+
curl -L \
100+
-u "api_key:ROOT-SITE-ADMINISTRATOR-PASSWORD" \
101+
-H "Content-Type: application/json" \
102+
"https://HOSTNAME:8443/manage/v1/upgrade/status?verbose=true"
103+
```
104+
105+
Wait until `status` shows `completed` and `is_running` shows `false`.
106+
107+
## Step 5: Enable maintenance mode
108+
109+
Enable maintenance mode.
110+
111+
### Using the CLI
112+
113+
```shell
114+
gh es maintenance set --enabled true
115+
```
116+
117+
### Using the API
118+
119+
```shell
120+
curl -L \
121+
-X POST \
122+
-u "api_key:ROOT-SITE-ADMINISTRATOR-PASSWORD" \
123+
-H "Content-Type: application/json" \
124+
https://HOSTNAME:8443/manage/v1/maintenance \
125+
-d '{"enabled":true}'
126+
```
127+
128+
## Step 6: Apply the upgrade's upgrade phase
129+
130+
Apply the upgrade. This runs both the pre-upgrade and upgrade phases sequentially.
131+
132+
### Using the CLI
133+
134+
```shell
135+
gh es upgrade apply --version VERSION --phase pre-upgrade
136+
```
137+
138+
### Using the API
139+
140+
```shell
141+
curl -L \
142+
-X POST \
143+
-u "api_key:ROOT-SITE-ADMINISTRATOR-PASSWORD" \
144+
-H "Content-Type: application/json" \
145+
https://HOSTNAME:8443/manage/v1/upgrade/apply \
146+
-d '{"version":"VERSION", "phase":"pre-upgrade}'
147+
```
148+
149+
## Step 7: Verify and disable maintenance mode
150+
151+
After the upgrade completes:
152+
153+
First, confirm the release version has been updated.
154+
155+
### Using the CLI
156+
157+
```shell
158+
gh es release version
159+
```
160+
161+
### Using the API
162+
163+
```shell
164+
curl -L \
165+
-u "api_key:ROOT-SITE-ADMINISTRATOR-PASSWORD" \
166+
-H "Content-Type: application/json" \
167+
https://HOSTNAME:8443/manage/v1/version
168+
```
169+
170+
Then, disable maintenance mode.
171+
172+
### Using the CLI
173+
174+
```shell
175+
gh es maintenance set --enabled false
176+
```
177+
178+
### Using the API
179+
180+
```shell
181+
curl -L \
182+
-X POST \
183+
-u "api_key:ROOT-SITE-ADMINISTRATOR-PASSWORD" \
184+
-H "Content-Type: application/json" \
185+
https://HOSTNAME:8443/manage/v1/maintenance \
186+
-d '{"enabled":false}'
187+
```
188+
189+
## Upgrading a high availability deployment
190+
191+
For instances with a high availability (HA) replica, the download and pre-upgrade phases are non-disruptive and can run across all nodes at once. UUID targeting is only needed for the upgrade phase itself, which triggers the reboot. This lets you control the order nodes reboot in: upgrade the replica first, then the primary.
192+
193+
To retrieve node UUIDs, run `gh es config get-metadata` or query `GET /manage/v1/config/nodes`.
194+
195+
### Using the CLI
196+
197+
```shell
198+
# Download the package to all nodes
199+
gh es upgrade download --version VERSION
200+
201+
# Wait for download to complete on all nodes
202+
gh es upgrade download status
203+
204+
# Run pre-upgrade on all nodes at once (non-disruptive)
205+
gh es upgrade apply --version VERSION --phase pre-upgrade
206+
207+
# Wait for pre-upgrade to complete
208+
gh es upgrade status --verbose
209+
210+
# Enable maintenance mode
211+
gh es maintenance set --enabled true
212+
213+
# Upgrade the replica first (triggers reboot)
214+
gh es upgrade apply --version VERSION --phase upgrade --uuid REPLICA-UUID
215+
gh es upgrade status --uuid REPLICA-UUID --verbose
216+
217+
# After the replica finishes, upgrade the primary
218+
gh es upgrade apply --version VERSION --phase upgrade --uuid PRIMARY-UUID
219+
gh es upgrade status --uuid PRIMARY-UUID --verbose
220+
221+
# Verify replication health and version, then disable maintenance mode
222+
gh es replication status
223+
gh es release version
224+
gh es maintenance set --enabled false
225+
```
226+
227+
### Using the API
228+
229+
```shell
230+
# Download the package to all nodes
231+
curl -L -X POST \
232+
-u "api_key:ROOT-SITE-ADMINISTRATOR-PASSWORD" \
233+
-H "Content-Type: application/json" \
234+
https://HOSTNAME:8443/manage/v1/upgrade/download \
235+
-d '{"version":"VERSION"}'
236+
237+
# Wait for download to complete on all nodes
238+
curl -L \
239+
-u "api_key:ROOT-SITE-ADMINISTRATOR-PASSWORD" \
240+
-H "Content-Type: application/json" \
241+
https://HOSTNAME:8443/manage/v1/upgrade/download/status
242+
243+
# Run pre-upgrade on all nodes at once (non-disruptive)
244+
curl -L -X POST \
245+
-u "api_key:ROOT-SITE-ADMINISTRATOR-PASSWORD" \
246+
-H "Content-Type: application/json" \
247+
https://HOSTNAME:8443/manage/v1/upgrade/apply \
248+
-d '{"version":"VERSION","phase":"pre-upgrade"}'
249+
250+
# Wait for pre-upgrade to complete
251+
curl -L \
252+
-u "api_key:ROOT-SITE-ADMINISTRATOR-PASSWORD" \
253+
-H "Content-Type: application/json" \
254+
"https://HOSTNAME:8443/manage/v1/upgrade/status?verbose=true"
255+
256+
# Enable maintenance mode
257+
curl -L -X POST \
258+
-u "api_key:ROOT-SITE-ADMINISTRATOR-PASSWORD" \
259+
-H "Content-Type: application/json" \
260+
https://HOSTNAME:8443/manage/v1/maintenance \
261+
-d '{"enabled":true}'
262+
263+
# Upgrade the replica first (triggers reboot)
264+
curl -L -X POST \
265+
-u "api_key:ROOT-SITE-ADMINISTRATOR-PASSWORD" \
266+
-H "Content-Type: application/json" \
267+
https://HOSTNAME:8443/manage/v1/upgrade/apply \
268+
-d '{"version":"VERSION","phase":"upgrade","uuid":"REPLICA-UUID"}'
269+
270+
# Monitor replica upgrade
271+
curl -L \
272+
-u "api_key:ROOT-SITE-ADMINISTRATOR-PASSWORD" \
273+
-H "Content-Type: application/json" \
274+
"https://HOSTNAME:8443/manage/v1/upgrade/status?uuid=REPLICA-UUID&verbose=true"
275+
276+
# After the replica finishes, upgrade the primary
277+
curl -L -X POST \
278+
-u "api_key:ROOT-SITE-ADMINISTRATOR-PASSWORD" \
279+
-H "Content-Type: application/json" \
280+
https://HOSTNAME:8443/manage/v1/upgrade/apply \
281+
-d '{"version":"VERSION","phase":"upgrade","uuid":"PRIMARY-UUID"}'
282+
283+
# Monitor primary upgrade
284+
curl -L \
285+
-u "api_key:ROOT-SITE-ADMINISTRATOR-PASSWORD" \
286+
-H "Content-Type: application/json" \
287+
"https://HOSTNAME:8443/manage/v1/upgrade/status?uuid=PRIMARY-UUID&verbose=true"
288+
289+
# Verify replication health and version, then disable maintenance mode
290+
curl -L \
291+
-u "api_key:ROOT-SITE-ADMINISTRATOR-PASSWORD" \
292+
-H "Content-Type: application/json" \
293+
https://HOSTNAME:8443/manage/v1/replication/status
294+
295+
curl -L \
296+
-u "api_key:ROOT-SITE-ADMINISTRATOR-PASSWORD" \
297+
-H "Content-Type: application/json" \
298+
https://HOSTNAME:8443/manage/v1/version
299+
300+
curl -L -X POST \
301+
-u "api_key:ROOT-SITE-ADMINISTRATOR-PASSWORD" \
302+
-H "Content-Type: application/json" \
303+
https://HOSTNAME:8443/manage/v1/maintenance \
304+
-d '{"enabled":false}'
305+
```
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: Upgrade Automation With API or CLI
3+
intro: 'You can automate appliance upgrade operation using the ghes-manage API and `es` plugin.'
4+
versions:
5+
ghes: '>= 3.21'
6+
children:
7+
- /enterprise-server-upgrade-automation
8+
---

content/admin/upgrading-your-instance/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@
77
- /preparing-to-upgrade
88
- /performing-an-upgrade
99
- /troubleshooting-upgrades
10+
- /automation-via-cli-api
1011
shortTitle: Upgrade your instance
1112
---

content/admin/upgrading-your-instance/performing-an-upgrade/upgrading-with-an-upgrade-package.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,26 @@ To upgrade a multi-node {% data variables.product.prodname_ghe_server %} environ
9595
{% data reusables.enterprise_installation.replication-status %} {% data reusables.enterprise_installation.replication-status-upgrade %}
9696
{% data reusables.enterprise_installation.multiple-node-repeat-upgrade-process %}
9797
{% data reusables.enterprise_installation.disable-maintenance-mode-after-replica-upgrade %}
98+
99+
## Upgrading an instance using phased upgrade execution
100+
101+
Phased upgrade execution allows {% data variables.product.prodname_ghe_server %} operators running versions 3.22 or greater better control over downtime-inducing actions by isolating those actions to their own phase. To use phased execution perform the following after downloading the upgrade package:
102+
1. Run the package's pre-upgrade phase
103+
104+
```shell
105+
ghe-upgrade --phase pre-upgrade GITHUB-UPGRADE.pkg
106+
```
107+
108+
1. Enable maintenance mode and wait for all active processes to complete on the {% data variables.product.prodname_ghe_server %} instance. See [AUTOTITLE](/admin/configuration/configuring-your-enterprise/enabling-and-scheduling-maintenance-mode).
109+
110+
> [!NOTE] When upgrading the primary node in a high availability configuration, the instance should already be in maintenance mode if you are following the instructions in [Upgrading the primary node with an upgrade package](#upgrading-the-primary-node-with-an-upgrade-package).
111+
1. Run the upgrade phase
112+
113+
```shell
114+
ghe-upgrade --phase pre-upgrade GITHUB-UPGRADE.pkg
115+
```
116+
117+
1. Optionally, after the upgrade, validate the upgrade by configuring an IP exception list to allow access to a specified list of IP addresses. See [AUTOTITLE](/admin/configuration/configuring-your-enterprise/enabling-and-scheduling-maintenance-mode#validating-changes-in-maintenance-mode-using-the-ip-exception-list).
118+
1. For single node upgrades, perform any post-upgrade tasks including disabling maintenance mode so users can use {% data variables.location.product_location %}.
119+
120+
> [!NOTE] After you upgrade an instance in a high availability configuration, you should remain in maintenance mode until you have upgraded all of the replica nodes and replication is current. See [Upgrading additional nodes with an upgrade package](#upgrading-additional-nodes-with-an-upgrade-package).

content/billing/concepts/budgets-and-alerts.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,12 @@ For metered products such as {% data variables.product.prodname_actions %}, {% d
2424
Each budget has a type and a scope that define which paid use contributes to spending against the budget.
2525

2626
* **Type**: Defines which metered product or SKU is measured.
27-
* **Scope**: Defines whether the budget applies to the whole account, or to a subset of repositories, organizations, cost centers (enterprise only), or users. User-scoped budgets are currently only supported for {% data variables.product.prodname_copilot_short %} {% data variables.product.prodname_ai_credits_short %}. There are two types: a universal budget that applies to all licensed users by default, and individual budgets that override the universal for specific users. See [AUTOTITLE](/copilot/concepts/billing/budgets-for-usage-based-billing).
27+
* **Scope**: Defines whether the budget applies to the whole account, or to a subset of repositories, organizations, cost centers (enterprise only), or users. User-scoped budgets are currently only supported for {% data variables.product.prodname_copilot_short %} {% data variables.product.prodname_ai_credits_short %}, and have three scopes:
28+
* **Universal**: applies to all licensed users by default
29+
* **Cost center user-level**: applies to every user in a cost center
30+
* **Individual**: overrides the above for specific users
31+
32+
For more information about how user-level budgets work and how they interact with other budget controls, see [AUTOTITLE](/copilot/concepts/billing/budgets-for-usage-based-billing).
2833

2934
## Budget alerts
3035

0 commit comments

Comments
 (0)