rubyjs / therubyracer

Embed the V8 Javascript Interpreter into Ruby
1.67k stars 190 forks source link

Precompile freezing during kubernetes deploy #465

Closed noir-fm closed 7 months ago

noir-fm commented 2 years ago

Hi!

We encountered strange gem behavior when working with the stack

Jenkins - Kubernetes Version: v1.20.6

When doing a job

      - name: precompile-assets

        image: imagename

        command: ['sh', '-c', 'rake assets:precompile']

        envFrom:

        - configMapRef:

            name: ehr-init-configmap

        - configMapRef:

            name: ehr-pg-configmap

        volumeMounts:

          - mountPath: "/app/public"

            name: ehr

      containers:

      - name: done

        imagePullPolicy: IfNotPresent

        image: busybox

        command: ['sh', '-c', 'echo "run-migrations and precompile-assets completed"']

      imagePullSecrets:

      - name: credockerhub

Pod precompile-assets hangs in Notready state

The main oddity is that the problem does not reproduce regularly. About 1 time out of 5.

Gem version therubyracer (0.12.3)

Pod logs with --trace

** Invoke assets:precompile (first_time)

** Invoke assets:environment (first_time)

** Execute assets:environment

** Invoke environment (first_time)

** Execute environment

W, [2022-03-23T15:45:46.425409 #6]  WARN -- : Ehr::Direction::ServiceRequest: overriding method 'invalid?'!

W, [2022-03-23T15:45:46.426528 #6]  WARN -- : Ehr::Direction::ServiceRequest: overriding method 'not_sent?'!

** Invoke yarn:install (first_time)

** Execute yarn:install

** Execute assets:precompile

W, [2022-03-23T15:46:05.260395 #6]  WARN -- : Removed sourceMappingURL comment for missing asset 'jsoneditor.map' from /app/app/assets/javascripts/jsoneditor.js

W, [2022-03-23T15:46:05.260635 #6]  WARN -- : Removed sourceMappingURL comment for missing asset 'jsoneditor.map' from /app/app/assets/javascripts/jsoneditor.js

W, [2022-03-23T15:46:05.265931 #6]  WARN -- : Removed sourceMappingURL comment for missing asset 'jsoneditor.map' from /app/app/assets/javascripts/jsoneditor.js

when the job does not work correctly in the logs of jenkins, it constantly repeats

13:45:12  One or more Pods still initializing

13:45:12 

13:45:12  [Pipeline] sleep

13:45:12  Sleeping for 3 sec

13:45:15  [Pipeline] sh

13:45:15  + kubectl get jobs --kubeconfig=/var/jenkins_home/.kube/dev -n dev -l pre-deploy==ehr -o jsonpath={.items[].status.conditions[?(@.type=="Complete")].status} --ignore-not-found=true

13:45:15  [Pipeline] sh

13:45:15  + date --iso-8601=seconds

13:45:15  [Pipeline] sh

13:45:16  + kubectl logs ehr-pre-deploy-mzvml --kubeconfig=/var/jenkins_home/.kube/dev -n dev --all-containers=true --since-time=2022-03-23T13:45:11+02:00 --tail=-1

13:45:16  + echo One or more Pods still initializing

when the job is working correctly, deploy successfully end with message:

Copying assets (preserving modes) to /app/public/assets/tinymce

lloeki commented 7 months ago

Sorry but this gem is unmaintained, so I will close this issue.

We recommend going with mini_racer + libv8-node. If you feel the issue is still relevant to either of those, please open an issue over there!