Skip to content

Commit d9d08d1

Browse files
authored
Pin versions of Postgres, Redis, Python and uv in CI, Dockerfile and Docker composes (#950)
…Docker composes # Description ## Summary <!--BRIEF description: DONT'T EXPLAIN the code: JUSTIFY what this PR is for!--> That's obvious <!--#### Sources at the end--> ## Related PR Subset of #944 ## Changes Made <!--DESCRIBE the changes: tell the BIG STEPS, use a CHECKLIST to show progress. You can explain below how the code works.--> See diff <!--Don't touch thses two tags--> <details> <summary> # Classification </summary> ## Type of Change - [ ] 🐛 Bug fix (non-breaking change which fixes an issue) - [ ] ✨ New feature (non-breaking change which adds functionality) - [ ] 🔨 Refactor (non-breaking change that neither fixes a bug nor adds a feature) - [x] 🔧 Infra CI/CD (changes to configs of workflows) - [ ] 💥 BREAKING CHANGE (fix or feature that require a new minimal version of the front-end) - [x] 😶‍🌫️ No impact for the end-users ## Impact & Scope - [ ] Core functionality changes - [ ] Single module changes - [ ] Multiple modules changes - [ ] Database migrations required - [x] Other: ... <!--Not module-oriented: write something!--> ## Testing - [x] 1. Tested this locally - [ ] 2. Added/modified tests that pass the CI (or tested in a downstream fork) - [ ] 3. Tested in a deployed pre-prod - [ ] 0. Untestable (exceptionally), will be tested in prod directly ## Documentation - [ ] Updated [the docs](docs.myecl.fr) accordingly : <!--[Docs#0 - Title](https://github.com/aeecleclair/myecl-documentation/pull/0)--> - [ ] `"` Docstrings - [ ] `#` Inline comments - [ ] No documentation needed </details>
1 parent 457e7ae commit d9d08d1

6 files changed

Lines changed: 23 additions & 18 deletions

File tree

.github/workflows/lintandformat.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
uses: actions/setup-python@v6
2020
id: setup-python
2121
with:
22-
python-version: "3.14"
22+
python-version-file: .python-version
2323

2424
- name: Cache uv folder
2525
id: cache-uv
@@ -29,7 +29,7 @@ jobs:
2929
key: ${{ runner.os }}-python-${{ steps.setup-python.outputs.python-version }}-uv-${{ hashFiles('requirements.txt', 'requirements-dev.txt') }}
3030

3131
- name: Install uv
32-
run: curl -LsSf https://astral.sh/uv/install.sh | sh
32+
run: curl -LsSf https://astral.sh/uv/0.9.27/install.sh | sh
3333

3434
- name: Install dependencies
3535
run: uv pip install --system -r requirements-dev.txt

.github/workflows/test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
# Label used to access the service container
2121
redis:
2222
# Docker Hub image
23-
image: redis
23+
image: redis:7.0-alpine3.17
2424
# Set health checks to wait until redis has started
2525
options: >-
2626
--health-cmd "redis-cli ping"
@@ -32,7 +32,7 @@ jobs:
3232
- 6379:6379
3333
postgres:
3434
# Docker Hub image
35-
image: "postgres:15.1"
35+
image: postgres:15.1-alpine3.17
3636
# Provide the password for postgres
3737
env:
3838
POSTGRES_PASSWORD: "somerealpassword"
@@ -60,7 +60,7 @@ jobs:
6060
uses: actions/setup-python@v6
6161
id: setup-python
6262
with:
63-
python-version: "3.14"
63+
python-version-file: .python-version
6464

6565
- name: Cache uv folder
6666
id: cache-uv
@@ -70,7 +70,7 @@ jobs:
7070
key: ${{ runner.os }}-python-${{ steps.setup-python.outputs.python-version }}-uv-${{ hashFiles('requirements.txt', 'requirements-dev.txt') }}
7171

7272
- name: Install uv
73-
run: curl -LsSf https://astral.sh/uv/install.sh | sh
73+
run: curl -LsSf https://astral.sh/uv/0.9.27/install.sh | sh
7474

7575
- name: Install dependencies
7676
run: uv pip install --system -r requirements-dev.txt

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ __pycache__/
44
.pytest_cache/
55
.ruff_cache/
66

7-
# Databases (PostgreSQL and SQLite)
7+
# Databases (PostgreSQL and SQLite) and Redis volumes
8+
hyperion-redis/
89
hyperion-db/
910
*.db
1011

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ghcr.io/astral-sh/uv:python3.14-trixie-slim
1+
FROM ghcr.io/astral-sh/uv:0.9.27-python3.14-trixie-slim
22

33
# Default number of workers; can be overridden at runtime
44
ENV WORKERS=1
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
services:
22
hyperion-db:
3-
image: postgres
3+
image: postgres:15.1-alpine3.17
44
container_name: hyperion-db-dev
55
restart: unless-stopped
66
environment:
@@ -12,14 +12,16 @@ services:
1212
ports:
1313
- 5432:5432
1414
volumes:
15-
- hyperion_db_data:/var/lib/postgresql/data
15+
- ./hyperion-db:/var/lib/postgresql/data
1616

1717
hyperion-redis:
18-
image: redis
18+
image: redis:7.0-alpine3.17
1919
container_name: hyperion-redis-dev
2020
restart: unless-stopped
2121
ports:
2222
- 6379:6379
23+
volumes:
24+
- ./hyperion-redis:/data
2325

2426
volumes:
2527
hyperion_db_data:
Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
services:
22
hyperion-db:
3-
image: postgres
3+
image: postgres:15.1-alpine3.17
44
container_name: hyperion-db
55
restart: unless-stopped
66
healthcheck:
@@ -14,15 +14,17 @@ services:
1414
POSTGRES_DB: ${POSTGRES_DB}
1515
PGTZ: ${POSTGRES_TZ}
1616
volumes:
17-
- ./hyperion_db_data:/var/lib/postgresql/data:Z
17+
- ./hyperion-db:/var/lib/postgresql/data
1818

1919
hyperion-redis:
20-
image: redis
20+
image: redis:7.0-alpine3.17
2121
container_name: hyperion-redis
2222
restart: unless-stopped
2323
command: redis-server --requirepass ${REDIS_PASSWORD}
2424
environment:
2525
REDIS_PASSWORD: ${REDIS_PASSWORD}
26+
volumes:
27+
- ./hyperion-redis:/data
2628

2729
hyperion-app:
2830
build:
@@ -39,7 +41,7 @@ services:
3941
- 8000:8000
4042
env_file: .env
4143
volumes:
42-
- ./logs:/hyperion/logs:Z
43-
- ./data:/hyperion/data:Z
44-
- ./config.yaml:/hyperion/config.yaml:Z
45-
- ./firebase.json:/hyperion/firebase.json:Z
44+
- ./logs:/hyperion/logs
45+
- ./data:/hyperion/data
46+
- ./config.yaml:/hyperion/config.yaml
47+
- ./firebase.json:/hyperion/firebase.json

0 commit comments

Comments
 (0)