cloudfoundry / bosh-deployment-resource

Apache License 2.0
12 stars 26 forks source link

Added support for uploading stemcells directly from bosh.io #64

Closed rkoster closed 4 years ago

rkoster commented 4 years ago

My usecase is similar to https://github.com/cloudfoundry/bosh-deployment-resource/issues/62.

Wanting to upload the stemcell for kubo or cf directly from bosh.io.

I have added an bosh_io_stemcell_type param which supports light and regular. I'm open to suggestions on better naming for the feature (maybe auto_stemcell_upload?)

rkoster commented 4 years ago

Have added tests, PR is ready for review

rkoster commented 4 years ago

@drich10 would you be able to review this PR?

drich10 commented 4 years ago

Thanks for the PR! Yes I should be able to review this sometime in the next few days.

Would you mind explaining the value of this to you over using the concourse stemcell resource in a previous step? Just looking for some additional context 😄

rkoster commented 4 years ago

Since cf-deployment uses a hard coded stemcell version there can be situations where this stemcell is not yet uploaded to the bosh director.

You could work around this by using the version_family in the bosh-io-stemcell-resource, however you would need to update your pipeline manually for that, each time a stemcell bump happens. This is due to the limitation in concourse, a script can not ask for a specific version of a resource. You will always get the latest version. Or the last version which has passed some other task.

Also because the stemcell version could be overwritten with an opsfile ideally the logic on making sure the stemcell exists on the director should happen on the interpolated_manifest. One could theoretically implement a task which would act as a gate and only succeed if the version of the stemcell matches the stemcell specified in the manifest. But you would need to keep the lists of opsfiles in sync with the ones used by the bosh-deployment-resource.

So all the above is why I came to the conclusion that it would be best to add bosh io related logic in the bosh-deployment-resource. Since we already have the credentials for talking to bosh + the information needed to render an interpolated_manifest. To make sure this would not slow down deployments where the stemcell already exists I have used a feature of the bosh cli, which can skip upload when the stemcell already exists when the --name and --version flags are passed.

rkoster commented 4 years ago

ping @drich10

drich10 commented 4 years ago

Look for a new released version with this in it in the next few days!

rkoster commented 4 years ago

@drich10 Thanks!