dashboard: find static IP automatically, update images
Remove subversion & use newer version of the builder which makes -verbose direct all.bash output to stdout/stderr. LGTM=cmang R=adg, cmang CC=golang-codereviews https://golang.org/cl/140910044
This commit is contained in:
parent
1e11d05bd8
commit
9f2fca72f6
|
@ -4,4 +4,6 @@ last-change
|
||||||
dashboard/coordinator/buildongce/client-*.dat
|
dashboard/coordinator/buildongce/client-*.dat
|
||||||
dashboard/coordinator/buildongce/token.dat
|
dashboard/coordinator/buildongce/token.dat
|
||||||
dashboard/coordinator/coordinator
|
dashboard/coordinator/coordinator
|
||||||
|
dashboard/env/linux-x86-base/*.tar.gz
|
||||||
|
dashboard/env/linux-x86-nacl/*.tar.gz
|
||||||
|
|
||||||
|
|
|
@ -25,8 +25,9 @@ var (
|
||||||
proj = flag.String("project", "symbolic-datum-552", "name of Project")
|
proj = flag.String("project", "symbolic-datum-552", "name of Project")
|
||||||
zone = flag.String("zone", "us-central1-a", "GCE zone")
|
zone = flag.String("zone", "us-central1-a", "GCE zone")
|
||||||
mach = flag.String("machinetype", "n1-standard-16", "Machine type")
|
mach = flag.String("machinetype", "n1-standard-16", "Machine type")
|
||||||
instName = flag.String("instance_name", "go-builder", "Name of VM instance.")
|
instName = flag.String("instance_name", "go-builder-1", "Name of VM instance.")
|
||||||
sshPub = flag.String("ssh_public_key", "", "ssh public key file to authorize. Can modify later in Google's web UI anyway.")
|
sshPub = flag.String("ssh_public_key", "", "ssh public key file to authorize. Can modify later in Google's web UI anyway.")
|
||||||
|
staticIP = flag.String("static_ip", "", "Static IP to use. If empty, automatic.")
|
||||||
)
|
)
|
||||||
|
|
||||||
func readFile(v string) string {
|
func readFile(v string) string {
|
||||||
|
@ -110,6 +111,25 @@ func main() {
|
||||||
storageService, _ := storage.New(oauthClient)
|
storageService, _ := storage.New(oauthClient)
|
||||||
_ = storageService // TODO?
|
_ = storageService // TODO?
|
||||||
|
|
||||||
|
natIP := *staticIP
|
||||||
|
if natIP == "" {
|
||||||
|
// Try to find it by name.
|
||||||
|
aggAddrList, err := computeService.Addresses.AggregatedList(*proj).Do()
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
// http://godoc.org/code.google.com/p/google-api-go-client/compute/v1#AddressAggregatedList
|
||||||
|
IPLoop:
|
||||||
|
for _, asl := range aggAddrList.Items {
|
||||||
|
for _, addr := range asl.Addresses {
|
||||||
|
if addr.Name == *instName+"-ip" && addr.Status == "RESERVED" {
|
||||||
|
natIP = addr.Address
|
||||||
|
break IPLoop
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
cloudConfig := baseConfig
|
cloudConfig := baseConfig
|
||||||
if *sshPub != "" {
|
if *sshPub != "" {
|
||||||
key := strings.TrimSpace(readFile(*sshPub))
|
key := strings.TrimSpace(readFile(*sshPub))
|
||||||
|
@ -135,7 +155,7 @@ func main() {
|
||||||
InitializeParams: &compute.AttachedDiskInitializeParams{
|
InitializeParams: &compute.AttachedDiskInitializeParams{
|
||||||
DiskName: *instName + "-coreos-stateless-pd",
|
DiskName: *instName + "-coreos-stateless-pd",
|
||||||
SourceImage: imageURL,
|
SourceImage: imageURL,
|
||||||
DiskSizeGb: 100,
|
DiskSizeGb: 50,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -156,6 +176,7 @@ func main() {
|
||||||
&compute.AccessConfig{
|
&compute.AccessConfig{
|
||||||
Type: "ONE_TO_ONE_NAT",
|
Type: "ONE_TO_ONE_NAT",
|
||||||
Name: "External NAT",
|
Name: "External NAT",
|
||||||
|
NatIP: natIP,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Network: prefix + "/global/networks/default",
|
Network: prefix + "/global/networks/default",
|
||||||
|
|
|
@ -24,7 +24,7 @@ RUN apt-get install -y --no-install-recommends gcc libc6-dev
|
||||||
RUN apt-get install -y --no-install-recommends libc6-dev-i386 gcc-multilib
|
RUN apt-get install -y --no-install-recommends libc6-dev-i386 gcc-multilib
|
||||||
|
|
||||||
# For interacting with the Go source & subrepos:
|
# For interacting with the Go source & subrepos:
|
||||||
RUN apt-get install -y --no-install-recommends mercurial git-core subversion
|
RUN apt-get install -y --no-install-recommends mercurial git-core
|
||||||
|
|
||||||
ENV GOPATH /gopath
|
ENV GOPATH /gopath
|
||||||
ENV GOROOT /goroot
|
ENV GOROOT /goroot
|
||||||
|
@ -36,10 +36,10 @@ ENV GO_TOOLS $GOPATH/src/code.google.com/p/go.tools
|
||||||
RUN mkdir -p $GO_TOOLS
|
RUN mkdir -p $GO_TOOLS
|
||||||
RUN cd $GO_TOOLS $ && curl -s https://storage.googleapis.com/gobuilder/go.tools-snap.tar.gz | tar x --no-same-owner -zv
|
RUN cd $GO_TOOLS $ && curl -s https://storage.googleapis.com/gobuilder/go.tools-snap.tar.gz | tar x --no-same-owner -zv
|
||||||
|
|
||||||
RUN cd $GOROOT && hg update -C b8ff0ec2a724
|
RUN cd $GOROOT && hg pull && hg update -C b8ff0ec2a724
|
||||||
RUN cd $GOROOT/src && ./make.bash
|
RUN cd $GOROOT/src && ./make.bash
|
||||||
RUN mkdir -p /usr/local/bin
|
RUN mkdir -p /usr/local/bin
|
||||||
|
|
||||||
RUN cd $GO_TOOLS && hg update -C 918b8a7e7b1e
|
RUN cd $GO_TOOLS && hg pull && hg update -C f9e37a924785
|
||||||
ENV GOBIN /usr/local/bin
|
ENV GOBIN /usr/local/bin
|
||||||
RUN /goroot/bin/go install code.google.com/p/go.tools/dashboard/builder
|
RUN /goroot/bin/go install code.google.com/p/go.tools/dashboard/builder
|
||||||
|
|
|
@ -3,7 +3,10 @@
|
||||||
# license that can be found in the LICENSE file.
|
# license that can be found in the LICENSE file.
|
||||||
|
|
||||||
docker: Dockerfile
|
docker: Dockerfile
|
||||||
|
rm -f docker-linux.base.tar.gz
|
||||||
docker build -t gobuilders/linux-x86-base .
|
docker build -t gobuilders/linux-x86-base .
|
||||||
|
|
||||||
push: docker
|
# This gets uploaded to:
|
||||||
docker push gobuilders/linux-x86-base
|
# https://console.developers.google.com/project/apps~symbolic-datum-552/storage/go-builder-data/
|
||||||
|
docker-linux.base.tar.gz: docker
|
||||||
|
docker save gobuilders/linux-x86-base | gzip > docker-linux.base.tar.gz
|
||||||
|
|
|
@ -15,6 +15,8 @@ FROM ubuntu:trusty
|
||||||
MAINTAINER golang-dev <golang-dev@googlegroups.com>
|
MAINTAINER golang-dev <golang-dev@googlegroups.com>
|
||||||
|
|
||||||
ENV DEBIAN_FRONTEND noninteractive
|
ENV DEBIAN_FRONTEND noninteractive
|
||||||
|
|
||||||
|
RUN echo cachebuster4
|
||||||
RUN apt-get update && apt-get upgrade -y
|
RUN apt-get update && apt-get upgrade -y
|
||||||
|
|
||||||
# For running curl to get the hg starter tarballs (faster than hg clone).
|
# For running curl to get the hg starter tarballs (faster than hg clone).
|
||||||
|
@ -24,7 +26,7 @@ RUN apt-get install -y --no-install-recommends curl ca-certificates
|
||||||
RUN apt-get install -y --no-install-recommends gcc libc6-dev
|
RUN apt-get install -y --no-install-recommends gcc libc6-dev
|
||||||
|
|
||||||
# For interacting with the Go source & subrepos:
|
# For interacting with the Go source & subrepos:
|
||||||
RUN apt-get install -y --no-install-recommends mercurial git-core subversion
|
RUN apt-get install -y --no-install-recommends mercurial git-core
|
||||||
|
|
||||||
# For 32-bit nacl:
|
# For 32-bit nacl:
|
||||||
RUN apt-get install -y --no-install-recommends libc6-i386 libc6-dev-i386 lib32stdc++6 gcc-multilib
|
RUN apt-get install -y --no-install-recommends libc6-i386 libc6-dev-i386 lib32stdc++6 gcc-multilib
|
||||||
|
@ -39,11 +41,11 @@ ENV GO_TOOLS $GOPATH/src/code.google.com/p/go.tools
|
||||||
RUN mkdir -p $GO_TOOLS
|
RUN mkdir -p $GO_TOOLS
|
||||||
RUN cd $GO_TOOLS $ && curl -s https://storage.googleapis.com/gobuilder/go.tools-snap.tar.gz | tar x --no-same-owner -zv
|
RUN cd $GO_TOOLS $ && curl -s https://storage.googleapis.com/gobuilder/go.tools-snap.tar.gz | tar x --no-same-owner -zv
|
||||||
|
|
||||||
RUN cd $GOROOT && hg update -C b8ff0ec2a724
|
RUN cd $GOROOT && hg pull && hg update -C b8ff0ec2a724
|
||||||
RUN cd $GOROOT/src && ./make.bash
|
RUN cd $GOROOT/src && ./make.bash
|
||||||
RUN mkdir -p /usr/local/bin
|
RUN mkdir -p /usr/local/bin
|
||||||
|
|
||||||
RUN cd $GO_TOOLS && hg update -C 918b8a7e7b1e
|
RUN cd $GO_TOOLS && hg pull && hg update -C f9e37a924785
|
||||||
ENV GOBIN /usr/local/bin
|
ENV GOBIN /usr/local/bin
|
||||||
RUN /goroot/bin/go install code.google.com/p/go.tools/dashboard/builder
|
RUN /goroot/bin/go install code.google.com/p/go.tools/dashboard/builder
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,11 @@
|
||||||
# license that can be found in the LICENSE file.
|
# license that can be found in the LICENSE file.
|
||||||
|
|
||||||
docker: Dockerfile
|
docker: Dockerfile
|
||||||
|
rm -f docker-linux.nacl.tar.gz
|
||||||
docker build -t gobuilders/linux-x86-nacl .
|
docker build -t gobuilders/linux-x86-nacl .
|
||||||
|
|
||||||
push: docker
|
# This gets uploaded to:
|
||||||
docker push gobuilders/linux-x86-nacl
|
# https://console.developers.google.com/project/apps~symbolic-datum-552/storage/go-builder-data/
|
||||||
|
docker-linux.nacl.tar.gz: docker
|
||||||
|
docker save gobuilders/linux-x86-nacl | gzip > docker-linux.nacl.tar.gz
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue