Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use odo with complex NodeJS project (big number of dependencies) #6836

Open
kadel opened this issue May 23, 2023 · 4 comments
Open
Labels
area/dev Issues or PRs related to `odo dev` kind/bug Categorizes issue or PR as related to a bug. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness.

Comments

@kadel
Copy link
Member

kadel commented May 23, 2023

/kind bug

What versions of software are you using?

Operating System:

Output of odo version:
odo v3.10.0 (d558780)

How did you run odo exactly?

git clone https://github.com/backstage/backstage
cd backstage
# place following devfile.yaml to the the directory
odo dev --port-forward 3000:3000 --port-forward 7007:7007
devfile.yaml
schemaVersion: 2.2.0
metadata:
  name: my-backstage

commands:
  - id: install-yarn
    exec:
      commandLine: npm install -g yarn
      workingDir: ${PROJECT_SOURCE}
      component: nodejs

  - id: yarn-install
    exec:
      commandLine: npx yarn install
      component: nodejs
      workingDir: ${PROJECT_SOURCE}
      group:
        kind: build
        isDefault: true
    
  - id: run-start
    exec:
      commandLine: npx yarn run start
      component: nodejs
      workingDir: ${PROJECT_SOURCE}
      group:
        kind: run
        isDefault: true
    
components:
  - name: nodejs
    container:
      image: registry.access.redhat.com/ubi9/nodejs-18:latest
      sourceMapping: /projects
      command: ['tail', '-f', '/dev/null']
      memoryLimit: 2Gi
      # workaround for https://github.com/redhat-developer/odo/issues/6836
      volumeMounts:
        - name: node-modules
          path: /projects/node_modules
      endpoints:
        - name: frontend
          targetPort: 3000
          exposure: public
        - name: backend
          targetPort: 7007
          exposure: public
  
  - name: node-modules
    volume:
      size: 3Gi
      
      

      
events:
  postStart:
    - install-yarn

Actual behavior

 odo dev
  __
 /  \__     Developing using the "my-backstage" Devfile
 \__/  \    Namespace: tkral-dev
 /  \__/    odo version: v3.10.0
 \__/

↪ Running on the cluster in Dev mode
 •  Waiting for Kubernetes resources  ...
 ⚠  Pod is Pending
 ✓  Pod is Running
 ✓  Syncing files into the container [4s]
 ✓  Executing post-start command in container (command: install-yarn) [3s]
 ✗  Building your application in container (command: build) [3m]

added 1 package in 1s
npm notice
npm notice New minor version of npm available! 9.5.0 -> 9.6.7
npm notice Changelog: <https://github.com/npm/cli/releases/tag/v9.6.7>
npm notice Run `npm install -g [email protected]` to update!
npm notice
yarn install v1.22.19
[1/5] Validating package.json...
[2/5] Resolving packages...
2" has unmet peer dependency "@codemirror/state@>=6.0.0".
warning "workspace-aggregator-057fe7c5-b0d7-43a3-9266-e6447bf6795c > app > @backstage/plugin-scaffolder > @uiw/[email protected]" has unmet peer dependency "@codemirror/theme-one-dark@>=6.0.0".
warning "workspace-aggregator-057fe7c5-b0d7-43a3-9266-e6447bf6795c > app > @backstage/plugin-scaffolder > @uiw/[email protected]" has unmet peer dependency "codemirror@>=6.0.0".
warning "workspace-aggregator-057fe7c5-b0d7-43a3-9266-e6447bf6795c > app > @backstage/plugin-scaffolder > @backstage/plugin-scaffolder-react > @rjsf/[email protected]" has incorrect peer dependency "@rjsf/core@^5.0.0".
warning "workspace-aggregator-057fe7c5-b0d7-43a3-9266-e6447bf6795c > app > @backstage/plugin-scaffolder > @uiw/react-codemirror > @uiw/[email protected]" has unmet peer dependency "@codemirror/autocomplete@>=6.0.0".
warning "workspace-aggregator-057fe7c5-b0d7-43a3-9266-e6447bf6795c > app > @backstage/plugin-scaffolder > @uiw/react-codemirror > @uiw/[email protected]" has unmet peer dependency "@codemirror/lint@>=6.0.0".
warning "workspace-aggregator-057fe7c5-b0d7-43a3-9266-e6447bf6795c > app > @backstage/plugin-scaffolder > @uiw/react-codemirror > @uiw/[email protected]" has unmet peer dependency "@codemirror/search@>=6.0.0".
warning "workspace-aggregator-057fe7c5-b0d7-43a3-9266-e6447bf6795c > backend > @backstage/plugin-techdocs-backend > @backstage/plugin-techdocs-node > @aws-sdk/[email protected]" has unmet peer dependency "@aws-sdk/abort-controller@^3.0.0".
warning "workspace-aggregator-057fe7c5-b0d7-43a3-9266-e6447bf6795c > app > @backstage/plugin-api-docs > graphiql > @graphiql/react > [email protected]" has unmet peer dependency "@codemirror/language@^0.20.0".
warning "workspace-aggregator-057fe7c5-b0d7-43a3-9266-e6447bf6795c > app > @backstage/plugin-scaffolder > @uiw/react-codemirror > @uiw/codemirror-extensions-basic-setup > @codemirror/[email protected]" has unmet peer dependency "@lezer/common@^1.0.0".
warning Workspaces can only be enabled in private projects.
warning Workspaces can only be enabled in private projects.
warning Workspaces can only be enabled in private projects.
error Could not write file "/projects/yarn-error.log": "ENOSPC: no space left on device, open '/projects/yarn-error.log'"
error An unexpected error occurred: "ENOSPC: no space left on device, copyfile '/opt/app-root/src/.cache/yarn/v6/npm-date-fns-2.30.0-f367e644839ff57894ec6ac480de40cae4b0f4d0-integrity/node_modules/date-fns/esm/locale/lv/_lib/localize/index.js' -> '/projects/node_modules/date-fns/esm/locale/lv/_lib/localize/index.js'".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
Error occurred on Push - watch command was unable to push component: unable to exec command [/bin/sh -c cd ${PROJECT_SOURCE} && (yarn install) 1>>/proc/1/fd/1 2>>/proc/1/fd/2]: error while streaming command: command terminated with exit code 1

Currently, odo uses 2G PVC for /projects; the problem with that is that node_modules for larger projects can grow beyond that.

odo should allow users to define a bigger volume for source code

@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label May 23, 2023
@github-actions github-actions bot added the needs-triage Indicates an issue or PR lacks a `triage/*` and requires one. label May 23, 2023
@rm3l
Copy link
Member

rm3l commented May 23, 2023

😨 Wow - that's a lot! Reminds me of this ^^
image

Just kidding - can you share the Devfile you used?

I tried to run odo init on this Project, but it seems Alizer panic'ed:

odo init logs
$ odo init                                                                                                                                                                                     
  __                                                                                                                                                                                           
 /  \__     Initializing a new component                                                                                                                                                       
 \__/  \    Files: Source code detected, a Devfile will be determined based upon source code autodetection                                                                                     
 /  \__/    odo version: v3.10.0                                                                                                                                                               
 \__/                                                                                                                                                                                          
                                                                                                                                                                                               
Interactive mode enabled, please answer the following questions:                                                                                                                               
 ✓  Determining a Devfile for the current directory [4s]                                                                                                                                       
panic: regexp: Compile("(let|const|var)\\s+{\n      onUnhandledRequest: ({ headers }\\s*=\\s*([^;]*)"): error parsing regexp: missing closing ): `(let|const|var)\s+{                          
      onUnhandledRequest: ({ headers }\s*=\s*([^;]*)`

goroutine 71 [running]:
regexp.MustCompile({0xc000b4bc70, 0x48})
        /home/asoro/.asdf/installs/golang/1.19.6/go/src/regexp/regexp.go:319 +0xbb
github.com/redhat-developer/alizer/go/pkg/apis/enricher/framework/javascript/nodejs.getPort({0xc000744c80, 0xc6d}, {0xc000b81d80, 0x111f11f?, 0x33acb6e?})
        /home/asoro/work/projects/odo/vendor/github.com/redhat-developer/alizer/go/pkg/apis/enricher/framework/javascript/nodejs/express_detector.go:86 +0x199
github.com/redhat-developer/alizer/go/pkg/apis/enricher/framework/javascript/nodejs.ExpressDetector.DoPortsDetection({}, 0xc0000c3a90, 0xd?)
        /home/asoro/work/projects/odo/vendor/github.com/redhat-developer/alizer/go/pkg/apis/enricher/framework/javascript/nodejs/express_detector.go:51 +0x20b
github.com/redhat-developer/alizer/go/pkg/apis/enricher.JavaScriptEnricher.DoEnrichComponent({}, 0xc0000c3a90, {{0xc00005c184, 0x1e}, {0xc000a98b10, 0x3, 0x3}}, 0x4cc5010?)
        /home/asoro/work/projects/odo/vendor/github.com/redhat-developer/alizer/go/pkg/apis/enricher/javascript_enricher.go:94 +0x5e8
github.com/redhat-developer/alizer/go/pkg/apis/recognizer.enrichComponent(0xc0000c3a90, {{0xc00005c184, 0x1e}, {0xc000a98b10, 0x3, 0x3}}, 0xc000492150?)
        /home/asoro/work/projects/odo/vendor/github.com/redhat-developer/alizer/go/pkg/apis/recognizer/component_recognizer.go:331 +0x89
github.com/redhat-developer/alizer/go/pkg/apis/recognizer.detectComponentByAnalyzingConfigFile({0xc000a33680, 0x41}, {0xc000867610, 0xa}, {{0xc00005c184, 0x1e}, {0xc000a98b10, 0x3, 0x3}}, 0xc000ac6050)
        /home/asoro/work/projects/odo/vendor/github.com/redhat-developer/alizer/go/pkg/apis/recognizer/component_recognizer.go:303 +0x3ae
github.com/redhat-developer/alizer/go/pkg/apis/recognizer.detectComponentUsingConfigFile({0xc000a33680, 0x41}, {0xc00080de40?, 0x2, 0x2}, {{0xc00005c184, 0x1e}, {0xc000a98b10, 0x3, 0x3}}, ...)
        /home/asoro/work/projects/odo/vendor/github.com/redhat-developer/alizer/go/pkg/apis/recognizer/component_recognizer.go:316 +0x15a
github.com/redhat-developer/alizer/go/pkg/apis/recognizer.DetectComponentsFromFilesList({0xc0010b6000, 0x2b50, 0xc000ac6050?}, {{0xc00005c184, 0x1e}, {0xc000a98b10, 0x3, 0x3}}, 0xc000a98b10?)
        /home/asoro/work/projects/odo/vendor/github.com/redhat-developer/alizer/go/pkg/apis/recognizer/component_recognizer.go:229 +0x327
github.com/redhat-developer/alizer/go/pkg/apis/recognizer.detectComponentsWithSettings({{0xc00005c184, 0x1e}, {0xc000a98b10, 0x3, 0x3}}, 0x4b4e680?)
        /home/asoro/work/projects/odo/vendor/github.com/redhat-developer/alizer/go/pkg/apis/recognizer/component_recognizer.go:86 +0xa5
github.com/redhat-developer/alizer/go/pkg/apis/recognizer.detectComponentsWithPathAndPortStartegy(...)
        /home/asoro/work/projects/odo/vendor/github.com/redhat-developer/alizer/go/pkg/apis/recognizer/component_recognizer.go:55
github.com/redhat-developer/alizer/go/pkg/apis/recognizer.DetectComponents({0xc00005c184, 0x1e})
        /home/asoro/work/projects/odo/vendor/github.com/redhat-developer/alizer/go/pkg/apis/recognizer/component_recognizer.go:34 +0xd1
github.com/redhat-developer/odo/pkg/alizer.(*Alizer).DetectPorts(0x34442f0?, {0xc00005c184, 0x1e})
        /home/asoro/work/projects/odo/pkg/alizer/alizer.go:128 +0x2d
github.com/redhat-developer/odo/pkg/init/backend.(*AlizerBackend).SelectDevfile.func1.1(0xc000699ae0, {0x380a598, 0xc000992fc0}, {0xc00005c184, 0x1e})
        /home/asoro/work/projects/odo/pkg/init/backend/alizer.go:57 +0x3af
github.com/redhat-developer/odo/pkg/init/backend.(*AlizerBackend).SelectDevfile.func1()
        /home/asoro/work/projects/odo/pkg/init/backend/alizer.go:80 +0x36
created by github.com/redhat-developer/odo/pkg/init/backend.(*AlizerBackend).SelectDevfile
        /home/asoro/work/projects/odo/pkg/init/backend/alizer.go:46 +0x12a

@kadel kadel changed the title Unable to use odo with larger NodeJS project. Unable to use odo with complex NodeJS project. May 23, 2023
@kadel kadel changed the title Unable to use odo with complex NodeJS project. Unable to use odo with complex NodeJS project (big number of dependencies) May 23, 2023
@rm3l rm3l added area/dev Issues or PRs related to `odo dev` needs-triage Indicates an issue or PR lacks a `triage/*` and requires one. and removed needs-triage Indicates an issue or PR lacks a `triage/*` and requires one. labels Jun 29, 2023
@rm3l
Copy link
Member

rm3l commented Jun 29, 2023

Grooming (Jun 29, 2023):

  • Flag to set the /projects volume size: --projects-volume-size

@rm3l rm3l removed the needs-triage Indicates an issue or PR lacks a `triage/*` and requires one. label Jun 29, 2023
@github-actions
Copy link
Contributor

A friendly reminder that this issue had no activity for 90 days. Stale issues will be closed after an additional 30 days of inactivity.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Sep 28, 2023
@rm3l rm3l removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Sep 28, 2023
Copy link
Contributor

A friendly reminder that this issue had no activity for 90 days. Stale issues will be closed after an additional 30 days of inactivity.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Dec 28, 2023
@rm3l rm3l added lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jan 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/dev Issues or PRs related to `odo dev` kind/bug Categorizes issue or PR as related to a bug. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness.
Projects
Status: No status
Development

No branches or pull requests

2 participants