Skip to content

Commit

Permalink
Test other agent (#2081)
Browse files Browse the repository at this point in the history
  • Loading branch information
tamirdavid1 authored Dec 29, 2024
1 parent 3f20124 commit df7f73a
Show file tree
Hide file tree
Showing 6 changed files with 123 additions and 2 deletions.
19 changes: 19 additions & 0 deletions tests/e2e/workload-lifecycle/01-assert-apps-installed.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,25 @@ status:
---
apiVersion: v1
kind: Pod
metadata:
labels:
app: python-other-agent
namespace: default
spec:
containers:
- env:
- name: DJANGO_SETTINGS_MODULE
(value != null): true
status:
containerStatuses:
- name: python-other-agent
ready: true
restartCount: 0
started: true
phase: Running
---
apiVersion: v1
kind: Pod
metadata:
labels:
app: python-alpine
Expand Down
15 changes: 13 additions & 2 deletions tests/e2e/workload-lifecycle/01-assert-instrumented.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,19 @@ status:
reason: RuntimeVersionNotSupported
status: "False"
type: AppliedInstrumentationDevice


---
apiVersion: odigos.io/v1alpha1
kind: InstrumentedApplication
metadata:
namespace: default
name: deployment-python-other-agent
status:
conditions:
- message: "device not added to any container due to the presence of another agent"
observedGeneration: 1
reason: ErrApplyingInstrumentationDevice
status: "False"
type: AppliedInstrumentationDevice
---
apiVersion: odigos.io/v1alpha1
kind: InstrumentationInstance
Expand Down
19 changes: 19 additions & 0 deletions tests/e2e/workload-lifecycle/01-assert-runtime-detected.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,25 @@ spec:
---
apiVersion: odigos.io/v1alpha1
kind: InstrumentedApplication
metadata:
name: deployment-python-other-agent
namespace: default
ownerReferences:
- apiVersion: apps/v1
blockOwnerDeletion: true
controller: true
kind: Deployment
name: python-other-agent
spec:
runtimeDetails:
- containerName: python-other-agent
language: python
otherAgent:
name: New Relic Agent
(runtimeVersion != null): true
---
apiVersion: odigos.io/v1alpha1
kind: InstrumentedApplication
metadata:
name: deployment-python-min-version
namespace: default
Expand Down
48 changes: 48 additions & 0 deletions tests/e2e/workload-lifecycle/01-install-test-apps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,54 @@ spec:
---
kind: Deployment
apiVersion: apps/v1
metadata:
name: python-other-agent
namespace: default
labels:
app: python-other-agent
spec:
selector:
matchLabels:
app: python-other-agent
template:
metadata:
labels:
app: python-other-agent
spec:
containers:
- name: python-other-agent
image: python-other-agent:v0.0.1
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8000
env:
- name: DJANGO_SETTINGS_MODULE
value: "myapp.settings"
livenessProbe:
httpGet:
path: /health/
port: 8000
initialDelaySeconds: 10
periodSeconds: 30
timeoutSeconds: 5
failureThreshold: 3
successThreshold: 1
---
kind: Service
apiVersion: v1
metadata:
name: python-other-agent
namespace: default
spec:
selector:
app: python-other-agent
ports:
- protocol: TCP
port: 3000
targetPort: 8000
---
kind: Deployment
apiVersion: apps/v1
metadata:
name: python-alpine
namespace: default
Expand Down
2 changes: 2 additions & 0 deletions tests/e2e/workload-lifecycle/chainsaw-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ spec:
docker build -t python-latest-version:v0.0.1 -f services/python-http-server/Dockerfile.python-latest services/python-http-server
kind load docker-image python-latest-version:v0.0.1
docker build -t python-other-agent:v0.0.1 -f services/python-http-server/Dockerfile.python-other-agent services/python-http-server
kind load docker-image python-other-agent:v0.0.1
docker build -t python-alpine:v0.0.1 -f services/python-http-server/Dockerfile.python-alpine services/python-http-server
kind load docker-image python-alpine:v0.0.1
docker build -t python-not-supported:v0.0.1 -f services/python-http-server/Dockerfile.python-not-supported-version services/python-http-server
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM python

WORKDIR /app
COPY . /app

# Install dependencies from requirements.txt
COPY requirements.txt /app/requirements.txt

RUN apt-get update && apt-get install sqlite3 -y

RUN pip install --no-cache-dir -r requirements.txt

# Supress health check endpoint from tracing
ENV OTEL_PYTHON_DJANGO_EXCLUDED_URLS=health/

COPY entrypoint.sh /entrypoint.sh

ENV NEW_RELIC_CONFIG_FILE=/app/newrelic.ini

RUN chmod +x /entrypoint.sh

ENTRYPOINT ["/entrypoint.sh"]

0 comments on commit df7f73a

Please sign in to comment.