Skip to content

Commit

Permalink
Merge pull request #242 from ItsCalebJones/django-silk-debug
Browse files Browse the repository at this point in the history
chore: some updates to get silk working
  • Loading branch information
ItsCalebJones authored Apr 15, 2024
2 parents 099c8e2 + cca6070 commit 2381896
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 6 deletions.
1 change: 0 additions & 1 deletion .github/workflows/build-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ jobs:
else
helm upgrade $RELEASE_NAME k8s/helm/ --namespace=$DEPLOYMENT_NAMESPACE --values $VALUES
kubectl rollout restart deploy $WEB_DEPLOYMENT --namespace=$DEPLOYMENT_NAMESPACE
kubectl rollout restart deploy $SERVICE_DEPLOYMENT --namespace=$DEPLOYMENT_NAMESPACE
fi
release:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ report/
*secret*.yaml
dist/**
.vscode/**
docker/*.backup
*.log
2 changes: 1 addition & 1 deletion docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

### Restore Database
**Example**
`docker exec -i sln_db pg_restore -U spacelaunchnow_prod_user -v -d spacelaunchnow_local < spacelaunchnow_2024.01.11-16.42.44.backup &> restore.log`
`docker exec -i sln_db pg_restore -U spacelaunchnow_prod_user -v -d sln_db < spacelaunchnow.backup &> restore.log`

## Run full stack locally
Run `docker-compose -f docker-compose.stack.yml up -d --build`
Expand Down
7 changes: 4 additions & 3 deletions docker/docker-compose.stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ version: '3'
services:
sln_db:
container_name: sln_db
image: postgres:14-alpine
image: postgres:14.10
env_file:
- .env
sln_cache:
container_name: sln_cache
image: memcached
args:
- MEMCACHED_ENABLE_SASL=1
expose:
- "11211"
sln_web:
Expand All @@ -20,8 +22,7 @@ services:
- PRIVATE_PASSWORD=${POETRY_HTTP_BASIC_TSD_PASSWORD}
image: space_launch_now_local
command: >
bash -c "python manage.py migrate --noinput
&& gunicorn --workers 1 --threads 2 --bind :8080 --log-level INFO spacelaunchnow.wsgi"
bash -c "gunicorn --workers 1 --threads 2 --bind :8080 --log-level INFO spacelaunchnow.wsgi"
ports:
- "8080:8080"
env_file:
Expand Down
1 change: 1 addition & 0 deletions k8s/helm/values-staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ env:
SLN_ENVIRONMENT: "staging"
ENABLE_SILKY: "True"
SILKY_INTERCEPT_PERCENT: "100"
SILKY_ANALYZE_QUERIES: "False"

worker:
IS_WEBSERVER: "False"
Expand Down
11 changes: 11 additions & 0 deletions k8s/memcached/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
resources:
requests:
cpu: 10m
memory: 75Mi
limits:
cpu: 25m
memory: 500Mi

args:
- /run.sh
- -I 100m
2 changes: 1 addition & 1 deletion src/spacelaunchnow/settings/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,4 +422,4 @@ def get_user_permissions(user):
SILKY_AUTHORISATION = True # User must have permissions
SILKY_PERMISSIONS = get_user_permissions
SILKY_INTERCEPT_PERCENT = env.int("SILKY_INTERCEPT_PERCENT", 50)
SILKY_ANALYZE_QUERIES = env.bool("SILKY_ANALYZE_QUERIES", True)
SILKY_ANALYZE_QUERIES = env.bool("SILKY_ANALYZE_QUERIES", False)

0 comments on commit 2381896

Please sign in to comment.