From 9c46044100c0cfaccfe0dfb8cd16667036ddf207 Mon Sep 17 00:00:00 2001 From: Jason Price Date: Wed, 13 Nov 2019 11:40:36 -0500 Subject: [PATCH 01/11] debug info, prepurge runit as cargocult, and then install its systemd unit file too --- .travis.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index b2f66e2a9..5432ea2ee 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,15 +8,18 @@ env: - RACE= before_install: + - cat /etc/issue + - apt-get purge runit + - sudo apt-get autoremove - sudo apt-get update -qq - - sudo apt-get install -y runit + - sudo apt-get install -y runit runit-systemd install: - gem install rake - go get github.com/kisielk/errcheck - rake install - - wget https://releases.hashicorp.com/consul/0.7.1/consul_0.7.1_linux_amd64.zip - - unzip consul_0.7.1_linux_amd64.zip + - wget https://releases.hashicorp.com/consul/0.9.4/consul_0.9.4_linux_amd64.zip + - unzip consul_0.9.4_linux_amd64.zip - sudo mv consul /usr/bin/ script: From c43a78fc92b8d809ff2fdad5bad292a0a5c294f2 Mon Sep 17 00:00:00 2001 From: Jason Price Date: Wed, 13 Nov 2019 12:49:45 -0500 Subject: [PATCH 02/11] more os hackery --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 5432ea2ee..9cd04adc0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: go go: - - 1.12 + - "1.12" env: - RACE=-race @@ -9,6 +9,7 @@ env: before_install: - cat /etc/issue + - ls -l /etc/*release - apt-get purge runit - sudo apt-get autoremove - sudo apt-get update -qq From 9058baa6628dbf769d24f002d87b46a3d9c5ebda Mon Sep 17 00:00:00 2001 From: Jason Price Date: Wed, 13 Nov 2019 12:52:30 -0500 Subject: [PATCH 03/11] sudo is useful --- .travis.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9cd04adc0..c7736d1d4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,9 +8,8 @@ env: - RACE= before_install: - - cat /etc/issue - - ls -l /etc/*release - - apt-get purge runit + - sudo cat /etc/issue + - sudo apt-get purge runit - sudo apt-get autoremove - sudo apt-get update -qq - sudo apt-get install -y runit runit-systemd From af169aec4b9db09a27a2bab98fa99a7963d881c6 Mon Sep 17 00:00:00 2001 From: Jason Price Date: Wed, 13 Nov 2019 13:03:38 -0500 Subject: [PATCH 04/11] lsb-release? --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index c7736d1d4..59c1019c6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,7 @@ env: before_install: - sudo cat /etc/issue + - sudo cat /etc/lsb-release - sudo apt-get purge runit - sudo apt-get autoremove - sudo apt-get update -qq From fd92bc64973edf050d598d01e63d2d6fb3878460 Mon Sep 17 00:00:00 2001 From: Jason Price Date: Wed, 13 Nov 2019 13:22:01 -0500 Subject: [PATCH 05/11] force trusty --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 59c1019c6..10e731b16 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,7 @@ language: go +dist: trusty + go: - "1.12" From 21c82d78859a31689b87de99a41685e7ba2ef86b Mon Sep 17 00:00:00 2001 From: Jason Price Date: Wed, 13 Nov 2019 15:23:43 -0500 Subject: [PATCH 06/11] chase a theory --- .travis.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 10e731b16..1f55f55f8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,10 +12,8 @@ env: before_install: - sudo cat /etc/issue - sudo cat /etc/lsb-release - - sudo apt-get purge runit - - sudo apt-get autoremove - sudo apt-get update -qq - - sudo apt-get install -y runit runit-systemd + - sudo apt-get install -y runit install: - gem install rake From 6506f130752c70e63ef8212ddb50954c91b21a97 Mon Sep 17 00:00:00 2001 From: Jason Price Date: Wed, 13 Nov 2019 16:11:54 -0500 Subject: [PATCH 07/11] remove debugging lines --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1f55f55f8..05ca3a607 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,8 +10,6 @@ env: - RACE= before_install: - - sudo cat /etc/issue - - sudo cat /etc/lsb-release - sudo apt-get update -qq - sudo apt-get install -y runit From c3529e3c4bdd2df1332237ff4cc02008a8611fde Mon Sep 17 00:00:00 2001 From: Aaron Goldsmith Date: Thu, 21 Nov 2019 08:04:05 -0500 Subject: [PATCH 08/11] Get better logging from composite verifier process (#1139) * Get better logging from composite verifier process * Only return errors on failure * Only use errstrings when dealing with errors * Slight error wording change --- pkg/auth/artifact_verifier.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/auth/artifact_verifier.go b/pkg/auth/artifact_verifier.go index bb33401c1..d0b493aeb 100644 --- a/pkg/auth/artifact_verifier.go +++ b/pkg/auth/artifact_verifier.go @@ -76,13 +76,19 @@ func NewCompositeVerifier(keyringPath string, fetcher uri.Fetcher, logger *loggi func (b *CompositeVerifier) VerifyHoistArtifact(localCopy *os.File, verificationData VerificationData) error { err := b.manVerifier.VerifyHoistArtifact(localCopy, verificationData) if err != nil { + var errstrings []string + errstrings = append(errstrings, err.Error()) _, err = localCopy.Seek(0, os.SEEK_SET) if err != nil { return util.Errorf("Could not rewind localCopy %v back to start of file: %v", localCopy.Name(), err) } err = b.buildVerifier.VerifyHoistArtifact(localCopy, verificationData) + if err != nil { + errstrings = append(errstrings, err.Error()) + return util.Errorf("Failed to verify hoist artifact: %v", errstrings) + } } - return err + return nil } // BuildManifestVerifier ensures that the given LaunchableStanza's location From 4fbf10bd8d6081553f5eeb9994aafc67ea76e1c7 Mon Sep 17 00:00:00 2001 From: Matthew McPherrin Date: Thu, 5 Dec 2019 20:35:25 -0800 Subject: [PATCH 09/11] Unregister metrics when stopping monitoring them --- pkg/ds/farm.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pkg/ds/farm.go b/pkg/ds/farm.go index d56b6b660..302464e8c 100644 --- a/pkg/ds/farm.go +++ b/pkg/ds/farm.go @@ -580,6 +580,18 @@ func (dsf *Farm) spawnDaemonSet( for { select { case <-ctx.Done(): + for _, name := range ds.MetricNames("healthy") { + p2metrics.Registry.Unregister(name) + } + for _, name := range ds.MetricNames("critical") { + p2metrics.Registry.Unregister(name) + } + for _, name := range ds.MetricNames("unknown") { + p2metrics.Registry.Unregister(name) + } + for _, name := range ds.MetricNames("warning") { + p2metrics.Registry.Unregister(name) + } return case <-ticks.C: eligible, err := ds.EligibleNodes() From 229d5f2e5808addcd711090f018af437b1a4c61f Mon Sep 17 00:00:00 2001 From: Matthew McPherrin Date: Thu, 5 Dec 2019 21:05:15 -0800 Subject: [PATCH 10/11] Reduce duplicated code --- pkg/ds/farm.go | 51 +++++++++++++++++--------------------------------- 1 file changed, 17 insertions(+), 34 deletions(-) diff --git a/pkg/ds/farm.go b/pkg/ds/farm.go index 302464e8c..bf9439f49 100644 --- a/pkg/ds/farm.go +++ b/pkg/ds/farm.go @@ -580,17 +580,10 @@ func (dsf *Farm) spawnDaemonSet( for { select { case <-ctx.Done(): - for _, name := range ds.MetricNames("healthy") { - p2metrics.Registry.Unregister(name) - } - for _, name := range ds.MetricNames("critical") { - p2metrics.Registry.Unregister(name) - } - for _, name := range ds.MetricNames("unknown") { - p2metrics.Registry.Unregister(name) - } - for _, name := range ds.MetricNames("warning") { - p2metrics.Registry.Unregister(name) + for _, suffix := range []string{"healthy", "critical", "unknown", "warning"} { + for _, name := range ds.MetricNames(suffix) { + p2metrics.Registry.Unregister(name) + } } return case <-ticks.C: @@ -600,29 +593,19 @@ func (dsf *Farm) spawnDaemonSet( continue } - numHealthy := aggregateHealth.NumHealthyOf(eligible) - numUnhealthy := aggregateHealth.NumUnhealthyOf(eligible) - numUnknownHealth := aggregateHealth.NumUnknownHealthOf(eligible) - numWarningHealth := aggregateHealth.NumWarningHealthOf(eligible) - - for _, name := range ds.MetricNames("healthy") { - gauge := metrics.GetOrRegisterGauge(name, p2metrics.Registry) - gauge.Update(int64(numHealthy)) - } - - for _, name := range ds.MetricNames("critical") { - gauge := metrics.GetOrRegisterGauge(name, p2metrics.Registry) - gauge.Update(int64(numUnhealthy)) - } - - for _, name := range ds.MetricNames("unknown") { - gauge := metrics.GetOrRegisterGauge(name, p2metrics.Registry) - gauge.Update(int64(numUnknownHealth)) - } - - for _, name := range ds.MetricNames("warning") { - gauge := metrics.GetOrRegisterGauge(name, p2metrics.Registry) - gauge.Update(int64(numWarningHealth)) + for _, metric := range []struct { + suffix string + val int + }{ + {"healthy", aggregateHealth.NumHealthyOf(eligible)}, + {"critical", aggregateHealth.NumUnhealthyOf(eligible)}, + {"unknown", aggregateHealth.NumUnknownHealthOf(eligible)}, + {"warning", aggregateHealth.NumWarningHealthOf(eligible)}, + } { + for _, name := range ds.MetricNames(metric.suffix) { + gauge := metrics.GetOrRegisterGauge(name, p2metrics.Registry) + gauge.Update(int64(metric.val)) + } } } } From ae0f97c6a10f34bc8776d0cf9cd59bf81e8c5fab Mon Sep 17 00:00:00 2001 From: Eric Suen Date: Mon, 13 Jan 2020 14:51:33 -0800 Subject: [PATCH 11/11] go 1.12 -> 1.13 --- .travis.yml | 2 +- go.mod | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 05ca3a607..a11bfbb3a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,7 @@ language: go dist: trusty go: - - "1.12" + - "1.13" env: - RACE=-race diff --git a/go.mod b/go.mod index 1eb17bbb8..10fcae987 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/square/p2 -go 1.12 +go 1.13 require ( cloud.google.com/go v0.43.0 // indirect