Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9336750
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
11 KB
Subscribers
None
View Options
diff --git a/kubernetes/30-webapp.yml b/kubernetes/30-webapp.yml
index e5c6de0..35514e8 100644
--- a/kubernetes/30-webapp.yml
+++ b/kubernetes/30-webapp.yml
@@ -1,308 +1,310 @@
---
apiVersion: v1
kind: ConfigMap
metadata:
name: webapp
data:
config.yml: |
storage:
cls: remote
args:
url: http://storage:5002/
timeout: 1
objstorage:
cls: remote
args:
url: http://objstorage:5003/
- # indexer_storage:
- # cls: remote
- # args:
- # url: http://indexer-storage:5007/
+ indexer_storage:
+ cls: remote
+ args:
+ url: http://idx-storage:5007/
scheduler:
cls: remote
args:
url: http://scheduler:5008/
vault:
cls: remote
args:
url: http://vault:5005/
# deposit:
# private_api_url: https://deposit:5006/1/private/
# private_api_user: swhworker
# private_api_password: ''
# TODO: remove the *
allowed_hosts:
- "*"
- appserver
debug: yes
serve_assets: yes
history_counters_url: http://counters:5011/counters_history/history.json
# TODO find a way to make this dynamic
production_db:
host: web-db
port: 5432
name: swh-web
user: swh
password: swh
throttling:
cache_uri: memcached:11211
scopes:
swh_api:
limiter_rate:
default: 120/h
exempted_networks:
- 0.0.0.0/0
swh_api_origin_search:
limiter_rate:
default: 70/m
exempted_networks:
- 0.0.0.0/0
swh_api_origin_visit_latest:
limiter_rate:
default: 700/m
exempted_networks:
- 0.0.0.0/0
swh_vault_cooking:
limiter_rate:
default: 120/h
exempted_networks:
- 0.0.0.0/0
swh_save_origin:
limiter_rate:
default: 120/h
exempted_networks:
- 0.0.0.0/0
search:
cls: remote
url: http://search:5010/
+ metadata_search_backend: swh-search
+
entrypoint-init.sh: |
#!/bin/bash
set -e
source /srv/softwareheritage/utils/pgsql.sh
create_admin_script="
from django.contrib.auth import get_user_model
username = 'admin';
password = 'admin';
email = 'admin@swh-web.org';
User = get_user_model();
if not User.objects.filter(username = username).exists():
User.objects.create_superuser(username, email, password);
"
echo "waiting for database availability"
wait_pgsql ${PGDATABASE}
echo "Migrating db using ${DJANGO_SETTINGS_MODULE}"
django-admin migrate --settings=${DJANGO_SETTINGS_MODULE}
echo "Creating Django admin user"
echo "$create_admin_script" | python3 -m swh.web.manage shell
entrypoint.sh: |
#!/bin/bash
set -e
echo "starting the swh-web server"
exec gunicorn --bind 0.0.0.0:5004 \
--threads 2 \
--workers 2 \
--timeout 3600 \
--access-logfile '-' \
--config 'python:swh.web.gunicorn_config' \
'django.core.wsgi:get_wsgi_application()'
---
apiVersion: v1
kind: Service
metadata:
name: memcached
spec:
type: ClusterIP
selector:
app: memcached
ports:
- port: 11211
targetPort: 11211
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: memcached
labels:
app: memcached
spec:
replicas: 1
selector:
matchLabels:
app: memcached
template:
metadata:
labels:
app: memcached
spec:
containers:
- name: memcached
image: memcached
imagePullPolicy: Always
resources:
limits:
memory: "128Mi"
cpu: "100m"
---
apiVersion: v1
kind: Service
metadata:
name: webapp
spec:
selector:
app: webapp
ports:
- port: 5004
targetPort: 5004
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: webapp
labels:
name: webapp
spec:
rules:
- host: webapp.default
http:
paths:
- pathType: Prefix
path: "/"
backend:
service:
name: webapp
port:
number: 5004
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: webapp
spec:
selector:
matchLabels:
app: webapp
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
template:
metadata:
labels:
app: webapp
spec:
initContainers:
- name: web-init
image: swh/webapp:latest
imagePullPolicy: Always
command:
- /entrypoint.sh
env:
- name: PGHOST
value: "web-db"
- name: PGUSER
valueFrom:
configMapKeyRef:
name: web-db
key: POSTGRES_USER
- name: PGPASSWORD
valueFrom:
secretKeyRef:
name: web-db
key: POSTGRES_PASSWORD
- name: PGDATABASE
valueFrom:
configMapKeyRef:
name: web-db
key: POSTGRES_DB
- name: DJANGO_SETTINGS_MODULE
value: swh.web.settings.production
volumeMounts:
- name: db-password
mountPath: /run/secrets/postgres-password
subPath: POSTGRES_PASSWORD
readOnly: true
- name: config
mountPath: /entrypoint.sh
subPath: entrypoint-init.sh
readOnly: true
containers:
- name: webapp
image: swh/webapp:latest
imagePullPolicy: Always
command:
- /entrypoint.sh
readinessProbe:
httpGet:
path: /
port: 5004
scheme: "HTTP"
initialDelaySeconds: 0
failureThreshold: 2
periodSeconds: 10
startupProbe:
httpGet:
path: /
port: 5004
scheme: "HTTP"
initialDelaySeconds: 5
failureThreshold: 30
periodSeconds: 1
resources:
requests:
memory: "196Mi"
cpu: "50m"
limits:
memory: "256Mi"
cpu: "512m"
ports:
- containerPort: 5004
env:
- name: PORT
value: "5004"
- name: VERBOSITY
value: "3"
- name: DJANGO_SETTINGS_MODULE
value: swh.web.settings.production
- name: SWH_CONFIG_FILENAME
value: /etc/softwareheritage/config.yml
volumeMounts:
- name: config
mountPath: /etc/softwareheritage/config.yml
subPath: config.yml
readOnly: true
- name: config
mountPath: /entrypoint.sh
subPath: entrypoint.sh
readOnly: true
volumes:
- name: config
configMap:
name: webapp
defaultMode: 0777
- name: db-password
secret:
secretName: web-db
diff --git a/kubernetes/56-search-journal-client.yml b/kubernetes/56-search-journal-client.yml
index c694f2a..308adbc 100644
--- a/kubernetes/56-search-journal-client.yml
+++ b/kubernetes/56-search-journal-client.yml
@@ -1,79 +1,139 @@
---
apiVersion: v1
kind: ConfigMap
metadata:
name: search-journal-client
data:
config-journal-client-objects.yml: |
search:
cls: remote
url: http://search:5010/
journal:
brokers:
- kafka
group_id: swh.search.journal_client
prefix: swh.journal.objects
object_types:
- origin
- origin_visit
- origin_visit_status
+ config-journal-client-indexed.yml: |
+ search:
+ cls: remote
+ url: http://search:5010/
+ journal:
+ brokers:
+ - kafka
+ group_id: swh.search.journal_client.indexed
+ prefix: swh.journal.indexed
+ object_types:
+ - origin_intrinsic_metadata
entrypoint-journal-client-objects.sh: |
#!/bin/bash
set -e
wait-for-it kafka:9092 -s --timeout=0
wait-for-it search:5010 -s --timeout=0
swh --log-level INFO search \
--config-file /etc/softwareheritage/config.yml \
journal-client objects
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: search-journal-client-objects
labels:
app: search-journal-client-objects
spec:
replicas: 1
selector:
matchLabels:
app: search-journal-client-objects
strategy:
type: Recreate
template:
metadata:
labels:
app: search-journal-client-objects
spec:
containers:
- name: search-journal-client-objects
image: swh/search:latest
imagePullPolicy: Always
command:
- /entrypoint.sh
env:
- name: SWH_CONFIG_FILENAME
value: /etc/softwareheritage/config.yml
volumeMounts:
- name: config
mountPath: /etc/softwareheritage/config.yml
subPath: config-journal-client-objects.yml
readOnly: true
- name: config
mountPath: /entrypoint.sh
subPath: entrypoint-journal-client-objects.sh
readOnly: true
resources:
requests:
memory: "50Mi"
cpu: "20m"
limits:
memory: "100Mi"
cpu: "100m"
volumes:
- name: config
configMap:
name: search-journal-client
defaultMode: 0777
+---
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: search-journal-client-indexed
+ labels:
+ app: search-journal-client-indexed
+spec:
+ replicas: 1
+ selector:
+ matchLabels:
+ app: search-journal-client-indexed
+ strategy:
+ type: Recreate
+ template:
+ metadata:
+ labels:
+ app: search-journal-client-indexed
+ spec:
+ containers:
+ - name: search-journal-client-indexed
+ image: swh/search:latest
+ imagePullPolicy: Always
+ command:
+ - /entrypoint.sh
+ env:
+ - name: SWH_CONFIG_FILENAME
+ value: /etc/softwareheritage/config.yml
+ volumeMounts:
+ - name: config
+ mountPath: /etc/softwareheritage/config.yml
+ subPath: config-journal-client-indexed.yml
+ readOnly: true
+ - name: config
+ mountPath: /entrypoint.sh
+ subPath: entrypoint-journal-client-objects.sh
+ readOnly: true
+ resources:
+ requests:
+ memory: "50Mi"
+ cpu: "20m"
+ limits:
+ memory: "100Mi"
+ cpu: "100m"
+ volumes:
+ - name: config
+ configMap:
+ name: search-journal-client
+ defaultMode: 0777
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Jul 4 2025, 7:42 AM (10 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3333170
Attached To
rDENV Development environment
Event Timeline
Log In to Comment