Skip to content

Commit 708fc65

Browse files
authored
Merge pull request #1 from code-kern-ai/third-party-versions
Add versions of third party services to template
2 parents e6f3aa5 + 3684c0e commit 708fc65

File tree

7 files changed

+25
-13
lines changed

7 files changed

+25
-13
lines changed

replace_release_build

100644100755
File mode changed.

templates/docker-compose.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: "3.9"
22

33
services:
44
kratos-migrate:
5-
image: oryd/kratos:v0.8.0-alpha.2-sqlite
5+
image: oryd/kratos:{KRATOS}
66
environment:
77
- DSN=sqlite:///var/lib/sqlite/db.sqlite?_fk=true&mode=rwc
88
volumes:
@@ -19,7 +19,7 @@ services:
1919
kratos:
2020
depends_on:
2121
- kratos-migrate
22-
image: oryd/kratos:v0.8.0-alpha.2-sqlite
22+
image: oryd/kratos:{KRATOS}
2323
restart: unless-stopped
2424
environment:
2525
- DSN=sqlite:///var/lib/sqlite/db.sqlite?_fk=true
@@ -33,7 +33,7 @@ services:
3333
- default
3434

3535
oathkeeper:
36-
image: oryd/oathkeeper:v0.38.15-beta.1
36+
image: oryd/oathkeeper:{OATHKEEPER}
3737
depends_on:
3838
- kratos
3939
ports:
@@ -56,7 +56,7 @@ services:
5656
- default
5757

5858
mailhog:
59-
image: mailhog/mailhog:latest
59+
image: mailhog/mailhog:{MAILHOG}
6060
ports:
6161
- 1025:1025
6262
- 4436:8025
@@ -132,7 +132,7 @@ services:
132132
- default
133133

134134
graphql-postgres:
135-
image: docker.io/postgres:13
135+
image: docker.io/postgres:{POSTGRES}
136136
restart: always
137137
ports:
138138
- 7052:5432
@@ -147,7 +147,7 @@ services:
147147
- {LOCAL_VOLUME_POSTGRES}:/var/lib/postgresql/data
148148

149149
qdrant:
150-
image: qdrant/qdrant:v0.9.1
150+
image: qdrant/qdrant:{QDRANT}
151151
restart: always
152152
ports:
153153
- 6333:6333
@@ -176,7 +176,7 @@ services:
176176
- default
177177

178178
object-storage:
179-
image: docker.io/minio/minio:latest
179+
image: docker.io/minio/minio:{MINIO}
180180
restart: always
181181
ports:
182182
- 7053:9000

util/constants.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,7 @@
1212
JWKS_PATH = "/refinery/oathkeeper/jwks.json"
1313
PG_CONTAINER = "graphql-postgres"
1414
POSTGRES_MIGRATE_CONTAINER = "postgres-migrate"
15+
REFINERY = "REFINERY"
1516
SERVICE_VERSIONS = "/refinery/versions.json"
1617
SETTINGS = "/refinery/settings.json"
18+
THIRD_PARTY = "THIRD_PARTY"

util/docker_helper.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,15 @@
99
SERVICE_VERSIONS,
1010
JWKS_PATH,
1111
POSTGRES_MIGRATE_CONTAINER,
12+
REFINERY,
1213
)
1314

1415
client = docker.from_env()
1516

1617

1718
def check_and_pull_exec_env_images() -> None:
1819
with open(SERVICE_VERSIONS, "r") as f:
19-
versions = json.load(f)
20+
versions = json.load(f)[REFINERY]
2021

2122
for exec_env, image_name in EXEC_ENVS.items():
2223
image_tag = versions[exec_env]

util/postgres_helper.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@
44
from datetime import datetime
55
from typing import Dict
66
from zipfile import ZipFile
7-
from util.constants import BACKUP_DIR, CONNECTION_STRING, PG_CONTAINER, SERVICE_VERSIONS
7+
from util.constants import (
8+
BACKUP_DIR,
9+
CONNECTION_STRING,
10+
PG_CONTAINER,
11+
SERVICE_VERSIONS,
12+
REFINERY,
13+
)
814
from util.docker_helper import exec_command_on_container
915

1016

@@ -61,7 +67,7 @@ def get_db_versions() -> Dict[str, str]:
6167
def update_db_versions() -> bool:
6268

6369
with open(SERVICE_VERSIONS, "r") as f:
64-
current_versions = json.load(f)
70+
current_versions = json.load(f)[REFINERY]
6571
db_versions = get_db_versions()
6672

6773
# update existing service versions

util/template_processor.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
DOCKER_COMPOSE_TEMPLATE,
77
SERVICE_VERSIONS,
88
SETTINGS,
9+
REFINERY,
10+
THIRD_PARTY,
911
)
1012
from util.docker_helper import get_credential_ip
1113

@@ -27,7 +29,8 @@ def process_docker_compose_template(refinery_dir: str, minio_endpoint: str) -> N
2729
settings[volume] = os.path.normpath(os.path.join(refinery_dir, rel_path))
2830

2931
docker_compose = template.format(
30-
**versions,
32+
**versions[REFINERY],
33+
**versions[THIRD_PARTY],
3134
**settings,
3235
**{
3336
"CRED_ENDPOINT": cred_endpoint,

util/update_helper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import json
22
import time
33
from typing import List
4-
from util.constants import SERVICE_VERSIONS
4+
from util.constants import SERVICE_VERSIONS, REFINERY
55
from util.docker_helper import is_uvicorn_application_started, exec_command_on_container
66
from util.postgres_helper import get_db_versions, wait_until_postgres_is_ready
77

88

99
def is_any_service_version_changed() -> bool:
1010
with open(SERVICE_VERSIONS, "r") as f:
11-
current_versions = json.load(f)
11+
current_versions = json.load(f)[REFINERY]
1212

1313
db_versions = get_db_versions()
1414

0 commit comments

Comments
 (0)