Skip to content

Commit

Permalink
docs: Integration guide for sample-app (#1733)
Browse files Browse the repository at this point in the history
Co-authored-by: Rakesh Garimella <[email protected]>
Co-authored-by: Nina Hingerl <[email protected]>
  • Loading branch information
3 people authored Jan 15, 2025
1 parent a099d94 commit 09d6fd9
Show file tree
Hide file tree
Showing 23 changed files with 1,051 additions and 49 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@ jobs:
with:
payload-file-path: ".github/workflows/slack-message.json"
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_HUSKIES_NOTIF_WEBHOOK_URL }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
51 changes: 51 additions & 0 deletions .github/workflows/build-sample-app-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Build Sample App Image

on:
pull_request_target:
paths:
- "docs/user/integration/sample-app/**"
types: [ opened, edited, synchronize, reopened, ready_for_review ]
push:
branches:
- main
- sample-app
paths:
- "docs/user/integration/sample-app/**"
workflow_dispatch:

jobs:
envs:
runs-on: ubuntu-latest
outputs:
tags: ${{ steps.create-tags.outputs.tags }}

steps:
- name: create tags
id: create-tags
run: |
if [[ $GITHUB_EVENT_NAME == 'push' || $GITHUB_EVENT_NAME == 'merge_group' ]]; then
echo 'TAGS=latest' >> "$GITHUB_OUTPUT"
else
{
echo 'tags<<TAGS'
echo 'PR-${{ github.event.pull_request.number }}'
echo '${{ github.event.pull_request.head.sha }}'
echo 'TAGS'
} >> "$GITHUB_OUTPUT"
fi
build-image:
needs: envs
uses: kyma-project/test-infra/.github/workflows/image-builder.yml@main
with:
name: samples/telemetry-sample-app
dockerfile: Dockerfile
context: docs/user/integration/sample-app
tags: ${{ needs.envs.outputs.tags }}
list-images:
needs: build-image
runs-on: ubuntu-latest
steps:
- name: List images
run: |
echo "${{ needs.build-image.outputs.images }}"
2 changes: 1 addition & 1 deletion .github/workflows/build-telemetry-self-monitor-image.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Telemetry Self Monitor Image Builder
name: Build Telemetry Self Monitor Image

on:
pull_request_target:
Expand Down
2 changes: 1 addition & 1 deletion config/samples/telemetry_v1alpha1_metricpipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ spec:
app: metric-gen
spec:
containers:
- image: europe-docker.pkg.dev/kyma-project/prod/examples/monitoring-custom-metrics:v20230905-b823fd14
- image: europe-docker.pkg.dev/kyma-project/prod/samples/telemetry-sample-app:latest
imagePullPolicy: IfNotPresent
name: metric-gen
ports:
Expand Down
2 changes: 1 addition & 1 deletion docs/user/03-traces.md
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ metadata:
spec:
selector:
matchLabels:
kubernetes.io/name: "my-app"
app.kubernetes.io/name: "my-app"
tracing:
- providers:
- name: "kyma-traces"
Expand Down
133 changes: 133 additions & 0 deletions docs/user/integration/assets/sample-app.drawio.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions docs/user/integration/sample-app/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM golang:1.23 AS builder
RUN mkdir /app
ADD . /app
WORKDIR /app
RUN CGO_ENABLED=0 GOOS=linux go build -o main ./...

FROM scratch
LABEL [email protected]:kyma-project/telemetry-manager.git

COPY --from=builder /app .
EXPOSE 8080

CMD ["./main"]
105 changes: 105 additions & 0 deletions docs/user/integration/sample-app/Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions docs/user/integration/sample-app/Gopkg.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@


required = [
"golang.org/x/lint/golint"
]

[[constraint]]
version = "v0.9.2"
name = "github.com/prometheus/client_golang"
15 changes: 15 additions & 0 deletions docs/user/integration/sample-app/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
APP_NAME = sample-app

build:
go mod vendor
go generate ./...
CGO_ENABLED=0 go build -o ./bin/app $(buildpath)

run: build
./bin/app

image:
docker build -t $(APP_NAME):latest .

clean:
rm -f ./bin/app
Loading

0 comments on commit 09d6fd9

Please sign in to comment.