-
-
Notifications
You must be signed in to change notification settings - Fork 273
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 #1809 from Sefaria/topic-prompt-generator
Topic prompt generator
- Loading branch information
Showing
33 changed files
with
1,190 additions
and
94 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,153 @@ | ||
{{- if .Values.tasks.enabled }} | ||
{{- $QueueConfig := (fromYaml (include "sefaria.tasks.queues" . )) -}} | ||
--- | ||
# apiVersion: apps/v1 | ||
# kind: Deployment | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Rollout | ||
metadata: | ||
name: {{ .Values.deployEnv }}-tasks | ||
labels: | ||
deployEnv: "{{ .Values.deployEnv }}" | ||
app: tasks-{{ .Values.deployEnv }} | ||
# releaseRevision: "{{ .Release.Revision }}" | ||
annotations: | ||
rollout.argoproj.io/revision: "{{ .Release.Revision }}" | ||
spec: | ||
strategy: | ||
blueGreen: | ||
activeService: task-{{ .Values.deployEnv }} | ||
autoPromotionEnabled: true | ||
prePromotionAnalysis: | ||
templates: | ||
# - templateName: rollout-readiness-{{ .Values.deployEnv }} | ||
- templateName: rollout-ready-{{ .Values.deployEnv }} | ||
args: | ||
- name: healthcheck-hostname | ||
value: "nginx-{{ .Values.deployEnv }}-{{ .Release.Revision }}" | ||
{{- if .Values.deploymentMessage }} | ||
postPromotionAnalysis: | ||
templates: | ||
- templateName: rollout-complete-{{ .Values.deployEnv }} | ||
args: | ||
- name: revision | ||
value: "{{ .Release.Revision }}" | ||
- name: deployment | ||
value: {{ .Values.deployEnv }} | ||
- name: version | ||
value: {{ .Values.web.containerImage.tag }} | ||
- name: chartVersion | ||
value: {{ .Chart.Version }} | ||
{{- end }} | ||
selector: | ||
matchLabels: | ||
app: tasks-{{ .Values.deployEnv }} | ||
# releaseRevision: "{{ .Release.Revision }}" | ||
revisionHistoryLimit: 2 | ||
replicas: {{ .Values.tasks.replicaCount }} | ||
progressDeadlineSeconds: 1200 | ||
template: | ||
metadata: | ||
labels: | ||
app: tasks-{{ .Values.deployEnv }} | ||
tier: application | ||
deployEnv: "{{ .Values.deployEnv }}" | ||
stackRole: celery | ||
releaseRevision: "{{ .Release.Revision }}" | ||
spec: | ||
affinity: | ||
podAntiAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
- labelSelector: | ||
matchExpressions: | ||
- key: app | ||
operator: In | ||
values: | ||
- mongo | ||
topologyKey: kubernetes.io/hostname | ||
- labelSelector: | ||
matchExpressions: | ||
- key: app | ||
operator: In | ||
values: | ||
- "tasks-{{ .Values.deployEnv }}" | ||
topologyKey: kubernetes.io/hostname | ||
nodeAffinity: | ||
{{- include "sefaria.nodeAffinities" . | nindent 10 }} | ||
containers: | ||
- name: tasks | ||
image: "{{ .Values.web.containerImage.imageRegistry }}:{{ .Values.web.containerImage.tag }}" | ||
imagePullPolicy: Always | ||
command: ["celery"] | ||
args: ["-A", "sefaria.celery_setup.app","worker", "-Q", "{{ $QueueConfig.tasks }}", "-l", "INFO"] | ||
env: | ||
- name: ENV_NAME | ||
value: "{{ .Values.deployEnv }}" | ||
- name: STACK_COMPONENT | ||
value: tasks | ||
- 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: HELM_REVISION | ||
value: "{{ .Release.Revision }}" | ||
envFrom: | ||
{{- if .Values.tasks.enabled }} | ||
- secretRef: | ||
name: {{ .Values.tasks.redis.sentinelPassword.ref }} | ||
- secretRef: | ||
name: {{ .Values.tasks.redis.redisPassword.ref }} | ||
{{- end }} | ||
- secretRef: | ||
name: {{ template "sefaria.secrets.elasticUser" . }} | ||
- 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-web-{{ .Values.deployEnv }} | ||
optional: true | ||
- secretRef: | ||
name: local-settings-web-secrets-{{ .Values.deployEnv }} | ||
optional: true | ||
resources: {{ toYaml .Values.tasks.resources | nindent 10 }} | ||
volumeMounts: | ||
- mountPath: /app/sefaria/local_settings.py | ||
name: local-settings | ||
subPath: local_settings.py | ||
readOnly: true | ||
- mountPath: /client-secret | ||
name: client-secret | ||
readOnly: true | ||
- mountPath: /app/logging-secret.json | ||
name: logging-secret | ||
subPath: logging-secret.json | ||
readOnly: true | ||
- name: elastic-cert | ||
mountPath: /etc/ssl/certs/elastic | ||
readOnly: true | ||
volumes: | ||
- name: local-settings | ||
configMap: | ||
name: local-settings-file-{{ .Values.deployEnv }} | ||
items: | ||
- key: local_settings.py | ||
path: local_settings.py | ||
- name: elastic-cert | ||
secret: | ||
secretName: {{ template "sefaria.secrets.elasticCertificate" . }} | ||
optional: true | ||
- name: client-secret | ||
secret: | ||
secretName: {{ template "sefaria.secrets.googleClient" . }} # needs to be checked if it's a reference object or the data object we created. | ||
- name: logging-secret | ||
secret: | ||
secretName: {{ template "sefaria.secrets.logging" . }} | ||
optional: true | ||
{{- 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: task-{{ .Values.deployEnv }} | ||
labels: | ||
app: tasks-{{ .Values.deployEnv }} | ||
deployEnv: "{{ .Values.deployEnv }}" | ||
stackRole: task | ||
spec: | ||
ports: | ||
- port: 80 | ||
selector: | ||
app: "tasks-{{ .Values.deployEnv }}" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ djangorestframework_simplejwt==3.3.0 | |
PyJWT==1.7.1 # pinned b/c current version 2.0.0 breaks simplejwt. waiting for 2.0.1 | ||
elasticsearch==8.8.2 | ||
git+https://github.com/Sefaria/[email protected]#egg=elasticsearch-dsl | ||
git+https://github.com/Sefaria/[email protected]#egg=sefaria_llm_interface&subdirectory=app/llm_interface | ||
geojson==2.5.0 | ||
geopy==2.3.0 | ||
gevent==20.12.0; sys_platform != 'darwin' | ||
|
@@ -65,7 +66,9 @@ babel | |
python-bidi | ||
requests | ||
Cerberus | ||
celery[redis] | ||
google-re2 | ||
dnspython~=2.5.0 | ||
|
||
#opentelemetry-distro | ||
#opentelemetry-exporter-otlp | ||
|
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,6 @@ | ||
from celery import Celery | ||
from sefaria.celery_setup.config import generate_config_from_env | ||
|
||
app = Celery('sefaria') | ||
app.conf.update(**generate_config_from_env()) | ||
app.autodiscover_tasks(packages=['sefaria.helper.llm']) |
Oops, something went wrong.