Merge ~canonical-server/prometheus-snap:prom2-update-to-latest-version into ~canonical-is-sa/prometheus-snap:prometheus2

Proposed by Lucas Kanashiro
Status: Merged
Approved by: Tom Haddon
Approved revision: 0a1f9ccfa25c2e50e98eab1cf0b75cf6fbf5287d
Merged at revision: e9a371e4d2e296014bc79227182263be91e9a5b4
Proposed branch: ~canonical-server/prometheus-snap:prom2-update-to-latest-version
Merge into: ~canonical-is-sa/prometheus-snap:prometheus2
Diff against target: 65 lines (+18/-16)
1 file modified
snapcraft.yaml (+18/-16)
Reviewer Review Type Date Requested Status
Tom Haddon Approve
Junien F Approve
Canonical IS Reviewers Pending
Canonical IS SAs Pending
Review via email: mp+388843@code.launchpad.net

Commit message

Update prometheus2 to version 2.20.1

Description of the change

Update prometheus2 snap to the latest version (2.20.1). The Server team is working on prometheus for the LMA stack we want to support, and we noticed the prometheus2 snap is quite outdated. We think we can work together with the IS team to provide and up-to-dated snap. A summary of the proposed changes:

- Update to version 2.20.1
- Build the snap based on core18
- Build the snap for different architectures: amd64, arm64, ppc64el and s390x
- Rewrite part of 'prometheus' parts section
  + Run a set of upstream tests during build time

I have personally played with it locally and AFAICS it looks good, works well. I also built the snap in all 4 architectures here:

https://code.launchpad.net/~lucaskanashiro/+snap/prometheus

Thanks for considering those changes, feedback is appreciated.

To post a comment you must log in.
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Unable to determine commit message from repository - please click "Set commit message" and enter the commit message manually.

Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

Any feedback?

Revision history for this message
Junien F (axino) wrote :

LGTM, thanks a lot for doing that

review: Approve
Revision history for this message
Tom Haddon (mthaddon) wrote :

Two minor changes via online comments

review: Needs Fixing
Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

Thanks Junien and Tom! I added a new commit addressing Tom's comments.

Revision history for this message
Tom Haddon (mthaddon) wrote :

LGTM, thx

review: Approve
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Change successfully merged at revision e9a371e4d2e296014bc79227182263be91e9a5b4

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/snapcraft.yaml b/snapcraft.yaml
2index bc2afb0..908dcc3 100644
3--- a/snapcraft.yaml
4+++ b/snapcraft.yaml
5@@ -1,10 +1,16 @@
6 name: prometheus
7-adopt-info: prometheus
8+version: 2.20.1
9+base: core18
10 grade: stable
11 summary: The Prometheus monitoring system and time series database
12 description: |
13 Prometheus is a systems and service monitoring system. It collects metrics from configured targets at given intervals, evaluates rule expressions, displays the results, and can trigger alerts if some condition is observed to be true.
14 confinement: strict
15+architectures:
16+ - build-on: amd64
17+ - build-on: arm64
18+ - build-on: ppc64el
19+ - build-on: s390x
20
21 apps:
22 prometheus:
23@@ -17,31 +23,27 @@ apps:
24 command: 'bin/promtool'
25 plugs:
26 content:
27+ interface: content
28 content: promreg
29 target: $SNAP_DATA/promreg
30
31 parts:
32- go:
33- source-tag: go1.12
34 prometheus:
35- after: [go]
36 plugin: go
37+ go-channel: 1.14/stable
38 source: https://github.com/prometheus/prometheus.git
39+ source-tag: v${SNAPCRAFT_PROJECT_VERSION}
40 go-importpath: github.com/prometheus/prometheus
41- build: |
42- export "GOPATH=$PWD/../go"
43- cd ../go/src/github.com/prometheus/prometheus/
44- version="$(git tag -l | grep -v '\-rc' | sort -V | tail -n 1)"
45- snap_version=$(echo $version | sed -e s/^v//)
46- snapcraftctl set-version "$snap_version"
47- git checkout tags/$version
48+ build-packages: [build-essential, curl, make, npm]
49+ override-build: |
50+ npm install yarn -g
51+ make common-test-short
52 make build
53- install: |
54- mkdir $SNAPCRAFT_PART_INSTALL/bin
55+ mkdir -p $SNAPCRAFT_PART_INSTALL/bin
56 mkdir -p $SNAPCRAFT_PART_INSTALL/etc/prometheus
57- cp -p $SNAPCRAFT_PART_INSTALL/../src/promtool $SNAPCRAFT_PART_INSTALL/bin/
58- cp -p $SNAPCRAFT_PART_INSTALL/../src/prometheus $SNAPCRAFT_PART_INSTALL/bin/
59- cp -p $SNAPCRAFT_PART_INSTALL/../src/documentation/examples/prometheus.yml $SNAPCRAFT_PART_INSTALL/etc/prometheus/prometheus.yml.example
60+ cp -p $SNAPCRAFT_PART_BUILD/promtool $SNAPCRAFT_PART_INSTALL/bin/
61+ cp -p $SNAPCRAFT_PART_BUILD/prometheus $SNAPCRAFT_PART_INSTALL/bin/
62+ cp -p $SNAPCRAFT_PART_SRC/documentation/examples/prometheus.yml $SNAPCRAFT_PART_INSTALL/etc/prometheus/prometheus.yml.example
63 snap-wrappers:
64 plugin: dump
65 source: .

Subscribers

People subscribed via source and target branches