Skip to content

Commit 1716a39

Browse files
[major] Harden the modular cloud runtime foundation
1 parent fc4be17 commit 1716a39

244 files changed

Lines changed: 21277 additions & 1542 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/cloud-smoke.yml

Lines changed: 99 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ on:
77

88
permissions:
99
contents: read
10-
id-token: write
1110

1211
concurrency:
1312
group: cloud-compose-smoke
@@ -20,15 +19,29 @@ jobs:
2019
steps:
2120
- name: Checkout repository
2221
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
22+
with:
23+
fetch-depth: 0
24+
persist-credentials: false
25+
26+
- name: Install contract tools
27+
run: |
28+
sudo apt-get update
29+
sudo apt-get install --yes ripgrep
2330
2431
- name: Install Terraform
2532
uses: hashicorp/setup-terraform@dfe3c3f87815947d99a8997f908cb6525fc44e9e # v4
2633
with:
2734
terraform_version: 1.14.6
2835
terraform_wrapper: false
2936

30-
- name: Run Terraform lint
31-
run: make terraform-lint-check
37+
- name: Install Go
38+
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6
39+
with:
40+
go-version: "1.26.x"
41+
cache: false
42+
43+
- name: Run repository lint
44+
run: make lint-check
3245

3346
- name: Validate fallback cleanup behavior
3447
run: |
@@ -53,6 +66,7 @@ jobs:
5366
runs-on: ubuntu-24.04
5467
timeout-minutes: 150
5568
if: github.event.pull_request.head.repo.full_name == github.repository
69+
environment: cloud-smoke-linode
5670
strategy:
5771
fail-fast: false
5872
matrix:
@@ -93,6 +107,7 @@ jobs:
93107
runs-on: ubuntu-24.04
94108
timeout-minutes: 150
95109
if: github.event.pull_request.head.repo.full_name == github.repository
110+
environment: cloud-smoke-${{ matrix.provider }}
96111
strategy:
97112
fail-fast: false
98113
matrix:
@@ -103,9 +118,6 @@ jobs:
103118
- name: Linode WordPress
104119
provider: linode
105120
template: wp
106-
- name: GCP WordPress
107-
provider: gcp
108-
template: wp
109121
concurrency:
110122
group: cloud-compose-smoke-${{ matrix.provider }}-${{ matrix.template }}
111123
cancel-in-progress: false
@@ -115,52 +127,115 @@ jobs:
115127
CLOUD_COMPOSE_SMOKE_SWEEP_ORPHANS: "true"
116128
CLOUD_COMPOSE_SMOKE_RUN_ID: ${{ github.run_id }}
117129
CLOUD_COMPOSE_SOURCE_REF: ${{ github.event.pull_request.head.sha }}
118-
DIGITALOCEAN_TOKEN: ${{ secrets.DIGITALOCEAN_TOKEN }}
130+
DIGITALOCEAN_TOKEN: ${{ matrix.provider == 'digitalocean' && secrets.DIGITALOCEAN_TOKEN || '' }}
131+
LINODE_TOKEN: ${{ matrix.provider == 'linode' && secrets.LINODE_TOKEN || '' }}
132+
133+
steps:
134+
- name: Checkout repository
135+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
136+
137+
- name: Install Terraform
138+
uses: hashicorp/setup-terraform@dfe3c3f87815947d99a8997f908cb6525fc44e9e # v4
139+
with:
140+
terraform_version: 1.14.6
141+
terraform_wrapper: false
142+
143+
- name: Install sitectl
144+
run: ci/install-sitectl-apt.sh
145+
146+
- name: Run smoke test
147+
run: make smoke-test PROVIDER=${{ matrix.provider }} TEMPLATE=${{ matrix.template }}
148+
149+
- name: Destroy smoke resources
150+
if: always()
151+
run: ci/cloud-smoke.sh destroy-${{ matrix.provider }}-${{ matrix.template }}
152+
153+
gcp-smoke:
154+
name: GCP WordPress
155+
needs:
156+
- terraform-lint
157+
- config-management-lint
158+
runs-on: ubuntu-24.04
159+
timeout-minutes: 210
160+
if: github.event.pull_request.head.repo.full_name == github.repository
161+
environment: cloud-smoke-gcp
162+
permissions:
163+
contents: read
164+
id-token: write
165+
concurrency:
166+
group: cloud-compose-smoke-gcp-wp
167+
cancel-in-progress: false
168+
env:
169+
CLOUD_COMPOSE_SMOKE_AUTO_APPROVE: "true"
170+
CLOUD_COMPOSE_SMOKE_DESTROY_TIMEOUT: "1800"
171+
CLOUD_COMPOSE_SMOKE_SWEEP_ORPHANS: "true"
172+
CLOUD_COMPOSE_SMOKE_RUN_ID: ${{ github.run_id }}
173+
CLOUD_COMPOSE_SOURCE_REF: ${{ github.event.pull_request.head.sha }}
174+
CLOUD_COMPOSE_UPGRADE_BASE_SHA: f33117cdbbf4a9c7d59006a4db986baef118e6bb
175+
CLOUD_COMPOSE_UPGRADE_CURRENT_REF: ${{ github.sha }}
119176
GCLOUD_OIDC_POOL: ${{ vars.GCLOUD_OIDC_POOL || secrets.GCLOUD_OIDC_POOL }}
120177
GCLOUD_PROJECT: ${{ vars.GCLOUD_PROJECT || secrets.GCLOUD_PROJECT }}
121178
GCLOUD_REGION: ${{ vars.GCLOUD_REGION || secrets.GCLOUD_REGION }}
179+
GCLOUD_NETWORK_PROJECT_ID: ${{ vars.GCLOUD_NETWORK_PROJECT_ID || secrets.GCLOUD_NETWORK_PROJECT_ID }}
180+
GCLOUD_NETWORK_NAME: ${{ vars.GCLOUD_NETWORK_NAME || secrets.GCLOUD_NETWORK_NAME }}
181+
GCLOUD_SUBNETWORK_NAME: ${{ vars.GCLOUD_SUBNETWORK_NAME || secrets.GCLOUD_SUBNETWORK_NAME }}
182+
GCLOUD_POWER_START_ROLE: ${{ vars.GCLOUD_POWER_START_ROLE || secrets.GCLOUD_POWER_START_ROLE }}
183+
GCLOUD_POWER_SUSPEND_ROLE: ${{ vars.GCLOUD_POWER_SUSPEND_ROLE || secrets.GCLOUD_POWER_SUSPEND_ROLE }}
122184
GSA: ${{ vars.GSA || secrets.GSA }}
123-
LINODE_TOKEN: ${{ secrets.LINODE_TOKEN }}
124-
125185
steps:
126186
- name: Checkout repository
127187
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
188+
with:
189+
fetch-depth: 0
190+
persist-credentials: false
128191

129192
- name: Install Terraform
130193
uses: hashicorp/setup-terraform@dfe3c3f87815947d99a8997f908cb6525fc44e9e # v4
131194
with:
132195
terraform_version: 1.14.6
133196
terraform_wrapper: false
134197

135-
- name: Check GCP smoke secrets
136-
if: matrix.provider == 'gcp'
198+
- name: Check GCP smoke configuration
199+
run: |
200+
test -n "$GCLOUD_OIDC_POOL" || { echo "GCLOUD_OIDC_POOL environment variable or secret is required for GCP smoke tests"; exit 1; }
201+
test -n "$GSA" || { echo "GSA environment variable or secret is required for GCP smoke tests"; exit 1; }
202+
test -n "$GCLOUD_PROJECT" || { echo "GCLOUD_PROJECT environment variable or secret is required for GCP smoke tests"; exit 1; }
203+
204+
- name: Check GCP upgrade configuration
205+
if: ${{ startsWith(github.event.pull_request.title, '[major]') }}
137206
run: |
138-
test -n "$GCLOUD_OIDC_POOL" || { echo "GCLOUD_OIDC_POOL Actions variable or secret is required for GCP smoke tests"; exit 1; }
139-
test -n "$GSA" || { echo "GSA Actions variable or secret is required for GCP smoke tests"; exit 1; }
140-
test -n "$GCLOUD_PROJECT" || { echo "GCLOUD_PROJECT Actions variable or secret is required for GCP smoke tests"; exit 1; }
207+
test -n "$GCLOUD_NETWORK_PROJECT_ID" || { echo "GCLOUD_NETWORK_PROJECT_ID environment variable or secret is required for the GCP upgrade smoke test"; exit 1; }
208+
test -n "$GCLOUD_NETWORK_NAME" || { echo "GCLOUD_NETWORK_NAME environment variable or secret is required for the GCP upgrade smoke test"; exit 1; }
209+
test -n "$GCLOUD_SUBNETWORK_NAME" || { echo "GCLOUD_SUBNETWORK_NAME environment variable or secret is required for the GCP upgrade smoke test"; exit 1; }
210+
test -n "$GCLOUD_POWER_START_ROLE" || { echo "GCLOUD_POWER_START_ROLE environment variable or secret is required for the GCP upgrade smoke test"; exit 1; }
211+
test -n "$GCLOUD_POWER_SUSPEND_ROLE" || { echo "GCLOUD_POWER_SUSPEND_ROLE environment variable or secret is required for the GCP upgrade smoke test"; exit 1; }
212+
test "$GCLOUD_NETWORK_PROJECT_ID" = "$GCLOUD_PROJECT" || { echo "GCLOUD_NETWORK_PROJECT_ID must equal GCLOUD_PROJECT for the 0.10.2 baseline"; exit 1; }
141213
142214
- name: Authenticate to Google Cloud
143-
if: matrix.provider == 'gcp'
144215
uses: google-github-actions/auth@7c6bc770dae815cd3e89ee6cdf493a5fab2cc093 # v3
145216
with:
146217
workload_identity_provider: ${{ env.GCLOUD_OIDC_POOL }}
147218
service_account: ${{ env.GSA }}
148219
project_id: ${{ env.GCLOUD_PROJECT }}
149220

150221
- name: Install gcloud
151-
if: matrix.provider == 'gcp'
152222
uses: google-github-actions/setup-gcloud@aa5489c8933f4cc7a4f7d45035b3b1440c9c10db # v3
153223

154224
- name: Install sitectl
155225
run: ci/install-sitectl-apt.sh
156226

157-
- name: Run smoke test
158-
run: make smoke-test PROVIDER=${{ matrix.provider }} TEMPLATE=${{ matrix.template }}
227+
- name: Run fresh smoke test
228+
if: ${{ !startsWith(github.event.pull_request.title, '[major]') }}
229+
run: make smoke-test PROVIDER=gcp TEMPLATE=wp
159230

160-
- name: Destroy smoke resources
161-
if: always() && (matrix.provider != 'gcp' || (env.GCLOUD_OIDC_POOL != '' && env.GSA != '' && env.GCLOUD_PROJECT != ''))
162-
run: ci/cloud-smoke.sh destroy-${{ matrix.provider }}-${{ matrix.template }}
231+
- name: Run 0.10.2 upgrade smoke test
232+
if: ${{ startsWith(github.event.pull_request.title, '[major]') }}
233+
run: ci/gcp-upgrade-smoke.sh run
234+
235+
- name: Destroy fresh smoke resources
236+
if: ${{ always() && !startsWith(github.event.pull_request.title, '[major]') && env.GCLOUD_OIDC_POOL != '' && env.GSA != '' && env.GCLOUD_PROJECT != '' }}
237+
run: ci/cloud-smoke.sh destroy-gcp-wp
163238

164-
- name: Skip GCP destroy
165-
if: always() && matrix.provider == 'gcp' && (env.GCLOUD_OIDC_POOL == '' || env.GSA == '' || env.GCLOUD_PROJECT == '')
166-
run: echo "Skipping GCP destroy because GCP smoke secrets are not configured and no GCP resources were applied."
239+
- name: Destroy upgrade smoke resources
240+
if: ${{ always() && startsWith(github.event.pull_request.title, '[major]') && env.GCLOUD_OIDC_POOL != '' && env.GSA != '' && env.GCLOUD_PROJECT != '' && env.GCLOUD_NETWORK_PROJECT_ID != '' && env.GCLOUD_NETWORK_NAME != '' && env.GCLOUD_SUBNETWORK_NAME != '' }}
241+
run: ci/gcp-upgrade-smoke.sh destroy

.github/workflows/docs.yml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
name: "Build docs"
22

33
on:
4+
pull_request:
5+
branches:
6+
- main
7+
paths:
8+
- "docs/**"
9+
- ".github/workflows/docs.yml"
10+
- "Makefile"
411
push:
512
branches:
613
- main
@@ -11,12 +18,25 @@ on:
1118

1219
permissions:
1320
contents: read
14-
pages: write
15-
id-token: write
1621

1722
jobs:
23+
validate:
24+
if: github.event_name == 'pull_request'
25+
runs-on: ubuntu-24.04
26+
steps:
27+
- name: Checkout code
28+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
29+
30+
- name: Build docs
31+
run: make docs-build
32+
1833
deploy:
34+
if: github.event_name == 'push'
1935
runs-on: ubuntu-24.04
36+
permissions:
37+
contents: read
38+
pages: write
39+
id-token: write
2040
environment:
2141
name: github-pages
2242
url: ${{ steps.deployment.outputs.page_url }}

.github/workflows/github-release.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ on:
88
jobs:
99
release:
1010
if: github.event.pull_request.merged == true && !contains(github.event.pull_request.title, 'skip-release')
11-
uses: libops/.github/.github/workflows/bump-release.yaml@main
11+
uses: libops/.github/.github/workflows/bump-release.yaml@8dfaf9c854df71d9bbffde48c5676ff07c543c51
12+
with:
13+
workflow_file: publish-rootfs.yaml
1214
permissions:
1315
contents: write
1416
actions: write
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Publish rootfs release asset
2+
3+
on:
4+
workflow_dispatch:
5+
6+
permissions:
7+
contents: write
8+
9+
jobs:
10+
publish:
11+
runs-on: ubuntu-24.04
12+
steps:
13+
- name: Checkout tagged source
14+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
15+
with:
16+
persist-credentials: false
17+
18+
- name: Build and verify canonical rootfs asset
19+
run: |
20+
ci/rootfs-package-contract.sh
21+
ci/package-rootfs.sh dist
22+
23+
- name: Upload rootfs asset and checksum
24+
env:
25+
GH_TOKEN: ${{ github.token }}
26+
run: >-
27+
gh release upload "$GITHUB_REF_NAME"
28+
dist/cloud-compose-rootfs.tar.gz
29+
dist/cloud-compose-rootfs.tar.gz.sha256
30+
--clobber

0 commit comments

Comments
 (0)