Skip to content

Commit 99035ab

Browse files
authored
Merge branch 'main' into dependabot/npm_and_yarn/samples/pulumi-remix-postgres/remix/tar-fs-2.1.4
2 parents 864ba93 + c976069 commit 99035ab

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+14919
-40
lines changed

.github/workflows/check-sample.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ jobs:
3030
./scripts/check-modified-samples.sh > modified.txt
3131
echo "@@ MODIFIED @@"
3232
cat modified.txt
33+
echo "@@ CHECKLIST @@"
34+
cat checklist.txt
3335
3436
# TODO: Uncomment the following lines to validate the Compose files
3537
# once we figure out how to prevent it from erroring on warnings.

.github/workflows/deploy-changed-samples.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ jobs:
102102
TEST_SLACK_CHANNEL_ID: ${{ secrets.TEST_SLACK_CHANNEL_ID }}
103103
TEST_SLACK_TOKEN: ${{ secrets.TEST_SLACK_TOKEN }}
104104
TEST_SHARED_SECRETS: ${{ secrets.TEST_SHARED_SECRETS}}
105+
TEST_SSL_MODE: ${{ secrets.TEST_SSL_MODE }}
105106
TEST_TAVILY_API_KEY: ${{ secrets.TEST_TAVILY_API_KEY }}
106107
TEST_ALLOWED_HOSTS: ${{ secrets.TEST_ALLOWED_HOSTS }}
107108
run: |

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ To start working on a new sample, run `. ./scripts/new-sample` from the root of
1010

1111
### Testing Samples
1212

13-
When you add a new sample, make sure to add any config vals to the `deploy-changed-samples.yml` workflow. They need to be prefixed with `TEST_` and those values need to be set in the repo secrets.
13+
When you add a new sample, make sure to add any config vals to the `deploy-changed-samples.yml` workflow. They need to be prefixed with `TEST_` and those values need to be set in the repo secrets. **NOTE** at the moment test break if we have a config value that only shows up in string interpolation in a longer string, for example in `ENV_NAME: proto://user:${PASSWORD}@host` if `PASSWORD` only ever shows up in that longer string, it will break the test. A workaround is to just add a line with `PASSWORD:` in the environment section, so the test can pick it up. Ugly, but works for now.

samples/agentic-strands/app/Dockerfile

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,12 @@ def chat():
158158
print(f"Error in /chat endpoint: {str(e)}")
159159
return jsonify({"error": str(e), "response": str(e)}), 500
160160

161+
@app.get("/health")
162+
def health_check():
163+
"""Health check endpoint"""
164+
return "ok"
165+
166+
161167
# Start Flask server when this script is run directly
162168
if __name__ == '__main__':
163169

samples/agentic-strands/compose.yaml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ services:
44
# domainname: example.com
55
build:
66
context: ./app
7-
dockerfile: Dockerfile
87
ports:
98
- target: 5001
109
published: 5001
@@ -13,13 +12,25 @@ services:
1312
LLM_URL: http://llm/api/v1/
1413
LLM_MODEL: default
1514
OPENAI_API_KEY: FAKE_TOKEN
15+
healthcheck:
16+
test:
17+
[
18+
"CMD",
19+
"python3",
20+
"-c",
21+
"import urllib.request; exit(0) if urllib.request.urlopen('http://localhost:5001/health').status == 200 else exit(1)",
22+
]
23+
interval: 30s
24+
timeout: 5s
25+
retries: 3
26+
start_period: 10s
1627
depends_on:
1728
- llm
1829

1930
llm:
2031
environment:
2132
- OPENAI_API_KEY=FAKE_TOKEN
22-
image: defangio/openai-access-gateway:06339c7
33+
image: defangio/openai-access-gateway
2334
ports:
2435
- target: 80
2536
published: 80

samples/django-celery/app/command.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
#!/bin/bash
22

3-
# Apply database migrations
4-
python manage.py migrate
5-
63
# Create superuser if not exists
74
python manage.py createsuperauto
85

samples/django-celery/compose.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ services:
1010
- POSTGRES_URL=postgres://postgres:${POSTGRES_PASSWORD}@database:5432/postgres
1111
depends_on:
1212
- database
13+
- migrate
1314
- broker
1415
ports:
1516
- mode: ingress
@@ -22,6 +23,19 @@ services:
2223
retries: 3
2324
start_period: 20s
2425

26+
migrate:
27+
restart: no
28+
build:
29+
context: ./app
30+
dockerfile: Dockerfile
31+
environment:
32+
- SECRET_KEY
33+
- REDIS_URL=redis://broker:6379/0
34+
- POSTGRES_URL=postgres://postgres:${POSTGRES_PASSWORD}@database:5432/postgres
35+
depends_on:
36+
- database
37+
command: python manage.py migrate
38+
2539
worker:
2640
restart: unless-stopped
2741
build:
@@ -37,6 +51,7 @@ services:
3751
depends_on:
3852
- database
3953
- broker
54+
- migrate
4055
command: celery -A django_celery worker --loglevel=info
4156

4257
database:
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"permissions": {
3+
"allow": [
4+
"Bash(docker compose:*)"
5+
],
6+
"deny": []
7+
}
8+
}

samples/django-channels-redis-postgres/app/Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Use a smaller base image
2-
FROM python:3.10-slim-buster
2+
FROM python:3.10-slim-bullseye
33

44
# Set environment variables
55
ENV PYTHONDONTWRITEBYTECODE=1
@@ -12,7 +12,8 @@ RUN apt-get update \
1212
&& apt-get install -y \
1313
gcc \
1414
python3-dev \
15-
libpq-dev
15+
libpq-dev \
16+
netcat-openbsd
1617

1718
# Install dependencies
1819
COPY requirements.txt /app/
@@ -32,4 +33,4 @@ RUN adduser --disabled-password --gecos '' django
3233
USER django
3334

3435
# Start server
35-
CMD ["sh", "-c", "python manage.py migrate && daphne -b 0.0.0.0 -p 8000 django_defang.asgi:application"]
36+
CMD ["sh", "-c", "daphne -b 0.0.0.0 -p 8000 django_defang.asgi:application"]

0 commit comments

Comments
 (0)