Skip to content

Commit cefa45b

Browse files
authored
feat(dr): new improved dr restore capability (#1583)
1 parent b3f919d commit cefa45b

40 files changed

+3329
-150
lines changed

.github/workflows/ci.yaml

Lines changed: 92 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,6 @@ jobs:
182182
run: |
183183
export K0S_VERSION=$(make print-K0S_VERSION)
184184
export EC_VERSION=$(git describe --tags --abbrev=4 --match='[0-9]*.[0-9]*.[0-9]*')
185-
export SHORT_SHA=dev-${{ needs.git-sha.outputs.git_sha }}
186185
export APP_VERSION=appver-dev-${{ needs.git-sha.outputs.git_sha }}
187186
# avoid rate limiting
188187
export FIO_VERSION=$(gh release list --repo axboe/fio --json tagName,isLatest | jq -r '.[] | select(.isLatest==true)|.tagName' | cut -d- -f2)
@@ -205,6 +204,75 @@ jobs:
205204
echo "K0S_VERSION=\"$K0S_VERSION\""
206205
echo "k0s_version=$K0S_VERSION" >> "$GITHUB_OUTPUT"
207206
207+
build-newdr:
208+
name: Build new DR
209+
runs-on: embedded-cluster
210+
needs:
211+
- git-sha
212+
outputs:
213+
k0s_version: ${{ steps.export.outputs.k0s_version }}
214+
steps:
215+
- name: Checkout
216+
uses: actions/checkout@v4
217+
with:
218+
fetch-depth: 0
219+
220+
- name: Cache embedded bins
221+
uses: actions/cache@v4
222+
with:
223+
path: |
224+
output/bins
225+
key: bins-cache
226+
227+
- name: Setup go
228+
uses: actions/setup-go@v5
229+
with:
230+
go-version-file: go.mod
231+
cache-dependency-path: "**/*.sum"
232+
233+
- name: Install dagger
234+
run: |
235+
curl -fsSL https://dl.dagger.io/dagger/install.sh | sh
236+
sudo mv ./bin/dagger /usr/local/bin/dagger
237+
238+
- name: Build
239+
env:
240+
APP_CHANNEL_ID: 2cHXb1RCttzpR0xvnNWyaZCgDBP
241+
APP_CHANNEL_SLUG: ci
242+
RELEASE_YAML_DIR: e2e/kots-release-install-newdr
243+
S3_BUCKET: "tf-staging-embedded-cluster-bin"
244+
USES_DEV_BUCKET: "0"
245+
AWS_ACCESS_KEY_ID: ${{ secrets.STAGING_EMBEDDED_CLUSTER_UPLOAD_IAM_KEY_ID }}
246+
AWS_SECRET_ACCESS_KEY: ${{ secrets.STAGING_EMBEDDED_CLUSTER_UPLOAD_IAM_SECRET }}
247+
AWS_REGION: "us-east-1"
248+
USE_CHAINGUARD: "1"
249+
UPLOAD_BINARIES: "1"
250+
SKIP_RELEASE: "1"
251+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
252+
run: |
253+
export K0S_VERSION=$(make print-K0S_VERSION)
254+
export EC_VERSION=$(git describe --tags --abbrev=4 --match='[0-9]*.[0-9]*.[0-9]*')-newdr
255+
export APP_VERSION=appver-dev-${{ needs.git-sha.outputs.git_sha }}-newdr
256+
# avoid rate limiting
257+
export FIO_VERSION=$(gh release list --repo axboe/fio --json tagName,isLatest | jq -r '.[] | select(.isLatest==true)|.tagName' | cut -d- -f2)
258+
259+
./scripts/build-and-release.sh
260+
cp output/bin/embedded-cluster output/bin/embedded-cluster-newdr
261+
262+
- name: Upload release
263+
uses: actions/upload-artifact@v4
264+
with:
265+
name: newdr-release
266+
path: |
267+
output/bin/embedded-cluster-newdr
268+
269+
- name: Export k0s version
270+
id: export
271+
run: |
272+
K0S_VERSION="$(make print-K0S_VERSION)"
273+
echo "K0S_VERSION=\"$K0S_VERSION\""
274+
echo "k0s_version=$K0S_VERSION" >> "$GITHUB_OUTPUT"
275+
208276
build-previous-k0s:
209277
name: Build previous k0s
210278
runs-on: embedded-cluster
@@ -260,6 +328,7 @@ jobs:
260328
export FIO_VERSION=$(gh release list --repo axboe/fio --json tagName,isLatest | jq -r '.[] | select(.isLatest==true)|.tagName' | cut -d- -f2)
261329
262330
./scripts/build-and-release.sh
331+
cp output/bin/embedded-cluster output/bin/embedded-cluster-previous-k0s
263332
264333
- name: Upload release
265334
uses: actions/upload-artifact@v4
@@ -363,6 +432,7 @@ jobs:
363432
export FIO_VERSION=$(gh release list --repo axboe/fio --json tagName,isLatest | jq -r '.[] | select(.isLatest==true)|.tagName' | cut -d- -f2)
364433
365434
./scripts/build-and-release.sh
435+
cp output/bin/embedded-cluster output/bin/embedded-cluster-upgrade
366436
367437
- name: Upload release
368438
uses: actions/upload-artifact@v4
@@ -439,6 +509,7 @@ jobs:
439509
needs:
440510
- git-sha
441511
- build-current
512+
- build-newdr
442513
- build-previous-k0s
443514
- build-upgrade
444515
- find-previous-stable
@@ -492,6 +563,12 @@ jobs:
492563
export RELEASE_YAML_DIR=e2e/kots-release-install
493564
./scripts/ci-release-app.sh
494565
566+
# promote a release with improved dr support
567+
export EC_VERSION="$(git describe --tags --abbrev=4 --match='[0-9]*.[0-9]*.[0-9]*')-newdr"
568+
export APP_VERSION="appver-${SHORT_SHA}-newdr"
569+
export RELEASE_YAML_DIR=e2e/kots-release-install-newdr
570+
./scripts/ci-release-app.sh
571+
495572
# then a noop upgrade
496573
export EC_VERSION="$(git describe --tags --abbrev=4 --match='[0-9]*.[0-9]*.[0-9]*')"
497574
export APP_VERSION="appver-${SHORT_SHA}-noop"
@@ -532,6 +609,12 @@ jobs:
532609
export RELEASE_YAML_DIR=e2e/kots-release-install
533610
./scripts/ci-release-app.sh
534611
612+
# promote a release with improved dr support
613+
export EC_VERSION="$(git describe --tags --abbrev=4 --match='[0-9]*.[0-9]*.[0-9]*')-newdr"
614+
export APP_VERSION="appver-${SHORT_SHA}-newdr"
615+
export RELEASE_YAML_DIR=e2e/kots-release-install-newdr
616+
./scripts/ci-release-app.sh
617+
535618
# and finally an app upgrade
536619
export EC_VERSION="$(git describe --tags --abbrev=4 --match='[0-9]*.[0-9]*.[0-9]*')-upgrade"
537620
export APP_VERSION="appver-${SHORT_SHA}-upgrade"
@@ -571,6 +654,7 @@ jobs:
571654
needs:
572655
- git-sha
573656
- build-current
657+
- build-newdr
574658
- build-previous-k0s
575659
- build-upgrade
576660
- find-previous-stable
@@ -600,6 +684,7 @@ jobs:
600684
- TestMultiNodeInstallation
601685
- TestMultiNodeHAInstallation
602686
- TestSingleNodeDisasterRecovery
687+
- TestSingleNodeNewDisasterRecovery
603688
- TestSingleNodeResumeDisasterRecovery
604689
- TestMultiNodeHADisasterRecovery
605690
- TestSingleNodeInstallationNoopUpgrade
@@ -618,6 +703,11 @@ jobs:
618703
with:
619704
name: current-release
620705
path: output/bin
706+
- name: Download new DR binary
707+
uses: actions/download-artifact@v4
708+
with:
709+
name: newdr-release
710+
path: output/bin
621711
- name: Setup go
622712
uses: actions/setup-go@v5
623713
with:
@@ -664,6 +754,7 @@ jobs:
664754
runs-on: ${{ matrix.runner || 'ubuntu-22.04' }}
665755
needs:
666756
- build-current
757+
- build-newdr
667758
- build-previous-k0s
668759
- build-upgrade
669760
- find-previous-stable

.github/workflows/release-prod.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,13 +260,15 @@ jobs:
260260
uses: actions/checkout@v4
261261
with:
262262
fetch-depth: 0
263+
263264
- name: Install replicated CLI
264265
env:
265266
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
266267
run: |
267268
gh release download --repo replicatedhq/replicated --pattern '*linux_amd64.tar.gz' --output replicated.tar.gz
268269
tar xf replicated.tar.gz replicated && rm replicated.tar.gz
269270
mv replicated /usr/local/bin/replicated
271+
270272
- name: Create CI releases
271273
env:
272274
REPLICATED_APP: "embedded-cluster-smoke-test-staging-app"
@@ -314,6 +316,7 @@ jobs:
314316
export APP_VERSION="appver-${{ github.ref_name }}-upgrade"
315317
export RELEASE_YAML_DIR=e2e/kots-release-upgrade
316318
./scripts/ci-release-app.sh
319+
317320
- name: Create airgap releases
318321
env:
319322
REPLICATED_APP: "embedded-cluster-smoke-test-staging-app"
@@ -327,21 +330,25 @@ jobs:
327330
export APP_VERSION="appver-${{ github.ref_name }}-previous-stable"
328331
export RELEASE_YAML_DIR=e2e/kots-release-install-stable
329332
./scripts/ci-release-app.sh
333+
330334
# promote a release with the current k0s version, but call it the previous version to test noop upgrades
331335
export EC_VERSION="${{ github.ref_name }}"
332336
export APP_VERSION="appver-${{ github.ref_name }}-previous-k0s"
333337
export RELEASE_YAML_DIR=e2e/kots-release-install
334338
./scripts/ci-release-app.sh
339+
335340
# promote a release with the current k0s version
336341
export EC_VERSION="${{ github.ref_name }}"
337342
export APP_VERSION="appver-${{ github.ref_name }}"
338343
export RELEASE_YAML_DIR=e2e/kots-release-install
339344
./scripts/ci-release-app.sh
345+
340346
# and finally an app upgrade
341347
export EC_VERSION="${{ github.ref_name }}"
342348
export APP_VERSION="appver-${{ github.ref_name }}-upgrade"
343349
export RELEASE_YAML_DIR=e2e/kots-release-upgrade
344350
./scripts/ci-release-app.sh
351+
345352
- name: Create Stable release
346353
env:
347354
REPLICATED_APP: "embedded-cluster-smoke-test-staging-app"

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,12 +186,14 @@ output/bin/embedded-cluster-release-builder:
186186
.PHONY: initial-release
187187
initial-release: export EC_VERSION = $(VERSION)-$(CURRENT_USER)
188188
initial-release: export APP_VERSION = appver-dev-$(call random-string)
189+
initial-release: export RELEASE_YAML_DIR = e2e/kots-release-install
189190
initial-release: check-env-EC_VERSION check-env-APP_VERSION
190191
UPLOAD_BINARIES=0 \
191192
./scripts/build-and-release.sh
192193

193194
.PHONY: rebuild-release
194195
rebuild-release: export EC_VERSION = $(VERSION)-$(CURRENT_USER)
196+
rebuild-release: export RELEASE_YAML_DIR = e2e/kots-release-install
195197
rebuild-release: check-env-EC_VERSION check-env-APP_VERSION
196198
UPLOAD_BINARIES=0 \
197199
SKIP_RELEASE=1 \

0 commit comments

Comments
 (0)