Page Not Found
We could not find what you were looking for.
Please contact the owner of the site that linked you to the original URL and let them know their link is broken.
diff --git a/Dockerfile b/Dockerfile index 61394c2b..362353e0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,8 +13,8 @@ ENV TAGS=${TAGS:-godror} ARG CGO_ENABLED ENV CGO_ENABLED=${CGO_ENABLED:-1} -ARG GO_VERSION -ENV GO_VERSION=${GO_VERSION:-1.24.9} +ARG GO_VERSION=1.24.9 +ENV GO_VERSION=${GO_VERSION} RUN microdnf install wget gzip gcc && \ wget -q https://go.dev/dl/go${GO_VERSION}.${GOOS}-${GOARCH}.tar.gz && \ diff --git a/Makefile b/Makefile index 561698a0..0e753102 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,7 @@ ARCH_TYPE ?= $(subst x86_64,amd64,$(patsubst i%86,386,$(ARCH))) GOOS ?= $(shell go env GOOS) GOARCH ?= $(shell go env GOARCH) TAGS ?= godror +PLATFORM ?= amd64 DOCKER_TARGET ?= exporter-godror CGO_ENABLED ?= 1 VERSION ?= 2.2.0 @@ -91,11 +92,24 @@ clean: push-images: @make --no-print-directory push-oraclelinux-image -docker: - docker build --no-cache --target=$(DOCKER_TARGET) --progress=plain $(BUILD_ARGS) -t "$(IMAGE_ID)-amd64" --build-arg BASE_IMAGE=$(ORACLE_LINUX_BASE_IMAGE) --build-arg GOARCH=amd64 . +docker: docker-amd docker-arm: - docker buildx build --target=$(DOCKER_TARGET) --platform linux/arm64 --load --no-cache --progress=plain $(BUILD_ARGS) -t "$(IMAGE_ID)-arm64" --build-arg BASE_IMAGE=$(ORACLE_LINUX_BASE_IMAGE) --build-arg GOARCH=arm64 . + @$(MAKE) PLATFORM=arm64 docker-platform + +docker-amd: + @$(MAKE) PLATFORM=amd64 docker-platform + +docker-platform: + @echo "Building Docker image for $(PLATFORM)..." + docker build --no-cache --target=$(DOCKER_TARGET) \ + --platform linux/$(PLATFORM) \ + --progress=plain $(BUILD_ARGS) \ + -t "$(IMAGE_ID)-$(PLATFORM)" \ + --build-arg BASE_IMAGE=$(ORACLE_LINUX_BASE_IMAGE) \ + --build-arg GOARCH=$(PLATFORM) \ + --build-arg CGO_ENABLED=$(CGO_ENABLED) \ + --build-arg TAGS=$(TAGS) . push-oraclelinux-image: docker push $(IMAGE_ID) @@ -112,4 +126,5 @@ podman-push: podman-release: podman-build podman-push -.PHONY: version build deps go-test clean docker podman-build podman-push podman-release +.PHONY: version build deps go-test clean docker docker-arm docker-platform docker-amd \ + podman-build podman-push podman-release \ No newline at end of file diff --git a/THIRD_PARTY_LICENSES.txt b/THIRD_PARTY_LICENSES.txt index 6312741d..2aa6a5c0 100644 --- a/THIRD_PARTY_LICENSES.txt +++ b/THIRD_PARTY_LICENSES.txt @@ -60,7 +60,7 @@ Copyright 2017 Microsoft Corporation. All rights reserved. --------------------------------- (separator) ---------------------------------- == Dependency -github.com/Azure/azure-sdk-for-go/sdk/keyvault/azsecrets +github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azsecrets == License Type SPDX:MIT @@ -71,7 +71,7 @@ Copyright (c) Microsoft Corporation. All rights reserved. --------------------------------- (separator) ---------------------------------- == Dependency -github.com/Azure/azure-sdk-for-go/sdk/keyvault/internal +github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal == License Type SPDX:MIT @@ -105,17 +105,6 @@ Copyright 2010 The Go Authors. All rights reserved. --------------------------------- (separator) ---------------------------------- -== Dependency -github.com/VictoriaMetrics/easyproto - -== License Type -SPDX:Apache-2.0 - -== Copyright -Copyright 2023-2024 VictoriaMetrics, Inc. - ---------------------------------- (separator) ---------------------------------- - == Dependency github.com/alecthomas/kingpin/v2 @@ -209,7 +198,8 @@ Copyright 2019 Square Inc. github.com/gofrs/flock == License Type -=== BSD-3-Clause-4e7459b3 +=== BSD-3-Clause-ccdad8f4 +Copyright (c) 2018-2024, The Gofrs Copyright (c) 2015-2020, Tim Heckman All rights reserved. @@ -244,8 +234,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Copyright (c) 2015-2020, Tim Heckman Copyright 2015 Tim Heckman. All rights reserved. Copyright 2018 The Go Authors. All rights reserved. -Copyright 2018 The Gofrs. All rights reserved. - +Copyright 2018-2024 The Gofrs. All rights reserved. --------------------------------- (separator) ---------------------------------- @@ -1803,4 +1792,4 @@ the Mozilla Public License, v. 2.0. === ATTRIBUTION-HELPER-GENERATED: === Attribution helper version: {Major:0 Minor:11 GitVersion:0.10.0-116-g2a434e4d-dirty GitCommit:2a434e4d7eea22d4dfd2d1cf04909239d05562b1 GitTreeState:dirty BuildDate:2025-04-29T00:30:45Z GoVersion:go1.22.4 Compiler:gc Platform:linux/amd64} -=== License file based on go.mod with md5 sum: 6cc83417e41baf616c93ce69e9c0cbb2 +=== License file based on go.mod with md5 sum: ca4151fddc683472717049863d0b84e9 diff --git a/build-all-macos.sh b/build-all-macos.sh new file mode 100755 index 00000000..91c8d867 --- /dev/null +++ b/build-all-macos.sh @@ -0,0 +1,136 @@ +#!/bin/bash + +# This script builds release artifacts for the Oracle Database Metrics Exporter. +# You must have a working docker socket, and docker or aliased docker command. +# It is designed to run on MacOS aarch64, creating the darwin-arm64 on the local host. +# Artifacts for linux-arm64, linux-amd64 are built in containers. + +# The following artifacts are created on a successful build in the 'dist' directory for the selected database driver target (godror or goora): +# - linux/arm64 and linux/amd64 container images +# - linux/arm64 and linux/amd64 binary tarballs for glibc 2.28 built on OL8 +# - linux/arm64 and linux/amd64 binary tarballs built on the latest Ubuntu distribution +# - darwin-arm64 binary tarball + +# Example usage: +# ./build-all-macos.sh 2.2.0 godror + +USAGE="Usage: $0 [-v VERSION] [-t TARGET] [-cmuo]" + +while getopts "v:t:cmuo" opt; do + case ${opt} in + v ) VERSION=$OPTARG;; # Exporter version + t ) TARGET=$OPTARG;; # Target database driver, may be "godror" or "goora" + c ) BUILD_CONTAINERS=true;; # Build exporter containers + m ) BUILD_DARWIN=true;; # Build darwin/macos binary + u ) BUILD_UBUNTU=true;; # Build binaries on latest Ubuntu + o ) BUILD_OL8=true;; # Build binaries on OL8 + \? ) echo $USAGE; exit 1;; + esac +done + +if [[ -z "$VERSION" ]] || [[ -z "$TARGET" ]]; then + echo $USAGE + exit 1 +fi + +OL_IMAGE="oraclelinux:8" +BASE_IMAGE="ghcr.io/oracle/oraclelinux:8-slim" +UBUNTU_IMAGE="ubuntu:24.04" +OL8_GLIBC_VERSION="2.28" +GO_VERSION="1.24.9" + +if [[ "${TARGET}" == "goora" ]]; then + TAGS="goora" + CGO_ENABLED=0 +else + TAGS="godror" + CGO_ENABLED=1 +fi + +build_darwin_local() { + echo "Build dawrin-arm64" + make go-build + echo "Built for darwin-arm64" +} + +build_ol_platform() { + build_ol "$1" + rename_glibc "$1" +} + +build_ol() { + local platform="$1" + local container="build-${platform}" + local image_artifact="exporter-${platform}" + local image_tar=${image_artifact}.tar + local filename="oracledb_exporter-${VERSION}.linux-${platform}.tar.gz" + + if [[ -n "$BUILD_CONTAINERS" ]]; then + echo "Starting $OL_IMAGE-${platform} build container" + PLATFORM=$platform make docker-platform + fi + + if [[ -n "BUILD_OL8" ]]; then + docker run -d --privileged --platform "linux/${platform}" --name "${container}" "${OL_IMAGE}" tail -f /dev/null + docker exec "${container}" bash -c "dnf install -y wget git make gcc && \ + wget -q https://go.dev/dl/go${GO_VERSION}.linux-${platform}.tar.gz && \ + rm -rf /usr/local/go && \ + tar -C /usr/local -xzf go${GO_VERSION}.linux-${platform}.tar.gz && \ + export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin && \ + git clone --depth 1 https://github.com/oracle/oracle-db-appdev-monitoring.git && \ + cd oracle-db-appdev-monitoring && \ + make go-build TAGS=$TAGS CGO_ENABLED=$CGO_ENABLED" + + docker cp "$container:/oracle-db-appdev-monitoring/dist/$filename" dist + + echo "Build complete for $OL_IMAGE-${platform}" + docker stop "$container" + docker rm "$container" + fi +} + +build_ubuntu() { + local container="ubuntu-build" + docker run -d --platform "linux/amd64" --name "${container}" "${UBUNTU_IMAGE}" tail -f /dev/null + docker exec "${container}" bash -c "apt-get update -y && \ + apt-get -y install podman qemu-user-static golang gcc-aarch64-linux-gnu git make && \ + git clone --depth 1 https://github.com/oracle/oracle-db-appdev-monitoring.git && \ + cd oracle-db-appdev-monitoring && \ + make go-build-linux-amd64 TAGS=$TAGS CGO_ENABLED=$CGO_ENABLED && \ + make go-build-linux-gcc-arm64 TAGS=$TAGS CGO_ENABLED=$CGO_ENABLED" + + + docker cp "$container:/oracle-db-appdev-monitoring/dist/oracledb_exporter-${VERSION}.linux-amd64.tar.gz" dist + docker cp "$container:/oracle-db-appdev-monitoring/dist/oracledb_exporter-${VERSION}.linux-arm64.tar.gz" dist + + docker stop "$container" + docker rm "$container" +} + +rename_glibc() { + local platform="$1" + + local f1="oracledb_exporter-${VERSION}.linux-${platform}.tar.gz" + local f2="oracledb_exporter-${VERSION}.linux-${platform}-glibc-${OL8_GLIBC_VERSION}.tar.gz" + + mv "out/$f1" "out/$f2" 2>/dev/null +} + +# clean dist directory before build +rm -r dist/* 2>/dev/null + +# Create darwin-arm64 artifacts on local host +if [[ -n "$BUILD_DARWIN" ]]; then + build_darwin_local +fi +# Create OL8 linux artifacts and containers for glibc 2.28 +# OL8 Linux artifacts are built on OL8 containers +build_ol_platform "arm64" +build_ol_platform "amd64" + + +if [[ -n "$BUILD_UBUNTU" ]]; then + # Create Linux artifacts and containers + build_ubuntu +fi + diff --git a/create-push-manifest.sh b/create-push-manifest.sh new file mode 100755 index 00000000..72a070dd --- /dev/null +++ b/create-push-manifest.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +VERSION="$1" # Exporter version +REGISTRY="$2" # Container registry/repository + +# Tag the images +docker tag exporter-amd64:latest ${REGISTRY}:${VERSION}-amd64 +docker tag exporter-arm64:latest ${REGISTRY}:${VERSION}-arm64 + +# Push the images +docker push ${REGISTRY}:${VERSION}-amd64 +docker push ${REGISTRY}:${VERSION}-arm64 + +# Create and push the manifest +docker manifest create ${REGISTRY}:${VERSION} ${REGISTRY}:${VERSION}-amd64 ${REGISTRY}:${VERSION}-arm64 +docker manifest push ${REGISTRY}:${VERSION} diff --git a/docker-compose/compose.yaml b/docker-compose/compose.yaml index 214d4f99..e96ed49e 100644 --- a/docker-compose/compose.yaml +++ b/docker-compose/compose.yaml @@ -59,7 +59,7 @@ services: start_period: 30s exporter: - image: container-registry.oracle.com/database/observability-exporter:2.1.0 + image: container-registry.oracle.com/database/observability-exporter:2.2.0 container_name: exporter command: - '--config.file=/exporter/config.yaml' diff --git a/docs/404.html b/docs/404.html index 4db0bdde..b55a4c05 100644 --- a/docs/404.html +++ b/docs/404.html @@ -4,13 +4,13 @@
We could not find what you were looking for.
Please contact the owner of the site that linked you to the original URL and let them know their link is broken.
We could not find what you were looking for.
Please contact the owner of the site that linked you to the original URL and let them know their link is broken.