chore: Keep docker containers up to date with latest patches. (#1347)

This commit is contained in:
Josh Suereth 2024-08-20 11:44:35 -04:00 committed by GitHub
parent bad36854b2
commit bcc38055d7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 21 additions and 13 deletions

View File

@ -19,15 +19,6 @@ CHLOGGEN_BINARY=bin/chloggen
CHLOGGEN = $(TOOLS_DIR)/$(CHLOGGEN_BINARY)
CHLOGGEN_CONFIG := .chloggen/config.yaml
# see https://github.com/open-telemetry/build-tools/releases for semconvgen updates
# Keep links in model/README.md and .vscode/settings.json in sync!
SEMCONVGEN_VERSION=0.25.0
# see https://github.com/open-telemetry/weaver/releases for weaver updates
WEAVER_VERSION=0.8.0
OPA_POLICY_AGENT_VERSION=0.67.1
# From where to resolve the containers (e.g. "otel/weaver").
CONTAINER_REPOSITORY=docker.io
@ -36,8 +27,12 @@ WEAVER_CONTAINER_REPOSITORY=$(CONTAINER_REPOSITORY)
SEMCONVGEN_CONTAINER_REPOSITORY=$(CONTAINER_REPOSITORY)
# Fully qualified references to containers used in this Makefile.
WEAVER_CONTAINER=$(WEAVER_CONTAINER_REPOSITORY)/otel/weaver:$(WEAVER_VERSION)
SEMCONVGEN_CONTAINER=$(SEMCONVGEN_CONTAINER_REPOSITORY)/otel/semconvgen:$(SEMCONVGEN_VERSION)
# These are parsed from dependencies.Dockerfile so dependabot will autoupdate
# the versions of docker files we use.
WEAVER_CONTAINER=$(shell cat dependencies.Dockerfile | awk '$$4=="weaver" {print $$2}')
SEMCONVGEN_CONTAINER=$(shell cat dependencies.Dockerfile | awk '$$4=="semconvgen" {print $$2}')
OPA_CONTAINER=$(shell cat dependencies.Dockerfile | awk '$$4=="opa" {print $$2}')
# TODO: add `yamllint` step to `all` after making sure it works on Mac.
.PHONY: all
@ -221,7 +216,7 @@ LATEST_RELEASED_SEMCONV_VERSION := $(shell git ls-remote --tags https://github.c
.PHONY: check-policies
check-policies:
docker run --rm -v $(PWD)/model:/source -v $(PWD)/docs:/spec -v $(PWD)/policies:/policies \
otel/weaver:${WEAVER_VERSION} registry check \
${WEAVER_CONTAINER} registry check \
--registry=/source \
--baseline-registry=https://github.com/open-telemetry/semantic-conventions/archive/refs/tags/v$(LATEST_RELEASED_SEMCONV_VERSION).zip[model] \
--policy=/policies
@ -230,7 +225,7 @@ check-policies:
.PHONY: test-policies
test-policies:
docker run --rm -v $(PWD)/policies:/policies -v $(PWD)/policies_test:/policies_test \
openpolicyagent/opa:${OPA_POLICY_AGENT_VERSION} test \
${OPA_CONTAINER} test \
--explain fails \
/policies \
/policies_test

13
dependencies.Dockerfile Normal file
View File

@ -0,0 +1,13 @@
# DO NOT BUILD
# This file is just for tracking dependencies of the semantic convention build.
# Dependabot can keep this file up to date with latest containers.
# Weaver is used to generate markdown docs, and enforce policies on the model.
FROM otel/weaver:0.8.0 AS weaver
# OPA is used to test policies enforced by weaver.
FROM openpolicyagent/opa:0.67.1 AS opa
# Semconv gen is used for backwards compatibility checks.
# TODO(jsuereth): Remove this when no longer used.
FROM otel/semconvgen:0.25.0 AS semconvgen