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

Optimize disk usage by colocating Jenkins workspaces #3897

Open
targos opened this issue Sep 10, 2024 · 11 comments
Open

Optimize disk usage by colocating Jenkins workspaces #3897

targos opened this issue Sep 10, 2024 · 11 comments

Comments

@targos
Copy link
Member

targos commented Sep 10, 2024

At the moment, each Jenkins job runs in its own workspace.
Since most of our machines are able to run only one job at a time, I suggest that we configure some of the jobs that require to build the node binary, to all run on a specific hardcoded workspace.
That way, we wouldn't have multiple copies of the build artifacts.

@targos targos changed the title Optimize disk usage by Jenkins workspaces Optimize disk usage by colocating Jenkins workspaces Sep 10, 2024
@targos
Copy link
Member Author

targos commented Sep 10, 2024

Example of a host that would benefit from it: https://ci.nodejs.org/computer/test%2Dibm%2Dubuntu2204%2Dx64%2D2/

root@test-ibm-ubuntu2204-x64-2:~# df -h
Filesystem      Size  Used Avail Use% Mounted on
tmpfs           390M  1.1M  388M   1% /run
/dev/xvda2       24G   22G  829M  97% /
root@test-ibm-ubuntu2204-x64-2:~# du -sh /home/iojs/build/workspace/*
615M    /home/iojs/build/workspace/citgm-smoker
2.9G    /home/iojs/build/workspace/node-stress-single-test
2.0G    /home/iojs/build/workspace/node-test-commit-custom-suites-freestyle
20K     /home/iojs/build/workspace/node-test-commit-custom-suites-freestyle@tmp
3.4G    /home/iojs/build/workspace/node-test-commit-linux
4.0K    /home/iojs/build/workspace/node-test-commit-linux@tmp
365M    /home/iojs/build/workspace/node-test-node-addon-api-new

We could save about 5GB (and possibly some compilation time) if node-stress-single-test, node-test-commit-custom-suites-freestyle, and node-test-commit-linux used the same workspace.

@richardlau
Copy link
Member

SGTM

@RedYetiDev
Copy link
Member

Theoretically, we could also build the node binary in GitHub actions, which are running these jobs anyway, and download it as an artifact to save time?

@richardlau
Copy link
Member

Theoretically, we could also build the node binary in GitHub actions, which are running these jobs anyway, and download it as an artifact to save time?

No, because GH actions does not support all of the platforms we build for.

@targos
Copy link
Member Author

targos commented Sep 16, 2024

I started by updating https://ci.nodejs.org/view/All/job/node-test-commit-custom-suites-freestyle/ and https://ci.nodejs.org/view/All/job/node-test-commit-linux/
Their custom workspace is now /home/iojs/build/workspace/node

@richardlau
Copy link
Member

richardlau commented Sep 16, 2024

I started by updating https://ci.nodejs.org/view/All/job/node-test-commit-custom-suites-freestyle/ and https://ci.nodejs.org/view/All/job/node-test-commit-linux/ Their custom workspace is now /home/iojs/build/workspace/node

FYI nodejs/jenkins-alerts#2871

[root@test-ibm-rhel9-x64-1 ~]# df -h /
Filesystem      Size  Used Avail Use% Mounted on
/dev/xvda2       24G   21G  1.5G  94% /
[root@test-ibm-rhel9-x64-1 ~]# du -hs /home/iojs/build/workspace/*
3.1G    /home/iojs/build/workspace/node
2.9G    /home/iojs/build/workspace/node-stress-single-test
3.2G    /home/iojs/build/workspace/node-test-commit-linux
4.0K    /home/iojs/build/workspace/node-test-commit-linux@tmp
4.0K    /home/iojs/build/workspace/node@tmp
[root@test-ibm-rhel9-x64-1 ~]#

I'll delete the node-stress-single-test and node-test-commit-linux workspaces.

@targos
Copy link
Member Author

targos commented Sep 17, 2024

The changes seem to work, but now I'm not sure how to handle node-stress-single-test. The job runs on machines that don't have /home/iojs/build/workspace (macOS, Windows).
I would like to use a relative path instead, but I'm not sure what "remote FS root" means in the inline documentation:

CleanShot 2024-09-17 at 18 13 43@2x

@richardlau
Copy link
Member

AFAIK "remote FS root" is a combination of:

which is how we end up with:

So I think we can set the workspace in the job to a relative "node".

@targos
Copy link
Member Author

targos commented Sep 18, 2024

@targos
Copy link
Member Author

targos commented Sep 18, 2024

I cancelled it and reverted the config change. It ran in /home/iojs/build/node on the workspace machine and C:\node on Windows.

@targos
Copy link
Member Author

targos commented Sep 18, 2024

Trying again with workspace/node: https://ci.nodejs.org/job/node-stress-single-test/537/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants