Skip to content

Commit

Permalink
Aadd dotnet-autoinstrumentation image (open-telemetry#989)
Browse files Browse the repository at this point in the history
  • Loading branch information
avadhut123pisal authored Jul 19, 2022
1 parent 925e1fa commit 38129f4
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 0 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/publish-autoinstrumentation-dotnet.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: "Publish DotNet Auto-Instrumentation"

on:
push:
paths:
- 'autoinstrumentation/dotnet/**'
- '.github/workflows/publish-autoinstrumentation-dotnet.yaml'
branches:
- main
pull_request:
paths:
- 'autoinstrumentation/dotnet/**'
- '.github/workflows/publish-autoinstrumentation-dotnet.yaml'
workflow_dispatch:

jobs:
publish:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v3

- name: Read version
run: echo "VERSION=$(cat autoinstrumentation/dotnet/version.txt)" >> $GITHUB_ENV

- name: Docker meta
id: meta
uses: docker/[email protected]
with:
images: ghcr.io/open-telemetry/opentelemetry-operator/autoinstrumentation-dotnet
tags: |
type=match,pattern=v(.*),group=1,value=v${{ env.VERSION }}
- name: Set up QEMU
uses: docker/[email protected]

- name: Set up Docker Buildx
uses: docker/[email protected]

- 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/[email protected]
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/[email protected]
with:
context: autoinstrumentation/dotnet
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
20 changes: 20 additions & 0 deletions autoinstrumentation/dotnet/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# To build one auto-instrumentation image for dotnet, please:
# - Download your dotnet auto-instrumentation artefacts to `/autoinstrumentation` directory. This is required as when instrumenting the pod,
# one init container will be created to copy the files to your app's container.
# - Grant the necessary access to the files in the `/autoinstrumentation` directory.
# - Following environment variables are injected to the application container to enable the auto-instrumentation.
# DOTNET_ADDITIONAL_DEPS=%InstallationLocation%/AdditionalDeps
# DOTNET_SHARED_STORE=%InstallationLocation%/store
# DOTNET_STARTUP_HOOKS=%InstallationLocation%/netcoreapp3.1/OpenTelemetry.AutoInstrumentation.StartupHook.dll

FROM busybox

ARG version

WORKDIR /autoinstrumentation

ADD https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/releases/download/v$version/opentelemetry-dotnet-instrumentation-linux-glibc.zip .

RUN unzip opentelemetry-dotnet-instrumentation-linux-glibc.zip

RUN chmod -R go+r .
1 change: 1 addition & 0 deletions autoinstrumentation/dotnet/version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.2.0-beta.1

0 comments on commit 38129f4

Please sign in to comment.