From bcc38055d7c6a2fe42276d416f52a7009b6f9739 Mon Sep 17 00:00:00 2001 From: Josh Suereth Date: Tue, 20 Aug 2024 11:44:35 -0400 Subject: [PATCH] chore: Keep docker containers up to date with latest patches. (#1347) --- Makefile | 21 ++++++++------------- dependencies.Dockerfile | 13 +++++++++++++ 2 files changed, 21 insertions(+), 13 deletions(-) create mode 100644 dependencies.Dockerfile diff --git a/Makefile b/Makefile index f3d4a2673f..574758d50a 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/dependencies.Dockerfile b/dependencies.Dockerfile new file mode 100644 index 0000000000..9afcb2db23 --- /dev/null +++ b/dependencies.Dockerfile @@ -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