cmd/tip: remove ability to serve talks.golang.org
The tip server is primarily about serving tip.golang.org, and it does
today. There was also a time it was used to serve talks.golang.org
with an auto-deploy feature, but that ability has degraded over time
and is currently unused.
After some investigation of our options, we made a decision in issue
golang.org/issue/36825 to remove this broken and unused functionality
in favor of x/talks' own simpler App Engine deployment. If needed,
this can all be brought back and restored as part of future work,
but it's better to delete code and a misleading README until then.
Fixes golang/go#36825.
Updates golang/go#38120.
Change-Id: I5fbca48dea13e871cd04e23b36c8d3acd2f8fef5
Reviewed-on: https://go-review.googlesource.com/c/build/+/290529
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Alexander Rakoczy <alex@golang.org>
diff --git a/cmd/tip/README b/cmd/tip/README
deleted file mode 100644
index b5f42a9..0000000
--- a/cmd/tip/README
+++ /dev/null
@@ -1,28 +0,0 @@
-============================================================
-Old instructions, only valid for talks.golang.org:
-============================================================
-
-1. Deploy the app.
-
- To deploy tip.golang.org:
- (See Kubernetes instruction below.)
-
- To deploy talks.golang.org:
- $ gcloud --project golang-org app deploy --no-promote talks.yaml
-
-2. Wait until the deployed version is serving requests.
-
-3. Go to the developer console and upgrade the default version.
- https://console.developers.google.com/appengine/versions?project=golang-org&moduleId=tip
-
-4. Clean up any old versions (they continue to use at least one instance).
-
-============================================================
-New Kubernetes instructions, for tip.golang.org:
-============================================================
-
-Kubernetes instructions:
-
- * make deploy-prod
-
-Also: move talks.golang.org to GKE too?
diff --git a/cmd/tip/README.md b/cmd/tip/README.md
new file mode 100644
index 0000000..60a8563
--- /dev/null
+++ b/cmd/tip/README.md
@@ -0,0 +1,25 @@
+<!-- Auto-generated by x/build/update-readmes.go -->
+
+[![Go Reference](https://pkg.go.dev/badge/golang.org/x/build/cmd/tip.svg)](https://pkg.go.dev/golang.org/x/build/cmd/tip)
+
+# golang.org/x/build/cmd/tip
+
+Command tip is the tip.golang.org server, serving the latest HEAD straight from the Git oven.
+
+## Deployment
+
+### Staging
+
+To deploy to the staging project https://tip-staging.golang.org:
+
+```sh
+$ make deploy-staging
+```
+
+### Production
+
+To deploy to https://tip.golang.org:
+
+```sh
+$ make deploy-prod
+```
diff --git a/cmd/tip/talks.go b/cmd/tip/talks.go
deleted file mode 100644
index f2e7cd6..0000000
--- a/cmd/tip/talks.go
+++ /dev/null
@@ -1,77 +0,0 @@
-// Copyright 2015 The Go Authors. All rights reserved.
-// Use of this source code is governed by the Apache 2.0
-// license that can be found in the LICENSE file.
-
-package main
-
-import (
- "bytes"
- "errors"
- "fmt"
- "log"
- "os"
- "os/exec"
- "path/filepath"
- "runtime"
-)
-
-type talksBuilder struct{}
-
-func (b talksBuilder) Signature(heads map[string]string) string {
- return heads["talks"]
-}
-
-const talksToolsRev = "8cab8a1319f0be9798e7fe78b15da75e5f94b2e9"
-
-func (b talksBuilder) Init(logger *log.Logger, dir, hostport string, heads map[string]string) (*exec.Cmd, error) {
- if _, ok := heads["talks"]; !ok {
- return nil, fmt.Errorf("missing HEAD revision for 'talks' repo")
- }
- // TODO: use logger
- toolsDir := filepath.Join(dir, "gopath/src/golang.org/x/tools")
- if err := checkout(repoURL+"tools", talksToolsRev, toolsDir); err != nil {
- return nil, err
- }
- talksDir := filepath.Join(dir, "gopath/src/golang.org/x/talks")
- if err := checkout(repoURL+"talks", heads["talks"], talksDir); err != nil {
- return nil, err
- }
-
- goDir := os.Getenv("GOROOT_BOOTSTRAP")
- if goDir == "" {
- goDir = runtime.GOROOT()
- }
- goBin := filepath.Join(goDir, "bin/go")
- goPath := filepath.Join(dir, "gopath")
- presentPath := "golang.org/x/tools/cmd/present"
- install := exec.Command(goBin, "install", "-tags=appenginevm", presentPath)
- install.Env = append(os.Environ(), "GOROOT="+goDir, "GOPATH="+goPath)
- if err := runErr(install); err != nil {
- return nil, err
- }
-
- talksBin := filepath.Join(goPath, "bin/present")
- presentSrc := filepath.Join(goPath, "src", presentPath)
- present := exec.Command(talksBin, "-http="+hostport, "-base="+presentSrc)
- present.Dir = talksDir
- // TODO(adg): log this somewhere useful
- present.Stdout = os.Stdout
- present.Stderr = os.Stderr
- if err := present.Start(); err != nil {
- return nil, err
- }
- return present, nil
-}
-
-var talksMsg = []byte("Talks - The Go Programming Language")
-
-func (b talksBuilder) HealthCheck(hostport string) error {
- body, err := getOK(fmt.Sprintf("http://%v/", hostport))
- if err != nil {
- return err
- }
- if !bytes.Contains(body, talksMsg) {
- return errors.New("couldn't match string")
- }
- return nil
-}
diff --git a/cmd/tip/talks.yaml b/cmd/tip/talks.yaml
deleted file mode 100644
index 24391a7..0000000
--- a/cmd/tip/talks.yaml
+++ /dev/null
@@ -1,12 +0,0 @@
-service: talks
-runtime: custom
-env: flex
-
-manual_scaling:
- instances: 1
-
-env_variables:
- TIP_BUILDER: 'talks'
-
-health_check:
- enable_health_check: False
diff --git a/cmd/tip/tip.go b/cmd/tip/tip.go
index 424ecb9..f5c13ec 100644
--- a/cmd/tip/tip.go
+++ b/cmd/tip/tip.go
@@ -46,8 +46,6 @@
switch os.Getenv(k) {
case "golangorg":
b = golangorgBuilder{}
- case "talks":
- b = talksBuilder{}
default:
log.Fatalf("Unknown %v value: %q", k, os.Getenv(k))
}