diff --git a/2.14.2/rockcraft.yaml b/2.14.2/rockcraft.yaml new file mode 100644 index 0000000..7560f20 --- /dev/null +++ b/2.14.2/rockcraft.yaml @@ -0,0 +1,49 @@ +name: mimir +summary: Grafana Mimir in a rock. +description: | + Grafana Mimir is a horizontally scalable, highly available, + multi-tenant, long-term storage for Prometheus. +version: "2.14.2" +base: ubuntu@22.04 +license: Apache-2.0 +platforms: + amd64: +services: + mimir: + command: /usr/bin/mimir + override: replace + startup: enabled +parts: + mimir: + plugin: go + source: https://github.com/grafana/mimir + source-type: git + source-tag: "mimir-2.14.2" + build-snaps: + - go/1.22/stable + build-environment: + - BUILD_IN_CONTAINER: "false" + override-build: | + make dist + install -D -m755 dist/metaconvert-linux-amd64 ${CRAFT_PART_INSTALL}/opt/mimir/bin/metaconvert + install -D -m755 dist/mimir-linux-amd64 ${CRAFT_PART_INSTALL}/opt/mimir/bin/mimir + install -D -m755 dist/mimirtool-linux-amd64 ${CRAFT_PART_INSTALL}/opt/mimir/bin/mimirtool + install -D -m755 dist/query-tee-linux-amd64 ${CRAFT_PART_INSTALL}/opt/mimir/bin/query-tee + organize: + opt/mimir/bin/metaconvert: usr/bin/metaconvert + opt/mimir/bin/mimir: usr/bin/mimir + opt/mimir/bin/mimirtool: usr/bin/mimirtool + opt/mimir/bin/query-tee: usr/bin/query-tee + ca-certs: + plugin: nil + overlay-packages: + - ca-certificates + deb-security-manifest: + plugin: nil + after: + - mimir + - ca-certs + override-prime: | + set -x + mkdir -p $CRAFT_PRIME/usr/share/rocks/ + (echo "# os-release" && cat /etc/os-release && echo "# dpkg-query" && dpkg-query --admindir=$CRAFT_PRIME/var/lib/dpkg/ -f '${db:Status-Abbrev},${binary:Package},${Version},${source:Package},${Source:Version}\n' -W) > $CRAFT_PRIME/usr/share/rocks/dpkg.query diff --git a/README.md b/README.md index 6a10e16..e599dff 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,11 @@ This repository holds all the necessary files to build rocks for the upstream ve The rocks on this repository are built with [OCI Factory](https://github.com/canonical/oci-factory/), which also takes care of periodically rebuilding the images. +New versions of the rock are tested using [`goss`](https://github.com/goss-org/goss) (for the actual validation) and [`noctua`](https://github.com/lucabello/noctua) (to run the actual command). + Automation takes care of: * validating PRs, by simply trying to build the rock; * pulling upstream releases, creating a PR with the necessary files to be manually reviewed; +* on PRs, validate the added (or modified) rocks by running them in a Kubernetes pod and testing them with `goss`; * releasing to GHCR at [ghcr.io/canonical/mimir:dev](https://ghcr.io/canonical/mimir:dev), when merging to main, for development purposes. diff --git a/goss.yaml b/goss.yaml new file mode 100644 index 0000000..1c41a6e --- /dev/null +++ b/goss.yaml @@ -0,0 +1,10 @@ +process: + mimir: + running: true +package: + ca-certificates: + installed: true +http: + mimir-config: + status: 200 + url: http://localhost:8080/config