Skip to content

Commit f253c3b

Browse files
committed
Merge branch 'develop' of github.com:MetaCell/cloud-harness into feature/CH-216-dev-containers
2 parents 80fd917 + 667020c commit f253c3b

199 files changed

Lines changed: 9171 additions & 8544 deletions

File tree

Some content is hidden

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

application-templates/django-fastapi/backend/django_baseapp/settings.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# Quick-start development settings - unsuitable for production
2121
# See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/
2222

23-
# SECURITY WARNING: keep the secret key used in production secret!
23+
# SECURITY WARNING: keep the secret key used in production secret! TODO change this
2424
SECRET_KEY = "django-insecure-81kv$0=07xac7r(pgz6ndb5t0at4-z@ae6&f@u6_3jo&9d#4kl"
2525

2626
# SECURITY WARNING: don't run with debug turned on in production!
@@ -164,3 +164,4 @@
164164
]
165165

166166
KC_DEFAULT_USER_ROLE = None # don't add the user role to the realm default role
167+
SESSION_COOKIE_AGE = 3600

application-templates/django-ninja/backend/django_baseapp/settings.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# Quick-start development settings - unsuitable for production
2121
# See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/
2222

23-
# SECURITY WARNING: keep the secret key used in production secret!
23+
# SECURITY WARNING: keep the secret key used in production secret! TODO change this
2424
SECRET_KEY = "django-insecure-81kv$0=07xac7r(pgz6ndb5t0at4-z@ae6&f@u6_3jo&9d#4kl"
2525

2626
# SECURITY WARNING: don't run with debug turned on in production!
@@ -165,3 +165,4 @@
165165
]
166166

167167
KC_DEFAULT_USER_ROLE = None # don't add the user role to the realm default role
168+
SESSION_COOKIE_AGE = 3600

applications/accounts/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM quay.io/keycloak/keycloak:26.2.1
1+
FROM quay.io/keycloak/keycloak:26.3.5
22

33
EXPOSE 9000
44
EXPOSE 8080
@@ -15,4 +15,4 @@ COPY themes/custom /opt/keycloak/themes/custom
1515
COPY plugins/metacell-admin-event-listener-module-1.0.0.jar /opt/keycloak/providers/
1616

1717
ENTRYPOINT [ "/opt/keycloak/bin/kc-entrypoint.sh" ]
18-
CMD [ "start-dev", "--import-realm", "--health-enabled=true", "--metrics-enabled=true" ]
18+
CMD [ "start", "--import-realm" ]

applications/accounts/deploy/resources/realm.json

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,72 @@
4545
"duplicateEmailsAllowed": false,
4646
"resetPasswordAllowed": true,
4747
"editUsernameAllowed": true,
48+
"components": {
49+
"org.keycloak.userprofile.UserProfileProvider": [
50+
{
51+
"id": "002b69df-9702-40dd-b73e-3a66d161bf11",
52+
"providerId": "declarative-user-profile",
53+
"subComponents": {},
54+
"config": {
55+
"kc.user.profile.config": [
56+
"{\"attributes\":[{\"name\":\"username\",\"displayName\":\"${username}\",\"validations\":{\"length\":{\"min\":3,\"max\":255},\"username-prohibited-characters\":{},\"up-username-not-idn-homograph\":{}},\"permissions\":{\"view\":[\"admin\",\"user\"],\"edit\":[\"admin\",\"user\"]},\"multivalued\":false},{\"name\":\"email\",\"displayName\":\"${email}\",\"validations\":{\"email\":{},\"length\":{\"max\":255}},\"annotations\":{},\"permissions\":{\"view\":[\"admin\",\"user\"],\"edit\":[\"admin\",\"user\"]},\"multivalued\":false},{\"name\":\"firstName\",\"displayName\":\"${firstName}\",\"validations\":{\"length\":{\"max\":255},\"person-name-prohibited-characters\":{}},\"annotations\":{},\"permissions\":{\"view\":[\"admin\",\"user\"],\"edit\":[\"admin\",\"user\"]},\"multivalued\":false},{\"name\":\"lastName\",\"displayName\":\"${lastName}\",\"validations\":{\"length\":{\"max\":255},\"person-name-prohibited-characters\":{}},\"annotations\":{},\"permissions\":{\"view\":[\"admin\",\"user\"],\"edit\":[\"admin\",\"user\"]},\"multivalued\":false}],\"groups\":[{\"name\":\"user-metadata\",\"displayHeader\":\"User metadata\",\"displayDescription\":\"Attributes, which refer to user metadata\"}]}"
57+
]
58+
}
59+
}
60+
],
61+
"org.keycloak.keys.KeyProvider": [
62+
{
63+
"id": "e632ce46-36ad-421a-b1a5-776383cc1565",
64+
"name": "rsa-generated",
65+
"providerId": "rsa-generated",
66+
"subComponents": {},
67+
"config": {
68+
"priority": [
69+
"100"
70+
]
71+
}
72+
},
73+
{
74+
"id": "b68bee45-a8f0-46ca-b7d9-0df90189736a",
75+
"name": "hmac-generated-hs512",
76+
"providerId": "hmac-generated",
77+
"subComponents": {},
78+
"config": {
79+
"priority": [
80+
"100"
81+
],
82+
"algorithm": [
83+
"HS512"
84+
]
85+
}
86+
},
87+
{
88+
"id": "55960a57-af77-4f4c-8b6e-925c74bb44db",
89+
"name": "aes-generated",
90+
"providerId": "aes-generated",
91+
"subComponents": {},
92+
"config": {
93+
"priority": [
94+
"100"
95+
]
96+
}
97+
},
98+
{
99+
"id": "ce068675-5cae-434e-851f-09f653ccc604",
100+
"name": "rsa-enc-generated",
101+
"providerId": "rsa-enc-generated",
102+
"subComponents": {},
103+
"config": {
104+
"priority": [
105+
"100"
106+
],
107+
"algorithm": [
108+
"RSA-OAEP"
109+
]
110+
}
111+
}
112+
]
113+
},
48114
"users": [
49115
{{- $j := 0}}
50116
{{- range $app := .Values.apps }}

applications/accounts/deploy/values.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,18 @@ harness:
3232
value: "user"
3333
- name: KC_DB_PASSWORD
3434
value: "password"
35+
- name: KC_HTTP_ENABLED
36+
value: "true"
37+
- name: KC_PROXY
38+
value: "edge"
39+
- name: KC_HOSTNAME_STRICT
40+
value: "false"
41+
- name: KC_HOSTNAME_STRICT_HTTPS
42+
value: "false"
43+
- name: KC_HEALTH_ENABLED
44+
value: "true"
45+
- name: KC_METRICS_ENABLED
46+
value: "true"
3547
- name: JAVA_OPTS
3648
value: -server -Xms64m -Xmx896m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true --add-exports=java.base/sun.nio.ch=ALL-UNNAMED --add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED --add-exports=jdk.unsupported/sun.reflect=ALL-UNNAMED
3749
database:

applications/accounts/dev/disable-theme-cache.cli

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 39 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,43 @@
1-
version: '3.2'
2-
1+
name: keycloak-dev
32
services:
43
postgres:
5-
image: postgres
6-
environment:
7-
POSTGRES_DB: keycloak
8-
POSTGRES_USER: keycloak
9-
POSTGRES_PASSWORD: password
10-
PGDATA: /var/lib/postgresql/data/pgdata
11-
volumes:
12-
- pg_data:/var/lib/postgresql/data/pgdata
13-
4+
image: postgres
5+
environment:
6+
POSTGRES_DB: keycloak
7+
POSTGRES_USER: keycloak
8+
POSTGRES_PASSWORD: password
9+
PGDATA: /var/lib/postgresql/data/pgdata
10+
volumes:
11+
- pg_data:/var/lib/postgresql/data/pgdata
1412
keycloak:
15-
image: quay.io/keycloak/keycloak:16.1.1
16-
environment:
17-
DB_VENDOR: POSTGRES
18-
DB_ADDR: postgres
19-
DB_DATABASE: keycloak
20-
DB_USER: keycloak
21-
DB_SCHEMA: public
22-
DB_PASSWORD: password
23-
KEYCLOAK_USER: admin
24-
KEYCLOAK_PASSWORD: Pa55w0rd
25-
26-
ports:
27-
- 8080:8080
28-
depends_on:
29-
- postgres
30-
volumes:
31-
- type: bind
32-
source: ../themes/custom
33-
target: /opt/jboss/keycloak/themes/custom
34-
# disable cache
35-
- type: bind
36-
source: ./disable-theme-cache.cli
37-
target: /opt/jboss/startup-scripts/disable-theme-cache.cli
38-
- type: bind
39-
source: ../scripts/create_api_user.sh
40-
target: /opt/jboss/startup-scripts/create_api_user.sh
41-
- type: bind
42-
source: ../plugins/metacell-admin-event-listener-bundle-1.0.0.ear
43-
target: /opt/jboss/keycloak/standalone/deployments/metacell-admin-event-listener-bundle-1.0.0.ear
13+
image: quay.io/keycloak/keycloak:26.3.4
14+
command: ["start-dev",
15+
"--spi-theme-static-max-age=1",
16+
"--spi-theme-cache-themes=false",
17+
"--spi-theme-cache-templates=false",
18+
"--hostname", "http://localhost:8080",
19+
"--hostname-backchannel-dynamic", "true"]
20+
environment:
21+
KC_DB_VENDOR: POSTGRES
22+
KC_DB_URL_HOST: postgres
23+
KC_DB: postgres
24+
KC_DB_URL_DATABASE: "postgres"
25+
KC_DB_USERNAME: keycloak
26+
KC_DB_PASSWORD: password
27+
KC_BOOTSTRAP_ADMIN_USERNAME: admin
28+
KC_BOOTSTRAP_ADMIN_PASSWORD: Pa55w0rd
29+
KC_HEALTH_ENABLED: "true"
30+
KC_METRICS_ENABLED: "true"
31+
KC_HTTP_ENABLED: "true"
32+
KC_HOSTNAME_STRICT: "false"
33+
KC_HOSTNAME_STRICT_HTTPS: "false"
34+
ports:
35+
- "8080:8080"
36+
depends_on:
37+
- postgres
38+
volumes:
39+
- type: bind
40+
source: ../themes/custom
41+
target: /opt/keycloak/themes/custom
4442
volumes:
45-
pg_data:
43+
pg_data:

applications/common/deploy/values.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ harness:
55
auto: true
66
port: 8080
77
name: common
8+
proxy:
9+
gatekeeper:
10+
replicas: 1
811
deployment:
912
auto: true
1013
name: common

applications/jupyterhub/src/harness_jupyter/harness_jupyter/jupyterhub.py

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -248,18 +248,21 @@ def change_pod_manifest(self: KubeSpawner):
248248

249249
logging.info("Setting user quota cpu/mem usage")
250250

251-
set_key_value(self, key="cpu_guarantee", value=float(user_quotas.get("quota-ws-guaranteecpu", self.cpu_guarantee)))
252-
set_key_value(self, key="cpu_limit", value=float(user_quotas.get("quota-ws-maxcpu", self.cpu_limit)))
253-
set_key_value(self, key="mem_guarantee", value=user_quotas.get("quota-ws-guaranteemem", self.mem_guarantee), unit="G")
254-
set_key_value(self, key="mem_limit", value=user_quotas.get("quota-ws-maxmem", self.mem_limit), unit="G")
255-
# check if there is an applicationHook defined in the values.yaml
256-
# if so then execute the applicationHook function with "self" as parameter
257-
#
258-
# e.g.
259-
# jupyterhub:
260-
# applicationHook: "jupyter.change_pod_manifest"
261-
#
262-
# this will execute jupyter.change_pod_manifest(self=self)
251+
set_key_value(self, key="cpu_guarantee", value=float(user_quotas.get("quota-ws-guaranteecpu", self.cpu_guarantee)))
252+
set_key_value(self, key="cpu_limit", value=float(user_quotas.get("quota-ws-maxcpu", self.cpu_limit)))
253+
set_key_value(self, key="mem_guarantee", value=user_quotas.get("quota-ws-guaranteemem", self.mem_guarantee), unit="G")
254+
set_key_value(self, key="mem_limit", value=user_quotas.get("quota-ws-maxmem", self.mem_limit), unit="G")
255+
256+
# check if there is an applicationHook defined in the values.yaml
257+
# if so then execute the applicationHook function with "self" as parameter
258+
#
259+
# e.g.
260+
# jupyterhub:
261+
# applicationHook: "jupyter.change_pod_manifest"
262+
#
263+
# this will execute jupyter.change_pod_manifest(self=self)
264+
265+
if 'jupyterhub' in harness and harness['jupyterhub']:
263266
if 'applicationHook' in harness['jupyterhub']:
264267
func_name = harness['jupyterhub']['applicationHook'].split('.')
265268
logging.info(f"Executing application hook {func_name}")

applications/samples/deploy/values.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ harness:
1717
usenfs: false
1818
auto: true
1919
port: 8080
20+
proxy:
21+
gatekeeper:
22+
replicas: 1
2023
uri_role_mapping:
2124
- uri: /
2225
white-listed: true

0 commit comments

Comments
 (0)