-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the Alertmanager ROCK to OCI Factory (#12)
* prepare repo for oci-factory * add workflow to open PRs to oci-factory as a test * build rock 0.24 to trigger new CI on 0.25 * enable manual action for release to oci-factory as a test * return to build 0.25 * add badge for future oci-releases * use workflow from main * fix alertmanager link in README
- Loading branch information
Showing
8 changed files
with
58 additions
and
42 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: Pull Requests | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
pull-request: | ||
name: PR | ||
uses: canonical/observability/.github/workflows/rock-pull-request.yaml@main | ||
secrets: inherit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: "Publish ROCK to GHCR:dev" | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
on: | ||
workflow_dispatch: {} | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
uses: canonical/observability/.github/workflows/rock-release-dev.yaml@main | ||
secrets: inherit | ||
with: | ||
rock-name: alertmanager |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: Open a PR to OCI Factory | ||
|
||
on: | ||
workflow_dispatch: {} # TODO: Test to see if this works | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
uses: canonical/observability/.github/workflows/rock-release-oci-factory.yaml@main | ||
with: | ||
rock-name: alertmanager |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,16 @@ | ||
# alertmanager-rock | ||
|
||
[![Build ROCK](https://github.com/canonical/alertmanager-rock/actions/workflows/build-rock.yaml/badge.svg)](https://github.com/canonical/alertmanager-rock/actions/workflows/build-rock.yaml) | ||
[![Open a PR to OCI Factory](https://github.com/canonical/alertmanager-rock/actions/workflows/rock-release-oci-factory.yaml/badge.svg)](https://github.com/canonical/alertmanager-rock/actions/workflows/rock-release-oci-factory.yaml) | ||
[![Publish to GHCR:dev](https://github.com/canonical/alertmanager-rock/actions/workflows/rock-release-dev.yaml/badge.svg)](https://github.com/canonical/alertmanager-rock/actions/workflows/rock-release-dev.yaml) | ||
[![Update ROCK](https://github.com/canonical/alertmanager-rock/actions/workflows/rock-update.yaml/badge.svg)](https://github.com/canonical/alertmanager-rock/actions/workflows/rock-update.yaml) | ||
|
||
Build an alertmanager image using | ||
[rockcraft](https://github.com/canonical/rockcraft), maintaining the same file | ||
hierarchy as the | ||
[`prometheus/alertmanager`](https://github.com/prometheus/alertmanager/blob/main/Dockerfile) | ||
image. | ||
[ROCKs](https://canonical-rockcraft.readthedocs-hosted.com/en/latest/) for [Alertmanager](https://prometheus.io/docs/alerting/latest/alertmanager/). | ||
This repository holds all the necessary files to build ROCKs for the upstream versions we support. The Alertmanager ROCK is used by the [alertmanager-k8s-operator](https://github.com/canonical/alertmanager-k8s-operator) charm. | ||
|
||
## Usage | ||
```shell | ||
rockcraft pack -v | ||
``` | ||
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. | ||
|
||
## Manual verification | ||
```shell | ||
tar tf alertmanager_0.24.0_amd64.rock | ||
tar -O -xf alertmanager_0.24.0_amd64.rock oci-layout | ||
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; | ||
* releasing to GHCR at [ghcr.io/canonical/alertmanager:dev](https://ghcr.io/canonical/alertmanager:dev), when merging to main, for development purposes. | ||
|
||
skopeo --insecure-policy copy oci-archive:alertmanager_0.24.0_amd64.rock docker-daemon:alertmanager:0.24.0 | ||
dive alertmanager:0.24.0 | ||
|
||
docker run --rm -d -p 9093:9093 alertmanager:0.24.0 | ||
curl localhost:9093/api/v1/alerts | ||
``` | ||
|
||
## Build automation | ||
This repo has workflows in place to: | ||
- update `rockcraft.yaml` when new versions of alertmanager are published; | ||
- publish a new rock on every merge. |