Re: On boarding of a new CF system build pack for Rust


Kashyap Vedurmudi
 

Hi all - My team at VMware contributes to both the v2 Cloud Foundry buildpacks as well as the Paketo Buildpacks project (v3). Just to re-iterate a couple points above and add a few others, you have a couple options here:
  1. Build a custom v2 Rust Buildpack and set add this to the system buildpack list as a CF admin (cf create-buildpack). This is likely the best short term option if you'd like to support this without integrating pack in CI and pushing with the --docker-image flag. A quick google search shows that there are a couple existing community Rust buildpacks that you can probably reference. https://github.com/ELD/rust-buildpack and https://github.com/amsantavicca/cloudfoundry-buildpack-rust. These haven't been updated in years though, so could be better to refer to the Paketo Rust buildpack to understand build/detection logic. 
  2. Use the v3 Paketo Rust buildpack, the pack CLI, and cf push with the --docker-image flag. As Dan mentioned, this should work but probably isn't ideal for larger orgs. 
  3. (long term, this doesn't actually exist yet) - Use a v3 to v2 buildpack "shim". One of the things our team at VMware has been exploring is to implement a generic "shim" tool to convert v3 Paketo Buildpacks into v2 buildpacks that can be used in CF. This doesn't exist yet, but I thought I'd mention it as this would likely be the best way to support new languages in CF in the long term.
As others in the thread have mentioned, my team at VMware is focusing most of our development efforts on v3 Paketo Buildpacks and likely won't have the bandwidth to build a v2 Rust buildpack. That said, Rust is definitely growing in popularity, so I'm happy to discuss any of these options above in depth, André. Feel free to keep the discussion going here or start a thread in the #buildpacks channel on CF slack.

Thanks,
Kashyap


From: cf-dev@... <cf-dev@...> on behalf of Dr Nic Williams <drnicwilliams@...>
Sent: Monday, May 10, 2021 4:45 AM
To: cf-dev@... <cf-dev@...>
Subject: Re: [cf-dev] On boarding of a new CF system build pack for Rust
 
Custom buildpacks (v2) can be installed in airgapped and enterprise CF. You convert the buildpack and it’s dependencies into a zip file and the CF admin installs it for all users to share, like you would upgrade a buildpack from the core CF team.

Paketo buildpacks (v3) — your own plus upstream — are baked into your builder Docker image, so again you have control over what buildpack you are using across all apps.

Nic

On Mon, 10 May 2021 at 6:28 pm, Borrmann, Andre via lists.cloudfoundry.org <a.borrmann=sap.com@...> wrote:

Hi Dr. Nic,

 

thanks for your reply and the links shared to the new buildpacks and the tutorial. As I’d like to use the buildpack within an enterprise context such custom buildpack would be a good starting point, but the ultimate goal would be to get it listed as part of this: https://docs.cloudfoundry.org/buildpacks/system-buildpacks.html

 

If I get you right, the CF core team/paketo team might be the right contacts to talk to about this topic to get a Rust buildpack eventually a core/system buildpack? Are you able to share some contact details to start the communication with the right audience straight away?

 

Thanks in advance.

 

BR

André

 

From: <cf-dev@...> on behalf of Dr Nic Williams <drnicwilliams@...>
Reply-To: "cf-dev@..." <cf-dev@...>
Date: Sunday, 9. May 2021 at 00:01
To: "cf-dev@..." <cf-dev@...>
Subject: Re: [cf-dev] On boarding of a new CF system build pack for Rust

 

Skipping the question of “core buildpacks” which is a good one but I can’t answer it.

 

I can point you to two paths for authoring Buildpacks, depending on which CF your using.

 

Newer CF/kubernetes CF uses Paketo buildpacks 

https://paketo.io/ which are implementations of the Cloud Native Buildpacks project https://buildpacks.io — the latter page has a tutorial for creating a buildpack; and the former is a collection of buildpacks. If you want your Rust buildpack to be “core” one day, cargo cult the core team/paketo team’s buildpacks rather than implement yours from scratch.

 

If you’re on an older CF, and using the older buildpacks then yes you can create a Rust buildpack, but it will never be included in “core” — the core team/paketo team is solely working on the new set of buildpakcs above. I wrote some tutorials for creating the older buildpacks; but I hesitate to recommend them since they are “the old way” :)

 

Dr Nic

--

Dr Nic Williams

+61 437 276 076

twitter @drnic

--
Dr Nic Williams
+61 437 276 076
twitter @drnic

Join cf-dev@lists.cloudfoundry.org to automatically receive all group messages.