rucio / rucio/webui

Building the WebUI uses too many resources in a limited resource environment

Open
#484 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

DevOps
Dominant language
TypeScript
Stars
5
Forks
36
Avg merge
6d 17h
Merged PRs (30d)
7

Description

Description

In our k8s cluster, our resources are limited. When deploying the WebUI with the official rucio/helm-charts, the pod that builds the webui crashes. The error in the logs is:

uncaughtException Error: spawn /usr/bin/node EAGAIN
  at ChildProcess._handle.onexit (node:internal/child_process:286:19)
  at onErrorNT (node:internal/child_process:484:16)
  at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
    errno: -11,
    code: 'EAGAIN',
    syscall: 'spawn /usr/bin/node',
    path: '/usr/bin/node',
    spawnargs: [
      '/opt/rucio/webui/node_modules/next/dist/compiled/jest-worker/processChild.js'
    ]
  }

This could be due to the pod requesting more processes or threads that is available.

Motivation

Some environments where the WebUI will be deployed in have limited resources, which would need to be accounted for, especially since the WebUI needs to be built every time it is deployed.

Change

According to https://kdaws.com/learn/fixing-next-js-error-spawn-errno-11-on-cpanel-and-plesk-with-cloudlinux/, there is a configuration in next.config.js that can be set:

module.exports = {
  distDir: 'build',
  experimental: {
    // This is experimental but can
    // be enabled to allow parallel threads
    // with nextjs automatic static generation
    workerThreads: false,
    cpus: 4
  }
};

In my use case, setting cpus: 1 and manually running docker-entrypoint.sh in our pod allows the build to work.

Additional Information
  • It is related to the Storybook?
  • It is related to the GitHub Actions?
  • It is related to the developer tools?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting next.config.js and docker-entrypoint.sh, then reproduce the WebUI build in a resource-limited Kubernetes pod. Compare the build behavior with the suggested CPU and worker settings; done means the deployment builds successfully without the spawn EAGAIN failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, helm, kubernetes, next.js, node.js, typescript
Domain
build-system, devops, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.