-
-
Notifications
You must be signed in to change notification settings - Fork 277
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1644 from Sefaria/elasticsearch-8-compat
Elasticsearch 8 compat
- Loading branch information
Showing
25 changed files
with
1,153 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -179,6 +179,8 @@ cronJobs: | |
enabled: true | ||
reindexElasticSearch: | ||
enabled: true | ||
SEARCH_HOST_ES6: "elasticsearch-data" | ||
SEARCH_HOST_ES8: "elasticsearch-es-http.elasticsearch.svc" | ||
topicsIndexing: | ||
enabled: true | ||
trello: | ||
|
@@ -206,7 +208,7 @@ localSettings: | |
} | ||
MONGO_HOST: "mongo" | ||
APSCHEDULER_NAME: "apscheduler-{{ .Values.deployEnv }}" | ||
SEARCH_ADMIN: "http://elasticsearch-data:9200" | ||
SEARCH_URL: "http://elasticsearch-data:9200" | ||
TURN_SERVER: '' | ||
USE_CLOUDFLARE: false | ||
FRONT_END_URL: "http://www.sefaria.org" | ||
|
@@ -216,7 +218,6 @@ localSettings: | |
GLOBAL_WARNING: false | ||
GLOBAL_WARNING_MESSAGE: "Sefaria will be in <b>Read-Only</b> mode for scheduled maintenance from 4:45pm-6:45pm Pacific time. Edits will <b>not</b> be saved during that time." | ||
SITE_PACKAGE: "sites.sefaria" | ||
SEARCH_HOST: elasticsearch.data | ||
DEFAULT_FROM_EMAIL: "Sefaria <[email protected]>" | ||
SERVER_EMAIL: "[email protected]" | ||
MULTISERVER_ENABLED: "True" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 77 additions & 0 deletions
77
helm-chart/sefaria-project/templates/cronjob/reindex-elasticsearch-es6.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
{{- if .Values.cronJobs.reindexElasticSearch.enabled }} | ||
--- | ||
apiVersion: batch/v1 | ||
kind: CronJob | ||
metadata: | ||
name: {{ .Values.deployEnv }}-reindex-elastic-search-es6 | ||
labels: | ||
{{- include "sefaria.labels" . | nindent 4 }} | ||
spec: | ||
schedule: "20 13 * * 0" | ||
jobTemplate: | ||
spec: | ||
backoffLimit: 1 | ||
template: | ||
spec: | ||
affinity: | ||
podAntiAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
- labelSelector: | ||
matchExpressions: | ||
- key: app | ||
operator: In | ||
values: | ||
- mongo | ||
topologyKey: kubernetes.io.hostname | ||
containers: | ||
- name: reindex-elastic-search-es6 | ||
image: "{{ .Values.web.containerImage.imageRegistry }}:{{ .Values.web.containerImage.tag }}" | ||
resources: | ||
limits: | ||
memory: 9Gi | ||
requests: | ||
memory: 7Gi | ||
env: | ||
- name: SEARCH_HOST | ||
value: "{{ .Values.cronjobs.reindexElasticSearch.SEARCH_HOST_ES6 }}" | ||
- name: REDIS_HOST | ||
value: "redis-{{ .Values.deployEnv }}" | ||
- name: NODEJS_HOST | ||
value: "node-{{ .Values.deployEnv }}-{{ .Release.Revision }}" | ||
- name: VARNISH_HOST | ||
value: "varnish-{{ .Values.deployEnv }}-{{ .Release.Revision }}" | ||
- name: SLACK_URL | ||
valueFrom: | ||
secretKeyRef: | ||
name: {{ template "sefaria.secrets.slackWebhook" . }} | ||
key: slack-webhook | ||
envFrom: | ||
- secretRef: | ||
name: {{ .Values.secrets.localSettings.ref }} | ||
optional: true | ||
- configMapRef: | ||
name: local-settings-{{ .Values.deployEnv }} | ||
- secretRef: | ||
name: local-settings-secrets-{{ .Values.deployEnv }} | ||
optional: true | ||
volumeMounts: | ||
- mountPath: /app/sefaria/local_settings.py | ||
name: local-settings | ||
subPath: local_settings.py | ||
readOnly: true | ||
command: ["bash"] | ||
args: [ | ||
"-c", | ||
"mkdir -p /log && touch /log/sefaria_book_errors.log && pip install numpy && /app/run /app/scripts/reindex_elasticsearch_cronjob_ES6.py" | ||
] | ||
restartPolicy: Never | ||
volumes: | ||
- name: local-settings | ||
configMap: | ||
name: local-settings-file-{{ .Values.deployEnv }} | ||
items: | ||
- key: local_settings.py | ||
path: local_settings.py | ||
successfulJobsHistoryLimit: 1 | ||
failedJobsHistoryLimit: 2 | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ metadata: | |
labels: | ||
{{- include "sefaria.labels" . | nindent 4 }} | ||
spec: | ||
schedule: "20 13 * * 0" | ||
schedule: "20 13 * * 2" | ||
jobTemplate: | ||
spec: | ||
backoffLimit: 1 | ||
|
@@ -32,6 +32,8 @@ spec: | |
requests: | ||
memory: 7Gi | ||
env: | ||
- name: SEARCH_HOST | ||
value: "{{ .Values.cronjobs.reindexElasticSearch.SEARCH_HOST_ES8 }}" | ||
- name: REDIS_HOST | ||
value: "redis-{{ .Values.deployEnv }}" | ||
- name: NODEJS_HOST | ||
|
@@ -44,14 +46,16 @@ spec: | |
name: {{ template "sefaria.secrets.slackWebhook" . }} | ||
key: slack-webhook | ||
envFrom: | ||
- secretRef: | ||
name: {{ template "sefaria.secrets.elasticAdmin" . }} | ||
- secretRef: | ||
name: {{ .Values.secrets.localSettings.ref }} | ||
optional: true | ||
- configMapRef: | ||
name: local-settings-{{ .Values.deployEnv }} | ||
- secretRef: | ||
name: local-settings-secrets-{{ .Values.deployEnv }} | ||
optional: true | ||
- configMapRef: | ||
name: local-settings-{{ .Values.deployEnv }} | ||
volumeMounts: | ||
- mountPath: /app/sefaria/local_settings.py | ||
name: local-settings | ||
|
@@ -60,7 +64,7 @@ spec: | |
command: ["bash"] | ||
args: [ | ||
"-c", | ||
"mkdir -p /log && touch /log/sefaria_book_errors.log && pip install numpy && /app/run /app/scripts/reindex_elasticsearch_cronjob.py" | ||
"mkdir -p /log && touch /log/sefaria_book_errors.log && pip install numpy elasticsearch==8.8.2 git+https://github.com/Sefaria/[email protected]#egg=elasticsearch-dsl && /app/run /app/scripts/reindex_elasticsearch_cronjob.py" | ||
] | ||
restartPolicy: Never | ||
volumes: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
helm-chart/sefaria-project/templates/secret/elastic-admin.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{{- if .Values.secrets.elasticAdmin.data }} | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: elastic-admin-{{ .Values.deployEnv }} | ||
labels: | ||
deployEnv: "{{ .Values.deployEnv }}" | ||
{{- include "sefaria.labels" . | nindent 4 }} | ||
type: Opaque | ||
stringData: {{ .Values.secrets.elasticAdmin.data | toYaml | nindent 2 }} | ||
{{- end }} |
11 changes: 11 additions & 0 deletions
11
helm-chart/sefaria-project/templates/secret/elastic-user.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{{- if .Values.secrets.elasticUser.data }} | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: elastic-user-{{ .Values.deployEnv }} | ||
labels: | ||
deployEnv: "{{ .Values.deployEnv }}" | ||
{{- include "sefaria.labels" . | nindent 4 }} | ||
type: Opaque | ||
stringData: {{ .Values.secrets.elasticUser.data | toYaml | nindent 2 }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.