From 07e73cc452451d9ce4ff1a6ad029f4cef2f51ad5 Mon Sep 17 00:00:00 2001 From: Martin Date: Wed, 9 Nov 2022 12:48:01 +0100 Subject: [PATCH 1/5] Apache Instrumentation - Agent Image Build --- autoinstrumentation/apache/Dockerfile | 26 ++++++++++++++++++++++++++ autoinstrumentation/apache/README.md | 13 +++++++++++++ autoinstrumentation/apache/version.txt | 1 + 3 files changed, 40 insertions(+) create mode 100644 autoinstrumentation/apache/Dockerfile create mode 100644 autoinstrumentation/apache/README.md create mode 100644 autoinstrumentation/apache/version.txt diff --git a/autoinstrumentation/apache/Dockerfile b/autoinstrumentation/apache/Dockerfile new file mode 100644 index 0000000000..6b99e022c1 --- /dev/null +++ b/autoinstrumentation/apache/Dockerfile @@ -0,0 +1,26 @@ + +############################ +# STEP 1 download the webserver agent +############################ +FROM alpine:latest as agent + +ARG version + +RUN mkdir /opt/opentelemetry +WORKDIR /opt/opentelemetry + +RUN wget https://github.com/open-telemetry/opentelemetry-cpp-contrib/releases/download/webserver%2Fv$version/opentelemetry-webserver-sdk-x64-linux.tgz.zip +RUN unzip opentelemetry-webserver-sdk-x64-linux.tgz.zip +RUN mkdir agent +RUN tar -xvf opentelemetry-webserver-sdk-x64-linux.tgz -C agent + +############################ +# STEP 2 download the webserver agent +############################ +FROM alpine:latest + +COPY --from=agent /opt/opentelemetry/agent/opentelemetry-webserver-sdk /opt/opentelemetry + +RUN chmod a+w /opt/opentelemetry/logs + +CMD ["cat", "Just delivering the Opentelemetry Apache/Nginx agent"] \ No newline at end of file diff --git a/autoinstrumentation/apache/README.md b/autoinstrumentation/apache/README.md new file mode 100644 index 0000000000..d26e6db90b --- /dev/null +++ b/autoinstrumentation/apache/README.md @@ -0,0 +1,13 @@ +# How to build Apache auto-instrumentation docker image + +To build image for Apache auto instrumentation, use the following commands + +``` +export REPO_NAME="" +export IMAGE_NAME_PREFIX="opentelemetry-apache-auto" +export IMAGE_VERSION=`cat version.txt` +export IMAGE_NAME=${REPO_NAME}/${IMAGE_NAME_PREFIX}:${IMAGE_VERSION} +docker build --build-arg version=${IMAGE_VERSION} . -t ${IMAGE_NAME} -t ${REPO_NAME}/${IMAGE_NAME_PREFIX}:latest +docker push ${IMAGE_NAME} +docker push ${REPO_NAME}/${IMAGE_NAME_PREFIX}:latest +``` diff --git a/autoinstrumentation/apache/version.txt b/autoinstrumentation/apache/version.txt new file mode 100644 index 0000000000..e6d5cb833c --- /dev/null +++ b/autoinstrumentation/apache/version.txt @@ -0,0 +1 @@ +1.0.2 \ No newline at end of file From 454b9a22165dd5a0811ff1e288bb78233ec3c45f Mon Sep 17 00:00:00 2001 From: Martin Date: Wed, 9 Nov 2022 12:49:32 +0100 Subject: [PATCH 2/5] Rename deafult image name --- autoinstrumentation/apache/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoinstrumentation/apache/README.md b/autoinstrumentation/apache/README.md index d26e6db90b..6bf2443a5c 100644 --- a/autoinstrumentation/apache/README.md +++ b/autoinstrumentation/apache/README.md @@ -4,7 +4,7 @@ To build image for Apache auto instrumentation, use the following commands ``` export REPO_NAME="" -export IMAGE_NAME_PREFIX="opentelemetry-apache-auto" +export IMAGE_NAME_PREFIX="opentelemetry-apache-agent" export IMAGE_VERSION=`cat version.txt` export IMAGE_NAME=${REPO_NAME}/${IMAGE_NAME_PREFIX}:${IMAGE_VERSION} docker build --build-arg version=${IMAGE_VERSION} . -t ${IMAGE_NAME} -t ${REPO_NAME}/${IMAGE_NAME_PREFIX}:latest From 52a4ccdf2a369c8b095aa357be163ef690c6971c Mon Sep 17 00:00:00 2001 From: Martin Date: Mon, 21 Nov 2022 14:43:59 +0100 Subject: [PATCH 3/5] Github bld action for Apache HTTPD autoinstr img --- ...lish-autoinstrumentation-apache-httpd.yaml | 65 +++++++++++++++++++ .../{apache => apache-httpd}/Dockerfile | 0 .../{apache => apache-httpd}/README.md | 6 +- .../{apache => apache-httpd}/version.txt | 0 4 files changed, 68 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/publish-autoinstrumentation-apache-httpd.yaml rename autoinstrumentation/{apache => apache-httpd}/Dockerfile (100%) rename autoinstrumentation/{apache => apache-httpd}/README.md (63%) rename autoinstrumentation/{apache => apache-httpd}/version.txt (100%) diff --git a/.github/workflows/publish-autoinstrumentation-apache-httpd.yaml b/.github/workflows/publish-autoinstrumentation-apache-httpd.yaml new file mode 100644 index 0000000000..2a8fb7b8bc --- /dev/null +++ b/.github/workflows/publish-autoinstrumentation-apache-httpd.yaml @@ -0,0 +1,65 @@ +name: "Publish Java Auto-Instrumentation" + +on: + push: + paths: + - 'autoinstrumentation/apache-httpd/**' + - '.github/workflows/publish-autoinstrumentation-apache-httpd.yaml' + branches: + - main + pull_request: + paths: + - 'autoinstrumentation/apache-httpd/**' + - '.github/workflows/publish-autoinstrumentation-apache-httpd.yaml' + workflow_dispatch: + +jobs: + publish: + runs-on: ubuntu-20.04 + + steps: + - uses: actions/checkout@v3 + + - name: Read version + run: echo "VERSION=$(cat autoinstrumentation/apache-httpd/version.txt)" >> $GITHUB_ENV + + - name: Docker meta + id: meta + uses: docker/metadata-action@v4 + with: + images: ghcr.io/open-telemetry/opentelemetry-operator/autoinstrumentation-apache-httpd + tags: | + type=match,pattern=v(.*),group=1,value=v${{ env.VERSION }} + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Cache Docker layers + uses: actions/cache@v3 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Login to GitHub Package Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v3 + with: + context: autoinstrumentation/apache-httpd + platforms: linux/amd64,linux/arm64 + push: ${{ github.event_name == 'push' }} + build-args: version=${{ env.VERSION }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache \ No newline at end of file diff --git a/autoinstrumentation/apache/Dockerfile b/autoinstrumentation/apache-httpd/Dockerfile similarity index 100% rename from autoinstrumentation/apache/Dockerfile rename to autoinstrumentation/apache-httpd/Dockerfile diff --git a/autoinstrumentation/apache/README.md b/autoinstrumentation/apache-httpd/README.md similarity index 63% rename from autoinstrumentation/apache/README.md rename to autoinstrumentation/apache-httpd/README.md index 6bf2443a5c..2ff4f1aa60 100644 --- a/autoinstrumentation/apache/README.md +++ b/autoinstrumentation/apache-httpd/README.md @@ -1,10 +1,10 @@ -# How to build Apache auto-instrumentation docker image +# How to build Apache HTTPD auto-instrumentation docker image -To build image for Apache auto instrumentation, use the following commands +To build image for Apache HTTPD auto instrumentation, use the following commands ``` export REPO_NAME="" -export IMAGE_NAME_PREFIX="opentelemetry-apache-agent" +export IMAGE_NAME_PREFIX="autoinstrumentation-apache-httpd" export IMAGE_VERSION=`cat version.txt` export IMAGE_NAME=${REPO_NAME}/${IMAGE_NAME_PREFIX}:${IMAGE_VERSION} docker build --build-arg version=${IMAGE_VERSION} . -t ${IMAGE_NAME} -t ${REPO_NAME}/${IMAGE_NAME_PREFIX}:latest diff --git a/autoinstrumentation/apache/version.txt b/autoinstrumentation/apache-httpd/version.txt similarity index 100% rename from autoinstrumentation/apache/version.txt rename to autoinstrumentation/apache-httpd/version.txt From 8af31a9cb3147a9bd65c119e27c840b56ce27aa7 Mon Sep 17 00:00:00 2001 From: Martin Date: Mon, 21 Nov 2022 14:49:07 +0100 Subject: [PATCH 4/5] Added Apache HTTPD image to publish images act --- .github/workflows/publish-images.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/publish-images.yaml b/.github/workflows/publish-images.yaml index cf625ec9ba..a04fcf3e1d 100644 --- a/.github/workflows/publish-images.yaml +++ b/.github/workflows/publish-images.yaml @@ -28,6 +28,7 @@ jobs: grep -v '\#' versions.txt | grep autoinstrumentation-nodejs | awk -F= '{print "AUTO_INSTRUMENTATION_NODEJS_VERSION="$2}' >> $GITHUB_ENV grep -v '\#' versions.txt | grep autoinstrumentation-python | awk -F= '{print "AUTO_INSTRUMENTATION_PYTHON_VERSION="$2}' >> $GITHUB_ENV grep -v '\#' versions.txt | grep autoinstrumentation-dotnet | awk -F= '{print "AUTO_INSTRUMENTATION_DOTNET_VERSION="$2}' >> $GITHUB_ENV + grep -v '\#' versions.txt | grep autoinstrumentation-apache-httpd | awk -F= '{print "AUTO_INSTRUMENTATION_APACHE_HTTPD_VERSION="$2}' >> $GITHUB_ENV echo "VERSION_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV echo "VERSION=$(git describe --tags | sed 's/^v//')" >> $GITHUB_ENV @@ -82,5 +83,6 @@ jobs: AUTO_INSTRUMENTATION_NODEJS_VERSION=${{ env.AUTO_INSTRUMENTATION_NODEJS_VERSION }} AUTO_INSTRUMENTATION_PYTHON_VERSION=${{ env.AUTO_INSTRUMENTATION_PYTHON_VERSION }} AUTO_INSTRUMENTATION_DOTNET_VERSION=${{ env.AUTO_INSTRUMENTATION_DOTNET_VERSION }} + AUTO_INSTRUMENTATION_APACHE_HTTPD_VERSION=${{ env.AUTO_INSTRUMENTATION_APACHE_HTTPD_VERSION }} cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache From c4c6cbd5488a36d89502b7d84f2bf4a4325d2a1d Mon Sep 17 00:00:00 2001 From: Martin Date: Mon, 21 Nov 2022 14:55:04 +0100 Subject: [PATCH 5/5] Heading change --- .github/workflows/publish-autoinstrumentation-apache-httpd.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-autoinstrumentation-apache-httpd.yaml b/.github/workflows/publish-autoinstrumentation-apache-httpd.yaml index 2a8fb7b8bc..597d79ecd4 100644 --- a/.github/workflows/publish-autoinstrumentation-apache-httpd.yaml +++ b/.github/workflows/publish-autoinstrumentation-apache-httpd.yaml @@ -1,4 +1,4 @@ -name: "Publish Java Auto-Instrumentation" +name: "Publish Apache HTTPD Auto-Instrumentation" on: push: