cf-platform-eng / tile-generator

Tools to develop, package, test, and deploy software on Pivotal Cloud Foundry
https://docs.pivotal.io/tiledev/tile-generator.html
Apache License 2.0
87 stars 60 forks source link

Pushing applications with cflinuxfs4 #325

Open acrmp opened 1 year ago

acrmp commented 1 year ago

The tile generator is currently hard-coded to push applications specifying the cflinuxfs3 stack if it is available. https://github.com/cf-platform-eng/tile-generator/blob/8cbcfb26a0dd7df3469b0bad361f5a562babd0a7/tile_generator/templates/jobs/deploy-all.sh.erb#L220-L227

It would be nice to be able to use cflinuxfs4 when it is available.

Prefer cflinuxfs4

One option would be to do something similar to what currently exists and use cflinuxfs4 if it is available, falling back to cflinuxfs3. For example:

function get_stack() {
    latest_stack="$($CF stacks | grep 'cflinuxfs' | sort -Vr | head -n1 | awk '{print $1}')"
    if [ -z "$latest_stack" ]; then
        echo >&2 "Using default stack"
    else
        echo >&2 "Using $latest_stack stack"
        echo "-s $latest_stack"
    fi
}

This has some potential to break tiles that don't work on cflinuxfs4, though that could be a good thing if it encourages adoption of cflinuxfs4.

It might also not work if operators were on a version of TAS 3.0 that has cflinuxfs4 but does not have a buildpack with support for cflinuxfs4 that is used when pushing the app. https://docs.vmware.com/en/VMware-Tanzu-Application-Service/3.0/tas-for-vms/runtime-rn.html#jammy-jellyfish-stack-support-beta-17

Default stack

Another option is to use the configured default stack. This means that the operator would control the stack used, though teams that are shipping tiles may prefer to have their applications use the latest stack that is available.

With the release of TAS 4.0 operators can choose to set cflinuxfs4 as the default stack: https://docs.vmware.com/en/VMware-Tanzu-Application-Service/4.0/tas-for-vms/runtime-rn.html

Specified by tile developers

Another option would be to allow tile developers to specify the stack that should be used at build time.

cf-gitbot commented 1 year ago

We have created an issue in Pivotal Tracker to manage this. Unfortunately, the Pivotal Tracker project is private so you may be unable to view the contents of the story.

The labels on this github issue will be updated when the story is started.

peterhaochen47 commented 1 year ago

+1 on this (on behalf of credhub service broker tile). Meanwhile, we'll override it just like https://github.com/vmware-tanzu/nozzle-for-microsoft-azure-log-analytics/pull/26/files