Skip to content

Commit

Permalink
Squashed 'release-tools/' changes from a6a1a797..d29a2e75
Browse files Browse the repository at this point in the history
kubernetes-csi/csi-release-tools@d29a2e75 Merge kubernetes-csi/csi-release-tools#198 from pohly/csi-test-5.0.0
kubernetes-csi/csi-release-tools@41cb70d3 prow.sh: sanity testing with csi-test v5.0.0
kubernetes-csi/csi-release-tools@c85a63fb Merge kubernetes-csi/csi-release-tools#197 from pohly/fix-alpha-testing
kubernetes-csi/csi-release-tools@b86d8e94 support Kubernetes 1.25 + Ginkgo v2
kubernetes-csi/csi-release-tools@ab0b0a3d Merge kubernetes-csi/csi-release-tools#192 from andyzhangx/patch-1
kubernetes-csi/csi-release-tools@7bbab24e Merge kubernetes-csi/csi-release-tools#196 from humblec/non-alpha
kubernetes-csi/csi-release-tools@e51ff2cc introduce control variable for non alpha feature gate configuration
kubernetes-csi/csi-release-tools@ca19ef52 Merge kubernetes-csi/csi-release-tools#195 from pohly/fix-alpha-testing
kubernetes-csi/csi-release-tools@3948331e fix testing with latest Kubernetes
kubernetes-csi/csi-release-tools@e4dab7ff Merge kubernetes-csi/csi-release-tools#194 from yselkowitz/registry-k8s-io
kubernetes-csi/csi-release-tools@84a4d5a1 Move from k8s.gcr.io to registry.k8s.io
kubernetes-csi/csi-release-tools@9a0260c5 fix boilerplate header
kubernetes-csi/csi-release-tools@37d11049 Merge kubernetes-csi/csi-release-tools#191 from pohly/go-1.18
kubernetes-csi/csi-release-tools@db917f5c update to Go 1.18
kubernetes-csi/csi-release-tools@335339f0 Merge kubernetes-csi/csi-release-tools#187 from mauriciopoppe/remove-eol-windows-versions
kubernetes-csi/csi-release-tools@890b87a2 Merge kubernetes-csi/csi-release-tools#188 from pwschuurman/update-release-notes-docs
kubernetes-csi/csi-release-tools@274bc9ba Update Sidecar Release Process documentation to reference latest syntax for release-notes tool
kubernetes-csi/csi-release-tools@87b6c372 Merge kubernetes-csi/csi-release-tools#185 from Garima-Negi/fix-OWNERS-files
kubernetes-csi/csi-release-tools@f1de2c66 Fix OWNERS file - squashed commits
kubernetes-csi/csi-release-tools@59ae38b7 Remove EOL windows versions from BUILD_PLATFORMS
kubernetes-csi/csi-release-tools@5d664712 Merge kubernetes-csi/csi-release-tools#186 from humblec/sp
kubernetes-csi/csi-release-tools@d066f1ba Correct prow.sh typo and make codespell linter pass
kubernetes-csi/csi-release-tools@762e22d0 Merge kubernetes-csi/csi-release-tools#184 from pohly/image-publishing-troubleshooting
kubernetes-csi/csi-release-tools@81e26c3f SIDECAR_RELEASE_PROCESS.md: add troubleshooting for image publishing
kubernetes-csi/csi-release-tools@31aa44d1 Merge kubernetes-csi/csi-release-tools#182 from chrishenzie/csi-sanity-version
kubernetes-csi/csi-release-tools@f49e141c Update csi-sanity test suite to v4.3.0
kubernetes-csi/csi-release-tools@d9815c28 Merge kubernetes-csi/csi-release-tools#181 from mauriciopoppe/armv7-support
kubernetes-csi/csi-release-tools@05c18012 Add support to build arm/v7 images
kubernetes-csi/csi-release-tools@4aedf357 Merge kubernetes-csi/csi-release-tools#178 from xing-yang/timeout
kubernetes-csi/csi-release-tools@2b9897eb Increase build timeout
kubernetes-csi/csi-release-tools@51d37029 Merge kubernetes-csi/csi-release-tools#177 from mauriciopoppe/kind-image-1.23
kubernetes-csi/csi-release-tools@a30efeac Add kind image for 1.23

git-subtree-dir: release-tools
git-subtree-split: d29a2e7547822371ebf3e61f7d2249c244879f85
  • Loading branch information
pohly committed Aug 4, 2022
1 parent bd9f876 commit 04e5202
Show file tree
Hide file tree
Showing 8 changed files with 115 additions and 56 deletions.
10 changes: 1 addition & 9 deletions KUBERNETES_CSI_OWNERS_ALIASES
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,7 @@ aliases:

# This documents who previously contributed to Kubernetes-CSI
# as approver.
emeritus_approver:
emeritus_approvers:
- lpabon
- sbezverk
- vladimirvivien

# This documents who previously contributed to Kubernetes-CSI
# as reviewer.
emeritus_reviewer:
- lpabon
- saad-ali
- sbezverk
- vladimirvivien
53 changes: 44 additions & 9 deletions SIDECAR_RELEASE_PROCESS.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,26 +46,38 @@ naming convention `<hostpath-deployment-version>-on-<kubernetes-version>`.
## Release Process
1. Identify all issues and ongoing PRs that should go into the release, and
drive them to resolution.
1. Download v2.8+ [K8s release notes
generator](https://github.com/kubernetes/release/tree/HEAD/cmd/release-notes)
1. Download the latest version of the
[K8s release notes generator](https://github.com/kubernetes/release/tree/HEAD/cmd/release-notes)
1. Create a
[Github personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token)
with `repo:public_repo` access
1. Generate release notes for the release. Replace arguments with the relevant
information.
information.
* Clean up old cached information (also needed if you are generating release
notes for multiple repos)
```bash
rm -rf /tmp/k8s-repo
```
* For new minor releases on master:
```bash
GITHUB_TOKEN=<token> release-notes --discover=mergebase-to-latest
--github-org=kubernetes-csi --github-repo=external-provisioner
--required-author="" --output out.md
GITHUB_TOKEN=<token> release-notes \
--discover=mergebase-to-latest \
--org=kubernetes-csi \
--repo=external-provisioner \
--required-author="" \
--markdown-links \
--output out.md
```
* For new patch releases on a release branch:
```bash
GITHUB_TOKEN=<token> release-notes --discover=patch-to-latest --branch=release-1.1
--github-org=kubernetes-csi --github-repo=external-provisioner
--required-author="" --output out.md
GITHUB_TOKEN=<token> release-notes \
--discover=patch-to-latest \
--branch=release-1.1 \
--org=kubernetes-csi \
--repo=external-provisioner \
--required-author="" \
--markdown-links \
--output out.md
```
1. Compare the generated output to the new commits for the release to check if
any notable change missed a release note.
Expand Down Expand Up @@ -100,6 +112,29 @@ naming convention `<hostpath-deployment-version>-on-<kubernetes-version>`.
and [k/k
in-tree](https://github.com/kubernetes/kubernetes/tree/HEAD/test/e2e/testing-manifests/storage-csi/hostpath/hostpath)

### Troubleshooting

#### Image build jobs

The following jobs are triggered after tagging to produce the corresponding
image(s):
https://k8s-testgrid.appspot.com/sig-storage-image-build

Clicking on a failed build job opens that job in https://prow.k8s.io. Next to
the job title is a rerun icon (circle with arrow). Clicking it opens a popup
with a "rerun" button that maintainers with enough permissions can use. If in
doubt, ask someone on #sig-release to rerun the job.

Another way to rerun a job is to search for it in https://prow.k8s.io and click
the rerun icon in the resulting job list:
https://prow.k8s.io/?job=canary-csi-test-push-images

#### Verify images

Canary and staged images can be viewed at https://console.cloud.google.com/gcr/images/k8s-staging-sig-storage

Promoted images can be viewed at https://console.cloud.google.com/gcr/images/k8s-artifacts-prod/us/sig-storage

## Adding support for a new Kubernetes release

1. Add the new release to `k8s_versions` in
Expand Down
28 changes: 15 additions & 13 deletions build.make
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ endif
# Specific packages can be excluded from each of the tests below by setting the *_FILTER_CMD variables
# to something like "| grep -v 'github.com/kubernetes-csi/project/pkg/foobar'". See usage below.

# BUILD_PLATFORMS contains a set of tuples [os arch suffix base_image addon_image]
# BUILD_PLATFORMS contains a set of tuples [os arch buildx_platform suffix base_image addon_image]
# separated by semicolon. An empty variable or empty entry (= just a
# semicolon) builds for the default platform of the current Go
# toolchain.
Expand All @@ -85,20 +85,20 @@ FULL_LDFLAGS = $(LDFLAGS) $(IMPORTPATH_LDFLAGS) $(EXT_LDFLAGS)
# defined by BUILD_PLATFORMS.
$(CMDS:%=build-%): build-%: check-go-version-go
mkdir -p bin
# os_arch_seen captures all of the $$os-$$arch seen for the current binary
# that we want to build, if we've seen an $$os-$$arch before it means that
# os_arch_seen captures all of the $$os-$$arch-$$buildx_platform seen for the current binary
# that we want to build, if we've seen an $$os-$$arch-$$buildx_platform before it means that
# we don't need to build it again, this is done to avoid building
# the windows binary multiple times (see the default value of $$BUILD_PLATFORMS)
export os_arch_seen="" && echo '$(BUILD_PLATFORMS)' | tr ';' '\n' | while read -r os arch suffix base_image addon_image; do \
os_arch_seen_pre=$${os_arch_seen%%$$os-$$arch*}; \
export os_arch_seen="" && echo '$(BUILD_PLATFORMS)' | tr ';' '\n' | while read -r os arch buildx_platform suffix base_image addon_image; do \
os_arch_seen_pre=$${os_arch_seen%%$$os-$$arch-$$buildx_platform*}; \
if ! [ $${#os_arch_seen_pre} = $${#os_arch_seen} ]; then \
continue; \
fi; \
if ! (set -x; cd ./$(CMDS_DIR)/$* && CGO_ENABLED=0 GOOS="$$os" GOARCH="$$arch" go build $(GOFLAGS_VENDOR) -a -ldflags '$(FULL_LDFLAGS)' -o "$(abspath ./bin)/$*$$suffix" .); then \
echo "Building $* for GOOS=$$os GOARCH=$$arch failed, see error(s) above."; \
exit 1; \
fi; \
os_arch_seen+=";$$os-$$arch"; \
os_arch_seen+=";$$os-$$arch-$$buildx_platform"; \
done

$(CMDS:%=container-%): container-%: build-%
Expand Down Expand Up @@ -154,16 +154,17 @@ $(CMDS:%=push-multiarch-%): push-multiarch-%: check-pull-base-ref build-%
dockerfile_windows=$$(if [ -e ./$(CMDS_DIR)/$*/Dockerfile.Windows ]; then echo ./$(CMDS_DIR)/$*/Dockerfile.Windows; else echo Dockerfile.Windows; fi); \
if [ '$(BUILD_PLATFORMS)' ]; then build_platforms='$(BUILD_PLATFORMS)'; else build_platforms="linux amd64"; fi; \
if ! [ -f "$$dockerfile_windows" ]; then \
build_platforms="$$(echo "$$build_platforms" | sed -e 's/windows *[^ ]* *.exe *[^ ]* *[^ ]*//g' -e 's/; *;/;/g' -e 's/;[ ]*$$//')"; \
build_platforms="$$(echo "$$build_platforms" | sed -e 's/windows *[^ ]* *[^ ]* *.exe *[^ ]* *[^ ]*//g' -e 's/; *;/;/g' -e 's/;[ ]*$$//')"; \
fi; \
pushMultiArch () { \
tag=$$1; \
echo "$$build_platforms" | tr ';' '\n' | while read -r os arch suffix base_image addon_image; do \
echo "$$build_platforms" | tr ';' '\n' | while read -r os arch buildx_platform suffix base_image addon_image; do \
escaped_base_image=$${base_image/:/-}; \
escaped_buildx_platform=$${buildx_platform//\//-}; \
if ! [ -z $$escaped_base_image ]; then escaped_base_image+="-"; fi; \
docker buildx build --push \
--tag $(IMAGE_NAME):$$arch-$$os-$$escaped_base_image$$tag \
--platform=$$os/$$arch \
--tag $(IMAGE_NAME):$$escaped_buildx_platform-$$os-$$escaped_base_image$$tag \
--platform=$$os/$$buildx_platform \
--file $$(eval echo \$${dockerfile_$$os}) \
--build-arg binary=./bin/$*$$suffix \
--build-arg ARCH=$$arch \
Expand All @@ -172,13 +173,14 @@ $(CMDS:%=push-multiarch-%): push-multiarch-%: check-pull-base-ref build-%
--label revision=$(REV) \
.; \
done; \
images=$$(echo "$$build_platforms" | tr ';' '\n' | while read -r os arch suffix base_image addon_image; do \
images=$$(echo "$$build_platforms" | tr ';' '\n' | while read -r os arch buildx_platform suffix base_image addon_image; do \
escaped_base_image=$${base_image/:/-}; \
escaped_buildx_platform=$${buildx_platform//\//-}; \
if ! [ -z $$escaped_base_image ]; then escaped_base_image+="-"; fi; \
echo $(IMAGE_NAME):$$arch-$$os-$$escaped_base_image$$tag; \
echo $(IMAGE_NAME):$$escaped_buildx_platform-$$os-$$escaped_base_image$$tag; \
done); \
docker manifest create --amend $(IMAGE_NAME):$$tag $$images; \
echo "$$build_platforms" | tr ';' '\n' | while read -r os arch suffix base_image addon_image; do \
echo "$$build_platforms" | tr ';' '\n' | while read -r os arch buildx_platform suffix base_image addon_image; do \
if [ $$os = "windows" ]; then \
escaped_base_image=$${base_image/:/-}; \
if ! [ -z $$escaped_base_image ]; then escaped_base_image+="-"; fi; \
Expand Down
5 changes: 2 additions & 3 deletions cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@
# To promote release images, see https://github.com/kubernetes/k8s.io/tree/HEAD/k8s.gcr.io/images/k8s-staging-sig-storage.

# This must be specified in seconds. If omitted, defaults to 600s (10 mins).
# Building three images in external-snapshotter takes roughly half an hour,
# sometimes more.
timeout: 3600s
# Building three images in external-snapshotter takes more than an hour.
timeout: 7200s
# This prevents errors if you don't use both _GIT_TAG and _PULL_BASE_REF,
# or any new substitutions added in the future.
options:
Expand Down
20 changes: 18 additions & 2 deletions filter-junit.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,18 @@ var (
)

/*
* TestSuite represents a JUnit file. Due to how encoding/xml works, we have
* TestResults represents a JUnit file. Due to how encoding/xml works, we have
* represent all fields that we want to be passed through. It's therefore
* not a complete solution, but good enough for Ginkgo + Spyglass.
*
* Before Kubernetes 1.25 and ginkgo v2, we directly had <testsuite> in the
* JUnit file. Now we get <testsuites> and inside it the <testsuite>.
*/
type TestResults struct {
XMLName string `xml:"testsuites"`
TestSuite TestSuite `xml:"testsuite"`
}

type TestSuite struct {
XMLName string `xml:"testsuite"`
TestCases []TestCase `xml:"testcase"`
Expand Down Expand Up @@ -93,7 +101,15 @@ func main() {
}
}
if err := xml.Unmarshal(data, &junit); err != nil {
panic(err)
if err.Error() != "expected element type <testsuite> but have <testsuites>" {
panic(err)
}
// Fall back to Ginkgo v2 format.
var junitv2 TestResults
if err := xml.Unmarshal(data, &junitv2); err != nil {
panic(err)
}
junit = junitv2.TestSuite
}
}

Expand Down
2 changes: 1 addition & 1 deletion go-get-kubernetes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

# This script can be used while converting a repo from "dep" to "go mod"
# by calling it after "go mod init" or to update the Kubernetes packages
# in a repo that has already been converted. Only packages that are
Expand Down
Loading

0 comments on commit 04e5202

Please sign in to comment.