Skip to content

Commit 185dd19

Browse files
Merge branch 'main' into refactor-scheduler
2 parents 7339db0 + aece481 commit 185dd19

File tree

18 files changed

+712
-383
lines changed

18 files changed

+712
-383
lines changed

.github/workflows/upgrade.yml

Lines changed: 59 additions & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@ on:
88
workflow_dispatch:
99
inputs:
1010
beforeTagOrCommit:
11-
description: 'The baseline tag or commit to build Fleet agents from; if not specified, the latest tag will be used'
12-
required: false
13-
afterTagOrCommit:
14-
description: 'The new tag or commit to build Fleet agents from; if not specified, the last commit in the codebase (PR or branch) will be used'
11+
description: 'The tag or commit to build the before upgrade version of the Fleet agents from; if not specified, the latest tag will be used'
1512
required: false
1613
pull_request:
1714
branches:
@@ -60,11 +57,11 @@ jobs:
6057
- name: Travel back in time to the before upgrade version
6158
run: |
6259
GIT_TAG="${{ github.event.inputs.beforeTagOrCommit }}"
63-
PREVIOUS_BRANCH=$(git branch --show-current)
64-
PREVIOUS_COMMIT=$(git rev-parse HEAD)
65-
echo "Current at branch $PREVIOUS_BRANCH, commit $PREVIOUS_COMMIT."
60+
CURRENT_BRANCH=$(git branch --show-current)
61+
CURRENT_BRANCH=$(git rev-parse HEAD)
62+
echo "Current at branch $CURRENT_BRANCH, commit $CURRENT_BRANCH."
6663
67-
echo "PREVIOUS_COMMIT=$PREVIOUS_COMMIT" >> "$GITHUB_ENV"
64+
echo "CURRENT_BRANCH=$CURRENT_BRANCH" >> "$GITHUB_ENV"
6865
6966
if [ -z "${GIT_TAG}" ]
7067
then
@@ -73,7 +70,6 @@ jobs:
7370
7471
git fetch --all
7572
GIT_TAG=$(git describe --tags $(git rev-list --tags --max-count=1))
76-
7773
else
7874
echo "A tag is specified; go back to the state tracked by the specified tag."
7975
echo "Fetch all tags..."
@@ -85,55 +81,35 @@ jobs:
8581
echo "Checked out source code at $GIT_TAG."
8682
8783
- name: Prepare the fleet using the before upgrade version
88-
run: cd test/upgrade && chmod +x setup.sh && ./setup.sh 3 && cd -
84+
# Set up the Fleet using images built the older source code but with the current setup script.
85+
#
86+
# Note that the `git checkout` command below only checks out the `test/upgrade` directory (at
87+
# the current commit); the rest of the source code is still at the before-upgrade version.
88+
run: |
89+
git checkout $CURRENT_BRANCH -- test/upgrade
90+
cd test/upgrade && chmod +x setup.sh && cd -
91+
./test/upgrade/setup.sh 3
8992
env:
9093
KUBECONFIG: '/home/runner/.kube/config'
9194
HUB_SERVER_URL: 'https://172.19.0.2:6443'
9295

9396
- name: Travel to the current state
94-
# Note: Fleet always uses the version compatibility test suite from the
95-
# baseline commit, i.e., the commit that triggers the workflow.
97+
# Run the test suite from the current version, i.e., the commit that triggered the workflow.
9698
run: |
97-
echo "Returning to the current state..."
98-
git checkout $PREVIOUS_COMMIT
99-
echo "Checked out source code at $PREVIOUS_COMMIT."
99+
git checkout $CURRENT_BRANCH
100+
echo "Checked out source code at $CURRENT_BRANCH."
100101
101102
- name: Run the Before suite
102103
run: cd test/upgrade/before && ginkgo -v -p . && cd -
103104
env:
104105
KUBECONFIG: '/home/runner/.kube/config'
105-
106-
- name: Travel back in time to the after upgrade version
107-
run: |
108-
GIT_TAG="${{ github.event.inputs.afterTagOrCommit }}"
109-
PREVIOUS_BRANCH=$(git branch --show-current)
110-
PREVIOUS_COMMIT=$(git rev-parse HEAD)
111-
echo "Current at branch $PREVIOUS_BRANCH, commit $PREVIOUS_COMMIT."
112-
113-
if [ -z "${GIT_TAG}" ]
114-
then
115-
echo "No tag is specified; go back to the current state."
116-
else
117-
echo "A tag is specified; go back to the state tracked by the specified tag."
118-
echo "Fetch all tags..."
119-
120-
git fetch --all
121-
git checkout $GIT_TAG
122-
echo "Checked out source code at $GIT_TAG."
123-
fi
124106

125107
- name: Upgrade the Fleet hub agent to the after upgrade version
126-
run: cd test/upgrade && chmod +x upgrade.sh && UPGRADE_HUB_SIDE=true ./upgrade.sh 3 && cd -
108+
run: |
109+
cd test/upgrade && chmod +x upgrade.sh && cd -
110+
UPGRADE_HUB_SIDE=true ./test/upgrade/upgrade.sh 3
127111
env:
128112
KUBECONFIG: '/home/runner/.kube/config'
129-
130-
- name: Travel to the current state
131-
# Note: Fleet always uses the version compatibility test suite from the
132-
# baseline commit, i.e., the commit that triggers the workflow.
133-
run: |
134-
echo "Returning to the current state..."
135-
git checkout $PREVIOUS_COMMIT
136-
echo "Checked out source code at $PREVIOUS_COMMIT."
137113

138114
- name: Run the After suite
139115
run: cd test/upgrade/after && ginkgo -v -p . && cd -
@@ -164,20 +140,19 @@ jobs:
164140
- name: Travel back in time to the before upgrade version
165141
run: |
166142
GIT_TAG="${{ github.event.inputs.beforeTagOrCommit }}"
167-
PREVIOUS_BRANCH=$(git branch --show-current)
168-
PREVIOUS_COMMIT=$(git rev-parse HEAD)
169-
echo "Current at branch $PREVIOUS_BRANCH, commit $PREVIOUS_COMMIT."
143+
CURRENT_BRANCH=$(git branch --show-current)
144+
CURRENT_BRANCH=$(git rev-parse HEAD)
145+
echo "Current at branch $CURRENT_BRANCH, commit $CURRENT_BRANCH."
170146
171-
echo "PREVIOUS_COMMIT=$PREVIOUS_COMMIT" >> "$GITHUB_ENV"
147+
echo "CURRENT_BRANCH=$CURRENT_BRANCH" >> "$GITHUB_ENV"
172148
173149
if [ -z "${GIT_TAG}" ]
174150
then
175151
echo "No tag is specified; go back to the state tracked by the last known tag."
176152
echo "Fetch all tags..."
177153
178154
git fetch --all
179-
GIT_TAG=$(git describe --tags $(git rev-list --tags --max-count=1))
180-
155+
GIT_TAG=$(git describe --tags $(git rev-list --tags --max-count=1))
181156
else
182157
echo "A tag is specified; go back to the state tracked by the specified tag."
183158
echo "Fetch all tags..."
@@ -188,56 +163,36 @@ jobs:
188163
git checkout $GIT_TAG
189164
echo "Checked out source code at $GIT_TAG."
190165
191-
- name: Prepare the fleet
192-
run: cd test/upgrade && chmod +x setup.sh && ./setup.sh 3 && cd -
166+
- name: Prepare the fleet using the before upgrade version
167+
# Set up the Fleet using images built the older source code but with the current setup script.
168+
#
169+
# Note that the `git checkout` command below only checks out the `test/upgrade` directory (at
170+
# the current commit); the rest of the source code is still at the before-upgrade version.
171+
run: |
172+
git checkout $CURRENT_BRANCH -- test/upgrade
173+
cd test/upgrade && chmod +x setup.sh && cd -
174+
./test/upgrade/setup.sh 3
193175
env:
194176
KUBECONFIG: '/home/runner/.kube/config'
195177
HUB_SERVER_URL: 'https://172.19.0.2:6443'
196178

197179
- name: Travel to the current state
198-
# Note: Fleet always uses the version compatibility test suite from the
199-
# baseline commit, i.e., the commit that triggers the workflow.
180+
# Run the test suite from the current version, i.e., the commit that triggered the workflow.
200181
run: |
201-
echo "Returning to the current state..."
202-
git checkout $PREVIOUS_COMMIT
203-
echo "Checked out source code at $PREVIOUS_COMMIT."
182+
git checkout $CURRENT_BRANCH
183+
echo "Checked out source code at $CURRENT_BRANCH."
204184
205185
- name: Run the Before suite
206186
run: cd test/upgrade/before && ginkgo -v -p . && cd -
207187
env:
208188
KUBECONFIG: '/home/runner/.kube/config'
209-
210-
- name: Travel back in time to the after upgrade version
211-
run: |
212-
GIT_TAG="${{ github.event.inputs.afterTagOrCommit }}"
213-
PREVIOUS_BRANCH=$(git branch --show-current)
214-
PREVIOUS_COMMIT=$(git rev-parse HEAD)
215-
echo "Current at branch $PREVIOUS_BRANCH, commit $PREVIOUS_COMMIT."
216-
217-
if [ -z "${GIT_TAG}" ]
218-
then
219-
echo "No tag is specified; go back to the current state."
220-
else
221-
echo "A tag is specified; go back to the state tracked by the specified tag."
222-
echo "Fetch all tags..."
223-
224-
git fetch --all
225-
git checkout $GIT_TAG
226-
echo "Checked out source code at $GIT_TAG."
227-
fi
228189

229190
- name: Upgrade the Fleet member agent
230-
run: cd test/upgrade && chmod +x upgrade.sh && UPGRADE_MEMBER_SIDE=true ./upgrade.sh 3 && cd -
191+
run: |
192+
cd test/upgrade && chmod +x upgrade.sh && cd -
193+
UPGRADE_MEMBER_SIDE=true ./test/upgrade/upgrade.sh 3
231194
env:
232195
KUBECONFIG: '/home/runner/.kube/config'
233-
234-
- name: Travel to the current state
235-
# Note: Fleet always uses the version compatibility test suite from the
236-
# baseline commit, i.e., the commit that triggers the workflow.
237-
run: |
238-
echo "Returning to the current state..."
239-
git checkout $PREVIOUS_COMMIT
240-
echo "Checked out source code at $PREVIOUS_COMMIT."
241196

242197
- name: Run the After suite
243198
run: cd test/upgrade/after && ginkgo -v -p . && cd -
@@ -268,20 +223,19 @@ jobs:
268223
- name: Travel back in time to the before upgrade version
269224
run: |
270225
GIT_TAG="${{ github.event.inputs.beforeTagOrCommit }}"
271-
PREVIOUS_BRANCH=$(git branch --show-current)
272-
PREVIOUS_COMMIT=$(git rev-parse HEAD)
273-
echo "Current at branch $PREVIOUS_BRANCH, commit $PREVIOUS_COMMIT."
226+
CURRENT_BRANCH=$(git branch --show-current)
227+
CURRENT_BRANCH=$(git rev-parse HEAD)
228+
echo "Current at branch $CURRENT_BRANCH, commit $CURRENT_BRANCH."
274229
275-
echo "PREVIOUS_COMMIT=$PREVIOUS_COMMIT" >> "$GITHUB_ENV"
230+
echo "CURRENT_BRANCH=$CURRENT_BRANCH" >> "$GITHUB_ENV"
276231
277232
if [ -z "${GIT_TAG}" ]
278233
then
279234
echo "No tag is specified; go back to the state tracked by the last known tag."
280235
echo "Fetch all tags..."
281236
282237
git fetch --all
283-
GIT_TAG=$(git describe --tags $(git rev-list --tags --max-count=1))
284-
238+
GIT_TAG=$(git describe --tags $(git rev-list --tags --max-count=1))
285239
else
286240
echo "A tag is specified; go back to the state tracked by the specified tag."
287241
echo "Fetch all tags..."
@@ -292,57 +246,37 @@ jobs:
292246
git checkout $GIT_TAG
293247
echo "Checked out source code at $GIT_TAG."
294248
295-
- name: Prepare the fleet
296-
run: cd test/upgrade && chmod +x setup.sh && ./setup.sh 3 && cd -
249+
- name: Prepare the fleet using the before upgrade version
250+
# Set up the Fleet using images built the older source code but with the current setup script.
251+
#
252+
# Note that the `git checkout` command below only checks out the `test/upgrade` directory (at
253+
# the current commit); the rest of the source code is still at the before-upgrade version.
254+
run: |
255+
git checkout $CURRENT_BRANCH -- test/upgrade
256+
cd test/upgrade && chmod +x setup.sh && cd -
257+
./test/upgrade/setup.sh 3
297258
env:
298259
KUBECONFIG: '/home/runner/.kube/config'
299260
HUB_SERVER_URL: 'https://172.19.0.2:6443'
300261

301262
- name: Travel to the current state
302-
# Note: Fleet always uses the version compatibility test suite from the
303-
# baseline commit, i.e., the commit that triggers the workflow.
263+
# Run the test suite from the current version, i.e., the commit that triggered the workflow.
304264
run: |
305-
echo "Returning to the current state..."
306-
git checkout $PREVIOUS_COMMIT
307-
echo "Checked out source code at $PREVIOUS_COMMIT."
265+
git checkout $CURRENT_BRANCH
266+
echo "Checked out source code at $CURRENT_BRANCH."
308267
309268
- name: Run the Before suite
310269
run: cd test/upgrade/before && ginkgo -v -p . && cd -
311270
env:
312271
KUBECONFIG: '/home/runner/.kube/config'
313-
314-
- name: Travel back in time to the after upgrade version
315-
run: |
316-
GIT_TAG="${{ github.event.inputs.afterTagOrCommit }}"
317-
PREVIOUS_BRANCH=$(git branch --show-current)
318-
PREVIOUS_COMMIT=$(git rev-parse HEAD)
319-
echo "Current at branch $PREVIOUS_BRANCH, commit $PREVIOUS_COMMIT."
320-
321-
if [ -z "${GIT_TAG}" ]
322-
then
323-
echo "No tag is specified; go back to the current state."
324-
else
325-
echo "A tag is specified; go back to the state tracked by the specified tag."
326-
echo "Fetch all tags..."
327-
328-
git fetch --all
329-
git checkout $GIT_TAG
330-
echo "Checked out source code at $GIT_TAG."
331-
fi
332272

333273
- name: Upgrade all Fleet agents
334-
run: cd test/upgrade && GIT_TAG="${{ github.event.inputs.afterTagOrCommit }}" chmod +x upgrade.sh && UPGRADE_HUB_SIDE=true UPGRADE_MEMBER_SIDE=true ./upgrade.sh 3 && cd -
274+
run: |
275+
cd test/upgrade && chmod +x upgrade.sh && cd -
276+
UPGRADE_HUB_SIDE=true UPGRADE_MEMBER_SIDE=true ./test/upgrade/upgrade.sh 3
335277
env:
336278
KUBECONFIG: '/home/runner/.kube/config'
337279

338-
- name: Travel to the current state
339-
# Note: Fleet always uses the version compatibility test suite from the
340-
# baseline commit, i.e., the commit that triggers the workflow.
341-
run: |
342-
echo "Returning to the current state..."
343-
git checkout $PREVIOUS_COMMIT
344-
echo "Checked out source code at $PREVIOUS_COMMIT."
345-
346280
- name: Run the After suite
347281
run: cd test/upgrade/after && ginkgo -v -p . && cd -
348282
env:

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ You can reach the KubeFleet community and developers via the following channels:
3838
We host bi-weekly community meetings that alternate between US/EU and APAC friendly time. In these sessions the community will showcase demos and discuss the current and future state of the project.
3939

4040
Please refer to the [calendar](https://zoom-lfx.platform.linuxfoundation.org/meetings/kubefleet?view=month) for the latest schedule:
41-
* Wednesdays at 09:30am PT [US/EU](https://zoom-lfx.platform.linuxfoundation.org/meeting/93624014488?password=27667a5c-9238-4b5a-b4d8-96daadaa9fa4) (biweekly). [Convert to your timezone](https://dateful.com/convert/pacific-time-pt?t=930am).
41+
* Wednesdays at 09:30am PT [US/EU](https://zoom-lfx.platform.linuxfoundation.org/meeting/93624014488?password=27667a5c-9238-4b5a-b4d8-96daadaa9fa4) (weekly). [Convert to your timezone](https://dateful.com/convert/pacific-time-pt?t=930am).
4242
* Thursday at 9:00am CST [APAC](https://zoom-lfx.platform.linuxfoundation.org/meeting/98901589453?password=9ab588fd-1214-40c3-84c2-757c124e984f) (biweekly). [Convert to your timezone](https://dateful.com/convert/beijing-china?t=9am).
4343

4444
For more meeting information, minutes and recordings, please see the [KubeFleet community meeting doc](https://docs.google.com/document/d/1iMcHn11fPlb9ZGoMHiGEBvdIc44W1CjZvsPH3eBg6pA/edit?usp=sharing).
@@ -61,4 +61,4 @@ For more information, see [SUPPORT](SUPPORT.md).
6161
[5]: https://img.shields.io/github/go-mod/go-version/kubefleet-dev/kubefleet
6262

6363
Copyright The KubeFleet Authors.
64-
The Linux Foundation® (TLF) has registered trademarks and uses trademarks. For a list of TLF trademarks, see [Trademark Usage](https://www.linuxfoundation.org/trademark-usage/).
64+
The Linux Foundation® (TLF) has registered trademarks and uses trademarks. For a list of TLF trademarks, see [Trademark Usage](https://www.linuxfoundation.org/trademark-usage/).

0 commit comments

Comments
 (0)