Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First step towards release automation #2340

Merged
merged 1 commit into from
Apr 10, 2021
Merged

Conversation

embano1
Copy link
Contributor

@embano1 embano1 commented Mar 31, 2021

First PR towards fully automating the release process with goreleaser. Cutting a release is still done manually, but using the goreleaser configuration provided in this PR. Once we gain confidence in the associated Github Actions workflows we can finally switch towards full release automation. This PR also adds more tests and build verification.

Changes

(1) Release Artefacts

⚠️ BREAKING Release artefacts created by the provided goreleaser configuration use a different naming template. In addition, the 386 GOARCH is dropped. This is to allow scripts to easily download and reference the correct binary per platform/arch (e.g. using uname). Example for vcsim:

vcsim_FreeBSD_armv6.tar.gz
vcsim_Windows_x86_64.zip
vcsim_Darwin_arm64.tar.gz
vcsim_Darwin_x86_64.tar.gz
vcsim_Linux_mips64le.tar.gz
vcsim_FreeBSD_x86_64.tar.gz
vcsim_Linux_x86_64.tar.gz
vcsim_Linux_armv6.tar.gz
vcsim_Linux_arm64.tar.gz
vcsim_FreeBSD_arm64.tar.gz

Homebrew files will be created during a manual release but not yet pushed to the pre-configured govmomi/homebrew-tap. This will be fixed in a subsequent PR when switching to full release automation. The Homebrew community provides govc in the core repo (not validated by govmomi maintainers though).

Docker images (separate for govc and vcsim) for linux/amd64 will be created and pushed during a manual run. Example tags pushed for govc:

vmware/govc:6a3ba216
vmware/govc:latest  
vmware/govc:v0.25.0

⚠️ BREAKING The checksum file is renamed to checksums.txt.

(2) Build

The go modules version is bumped to use v1.14 semantics. The go tool will use vendoring by default. For explicitness and documentation purposes -mod=vendor is still passed in various build/test related workflows. Tests will be run against Go v1.15 and v1.16. Builds (releases) will are configured to use Go v1.16 (once we use automated releases).

govc version output is enhanced to include build related information (injected via goreleaser). Example:

# with pseudo commit example using the "long" flag option
govc  version -l
Build Version: v0.25.0
Build Commit: 6a3ba216
Build Date: 2021-04-04T19:00:11Z

The old behavior is retained:

govc version
govc 0.25.0

vcsim shows version with a new subcommand:

# with pseudo commit example
./vcsim version
Build Version: 0.25.0
Build Commit: 6a3ba216
Build Date: 2021-04-01T12:01:20Z

(3) New/Updated Workflows

Add make govc-test Makefile target in a new govc-tests workflow.

Remove GORACE: history_size=5 from unit tests as it seems to be the cause for flaky unit tests in CI.

Verify build/releasability by running a new workflow on every PR/push to master and as a daily cron job which mimics a goreleaser run (without pushing a release, artefacts, etc.).

Fix wording in the stale issue/PR workflow.

Add 10min timeout to most workflows to prevent dangling workflow runs.

(4) Other

Use a custom powercli image in bats tests to avoid Docker rate limit pulls: projects.registry.vmware.com/pez/powerclicore.

Instead of using a curl container, use curl provided as part of the runner to avoid rate limits/reduce time.

The vcsim Dockerfile uses CMD instead of ENTRYPOINT so it's possible to overwrite the executable, e.g. to extract version information with:

docker run --rm vmware/vcsim /vcsim version
Build Version: 0.25.0
Build Commit: 6a3ba216
Build Date: 2021-04-01T12:01:20Z

⚠️ The govc-test target seems to be flaky in CI (randomly hangs until timeout enforced) as reported by other users (#2351) and from my experience running the PR checks. That's why this is a separate workflow so it's easy to re-run a failed workflow.

Closes: #2339
Related: #2302, #1844, #2295

Signed-off-by: Michael Gasch mgasch@vmware.com

@embano1 embano1 changed the title WIP - Releasability Verify Releasability Apr 1, 2021
@embano1 embano1 changed the title Verify Releasability WIP - Verify Releasability Apr 1, 2021
@embano1 embano1 force-pushed the issue-2339 branch 2 times, most recently from 711d584 to 62a5048 Compare April 3, 2021 20:14
@embano1 embano1 changed the title WIP - Verify Releasability WIP - Add govc tests and prepare for release automation Apr 3, 2021
@embano1 embano1 force-pushed the issue-2339 branch 3 times, most recently from cf6ccc5 to ebc00b3 Compare April 3, 2021 21:38
@embano1 embano1 changed the title WIP - Add govc tests and prepare for release automation First step towards release automation Apr 4, 2021
@embano1 embano1 requested a review from dougm April 4, 2021 19:50
@embano1 embano1 force-pushed the issue-2339 branch 4 times, most recently from ad1cf44 to e951983 Compare April 6, 2021 10:19
@embano1 embano1 force-pushed the issue-2339 branch 2 times, most recently from a50dcdb to 5dfc2a7 Compare April 7, 2021 10:13
@embano1
Copy link
Contributor Author

embano1 commented Apr 8, 2021

Reverted govc version behavior (new flag -l gives details) and added a vcsim version command instead of printing the version for vcsim in the help section.

All updates reflected in the PR description above.

@embano1
Copy link
Contributor Author

embano1 commented Apr 8, 2021

@dougm ready for another review

dougm
dougm previously approved these changes Apr 9, 2021
Copy link
Member

@dougm dougm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks @embano1 !!

govc/test/vcsim.bats Show resolved Hide resolved
vcsim/main.go Outdated Show resolved Hide resolved
First PR towards fully automating the release process with `goreleaser`.
Cutting a release is still done manually, but using the goreleaser
configuration provided in this PR. Once we gain confidence in the
associated Github Actions workflows we can finally switch towards full
release automation. This PR also adds more tests and build verification.

⚠️ **BREAKING** Release artefacts created by the provided `goreleaser`
configuration use a different naming template. In addition, the `386`
`GOARCH` is dropped. This is to allow scripts to easily download and
reference the correct binary per platform/arch (e.g. using `uname`).
Example for `vcsim`:

```bash
vcsim_FreeBSD_armv6.tar.gz
vcsim_Windows_x86_64.zip
vcsim_Darwin_arm64.tar.gz
vcsim_Darwin_x86_64.tar.gz
vcsim_Linux_mips64le.tar.gz
vcsim_FreeBSD_x86_64.tar.gz
vcsim_Linux_x86_64.tar.gz
vcsim_Linux_armv6.tar.gz
vcsim_Linux_arm64.tar.gz
vcsim_FreeBSD_arm64.tar.gz
```

Homebrew files will be created during a manual release but not yet
pushed to the pre-configured `govmomi/homebrew-tap`. This will be fixed
in a subsequent PR when switching to full release automation. The
Homebrew community provides `govc` in the core repo (not validated by
govmomi maintainers though).

Docker images (separate for `govc` and `vcsim`) for `linux/amd64` will
be created and pushed during a manual run. Example tags pushed for
`govc`:

```bash
vmware/govc:6a3ba216
vmware/govc:latest
vmware/govc:v0.25.0
```

⚠️ **BREAKING** The checksum file is renamed to `checksums.txt`.

The go modules version is bumped to use `v1.14`
[semantics](https://golang.org/doc/modules/gomod-ref#go). The go tool
will use vendoring by default. For explicitness and documentation
purposes `-mod=vendor` is still passed in various build/test related
workflows. Tests will be run against Go `v1.15` and `v1.16`. Builds
(releases) will are configured to use Go `v1.16` (once we use automated
releases).

`govc version` output is enhanced to include build related information
(injected via `goreleaser`). Example:

```bash
govc  version -l
Build Version: v0.25.0
Build Commit: 6a3ba21
Build Date: 2021-04-04T19:00:11Z
```

The old behavior is retained:

```bash
govc version
govc 0.25.0
```

`vcsim` shows version with a new subcommand:

```bash
./vcsim version
Build Version: 0.25.0
Build Commit: 6a3ba21
Build Date: 2021-04-01T12:01:20Z
```

Add `make govc-test` Makefile target in a new `govc-tests` workflow.

Remove `GORACE: history_size=5` from unit tests as it seems to be the
cause for flaky unit tests in CI.

Verify build/releasability by running a new workflow on every PR/push to
master and as a daily cron job which mimics a `goreleaser` run (without
pushing a release, artefacts, etc.).

Fix wording in the stale issue/PR workflow.

Add 10min timeout to most workflows to prevent dangling workflow runs.

Use a custom `powercli` image in `bats` tests to avoid Docker rate limit
pulls: `projects.registry.vmware.com/pez/powerclicore`.

Instead of using a `curl` container, use `curl` provided as part of the
runner to avoid rate limits/reduce time.

The `vcsim` Dockerfile uses `CMD` instead of `ENTRYPOINT` so it's
possible to overwrite the executable, e.g. to extract version
information with:

```bash
docker run --rm vmware/vcsim /vcsim version
Build Version: 0.25.0
Build Commit: 6a3ba21
Build Date: 2021-04-01T12:01:20Z
```

⚠️ The `govc-test` target seems to be flaky in CI (randomly hangs until
timeout enforced) as reported by other users (vmware#2351) and from my
experience running the PR checks. That's why this is a separate workflow
so it's easy to re-run a failed workflow.

Closes: vmware#2339
Related: vmware#2302, vmware#1844, vmware#2295

Signed-off-by: Michael Gasch <mgasch@vmware.com>
@embano1
Copy link
Contributor Author

embano1 commented Apr 9, 2021

@dougm addressed your feedback, all checks pass. Approval got dismissed due to force-push. Please approve and merge.

Copy link
Member

@dougm dougm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @embano1 ! 🎉

@dougm dougm merged commit 52c75aa into vmware:master Apr 10, 2021
@embano1
Copy link
Contributor Author

embano1 commented Apr 12, 2021

Pinged homebrew-core team about the upcoming change: Homebrew/discussions#1262

@embano1 embano1 deleted the issue-2339 branch April 12, 2021 13:43
@embano1 embano1 mentioned this pull request Apr 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Verify Releasability with Github Action
3 participants