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

HDDS-7569. Recon: pnpm and other library update to latest version. #4070

Closed
wants to merge 6 commits into from

Conversation

smitajoshi12
Copy link
Contributor

What changes were proposed in this pull request?

Currently Recon is still using v16.14.2 upgrade to New node version and update package.json with new updated versions.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-7569

How was this patch tested?

Manually Please check at your end also some times having build issue to create lib in taget folder.

@kerneltime
Copy link
Contributor

@devmadhuu @dombizita can you'll please take a look

@@ -233,7 +233,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs
<checkstyle.version>9.3</checkstyle.version>
<surefire.fork.timeout>1200</surefire.fork.timeout>
<aws-java-sdk.version>1.12.261</aws-java-sdk.version>
<frontend-maven-plugin.version>1.12.0</frontend-maven-plugin.version>
<frontend-maven-plugin.version>1.12.1</frontend-maven-plugin.version>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this the culprit where it fails to create dir?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh looks like the build is failing in CI:

https://github.com/apache/ozone/actions/runs/3677105755/jobs/6218636117

[INFO] --- frontend-maven-plugin:1.12.1:npx (set pnpm@7.18.1 store path) @ ozone-recon ---
[INFO] npm not inheriting proxy config from Maven
[INFO] Running 'npx pnpm@7.18.1 config set store-dir ~/.pnpm-store' in /home/runner/work/ozone/ozone/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web
[INFO] npm ERR! code ENOENT
[INFO] npm ERR! syscall lstat
[INFO] npm ERR! path /home/runner/work/ozone/ozone/hadoop-ozone/recon/target/lib
[INFO] npm ERR! errno -2
[INFO] npm ERR! enoent ENOENT: no such file or directory, lstat '/home/runner/work/ozone/ozone/hadoop-ozone/recon/target/lib'
[INFO] npm ERR! enoent This is related to npm not being able to find a file.
[INFO] npm ERR! enoent 
[INFO] 
[INFO] npm ERR! A complete log of this run can be found in:
[INFO] npm ERR!     /home/runner/.npm/_logs/2022-12-12T15_16_06_248Z-debug-0.log

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes Same Issue is happening in Local also. Not able to understand root cause

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@smitajoshi12 - pls check if below link will help. Few community members have reported since v7 of pnpm
pnpm/pnpm#4658

cc: @smengcl

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can see bin is created using this command pnpm bin and pnpm store path /home/root1/.pnpm-store/v3 If I do pnpm run build then local pnpm build is successful but if we do build with Maven then it is failing because of lib folder in target of Recon.

Copy link
Contributor

@smengcl smengcl Dec 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I attempted to create directory by adding a plugin in initialize phase in recon pom but it didn't seem to work (the lib directory doesn't seem to be created at all despite maven build shows this is being executed):

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <id>Workaround: Create lib directory under target</id>
            <phase>initialize</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <target name="Create lib dir">
                <mkdir dir="${project.build.directory}/lib"/>
              </target>
            </configuration>
          </execution>
        </executions>
      </plugin>

Copy link
Contributor

@smengcl smengcl Dec 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect that npx somehow lost track of its node_modules root directory path in the process. Might be a bug in frontend-maven-plugin or npx or npm or pnpm. I don't know too much about those nodejs build system so I can't be sure without digging even further. At least I see tons of lib directory for each nodejs module:

ozone$ find . -name lib
...
./hadoop-ozone/recon/target/node/node_modules/npm/node_modules/npm-bundled/node_modules/npm-normalize-package-bin/lib
./hadoop-ozone/recon/target/node/node_modules/npm/node_modules/npm-bundled/lib
./hadoop-ozone/recon/target/node/node_modules/npm/node_modules/nopt/lib
./hadoop-ozone/recon/target/node/node_modules/npm/lib
...

If this is the case merely creating the empty directory won't do much either, since it might still need the actual .js files in it. But we can try.

Need to debug this somehow. Or search for solutions.

@smitajoshi12 smitajoshi12 changed the title HDDS-7569. Recon: Bump nodejs to latest LTS (18.12.1) Upgrade packag HDDS-7569. Recon: Bump nodejs to latest LTS (18.12.1) Upgrade packag. Feb 7, 2023
@smitajoshi12 smitajoshi12 changed the title HDDS-7569. Recon: Bump nodejs to latest LTS (18.12.1) Upgrade packag. HDDS-7569. Recon: Bump nodejs to latest LTS (18.12.1) Upgrade package Feb 7, 2023
@smitajoshi12 smitajoshi12 changed the title HDDS-7569. Recon: Bump nodejs to latest LTS (18.12.1) Upgrade package HDDS-7569. Recon: pnpm and other library update to latest version. Feb 7, 2023
@smengcl smengcl marked this pull request as ready for review February 7, 2023 19:09
@smengcl
Copy link
Contributor

smengcl commented Feb 10, 2023

@smitajoshi12 Can you address the license check failure? The new .npmrc file has to have an Apache 2.0 license header.

@smitajoshi12
Copy link
Contributor Author

@smengcl

Do you mean below Changes we need to do in .npmrc file?

image

@smengcl
Copy link
Contributor

smengcl commented Feb 28, 2023

Looks like the change here is failing the CI because of OOM:

[INFO] <--- JS stacktrace --->
[INFO] 
[INFO] FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
[INFO]  1: 0xb09980 node::Abort() [node]
[INFO]  2: 0xa1c235 node::FatalError(char const*, char const*) [node]
[INFO]  3: 0xcf784e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
[INFO]  4: 0xcf7bc7 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
[INFO]  5: 0xeaf465  [node]
[INFO]  6: 0xebf12d v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
[INFO]  7: 0xec1e2e v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
[INFO]  8: 0xe8336a v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [node]
[INFO]  9: 0x11fc0b6 v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [node]
[INFO] 10: 0x15f0b19  [node]
[INFO]  ELIFECYCLE  Command failed with exit code 1.
Error: The operation was canceled.

https://github.com/smitajoshi12/ozone/actions/runs/4193312304/jobs/7270039425

@smitajoshi12 Can you look into that? See what is causing the memory issue.

Although this might be a GitHub action issue, I can't merge this in this state because once I do that it could start to fail master branch CI build.

* See the License for the specific language governing permissions and
* limitations under the License.
*/
store-dir=~/.pnpm-store
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try:

NODE_OPTIONS=--max_old_space_size=5120

@smitajoshi12
Copy link
Contributor Author

Closing PR Having Some Issues in CI Build for Heap out of Memory so will raise new PR for pnpm new version update.

@smitajoshi12 smitajoshi12 deleted the HDDS-7569 branch April 16, 2024 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
5 participants