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

feat: add Node.js 20 rock for Noble #8

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

linostar
Copy link

This add the rockcraft.yaml for Node.js built on 24.04.

Since there is no apt package for Node.js 20 on 24.04 yet (currently there is only Node.js 18 there), I opted to install Nodejs binaries using snap instead.

Note that the Nodejs snap include the package managers npm and yarn. yarn in particular needs bash, coreutils and sed to work because it is basically a shell script.

This is waiting on canonical/chisel-releases#182 to be merged.

@rebornplusplus
Copy link
Member

canonical/chisel-releases#182 is merged.

@rebornplusplus
Copy link
Member

Could you please update the GitHub workflow so that it runs the tests on the node20 image too?

@linostar linostar force-pushed the ROCKS-1053/feat/create-nodejs-rock branch 3 times, most recently from 666e4dc to 71741df Compare March 28, 2024 15:20
@linostar linostar force-pushed the ROCKS-1053/feat/create-nodejs-rock branch from 71741df to f203c8c Compare March 28, 2024 20:00
Copy link
Collaborator

@cjdcordeiro cjdcordeiro left a comment

Choose a reason for hiding this comment

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

Thanks. Interesting work.

TBH, I wouldn't merge this because it can easily backfire on us. For several reasons:

  1. node20 isn't in the archives, so what is our support commitment for such an image?
  2. I'm not too sure about the rockfile. I.e., slices are being installed, but then the whole node snap is also being installed, which by itself should already bring the node dependencies (which btw, are not chiselled). So is it really chiselled?

@linostar
Copy link
Author

linostar commented Apr 3, 2024

Thanks. Interesting work.

TBH, I wouldn't merge this because it can easily backfire on us. For several reasons:

1. node20 isn't in the archives, so what is our support commitment for such an image?

2. I'm not too sure about the rockfile. I.e., slices are being installed, but then the whole node snap is also being installed, which by itself should already bring the node dependencies (which btw, are not chiselled). So is it really chiselled?
  1. This was done because Snyk was looking for node20 rock. Understandably, this is not technically a rock, but it is as close as it can be since node20 isn't in ubuntu archives yet.
  2. When I was experimenting with node snap in a bare rock, the node binary was throwing errors on launch because of missing dep libs. This is likely due to the fact that the node binary is not staticly linked. So beside the slices found in the Dockerfile, I added the dependencies required one by one until node was able to run properly.

@cjdcordeiro
Copy link
Collaborator

This was done because Snyk was looking for node20 rock. Understandably, this is not technically a rock, but it is as close as it can be since node20 isn't in ubuntu archives yet.

True. And don't get me wrong. This is useful. I would keep this as a feature branch.
We will eventually have to do it, but I suspect the patch will rather be by using the actual source (or something we can maintain and chisel), rather than a snap we don't own.

@linostar
Copy link
Author

linostar commented Apr 3, 2024

This was done because Snyk was looking for node20 rock. Understandably, this is not technically a rock, but it is as close as it can be since node20 isn't in ubuntu archives yet.

True. And don't get me wrong. This is useful. I would keep this as a feature branch. We will eventually have to do it, but I suspect the patch will rather be by using the actual source (or something we can maintain and chisel), rather than a snap we don't own.

I will keep this branch then as a feature and change the rock so it uses something other the node snap.
I will create another PR for node 18 on 24.04.

@cjdcordeiro
Copy link
Collaborator

@linostar
Copy link
Author

linostar commented Apr 3, 2024

it already exists: https://github.com/canonical/chiselled-nodejs/blob/main/node18/Dockerfile.24.04

But not as a rock. Aren't we going to rockify it like we did with Python before?

@cjdcordeiro
Copy link
Collaborator

when it's time to publish it, yes. But that's not a priority for now.

@cthtrifork
Copy link

Any news on supporting v20? Has any circumstances changed ?

@linostar
Copy link
Author

Node.js 20 is available in Ubuntu 24.10 archives (https://packages.ubuntu.com/oracular/nodejs), so once we finish migrating chisel slice definition files from 24.04 to 24.10, creating a rock for Node.js 20 will be very straightforward.

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

Successfully merging this pull request may close these issues.

4 participants