Skip to content

Commit

Permalink
Merge branch 'main' into hotfix/configmap_parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
metalmatze authored Nov 20, 2024
2 parents e23920f + 4542341 commit ca35c45
Show file tree
Hide file tree
Showing 51 changed files with 1,479 additions and 872 deletions.
1 change: 0 additions & 1 deletion .errcheck_excludes.txt

This file was deleted.

8 changes: 4 additions & 4 deletions .github/workflows/container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac

- name: Set up Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed
with:
go-version-file: go.mod
check-latest: true
Expand Down Expand Up @@ -64,12 +64,12 @@ jobs:
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac

- name: Set up QEMU
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf
with:
platforms: amd64.arm64,arm

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349

- uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a
with:
Expand All @@ -90,7 +90,7 @@ jobs:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75
with:
context: .
push: ${{ github.repository == 'pyrra-dev/pyrra' && github.event_name != 'pull_request' }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependabot-merge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1
uses: dependabot/fetch-metadata@v2
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Enable auto-merge for Dependabot PRs
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/generate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ jobs:
name: Generate Jsonnet examples
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
- uses: actions/setup-go@v5.1.0
with:
go-version-file: go.mod
- uses: zendesk/setup-jsonnet@v11
- uses: zendesk/setup-jsonnet@v12
- run: go install github.com/brancz/gojsontoyaml@latest
- run: make --always-make examples && git diff --exit-code
2 changes: 1 addition & 1 deletion .github/workflows/go.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
name: Go
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed
with:
go-version-file: 'go.mod'
- run: mkdir -p ui/build && touch ui/build/empty
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed
with:
go-version-file: 'go.mod'
- name: Build UI
run: make ui
- name: golangci-lint
uses: golangci/golangci-lint-action@v4.0.0
uses: golangci/golangci-lint-action@v6.1.1
with:
args: --timeout=10m
version: 'latest'
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac

- name: Set up Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491
uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed
with:
go-version-file: go.mod
check-latest: true
Expand Down Expand Up @@ -68,12 +68,12 @@ jobs:
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac

- name: Set up QEMU
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf
with:
platforms: amd64.arm64,arm

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349

- uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a
with:
Expand All @@ -94,7 +94,7 @@ jobs:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75
with:
context: .
push: true
Expand Down
15 changes: 10 additions & 5 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
run:
deadline: 5m
go: 1.19
skip-dirs:
- proto/
deadline: 10m
go: 1.23

output:
formats:
- format: colored-line-number

linters:
enable:
Expand All @@ -14,6 +16,8 @@ linters:
- whitespace

issues:
exclude-dirs:
- proto/
exclude-rules:
- path: _test.go
linters:
Expand All @@ -39,7 +43,8 @@ linters-settings:
- pkg: github.com/pkg/errors
desc: "Use fmt.Errorf instead"
errcheck:
exclude: ./.errcheck_excludes.txt
exclude-functions:
- "(github.com/go-kit/log.Logger).Log"
goimports:
local-prefixes: github.com/pyrra-dev/pyrra
gofumpt:
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Run the API binary in one terminal
./pyrra api
```

*Note: the API assumes a Prometheus is running on [localhost:9090](http://localhost:9090) and a backend on [localhost:9444](http://localhost:9444)) by default. Check `./bin/api --help` flag for the parameters to change those.*
*Note: the API assumes a Prometheus is running on [localhost:9090](http://localhost:9090) and a backend on [localhost:9444](http://localhost:9444)) by default. Check `./pyrra api --help` flag for the parameters to change those.*

### Run a Kubernetes or filesystem backend

Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform="${BUILDPLATFORM:-linux/amd64}" docker.io/busybox:1.36.1 as builder
FROM --platform="${BUILDPLATFORM:-linux/amd64}" docker.io/busybox:1.37.0 as builder

ARG TARGETOS TARGETARCH TARGETVARIANT

Expand All @@ -15,7 +15,7 @@ RUN if [ "${TARGETARCH}" = 'amd64' ]; then \
fi
RUN chmod +x pyrra

FROM --platform="${TARGETPLATFORM:-linux/amd64}" docker.io/alpine:3.19.1 AS runner
FROM --platform="${TARGETPLATFORM:-linux/amd64}" docker.io/alpine:3.20.3 AS runner
WORKDIR /
COPY --chown=0:0 --from=builder /app/pyrra /usr/bin/pyrra
USER 65533
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform="${BUILDPLATFORM:-linux/amd64}" docker.io/golang:1.22.2-alpine as go-builder
FROM --platform="${BUILDPLATFORM:-linux/amd64}" docker.io/golang:1.23.3-alpine as go-builder

# renovate: datasource=go depName=github.com/go-delve/delve
ARG DLV_VERSION=v1.21.0
Expand All @@ -7,7 +7,7 @@ ARG DLV_VERSION=v1.21.0
RUN apk update && apk add --no-cache build-base
RUN go install "github.com/go-delve/delve/cmd/dlv@${DLV_VERSION}"

FROM --platform="${BUILDPLATFORM:-linux/amd64}" docker.io/busybox:1.36.1 as builder
FROM --platform="${BUILDPLATFORM:-linux/amd64}" docker.io/busybox:1.37.0 as builder

ARG TARGETOS TARGETARCH TARGETVARIANT

Expand All @@ -24,7 +24,7 @@ RUN if [ "${TARGETARCH}" = 'amd64' ]; then \
fi
RUN chmod +x pyrra

FROM --platform="${TARGETPLATFORM:-linux/amd64}" docker.io/alpine:3.19.1 AS runner
FROM --platform="${TARGETPLATFORM:-linux/amd64}" docker.io/alpine:3.20.3 AS runner
WORKDIR /
COPY --chown=0:0 --from=builder /app/pyrra /usr/bin/pyrra
COPY --chown=0:0 --from=go-builder /go/bin/dlv /usr/bin/dlv
Expand Down
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ vet:
# Generate manifests e.g. CRD, RBAC etc.
.PHONY: generate
generate: controller-gen gojsontoyaml ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
$(CONTROLLER_GEN) rbac:roleName=pyrra-kubernetes crd rbac:roleName="pyrra-kubernetes" webhook paths="./..." output:crd:artifacts:config=jsonnet/controller-gen
$(CONTROLLER_GEN) crd rbac:roleName="pyrra-kubernetes" webhook paths="./..." output:crd:artifacts:config=jsonnet/controller-gen
find jsonnet/controller-gen -name '*.yaml' -print0 | xargs -0 -I{} sh -c '$(GOJSONTOYAML) -yamltojson < "$$1" | jq > "$(PWD)/jsonnet/controller-gen/$$(basename -s .yaml $$1).json"' -- {}
find jsonnet/controller-gen -type f ! -name '*.json' -delete

Expand All @@ -69,7 +69,7 @@ docker-push:
# download controller-gen if necessary
controller-gen:
ifeq (, $(shell which controller-gen))
go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.11.1
go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.14.0
CONTROLLER_GEN=$(GOBIN)/controller-gen
else
CONTROLLER_GEN=$(shell which controller-gen)
Expand Down Expand Up @@ -99,3 +99,4 @@ examples/openshift/manifests: examples/openshift/main.jsonnet jsonnet/controller
jsonnetfmt -i examples/openshift/main.jsonnet
jsonnet -m examples/openshift/manifests examples/openshift/main.jsonnet | xargs -I{} sh -c 'cat {} | gojsontoyaml > {}.yaml' -- {}
find examples/openshift/manifests -type f ! -name '*.yaml' -delete

9 changes: 7 additions & 2 deletions examples/docker-compose/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ volumes:
services:
prometheus:
image: prom/prometheus:v2.47.0
container_name: prometheus
restart: always
networks:
- pyrra
Expand All @@ -18,12 +19,14 @@ services:
- --config.file=/etc/prometheus/prometheus.yml
- --storage.tsdb.path=/prometheus
- --storage.tsdb.retention.time=33d
- --web.enable-lifecycle
volumes:
- ./prometheus/prometheus.yaml:/etc/prometheus/prometheus.yml:ro
- ./prometheus_pyrra:/etc/prometheus/pyrra
- prometheus_pyrra:/etc/prometheus/pyrra

pyrra-api:
image: ghcr.io/pyrra-dev/pyrra:v0.7.5
container_name: pyrra_api
restart: always
command:
- api
Expand All @@ -37,6 +40,8 @@ services:

pyrra-filesystem:
image: ghcr.io/pyrra-dev/pyrra:v0.7.5
user: root
container_name: pyrra_filesystem
restart: always
command:
- filesystem
Expand All @@ -45,4 +50,4 @@ services:
- pyrra
volumes:
- ./pyrra:/etc/pyrra
- ./prometheus_pyrra:/etc/prometheus/pyrra
- prometheus_pyrra:/etc/prometheus/pyrra
Loading

0 comments on commit ca35c45

Please sign in to comment.