Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: python 3.12 #3506

Merged
merged 5 commits into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 24 additions & 44 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,50 +1,30 @@
SNAPI_VERSION=v1.2.3
DEBUG=1
SECRET_KEY='django-insecure-2kkmxbid^6w20^-5c#g+*@b%sl@0e1j85%@)yh(&t_z@hkqxvu'
DB_NAME=dummydb
DB_USER=dummyuser
DB_HOST=dummyhost
DB_PASSWORD=dummypassword
DB_PORT=5432
DATABASE_URL=postgres://${DB_USER}:${DB_PASSWORD}@${DB_HOST}:${DB_PORT}/${DB_NAME}
LL_URL=https://ll.thespacedevs.com/2.2.0
LL_TOKEN=dummytoken
CELERY_BROKER_URL=rabbitmq
CSRF_TRUSTED_ORIGIN=http://127.0.0.1

USE_MINIO=False
MINIO_ACCESS_KEY=dummykey
MINIO_SECRET_KEY=dummysecret
MINIO_BUCKET_NAME=dummybucket
MINIO_ENDPOINT=dummyendpoint
SNAPI_VERSION=4-develop
DEBUG=true

# Sentry
SENTRY_DSN=dummydsn

# AMQP settings for the import queue
AMQP_HOST=localhost
AMQP_HOST=rabbitmq
AMQP_PORT=5672
AMQP_USERNAME=guest
AMQP_PASSWORD=guest
AMQP_VHOST=/
AMQP_USERNAME=snapi-api
AMQP_PASSWORD=cCd7McCB966LidKtzev2iEgQ9itg
AMQP_VHOST=spaceflightnewsapiv3
AMQP_QUEUE=snapiv4
AMQP_EXCHANGE=importer
CELERY_BROKER_URL=amqp://${AMQP_USERNAME}:${AMQP_PASSWORD}@${AMQP_HOST}:${AMQP_PORT}/${AMQP_VHOST}

CSRF_TRUSTED_ORIGIN=http://localhost

LL_TOKEN=ae715685a458b03b5e1118bc99ee2d5920187fff
LL_URL=https://ll.thespacedevs.com/2.2.0

SECRET_KEY='django-insecure-2kkmxbid^6w20^-5c#g+*@b%sl@0e1j85%@)yh(&t_z@hkqxvu'

DB_HOST=database
DB_NAME=snapy
DB_USER=snapy-sa
DB_PASSWORD=Welkom123
DATABASE_URL=postgres://${DB_USER}:${DB_PASSWORD}@${DB_HOST}:5432/${DB_NAME}

# S3
USE_S3=true
AWS_ACCESS_KEY_ID=wejgnwkjegnwjkeg
AWS_SECRET_ACCESS_KEY=qwfqjgiowerjigo24
AWS_STORAGE_BUCKET_NAME=somebucket

# MQ Specific settings, for the importer. They might overlap with the AMQP settings but will soon be migrated.
DATABASE_HOST=${DB_HOST}
DATABASE_NAME=${DB_NAME}
DATABASE_PASSWORD=${DB_PASSWORD}
DATABASE_PORT=${DB_PORT}
DATABASE_USERNAME=${DB_USER}
MQ_HOST=${AMQP_HOST}
MQ_PASSWORD=${AMQP_PASSWORD}
MQ_PORT=${AMQP_PORT}
MQ_USERNAME=${AMQP_USERNAME}
MQ_VIRTUALHOST=snapi_vhost
USE_SSL=false
USE_S3=false
AWS_ACCESS_KEY_ID=DO00P9FFXXY8WWA98YDN
AWS_SECRET_ACCESS_KEY=JeRC1BBg2fZKVhcJO6LZs54fxEqMmrxGuBR09UjpfhA
AWS_STORAGE_BUCKET_NAME=snapi-dev
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- uses: actions/setup-python@v5
with:
cache: 'pip'
python-version: '3.11'
python-version: '3.12'

- name: Install dependencies
run: |
Expand All @@ -56,7 +56,7 @@ jobs:
uses: actions/setup-python@v5
with:
cache: 'pip'
python-version: "3.11"
python-version: "3.12"

- name: Install dependencies
run: |
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.11-slim AS base
FROM python:3.12-slim AS base

ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
Expand Down
33 changes: 27 additions & 6 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
version: "3.8"

volumes:
database:
rabbitmq:

services:
database:
image: postgres:15-alpine
restart: unless-stopped
healthcheck:
test: [ "CMD-SHELL", "pg_isready" ]
interval: 10s
test: [ "CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}"]
interval: 2s
timeout: 5s
retries: 5
retries: 15
volumes:
- database:/var/lib/postgresql/data
environment:
Expand All @@ -27,7 +26,7 @@ services:
- "5672:5672"
- "15672:15672"
volumes:
- rabbitmq:/var/lib/rabbitmq/
- rabbitmq:/var/lib/rabbitmq

consumer:
build:
Expand All @@ -38,3 +37,25 @@ services:
depends_on:
database:
condition: service_healthy


beat:
build:
context: .
restart: unless-stopped
command: celery -A snapy beat -l INFO
env_file: .env
depends_on:
database:
condition: service_healthy


worker:
build:
context: .
restart: unless-stopped
command: celery -A snapy worker -l INFO
env_file: .env
depends_on:
database:
condition: service_healthy
5 changes: 3 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ networks:
services:
database:
image: postgres:15-alpine
restart: unless-stopped
healthcheck:
test: [ "CMD-SHELL", "pg_isready" ]
test: [ "CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}" ]
interval: 2s
timeout: 5s
retries: 15
Expand All @@ -38,7 +39,7 @@ services:
python manage.py collectstatic --no-input &&
python manage.py migrate --no-input &&
python manage.py createdefaulttasks &&
gunicorn snapy.wsgi:application --workers 13 --bind 0.0.0.0:8000 --access-logfile - --disable-redirect-access-to-syslog
gunicorn snapy.wsgi:application --workers 4 --bind 0.0.0.0:8000 --access-logfile - --disable-redirect-access-to-syslog
networks:
- snapy
- nginx-proxy-manager_default
Expand Down
Loading