diff --git a/Makefile b/Makefile index 582fa46..28dedc2 100644 --- a/Makefile +++ b/Makefile @@ -222,14 +222,12 @@ crowdin-upload: ## Upload source translations to crowdin i18n-compile: ## compile all translations i18n-compile: \ - back-i18n-compile \ - frontend-i18n-compile + back-i18n-compile .PHONY: i18n-compile -i18n-generate: ## create the .pot files and extract frontend messages +i18n-generate: ## create the .pot files used for i18n i18n-generate: \ - back-i18n-generate \ - frontend-i18n-generate + back-i18n-generate .PHONY: i18n-generate i18n-download-and-compile: ## download all translated messages and compile them to be used by all applications diff --git a/bin/Tiltfile b/bin/Tiltfile index 705a658..773f481 100644 --- a/bin/Tiltfile +++ b/bin/Tiltfile @@ -17,17 +17,6 @@ docker_build( ] ) -docker_build( - 'localhost:5001/find-frontend:latest', - context='..', - dockerfile='../src/frontend/Dockerfile', - only=['./src/frontend', './docker', './.dockerignore'], - target = 'find', - live_update=[ - sync('../src/frontend', '/home/frontend'), - ] -) - k8s_yaml(local('cd ../src/helm && helmfile -n find -e dev template .')) diff --git a/crowdin/config.yml b/crowdin/config.yml index 5056eb7..fcdc09d 100644 --- a/crowdin/config.yml +++ b/crowdin/config.yml @@ -20,10 +20,4 @@ files: [ dest: "/backend-find.pot", translation : "/backend/locale/%locale_with_underscore%/LC_MESSAGES/django.po" }, - { - source: "/frontend/packages/i18n/locales/find/translations-crowdin.json", - dest: "/frontend-find.json", - translation: "/frontend/packages/i18n/locales/find/%two_letters_code%/translations.json", - skip_untranslated_strings: true, - }, ] diff --git a/src/helm/env.d/dev/values.find.yaml.gotmpl b/src/helm/env.d/dev/values.find.yaml.gotmpl index 1e849d1..03d6948 100644 --- a/src/helm/env.d/dev/values.find.yaml.gotmpl +++ b/src/helm/env.d/dev/values.find.yaml.gotmpl @@ -64,22 +64,6 @@ backend: shell -c "from core.models import User; not User.objects.filter(username='admin').exists() and User.objects.create_superuser('admin', 'admin@example.com', 'admin')" restartPolicy: Never -frontend: - envVars: - PORT: 8080 - NEXT_PUBLIC_API_ORIGIN: https://find.127.0.0.1.nip.io - NEXT_PUBLIC_SIGNALING_URL: wss://find.127.0.0.1.nip.io/ws - - replicas: 1 - command: - - yarn - - dev - - image: - repository: localhost:5001/find-frontend - pullPolicy: Always - tag: "latest" - ingress: enabled: true host: find.127.0.0.1.nip.io diff --git a/src/helm/env.d/preprod/values.find.yaml.gotmpl b/src/helm/env.d/preprod/values.find.yaml.gotmpl index ec80e9f..92564fd 100644 --- a/src/helm/env.d/preprod/values.find.yaml.gotmpl +++ b/src/helm/env.d/preprod/values.find.yaml.gotmpl @@ -111,12 +111,6 @@ backend: python manage.py createsuperuser --email $DJANGO_SUPERUSER_EMAIL --password $DJANGO_SUPERUSER_PASSWORD restartPolicy: Never -frontend: - image: - repository: lasuite/find-frontend - pullPolicy: Always - tag: "v1.1.0" - ingress: enabled: true host: find-preprod.beta.numerique.gouv.fr diff --git a/src/helm/env.d/production/values.find.yaml.gotmpl b/src/helm/env.d/production/values.find.yaml.gotmpl index d3a9612..7611ffb 100644 --- a/src/helm/env.d/production/values.find.yaml.gotmpl +++ b/src/helm/env.d/production/values.find.yaml.gotmpl @@ -111,12 +111,6 @@ backend: python manage.py createsuperuser --email $DJANGO_SUPERUSER_EMAIL --password $DJANGO_SUPERUSER_PASSWORD restartPolicy: Never -frontend: - image: - repository: lasuite/find-frontend - pullPolicy: Always - tag: "v1.1.0" - ingress: enabled: true host: docs.numerique.gouv.fr diff --git a/src/helm/env.d/staging/values.find.yaml.gotmpl b/src/helm/env.d/staging/values.find.yaml.gotmpl index e5a2ba0..bed6561 100644 --- a/src/helm/env.d/staging/values.find.yaml.gotmpl +++ b/src/helm/env.d/staging/values.find.yaml.gotmpl @@ -111,12 +111,6 @@ backend: python manage.py createsuperuser --email $DJANGO_SUPERUSER_EMAIL --password $DJANGO_SUPERUSER_PASSWORD restartPolicy: Never -frontend: - image: - repository: lasuite/find-frontend - pullPolicy: Always - tag: "main" - ingress: enabled: true host: find-staging.beta.numerique.gouv.fr diff --git a/src/helm/find/README.md b/src/helm/find/README.md index de6908c..5afb43c 100644 --- a/src/helm/find/README.md +++ b/src/helm/find/README.md @@ -78,51 +78,3 @@ | `backend.persistence.volume-name.mountPath` | Path where the volume should be mounted to | | | `backend.extraVolumeMounts` | Additional volumes to mount on the backend. | `[]` | | `backend.extraVolumes` | Additional volumes to mount on the backend. | `[]` | - -### frontend - -| Name | Description | Value | -| ------------------------------------------------------ | ----------------------------------------------------------------------------------- | ------------------------- | -| `frontend.image.repository` | Repository to use to pull find's frontend container image | `lasuite/find-frontend` | -| `frontend.image.tag` | find's frontend container tag | `latest` | -| `frontend.image.pullPolicy` | frontend container image pull policy | `IfNotPresent` | -| `frontend.command` | Override the frontend container command | `[]` | -| `frontend.args` | Override the frontend container args | `[]` | -| `frontend.replicas` | Amount of frontend replicas | `3` | -| `frontend.shareProcessNamespace` | Enable share process namefrontend between containers | `false` | -| `frontend.sidecars` | Add sidecars containers to frontend deployment | `[]` | -| `frontend.securityContext` | Configure frontend Pod security context | `nil` | -| `frontend.envVars` | Configure frontend container environment variables | `undefined` | -| `frontend.envVars.BY_VALUE` | Example environment variable by setting value directly | | -| `frontend.envVars.FROM_CONFIGMAP.configMapKeyRef.name` | Name of a ConfigMap when configuring env vars from a ConfigMap | | -| `frontend.envVars.FROM_CONFIGMAP.configMapKeyRef.key` | Key within a ConfigMap when configuring env vars from a ConfigMap | | -| `frontend.envVars.FROM_SECRET.secretKeyRef.name` | Name of a Secret when configuring env vars from a Secret | | -| `frontend.envVars.FROM_SECRET.secretKeyRef.key` | Key within a Secret when configuring env vars from a Secret | | -| `frontend.podAnnotations` | Annotations to add to the frontend Pod | `{}` | -| `frontend.service.type` | frontend Service type | `ClusterIP` | -| `frontend.service.port` | frontend Service listening port | `80` | -| `frontend.service.targetPort` | frontend container listening port | `8080` | -| `frontend.service.annotations` | Annotations to add to the frontend Service | `{}` | -| `frontend.probes` | Configure probe for frontend | `{}` | -| `frontend.probes.liveness.path` | Configure path for frontend HTTP liveness probe | | -| `frontend.probes.liveness.targetPort` | Configure port for frontend HTTP liveness probe | | -| `frontend.probes.liveness.initialDelaySeconds` | Configure initial delay for frontend liveness probe | | -| `frontend.probes.liveness.initialDelaySeconds` | Configure timeout for frontend liveness probe | | -| `frontend.probes.startup.path` | Configure path for frontend HTTP startup probe | | -| `frontend.probes.startup.targetPort` | Configure port for frontend HTTP startup probe | | -| `frontend.probes.startup.initialDelaySeconds` | Configure initial delay for frontend startup probe | | -| `frontend.probes.startup.initialDelaySeconds` | Configure timeout for frontend startup probe | | -| `frontend.probes.readiness.path` | Configure path for frontend HTTP readiness probe | | -| `frontend.probes.readiness.targetPort` | Configure port for frontend HTTP readiness probe | | -| `frontend.probes.readiness.initialDelaySeconds` | Configure initial delay for frontend readiness probe | | -| `frontend.probes.readiness.initialDelaySeconds` | Configure timeout for frontend readiness probe | | -| `frontend.resources` | Resource requirements for the frontend container | `{}` | -| `frontend.nodeSelector` | Node selector for the frontend Pod | `{}` | -| `frontend.tolerations` | Tolerations for the frontend Pod | `[]` | -| `frontend.affinity` | Affinity for the frontend Pod | `{}` | -| `frontend.persistence` | Additional volumes to create and mount on the frontend. Used for debugging purposes | `{}` | -| `frontend.persistence.volume-name.size` | Size of the additional volume | | -| `frontend.persistence.volume-name.type` | Type of the additional volume, persistentVolumeClaim or emptyDir | | -| `frontend.persistence.volume-name.mountPath` | Path where the volume should be mounted to | | -| `frontend.extraVolumeMounts` | Additional volumes to mount on the frontend. | `[]` | -| `frontend.extraVolumes` | Additional volumes to mount on the frontend. | `[]` | diff --git a/src/helm/find/templates/_helpers.tpl b/src/helm/find/templates/_helpers.tpl index 493ad13..2006650 100644 --- a/src/helm/find/templates/_helpers.tpl +++ b/src/helm/find/templates/_helpers.tpl @@ -139,15 +139,6 @@ Requires top level scope {{ include "find.fullname" . }}-backend {{- end }} -{{/* -Full name for the frontend - -Requires top level scope -*/}} -{{- define "find.frontend.fullname" -}} -{{ include "find.fullname" . }}-frontend -{{- end }} - {{/* Full name for the webrtc diff --git a/src/helm/find/templates/frontend_deployment.yaml b/src/helm/find/templates/frontend_deployment.yaml deleted file mode 100644 index 991f960..0000000 --- a/src/helm/find/templates/frontend_deployment.yaml +++ /dev/null @@ -1,136 +0,0 @@ -{{- $envVars := include "find.common.env" (list . .Values.frontend) -}} -{{- $fullName := include "find.frontend.fullname" . -}} -{{- $component := "frontend" -}} -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ $fullName }} - namespace: {{ .Release.Namespace | quote }} - labels: - {{- include "find.common.labels" (list . $component) | nindent 4 }} -spec: - replicas: {{ .Values.frontend.replicas }} - selector: - matchLabels: - {{- include "find.common.selectorLabels" (list . $component) | nindent 6 }} - template: - metadata: - annotations: - {{- with .Values.frontend.podAnnotations }} - {{- toYaml . | nindent 8 }} - {{- end }} - labels: - {{- include "find.common.selectorLabels" (list . $component) | nindent 8 }} - spec: - {{- if $.Values.image.credentials }} - imagePullSecrets: - - name: {{ include "find.secret.dockerconfigjson.name" (dict "fullname" (include "find.fullname" .) "imageCredentials" $.Values.image.credentials) }} - {{- end}} - shareProcessNamespace: {{ .Values.frontend.shareProcessNamespace }} - containers: - {{- with .Values.frontend.sidecars }} - {{- toYaml . | nindent 8 }} - {{- end }} - - name: {{ .Chart.Name }} - image: "{{ (.Values.frontend.image | default dict).repository | default .Values.image.repository }}:{{ (.Values.frontend.image | default dict).tag | default .Values.image.tag }}" - imagePullPolicy: {{ (.Values.frontend.image | default dict).pullPolicy | default .Values.image.pullPolicy }} - {{- with .Values.frontend.command }} - command: - {{- toYaml . | nindent 12 }} - {{- end }} - {{- with .Values.frontend.args }} - args: - {{- toYaml . | nindent 12 }} - {{- end }} - env: - {{- if $envVars}} - {{- $envVars | indent 12 }} - {{- end }} - {{- with .Values.frontend.securityContext }} - securityContext: - {{- toYaml . | nindent 12 }} - {{- end }} - ports: - - name: http - containerPort: {{ .Values.frontend.service.targetPort }} - protocol: TCP - {{- if .Values.frontend.probes.liveness }} - livenessProbe: - {{- include "find.probes.abstract" (merge .Values.frontend.probes.liveness (dict "targetPort" .Values.frontend.service.targetPort )) | nindent 12 }} - {{- end }} - {{- if .Values.frontend.probes.readiness }} - readinessProbe: - {{- include "find.probes.abstract" (merge .Values.frontend.probes.readiness (dict "targetPort" .Values.frontend.service.targetPort )) | nindent 12 }} - {{- end }} - {{- if .Values.frontend.probes.startup }} - startupProbe: - {{- include "find.probes.abstract" (merge .Values.frontend.probes.startup (dict "targetPort" .Values.frontend.service.targetPort )) | nindent 12 }} - {{- end }} - {{- with .Values.frontend.resources }} - resources: - {{- toYaml . | nindent 12 }} - {{- end }} - volumeMounts: - {{- range $index, $value := .Values.mountFiles }} - - name: "files-{{ $index }}" - mountPath: {{ $value.path }} - subPath: content - {{- end }} - {{- range $name, $volume := .Values.frontend.persistence }} - - name: "{{ $name }}" - mountPath: "{{ $volume.mountPath }}" - {{- end }} - {{- range .Values.frontend.extraVolumeMounts }} - - name: {{ .name }} - mountPath: {{ .mountPath }} - subPath: {{ .subPath | default "" }} - readOnly: {{ .readOnly }} - {{- end }} - {{- with .Values.frontend.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.frontend.affinity }} - affinity: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.frontend.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} - {{- end }} - volumes: - {{- range $index, $value := .Values.mountFiles }} - - name: "files-{{ $index }}" - configMap: - name: "{{ include "find.fullname" $ }}-files-{{ $index }}" - {{- end }} - {{- range $name, $volume := .Values.frontend.persistence }} - - name: "{{ $name }}" - {{- if eq $volume.type "emptyDir" }} - emptyDir: {} - {{- else }} - persistentVolumeClaim: - claimName: "{{ $fullName }}-{{ $name }}" - {{- end }} - {{- end }} - {{- range .Values.frontend.extraVolumes }} - - name: {{ .name }} - {{- if .existingClaim }} - persistentVolumeClaim: - claimName: {{ .existingClaim }} - {{- else if .hostPath }} - hostPath: - {{ toYaml .hostPath | nindent 12 }} - {{- else if .csi }} - csi: - {{- toYaml .csi | nindent 12 }} - {{- else if .configMap }} - configMap: - {{- toYaml .configMap | nindent 12 }} - {{- else if .emptyDir }} - emptyDir: - {{- toYaml .emptyDir | nindent 12 }} - {{- else }} - emptyDir: {} - {{- end }} - {{- end }} diff --git a/src/helm/find/templates/frontend_svc.yaml b/src/helm/find/templates/frontend_svc.yaml deleted file mode 100644 index eb8c840..0000000 --- a/src/helm/find/templates/frontend_svc.yaml +++ /dev/null @@ -1,21 +0,0 @@ -{{- $envVars := include "find.common.env" (list . .Values.frontend) -}} -{{- $fullName := include "find.frontend.fullname" . -}} -{{- $component := "frontend" -}} -apiVersion: v1 -kind: Service -metadata: - name: {{ $fullName }} - namespace: {{ .Release.Namespace | quote }} - labels: - {{- include "find.common.labels" (list . $component) | nindent 4 }} - annotations: - {{- toYaml $.Values.frontend.service.annotations | nindent 4 }} -spec: - type: {{ .Values.frontend.service.type }} - ports: - - port: {{ .Values.frontend.service.port }} - targetPort: {{ .Values.frontend.service.targetPort }} - protocol: TCP - name: http - selector: - {{- include "find.common.selectorLabels" (list . $component) | nindent 4 }} diff --git a/src/helm/find/templates/ingress.yaml b/src/helm/find/templates/ingress.yaml index b430dce..ee98d34 100644 --- a/src/helm/find/templates/ingress.yaml +++ b/src/helm/find/templates/ingress.yaml @@ -46,20 +46,6 @@ spec: - host: {{ .Values.ingress.host | quote }} http: paths: - - path: {{ .Values.ingress.path | quote }} - {{- if semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion }} - pathType: Prefix - {{- end }} - backend: - {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} - service: - name: {{ include "find.frontend.fullname" . }} - port: - number: {{ .Values.frontend.service.port }} - {{- else }} - serviceName: {{ include "find.frontend.fullname" . }} - servicePort: {{ .Values.frontend.service.port }} - {{- end }} - path: /api {{- if semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion }} pathType: Prefix @@ -82,20 +68,6 @@ spec: - host: {{ . | quote }} http: paths: - - path: {{ $.Values.ingress.path | quote }} - {{- if semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion }} - pathType: Prefix - {{- end }} - backend: - {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} - service: - name: {{ include "find.frontend.fullname" $ }} - port: - number: {{ $.Values.frontend.service.port }} - {{- else }} - serviceName: {{ include "find.frontend.fullname" $ }} - servicePort: {{ $.Values.frontend.service.port }} - {{- end }} - path: /api {{- if semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion }} pathType: Prefix diff --git a/src/helm/find/values.yaml b/src/helm/find/values.yaml index b0eb3d0..94104c9 100644 --- a/src/helm/find/values.yaml +++ b/src/helm/find/values.yaml @@ -171,95 +171,3 @@ backend: ## @param backend.extraVolumes Additional volumes to mount on the backend. extraVolumes: [] - - -## @section frontend - -frontend: - ## @param frontend.image.repository Repository to use to pull find's frontend container image - ## @param frontend.image.tag find's frontend container tag - ## @param frontend.image.pullPolicy frontend container image pull policy - image: - repository: lasuite/find-frontend - pullPolicy: IfNotPresent - tag: "latest" - - ## @param frontend.command Override the frontend container command - command: [] - - ## @param frontend.args Override the frontend container args - args: [] - - ## @param frontend.replicas Amount of frontend replicas - replicas: 3 - - ## @param frontend.shareProcessNamespace Enable share process namefrontend between containers - shareProcessNamespace: false - - ## @param frontend.sidecars Add sidecars containers to frontend deployment - sidecars: [] - - ## @param frontend.securityContext Configure frontend Pod security context - securityContext: null - - ## @param frontend.envVars Configure frontend container environment variables - ## @extra frontend.envVars.BY_VALUE Example environment variable by setting value directly - ## @extra frontend.envVars.FROM_CONFIGMAP.configMapKeyRef.name Name of a ConfigMap when configuring env vars from a ConfigMap - ## @extra frontend.envVars.FROM_CONFIGMAP.configMapKeyRef.key Key within a ConfigMap when configuring env vars from a ConfigMap - ## @extra frontend.envVars.FROM_SECRET.secretKeyRef.name Name of a Secret when configuring env vars from a Secret - ## @extra frontend.envVars.FROM_SECRET.secretKeyRef.key Key within a Secret when configuring env vars from a Secret - ## @skip frontend.envVars - envVars: - <<: *commonEnvVars - - ## @param frontend.podAnnotations Annotations to add to the frontend Pod - podAnnotations: {} - - ## @param frontend.service.type frontend Service type - ## @param frontend.service.port frontend Service listening port - ## @param frontend.service.targetPort frontend container listening port - ## @param frontend.service.annotations Annotations to add to the frontend Service - service: - type: ClusterIP - port: 80 - targetPort: 8080 - annotations: {} - - ## @param frontend.probes Configure probe for frontend - ## @extra frontend.probes.liveness.path Configure path for frontend HTTP liveness probe - ## @extra frontend.probes.liveness.targetPort Configure port for frontend HTTP liveness probe - ## @extra frontend.probes.liveness.initialDelaySeconds Configure initial delay for frontend liveness probe - ## @extra frontend.probes.liveness.initialDelaySeconds Configure timeout for frontend liveness probe - ## @extra frontend.probes.startup.path Configure path for frontend HTTP startup probe - ## @extra frontend.probes.startup.targetPort Configure port for frontend HTTP startup probe - ## @extra frontend.probes.startup.initialDelaySeconds Configure initial delay for frontend startup probe - ## @extra frontend.probes.startup.initialDelaySeconds Configure timeout for frontend startup probe - ## @extra frontend.probes.readiness.path Configure path for frontend HTTP readiness probe - ## @extra frontend.probes.readiness.targetPort Configure port for frontend HTTP readiness probe - ## @extra frontend.probes.readiness.initialDelaySeconds Configure initial delay for frontend readiness probe - ## @extra frontend.probes.readiness.initialDelaySeconds Configure timeout for frontend readiness probe - probes: {} - - ## @param frontend.resources Resource requirements for the frontend container - resources: {} - - ## @param frontend.nodeSelector Node selector for the frontend Pod - nodeSelector: {} - - ## @param frontend.tolerations Tolerations for the frontend Pod - tolerations: [] - - ## @param frontend.affinity Affinity for the frontend Pod - affinity: {} - - ## @param frontend.persistence Additional volumes to create and mount on the frontend. Used for debugging purposes - ## @extra frontend.persistence.volume-name.size Size of the additional volume - ## @extra frontend.persistence.volume-name.type Type of the additional volume, persistentVolumeClaim or emptyDir - ## @extra frontend.persistence.volume-name.mountPath Path where the volume should be mounted to - persistence: {} - - ## @param frontend.extraVolumeMounts Additional volumes to mount on the frontend. - extraVolumeMounts: [] - - ## @param frontend.extraVolumes Additional volumes to mount on the frontend. - extraVolumes: []