From 55384c343d8e5f2e7bb38f3ccb54d318bd9c3ff9 Mon Sep 17 00:00:00 2001 From: Andra <78518344+andracc@users.noreply.github.com> Date: Fri, 25 Oct 2024 10:38:50 -0400 Subject: [PATCH 1/2] Provide feedback after Vernacular name change (#3408) Resolves #2661 --- public/locales/en/translation.json | 1 + src/components/ProjectSettings/ProjectLanguages.tsx | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/public/locales/en/translation.json b/public/locales/en/translation.json index 5f2b8a25f9..7e757db4b4 100644 --- a/public/locales/en/translation.json +++ b/public/locales/en/translation.json @@ -182,6 +182,7 @@ "deleteAnalysisLanguage": "Delete this analysis language", "getGlossLanguages": "Find all language codes used in the current data", "updateVernacularLanguageNameFailed": "Failed to update vernacular language name", + "updateVernacularLanguageNameSuccess": "Vernacular language updated!", "addAnalysisLanguageFailed": "Failed to add analysis language", "makeDefaultAnalysisLanguageFailed": "Failed to make default analysis language", "deleteAnalysisLanguageFailed": "Failed to delete analysis language", diff --git a/src/components/ProjectSettings/ProjectLanguages.tsx b/src/components/ProjectSettings/ProjectLanguages.tsx index fff0870d58..f3894436d4 100644 --- a/src/components/ProjectSettings/ProjectLanguages.tsx +++ b/src/components/ProjectSettings/ProjectLanguages.tsx @@ -142,6 +142,7 @@ export default function ProjectLanguages( setAdd(false); setLangsInProj(""); setNewLang(newWritingSystem()); + setChangeVernName(false); }; const updateVernacularName = async (): Promise => { @@ -158,7 +159,12 @@ export default function ProjectLanguages( }; await props .setProject({ ...props.project, vernacularWritingSystem }) - .then(() => resetState()) + .then(() => { + resetState(); + toast.success( + t("projectSettings.language.updateVernacularLanguageNameSuccess") + ); + }) .catch((err) => { console.error(err); toast.error( From e349e02fb4079db87d3e06d637b434dbf3aa547b Mon Sep 17 00:00:00 2001 From: "D. Ror." Date: Wed, 30 Oct 2024 14:42:42 -0400 Subject: [PATCH 2/2] [deploy] Fix: helm resources; workflow ubuntu; Docker logging (#3405) --- .github/workflows/backend.yml | 27 +++++------ .github/workflows/codeql.yml | 6 +-- .github/workflows/combine_deploy_image.yml | 2 +- .github/workflows/database.yml | 5 ++- .github/workflows/dependency-review.yml | 2 +- .github/workflows/deploy_qa.yml | 4 +- .github/workflows/deploy_release.yml | 2 +- .github/workflows/frontend.yml | 14 +++--- .github/workflows/maintenance.yml | 5 ++- .github/workflows/pages.yml | 2 +- .github/workflows/python.yml | 2 +- .github/workflows/scorecards.yml | 2 +- .../templates/aws-ecr-login-cronjob.yaml | 6 ++- .../templates/aws-ecr-login-oneshot.yaml | 6 ++- .../templates/update-cert-cronjob.yaml | 6 ++- .../templates/update-cert-oneshot.yaml | 6 ++- .../deployment-cert-proxy-server.yaml | 4 +- .../templates/deployment-nuc-proxy.yaml | 4 +- .../templates/job-create-admin-user.yaml | 6 ++- .../backend/templates/deployment-backend.yaml | 2 +- .../charts/database/templates/database.yaml | 2 +- .../templates/deployment-frontend.yaml | 4 +- .../templates/cronjob-daily-backup.yaml | 4 +- .../templates/cronjob-update-fonts.yaml | 6 ++- .../templates/deployment-maintenance.yaml | 4 +- .../maintenance/templates/get-fonts-hook.yaml | 6 ++- deploy/scripts/build.py | 45 ++++++++++++++----- deploy/scripts/sem_dom_import.py | 7 ++- .../scripts/setup_files/collector_config.yaml | 4 +- .../scripts/setup_files/combine_config.yaml | 3 +- 30 files changed, 124 insertions(+), 74 deletions(-) diff --git a/.github/workflows/backend.yml b/.github/workflows/backend.yml index 189bf44b6f..3b91c38672 100644 --- a/.github/workflows/backend.yml +++ b/.github/workflows/backend.yml @@ -35,15 +35,14 @@ jobs: github.com:443 md-hdd-t032zjxllntc.z26.blob.storage.azure.net:443 objects.githubusercontent.com:443 - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - name: Checkout repository + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - name: Setup dotnet uses: actions/setup-dotnet@6bd8b7f7774af54e05809fcc5431931b3eb1ddee # v4.0.1 with: dotnet-version: ${{ matrix.dotnet }} - name: Install ffmpeg uses: FedericoCarboni/setup-ffmpeg@36c6454b5a2348e7794ba2d82a21506605921e3d # v3 - - # Coverage. - name: Run coverage tests run: dotnet test Backend.Tests/Backend.Tests.csproj shell: bash @@ -54,19 +53,16 @@ jobs: name: coverage path: Backend.Tests/coverage.cobertura.xml retention-days: 7 - - # Development build. - - run: dotnet build BackendFramework.sln - - # Release build. - - run: dotnet publish BackendFramework.sln - - # Fmt. - - run: dotnet format --verify-no-changes + - name: Development build + run: dotnet build BackendFramework.sln + - name: Release build + run: dotnet publish BackendFramework.sln + - name: Format check + run: dotnet format --verify-no-changes upload_coverage: needs: test_build - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: # See https://docs.stepsecurity.io/harden-runner/getting-started/ for instructions on # configuring harden-runner and identifying allowed endpoints. @@ -146,8 +142,8 @@ jobs: uses: github/codeql-action/analyze@d39d31e687223d841ef683f52467bd88e9b21c14 # v3.25.3 docker_build: + if: ${{ github.event.type }} == "PullRequest" runs-on: ubuntu-22.04 - # if: ${{ github.event.type }} == "PullRequest" steps: # See https://docs.stepsecurity.io/harden-runner/getting-started/ for instructions on # configuring harden-runner and identifying allowed endpoints. @@ -170,7 +166,8 @@ jobs: ts-crl.ws.symantec.com:80 # For subfolders, currently a full checkout is required. # See: https://github.com/marketplace/actions/build-and-push-docker-images#path-context - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - name: Checkout repository + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 with: fetch-depth: 0 - name: Build backend diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 6449b30c20..3044c16821 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -13,10 +13,10 @@ name: "CodeQL" on: push: - branches: ["master"] + branches: [master] pull_request: # The branches below must be a subset of the branches above - branches: ["master"] + branches: [master] schedule: - cron: "21 8 * * 3" @@ -26,7 +26,7 @@ permissions: # added using https://github.com/step-security/secure-workflows jobs: analyze: name: Analyze - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 permissions: actions: read contents: read diff --git a/.github/workflows/combine_deploy_image.yml b/.github/workflows/combine_deploy_image.yml index c8f010de39..4a5dc47a72 100644 --- a/.github/workflows/combine_deploy_image.yml +++ b/.github/workflows/combine_deploy_image.yml @@ -11,7 +11,7 @@ permissions: # added using https://github.com/step-security/secure-workflows jobs: build: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: # See https://docs.stepsecurity.io/harden-runner/getting-started/ for instructions on # configuring harden-runner and identifying allowed endpoints. diff --git a/.github/workflows/database.yml b/.github/workflows/database.yml index c33c59d25e..834f6c97f8 100644 --- a/.github/workflows/database.yml +++ b/.github/workflows/database.yml @@ -10,7 +10,7 @@ permissions: # added using https://github.com/step-security/secure-workflows jobs: docker_build: if: ${{ github.event.type }} == "PullRequest" - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: # See https://docs.stepsecurity.io/harden-runner/getting-started/ for instructions on # configuring harden-runner and identifying allowed endpoints. @@ -26,7 +26,8 @@ jobs: registry-1.docker.io:443 # For subfolders, currently a full checkout is required. # See: https://github.com/marketplace/actions/build-and-push-docker-images#path-context - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - name: Checkout repository + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 with: fetch-depth: 0 - name: Build database image diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml index 038fa8b486..40f2bd8e1b 100644 --- a/.github/workflows/dependency-review.yml +++ b/.github/workflows/dependency-review.yml @@ -14,7 +14,7 @@ permissions: jobs: dependency-review: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Harden Runner uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1 diff --git a/.github/workflows/deploy_qa.yml b/.github/workflows/deploy_qa.yml index e1b7bcce2f..652295bae1 100644 --- a/.github/workflows/deploy_qa.yml +++ b/.github/workflows/deploy_qa.yml @@ -13,7 +13,7 @@ jobs: matrix: component: [frontend, backend, maintenance, database] - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 outputs: image_tag: ${{ steps.build_combine.outputs.image_tag }} steps: @@ -64,7 +64,7 @@ jobs: build_component: ${{ matrix.component }} clean_ecr_repo: needs: build - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: # See https://docs.stepsecurity.io/harden-runner/getting-started/ for instructions on # configuring harden-runner and identifying allowed endpoints. diff --git a/.github/workflows/deploy_release.yml b/.github/workflows/deploy_release.yml index 527c18d793..f364747637 100644 --- a/.github/workflows/deploy_release.yml +++ b/.github/workflows/deploy_release.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: component: [frontend, backend, maintenance, database] - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 outputs: image_tag: ${{ steps.build_combine.outputs.image_tag }} steps: diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml index c417bb1892..edc2ad94fc 100644 --- a/.github/workflows/frontend.yml +++ b/.github/workflows/frontend.yml @@ -11,7 +11,7 @@ permissions: # added using https://github.com/step-security/secure-workflows jobs: lint_build: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 strategy: matrix: node-version: [20] @@ -40,7 +40,7 @@ jobs: - run: npm run build test_coverage: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 strategy: matrix: node-version: [20] @@ -64,7 +64,8 @@ jobs: with: node-version: ${{ matrix.node-version }} - run: npm ci - - run: npm run test-frontend:coverage + - name: Run tests and generate coverage + run: npm run test-frontend:coverage env: CI: true - name: Upload coverage artifact @@ -77,7 +78,7 @@ jobs: upload_coverage: needs: test_coverage - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: # See https://docs.stepsecurity.io/harden-runner/getting-started/ for instructions on # configuring harden-runner and identifying allowed endpoints. @@ -110,8 +111,8 @@ jobs: name: Frontend docker_build: - runs-on: ubuntu-latest if: ${{ github.event.type }} == "PullRequest" + runs-on: ubuntu-22.04 steps: # See https://docs.stepsecurity.io/harden-runner/getting-started/ for instructions on # configuring harden-runner and identifying allowed endpoints. @@ -128,7 +129,8 @@ jobs: pypi.org:443 registry-1.docker.io:443 registry.npmjs.org:443 - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - name: Checkout repository + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 with: fetch-depth: 0 - name: Build frontend diff --git a/.github/workflows/maintenance.yml b/.github/workflows/maintenance.yml index 2982b3f454..681e1e71fa 100644 --- a/.github/workflows/maintenance.yml +++ b/.github/workflows/maintenance.yml @@ -10,7 +10,7 @@ permissions: # added using https://github.com/step-security/secure-workflows jobs: docker_build: if: ${{ github.event.type }} == "PullRequest" - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: # See https://docs.stepsecurity.io/harden-runner/getting-started/ for instructions on # configuring harden-runner and identifying allowed endpoints. @@ -30,7 +30,8 @@ jobs: security.ubuntu.com:80 # For subfolders, currently a full checkout is required. # See: https://github.com/marketplace/actions/build-and-push-docker-images#path-context - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + - name: Checkout repository + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 with: fetch-depth: 0 - name: Build maintenance image diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 7c5482d3a2..eb1adabf76 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -12,7 +12,7 @@ permissions: # added using https://github.com/step-security/secure-workflows jobs: deploy: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: # See https://docs.stepsecurity.io/harden-runner/getting-started/ for instructions on # configuring harden-runner and identifying allowed endpoints. diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 7d79b2e4ef..707b6c463f 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -11,7 +11,7 @@ permissions: # added using https://github.com/step-security/secure-workflows jobs: tox: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 strategy: matrix: python-version: ["3.12"] diff --git a/.github/workflows/scorecards.yml b/.github/workflows/scorecards.yml index ca11ef0181..9c8cf78de4 100644 --- a/.github/workflows/scorecards.yml +++ b/.github/workflows/scorecards.yml @@ -21,7 +21,7 @@ permissions: read-all jobs: analysis: name: Scorecards analysis - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 permissions: # Needed to upload the results to code-scanning dashboard. security-events: write diff --git a/deploy/helm/aws-login/templates/aws-ecr-login-cronjob.yaml b/deploy/helm/aws-login/templates/aws-ecr-login-cronjob.yaml index 4a60994388..168958b695 100644 --- a/deploy/helm/aws-login/templates/aws-ecr-login-cronjob.yaml +++ b/deploy/helm/aws-login/templates/aws-ecr-login-cronjob.yaml @@ -59,7 +59,11 @@ spec: configMapKeyRef: key: DOCKER_EMAIL name: {{ .Values.awsEcr.configName }} - resources: {} + resources: + requests: + memory: 128Mi + limits: + memory: 128Mi securityContext: capabilities: {} terminationMessagePath: /dev/termination-log diff --git a/deploy/helm/aws-login/templates/aws-ecr-login-oneshot.yaml b/deploy/helm/aws-login/templates/aws-ecr-login-oneshot.yaml index f4737396e8..8f7266da63 100644 --- a/deploy/helm/aws-login/templates/aws-ecr-login-oneshot.yaml +++ b/deploy/helm/aws-login/templates/aws-ecr-login-oneshot.yaml @@ -59,7 +59,11 @@ spec: configMapKeyRef: key: DOCKER_EMAIL name: "{{ .Values.awsEcr.configName }}" - resources: {} + resources: + requests: + memory: 128Mi + limits: + memory: 128Mi securityContext: capabilities: {} terminationMessagePath: /dev/termination-log diff --git a/deploy/helm/cert-proxy-client/templates/update-cert-cronjob.yaml b/deploy/helm/cert-proxy-client/templates/update-cert-cronjob.yaml index 8b6d303673..97a51a3da4 100644 --- a/deploy/helm/cert-proxy-client/templates/update-cert-cronjob.yaml +++ b/deploy/helm/cert-proxy-client/templates/update-cert-cronjob.yaml @@ -73,7 +73,11 @@ spec: configMapKeyRef: key: VERBOSE name: {{ .Values.envName | quote }} - resources: {} + resources: + requests: + memory: 128Mi + limits: + memory: 128Mi securityContext: capabilities: {} terminationMessagePath: /dev/termination-log diff --git a/deploy/helm/cert-proxy-client/templates/update-cert-oneshot.yaml b/deploy/helm/cert-proxy-client/templates/update-cert-oneshot.yaml index 5011eb043a..a6de7a6c37 100644 --- a/deploy/helm/cert-proxy-client/templates/update-cert-oneshot.yaml +++ b/deploy/helm/cert-proxy-client/templates/update-cert-oneshot.yaml @@ -72,7 +72,11 @@ spec: configMapKeyRef: key: VERBOSE name: {{ .Values.envName | quote }} - resources: {} + resources: + requests: + memory: 128Mi + limits: + memory: 128Mi securityContext: capabilities: {} terminationMessagePath: /dev/termination-log diff --git a/deploy/helm/cert-proxy-server/templates/deployment-cert-proxy-server.yaml b/deploy/helm/cert-proxy-server/templates/deployment-cert-proxy-server.yaml index 7c23b4cb71..c7ea2c55bd 100644 --- a/deploy/helm/cert-proxy-server/templates/deployment-cert-proxy-server.yaml +++ b/deploy/helm/cert-proxy-server/templates/deployment-cert-proxy-server.yaml @@ -66,9 +66,9 @@ spec: resources: requests: cpu: 2m - memory: 100M + memory: 128Mi limits: - memory: 150M + memory: 128Mi restartPolicy: Always {{- if ne .Values.global.pullSecretName "None" }} imagePullSecrets: diff --git a/deploy/helm/cert-proxy-server/templates/deployment-nuc-proxy.yaml b/deploy/helm/cert-proxy-server/templates/deployment-nuc-proxy.yaml index 3ac30a1463..21be6f8608 100644 --- a/deploy/helm/cert-proxy-server/templates/deployment-nuc-proxy.yaml +++ b/deploy/helm/cert-proxy-server/templates/deployment-nuc-proxy.yaml @@ -51,9 +51,9 @@ spec: resources: requests: cpu: 1m - memory: 10M + memory: 128Mi limits: - memory: 50M + memory: 128Mi volumeMounts: - name: nginx-html mountPath: /usr/share/nginx/html diff --git a/deploy/helm/create-admin-user/templates/job-create-admin-user.yaml b/deploy/helm/create-admin-user/templates/job-create-admin-user.yaml index 7c60ca5e2c..eaf79685fb 100644 --- a/deploy/helm/create-admin-user/templates/job-create-admin-user.yaml +++ b/deploy/helm/create-admin-user/templates/job-create-admin-user.yaml @@ -50,7 +50,11 @@ spec: image: {{ include "create-admin-user.containerImage" . }} imagePullPolicy: {{ .Values.global.imagePullPolicy }} name: create-admin-user - resources: {} + resources: + requests: + memory: 128Mi + limits: + memory: 128Mi volumeMounts: - mountPath: /home/app/.CombineFiles name: backend-data diff --git a/deploy/helm/thecombine/charts/backend/templates/deployment-backend.yaml b/deploy/helm/thecombine/charts/backend/templates/deployment-backend.yaml index bcfdc71c3a..60a2f75de8 100644 --- a/deploy/helm/thecombine/charts/backend/templates/deployment-backend.yaml +++ b/deploy/helm/thecombine/charts/backend/templates/deployment-backend.yaml @@ -100,7 +100,7 @@ spec: resources: requests: cpu: 5m - memory: 960Mi + memory: 2Gi {{- if .Values.global.includeResourceLimits }} limits: memory: 4Gi diff --git a/deploy/helm/thecombine/charts/database/templates/database.yaml b/deploy/helm/thecombine/charts/database/templates/database.yaml index 6e681ca546..7c30530888 100644 --- a/deploy/helm/thecombine/charts/database/templates/database.yaml +++ b/deploy/helm/thecombine/charts/database/templates/database.yaml @@ -51,7 +51,7 @@ spec: resources: requests: cpu: 25m - memory: 950Mi + memory: 1Gi {{- if .Values.global.includeResourceLimits }} limits: memory: 2Gi diff --git a/deploy/helm/thecombine/charts/frontend/templates/deployment-frontend.yaml b/deploy/helm/thecombine/charts/frontend/templates/deployment-frontend.yaml index 739efab059..36e025f392 100644 --- a/deploy/helm/thecombine/charts/frontend/templates/deployment-frontend.yaml +++ b/deploy/helm/thecombine/charts/frontend/templates/deployment-frontend.yaml @@ -77,10 +77,10 @@ spec: resources: requests: cpu: 1m - memory: 15M + memory: 128Mi {{- if .Values.global.includeResourceLimits }} limits: - memory: 40M + memory: 128Mi {{- end }} volumeMounts: - mountPath: /usr/share/nginx/fonts diff --git a/deploy/helm/thecombine/charts/maintenance/templates/cronjob-daily-backup.yaml b/deploy/helm/thecombine/charts/maintenance/templates/cronjob-daily-backup.yaml index e37bd8df77..73b28a0ebf 100644 --- a/deploy/helm/thecombine/charts/maintenance/templates/cronjob-daily-backup.yaml +++ b/deploy/helm/thecombine/charts/maintenance/templates/cronjob-daily-backup.yaml @@ -33,9 +33,9 @@ spec: resources: requests: cpu: 200m - memory: 150M + memory: 128Mi limits: - memory: 150M + memory: 128Mi securityContext: capabilities: {} terminationMessagePath: /dev/termination-log diff --git a/deploy/helm/thecombine/charts/maintenance/templates/cronjob-update-fonts.yaml b/deploy/helm/thecombine/charts/maintenance/templates/cronjob-update-fonts.yaml index 8b306ec0c5..4fa9da913d 100644 --- a/deploy/helm/thecombine/charts/maintenance/templates/cronjob-update-fonts.yaml +++ b/deploy/helm/thecombine/charts/maintenance/templates/cronjob-update-fonts.yaml @@ -30,7 +30,11 @@ spec: - deployment/maintenance - -- - get-fonts.sh - resources: {} + resources: + requests: + memory: 128Mi + limits: + memory: 128Mi securityContext: capabilities: {} terminationMessagePath: /dev/termination-log diff --git a/deploy/helm/thecombine/charts/maintenance/templates/deployment-maintenance.yaml b/deploy/helm/thecombine/charts/maintenance/templates/deployment-maintenance.yaml index 6ffb0a0d5a..33821d5308 100644 --- a/deploy/helm/thecombine/charts/maintenance/templates/deployment-maintenance.yaml +++ b/deploy/helm/thecombine/charts/maintenance/templates/deployment-maintenance.yaml @@ -106,10 +106,10 @@ spec: resources: requests: cpu: 200m - memory: 1200Mi + memory: 1Gi {{- if .Values.global.includeResourceLimits }} limits: - memory: 4Gi + memory: 2Gi {{- end }} volumeMounts: - mountPath: {{ .Values.fontsDir }} diff --git a/deploy/helm/thecombine/charts/maintenance/templates/get-fonts-hook.yaml b/deploy/helm/thecombine/charts/maintenance/templates/get-fonts-hook.yaml index 8ca7f66f48..0327191cfc 100644 --- a/deploy/helm/thecombine/charts/maintenance/templates/get-fonts-hook.yaml +++ b/deploy/helm/thecombine/charts/maintenance/templates/get-fonts-hook.yaml @@ -45,7 +45,11 @@ spec: - {{ $lang | quote }} {{- end }} {{- end }} - resources: {} + resources: + requests: + memory: 128Mi + limits: + memory: 128Mi securityContext: capabilities: {} terminationMessagePath: /dev/termination-log diff --git a/deploy/scripts/build.py b/deploy/scripts/build.py index fa395b26b1..b090535de0 100755 --- a/deploy/scripts/build.py +++ b/deploy/scripts/build.py @@ -50,7 +50,8 @@ class Job: class JobQueue: """Class to manage a queue of jobs.""" - def __init__(self, name: str) -> None: + def __init__(self, name: str, debug: bool = False) -> None: + self.debug = debug self.name = name self.status = JobStatus.RUNNING self.job_list: List[Job] = [] @@ -88,6 +89,18 @@ def start_next(self) -> bool: logging.debug(f"{self.name}.start_next(): no more jobs to run.") return False + def print_out(self) -> None: + logging.debug("####################") + logging.debug("Printing the stdout:\n") + self.output_stream.print() + logging.debug("####################") + + def print_err(self) -> None: + logging.debug("####################") + logging.debug("Printing the stderr:\n") + self.error_stream.print() + logging.debug("####################") + def check_jobs(self) -> JobStatus: """ Check if all jobs in the queue have completed. @@ -104,12 +117,14 @@ def check_jobs(self) -> JobStatus: # Current job has finished if self.curr_job.returncode == 0: logging.info(f"{self.name} job has finished.") - self.output_stream.print() + self.print_out() + if self.debug: + self.print_err() else: logging.error(f"{self.name} job failed.") - self.error_stream.print() + self.print_err() self.returncode = self.curr_job.returncode - # skip remaining jobs + # Skip remaining jobs self.job_list = [] self.status = JobStatus.ERROR return self.status @@ -244,16 +259,20 @@ def main() -> None: init_logging(args) # Setup required build engine - docker or nerdctl - container_cli = os.getenv("CONTAINER_CLI", "docker") - match container_cli: + container_cmd = [os.getenv("CONTAINER_CLI", "docker")] + match container_cmd[0]: case "nerdctl": - build_cmd = [container_cli, "-n", args.namespace, "build"] - push_cmd = [container_cli, "-n", args.namespace, "push"] + if args.debug: + container_cmd.append("--debug-full") + build_cmd = container_cmd + ["-n", args.namespace, "build"] + push_cmd = container_cmd + ["-n", args.namespace, "push"] case "docker": - build_cmd = [container_cli, "buildx", "build"] - push_cmd = [container_cli, "push"] + if args.debug: + container_cmd.extend(["-D", "-l", "debug"]) + build_cmd = container_cmd + ["buildx", "build"] + push_cmd = container_cmd + ["push"] case _: - logging.critical(f"Container CLI '{container_cli}' is not supported.") + logging.critical(f"Container CLI '{container_cmd[0]}' is not supported.") sys.exit(1) # Setup build options @@ -280,10 +299,11 @@ def main() -> None: job_set: Dict[str, JobQueue] = {} for component in to_do: spec = build_specs[component] + logging.info(f"Starting pre-build for {component}") spec.pre_build() image_name = get_image_name(args.repo, spec.name, args.tag) job_opts = ["-t", image_name, "-f", "Dockerfile", "."] - job_set[component] = JobQueue(component) + job_set[component] = JobQueue(component, debug=args.debug) logging.debug(f"Adding job {build_cmd + job_opts}") job_set[component].add_job(Job(build_cmd + job_opts, spec.dir)) if args.repo is not None: @@ -304,6 +324,7 @@ def main() -> None: time.sleep(5.0) # Run the post_build cleanup functions for component in to_do: + logging.info(f"Starting post-build for {component}") build_specs[component].post_build() # Print job summary if output mode is ALL diff --git a/deploy/scripts/sem_dom_import.py b/deploy/scripts/sem_dom_import.py index d91823f013..fa93a81333 100755 --- a/deploy/scripts/sem_dom_import.py +++ b/deploy/scripts/sem_dom_import.py @@ -218,7 +218,6 @@ def get_sem_doms(node: ElementTree.Element, parent: SemDomTreeMap, prev: SemDomM elif field.tag == "Abbreviation": for abbrev_node in field: lang, id_text = get_auni_text(abbrev_node) - logging.debug(f"id[{lang}]='{id_text}'") domain_set[lang].id = id_text elif field.tag == "Description": for descr_node in field: @@ -296,7 +295,7 @@ def generate_semantic_domains( # Languages can be found in the Name element for sub_elem in elem: lang, name_text = get_auni_text(sub_elem) - logging.info(f"Language code: {lang}") + logging.debug(f"Language code: {lang}") if lang not in domain_tree: domain_tree[lang] = {} if lang not in domain_nodes: @@ -306,9 +305,9 @@ def generate_semantic_domains( prev_domain = get_sem_doms(root, {}, prev_domain) for lang in domain_nodes: - logging.info(f"Number of {lang} Domains: {len(domain_nodes[lang])}") + logging.debug(f"Number of {lang} Domains: {len(domain_nodes[lang])}") for lang in domain_tree: - logging.info(f"Number of {lang} Tree Nodes: {len(domain_tree[lang])}") + logging.debug(f"Number of {lang} Tree Nodes: {len(domain_tree[lang])}") if not flatten_questions: SemanticDomainFull.flatten_questions = False write_json(output_dir) diff --git a/deploy/scripts/setup_files/collector_config.yaml b/deploy/scripts/setup_files/collector_config.yaml index e9a6cc2562..30e243b965 100644 --- a/deploy/scripts/setup_files/collector_config.yaml +++ b/deploy/scripts/setup_files/collector_config.yaml @@ -56,6 +56,6 @@ useGOMEMLIMIT: true resources: requests: cpu: 25m - memory: 256Mi + memory: 128Mi limits: - memory: 512Mi + memory: 128Mi diff --git a/deploy/scripts/setup_files/combine_config.yaml b/deploy/scripts/setup_files/combine_config.yaml index ca9030bbbe..25755f0e17 100644 --- a/deploy/scripts/setup_files/combine_config.yaml +++ b/deploy/scripts/setup_files/combine_config.yaml @@ -125,9 +125,10 @@ profiles: # Set of charts # The set of charts defines properties for each of the charts listed in the profiles above. -# There are 2 keys for each chart: +# There are 3 keys for each chart: # namespace: the namespace where helm should install the chart. Note that the namespace needs to be # created beforehand +# install_langs: add font support for languages specified beyond the defaults # secrets: a list of secrets that are required for each chart. Each secret contains: # config_item: the name of the configuration value that is referenced in the chart's template files # env_var: the name of the environment variable that holds the value for the config_item.