Closed toothrot closed 2 years ago
Change https://golang.org/cl/243340 mentions this issue: cmd/relui: add proto definition for workflows
Change https://golang.org/cl/243339 mentions this issue: cmd/relui: enable creation of mock workflow
Change https://golang.org/cl/243338 mentions this issue: cmd/relui: add relui webserver for releases
Change https://golang.org/cl/245277 mentions this issue: maintner/maintnerd/maintapi/version: support beta and RC release tags
Change https://golang.org/cl/245645 mentions this issue: cmd/relui: add package comment
Change https://golang.org/cl/246298 mentions this issue: cmd/relui: add persistence to development database
Change https://golang.org/cl/250917 mentions this issue: cmd/relui: load development state on boot
Change https://golang.org/cl/257237 mentions this issue: cmd/relui: create pubsub topic on start
Change https://golang.org/cl/257239 mentions this issue: cmd/relui: publish task start message to pubsub
Change https://golang.org/cl/257238 mentions this issue: cmd/relui: generate uuid for workflow and task instances
The next step before moving forward needs to be guarding routes for specific HTTP methods. Capturing this from a comment in https://golang.org/cl/257239.
Change https://golang.org/cl/275236 mentions this issue: cmd/relworker: add relworker command
Change https://golang.org/cl/275237 mentions this issue: cmd/relui: add datastore support
Change https://golang.org/cl/291193 mentions this issue: internal/datastore/fake: use gob encoding
Change https://golang.org/cl/294249 mentions this issue: cmd/releasebot: add check for "create first minor release milestone" step
Change https://golang.org/cl/300570 mentions this issue: cmd/gopherbot: add task to ping "early-in-cycle" issues
Change https://golang.org/cl/307769 mentions this issue: cmd/{relui,relworker}: add simple gRPC API
Change https://golang.org/cl/354758 mentions this issue: cmd/releasebot: create GitHub milestones for next release
Change https://golang.org/cl/358899 mentions this issue: cmd/releasebot: add modes for making a release tweet programmatically
Change https://golang.org/cl/358897 mentions this issue: internal/task: add task to tweet about Go releases
Change https://golang.org/cl/358898 mentions this issue: internal/task: post tweets via Twitter API
Change https://go.dev/cl/393018 mentions this issue: internal/task: remove repetition in major Go release tweets
Change https://go.dev/cl/404535 mentions this issue: cmd/relui: add mail-dl-cl workflow
Change https://go.dev/cl/412176 mentions this issue: internal/relui: simplify rendering of homepage
Change https://go.dev/cl/419431 mentions this issue: cmd/releasebot: delete
Change https://go.dev/cl/470755 mentions this issue: cmd/release: deprecate
Change https://go.dev/cl/470756 mentions this issue: cmd/release: delete
As part of an effort to improve the reliability and reduce the complexity of Go releases, we should automate more of the release process.
A possible solution is a hosted release management tool (relui) that is responsible for the scheduling and operating of the release, much as
releasebot
handles this process on the CLI. We can improve the observability of the process by using a persistent web UI for coordinating releases.As a proof of concept, relui acts as the coordinator (and currently the task executor) for release tasks.
Rough Architecture
For the proof of concept, there will be a single application for both starting and running workflows. However, careful API boundaries should be maintained between the scheduler process and the runner processes to allow for separation in the future.
In general, the runner process should only know how to execute specific tasks without broader context, and report back to the scheduler. Tasks should have an associated type, and the runner should decide whether or not it has an implementation for a given task type.
Tasks, or BuildableTasks, have a shared configuration. All tasks have a type, a name, an optional task name to depend on, and an artifact URL. If a task depends on another named task, it will be provided with that task's artifact URL upon starting.
Finally, workflows should be described through a configuration, in order to allow us to share steps between workflows, and separate concerns between the implementation and the definition of all steps that must be completed for a release. This is especially important for steps that may need to run on different platforms (outside of our tooling on GCP, such as the signing process).
Rough initial workflow for a local workstation release:
Clone repo @ ref In:
Out:
Run make.bash In:
Build Race Detector In:
Clean (version.cache, pkg/bootstrap, race for other GOOS/GOARCH, pkg/GOOS_GOOARCH/cmd) In:
Run all.bash In:
Finalize In:
Tasks (remaining as of 2020-10-05)
relworker
(bootstrap worker) Subscribe to a PubSub Topic
A worker can connect to PubSub and subscribe to the configured topic. Messages should be subscribed to using the Receive API, which handles spawning goroutines for handling the message, as well as auto-extending the Ack deadline while a message is being processed.
For now, we can just log that we got the message,can handle it, and Ack it.
See: https://pkg.go.dev/cloud.google.com/go/pubsub#Subscription.Receive
Publish status on accepting a task
When the worker picks up a task, it should update the status of the task in relui as started.
Run FetchGitSource task
The FetchGitSource task should fetch the specified Git repo at the configured ref. The source should be tarred, record the artifact URL to relui, and mark the task as complete.
On gitiles, there is an +archive URL for this task:
Web: https://go.googlesource.com/go/+archive/refs/heads/master
Archive: https://go.googlesource.com/go/+archive/refs/heads/master.tar.gz
Handle non-transient errors on FetchGitSource
If a permanent error occurs when executing a task, the message should be ACK’d to prevent retries, and a terminal status for the task should be reported back to relui.
relui
Create Status API (gRPC server)
A worker can communicate the status of a task back to the coordinator as it progresses on a task. The initial API should at least be able to mark a task as started.
Datastore integration
Currently, relui commits state to disk. It should have a persistent database for handling multiple instances, like Datastore.
/cc @dmitshur @cagedmantis @andybons