Skip to content

Commit

Permalink
Move into separate repo
Browse files Browse the repository at this point in the history
  • Loading branch information
bwehrle committed Nov 9, 2024
0 parents commit f8707a9
Show file tree
Hide file tree
Showing 9 changed files with 114 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/run-agent.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Run Aider

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
run-aider:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Log in to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build Docker image
run: |
docker build -t aider-full .
- name: Run Aider from Docker container
run: |
docker run --rm -v ${{ github.workspace }}:/repo -w /repo paulgauthier/aider-full
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM paulgauthier/aider-full
RUN apt-get update
RUN apt-get install -y make
COPY scenarios /app/
COPY Makefile /app/
WORKDIR /app
ENTRYPOINT [ "make" ]
15 changes: 15 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

.PHONY: healtcheck-openai-4o
healtcheck-openai-4o:
@echo "Running $(@)"
@aider --model openai/gpt-4o --dry-run --load scenarios/healthchecks/scenario.cmd

.PHONY: healtcheck-anthropic-haiku
healtcheck-anthropic-sonnet:
@echo "Running $(@)"
@aider --model anthropic/claude-3-5-sonnet-20241022 --dry-run --load scenarios/healthchecks/scenario.cmd

.PHONY: docker-build
docker-build:
@echo "Building Docker image"
@docker build -t aider-agent .
16 changes: 16 additions & 0 deletions scenarios/alerts/alert-guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Alerts should be created for all services and added to the values.yaml file. The minimum alert is called `crash-loop`.

```yaml
alerts:
- name: CrashLoop
annotations:
description: 'Pod {{ $labels.namespace }}/{{ $labels.pod }} ({{ $labels.container
}}) is in waiting state (reason: "CrashLoopBackOff").'
runbook_url: https://runbooks.prometheus-operator.dev/runbooks/kubernetes/kubepodcrashlooping
summary: Pod is crash looping.
expr: max_over_time(kube_pod_container_status_waiting_reason{reason="CrashLoopBackOff",
job="kube-state-metrics", namespace=~".*"}[5m]) >= 1
for: 15m
labels:
severity: warning
```
3 changes: 3 additions & 0 deletions scenarios/healthchecks/configuration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Microservices can be configured through their `configuration` files. These files are located in different locations and contain important configuration values, including healthchecks.
* `config.yaml`
* `application.yaml`
9 changes: 9 additions & 0 deletions scenarios/healthchecks/configure-healthchecks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
The readiness and liveness health check urls are, by default, configured as below. To change them, modify `config.yaml`.

```yaml
healthchecks:
liveness:
url: /alternate-livez-path
readiness:
url: /alternate-readyz-path
```
22 changes: 22 additions & 0 deletions scenarios/healthchecks/repair.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Readiness and liveness are known as `health checks` and are defined in the `values.yaml` file. In the example, placeholder values are provided and service-specific values must be used.

```yaml
microservice:
readiness:
enabled: true
path: READINESS-URL
port: 80
initialDelaySeconds: 5
periodSeconds: 5
failureThreshold: 3
liveness:
enabled: true
path: LIVENESS-URL
initialDelaySeconds: 5
periodSeconds: 5
failureThreshold: 5
```
## References
* [Configuring readiness and liveness urls](configure-healthchecks.md)
* [URL validation](validate-url.md)
6 changes: 6 additions & 0 deletions scenarios/healthchecks/run.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/zsh

# Run the Aider application

aider --dry-run \
--load scenarios/healthchecks/scenario.cmd
5 changes: 5 additions & 0 deletions scenarios/healthchecks/scenario.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/add scenarios/healthchecks/repair.md
/add manifest/staging/values.yaml
/add scenarios/healthchecks/configure-healthchecks.md
/add src/config.yaml
/code Use the configured healthchecks to repair the issues with missing healthchecks in the values.yaml file.

0 comments on commit f8707a9

Please sign in to comment.