Skip to content

Conversation

@kathap
Copy link
Contributor

@kathap kathap commented Oct 22, 2025

  • Add blobstore_cli_config templates (buildpacks/droplets/packages/resource_pool) to api, worker and clock job
  • Pass default timeout of 41s if azure storage cli is used
  • Each job now renders:
    • storage_cli_config_droplets.json
    • storage_cli_config_buildpacks.json
    • storage_cli_config_packages.json
    • storage_cli_config_resource_pool.json
  • Update template specs for per-scope rendering
  • Keeps provider optional; non-Azure scopes render {}

New optional property in manifest: cc.[scope].blobstore_provider for each of buildpacks, droplets, packages, and resource_pool.
Default is nil (unset). If you set it to AzureRM, the job renders a storage_cli_config_[scope].json using the values under cc.[scope].connection_config (e.g., azure_storage_account_name, azure_storage_access_key, container_name, etc.).
If you leave it unset or set a non-Azure value, the template renders {} and existing behaviour is unchanged.

Manifest example:

cc:
  packages:
    blobstore_type: storage-cli
    blobstore_provider: AzureRM
    packages_directory_key: some-key
    connection_config:
      azure_storage_account_name: ((azure_account))
      azure_storage_access_key:   ((azure_key))
      container_name:             cc-packages
      ...

- Add blobstore_configs.json.erb (combines buildpacks/droplets/packages/resource_pool)
- Update job specs to render one template
- Pre-start now writes storage_cli_config_{buildpacks,droplets,packages,resource_pool}.json

Co-Authored-By: johha <johannes.haass@sap.com>
@jochenehret jochenehret self-requested a review October 24, 2025 09:42
jochenehret
jochenehret previously approved these changes Oct 24, 2025
Copy link
Contributor

@jochenehret jochenehret left a comment

Choose a reason for hiding this comment

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

Tested on bbl dev env, works.

@sethboyles
Copy link
Member

question why do we need to render the .json files at pre-start time, rather than have them rendered via bosh templates?

@kathap
Copy link
Contributor Author

kathap commented Oct 27, 2025

question why do we need to render the .json files at pre-start time, rather than have them rendered via bosh templates?
When we render them via bosh templates, we need 1 template file for each config json, that are 12 jsons additionally with nearly the same code, if we render them in pre-start and have 1 generic template per job, we just need 3 jsons extra in total.

@sethboyles
Copy link
Member

Ah, I see. BOSH templating sadly isn't super flexible for this sort of thing. I went down a rabbit hole today trying to see if there was any good way to share templating logic, but didn't find much.

Still, it's unfortunate that we need to introduce an additional possible failure point in pre-start task for some templating...

Is it possible to do something like the shared_job_templates instead? I think it would be something like 4 different templates in that directory:

storage_cli_config_buildpacks.json.erb
storage_cli_config_resources.json.erb
storage_cli_config_droplets.json.erb
storage_cli_config_packages.json.erb

And then in each of the 3 jobs that needs them, use a symlink. You can see how this is done with setup_local_blobstore or any of the other files in that directory. I know this is less DRY than your method (4 files with duplicate content instead of 3), but has the advantage of being contained to the template rendering step of a BOSH deploy.

@kathap
Copy link
Contributor Author

kathap commented Oct 28, 2025

Ah, I see. BOSH templating sadly isn't super flexible for this sort of thing. I went down a rabbit hole today trying to see if there was any good way to share templating logic, but didn't find much.

Still, it's unfortunate that we need to introduce an additional possible failure point in pre-start task for some templating...

Is it possible to do something like the shared_job_templates instead? I think it would be something like 4 different templates in that directory:

storage_cli_config_buildpacks.json.erb
storage_cli_config_resources.json.erb
storage_cli_config_droplets.json.erb
storage_cli_config_packages.json.erb

And then in each of the 3 jobs that needs them, use a symlink. You can see how this is done with setup_local_blobstore or any of the other files in that directory. I know this is less DRY than your method (4 files with duplicate content instead of 3), but has the advantage of being contained to the template rendering step of a BOSH deploy.

We thought the shared_templates folder is a bit outdated and not used really, and that symlinks are not the preferred option, https://github.com/cloudfoundry/capi-release/tree/develop/shared_job_templates, commit 2f640cd. That is why we decided against symlinking. We tried with having a template in the shared_templates folder without symlink, that did not work out.

@sethboyles
Copy link
Member

My main concern is that if an error is encountered during pre-start, that is much harder for an operator to resolve than if it occurs during template rendering, since it will pause a deployment midway. I would think it'd be preferable to avoid more pre-start logic unless it was necessary.

Maybe I'm missing something, but what about symlinks makes it worth the operational trade-off?

Is it possible to have a step in pre-packaging to render the template variations to each job instead of symlinks? Of course, pre_packaging is discouraged by BOSH as well...

@kathap
Copy link
Contributor Author

kathap commented Oct 29, 2025

That is true, your thought about not having it in pre-start sounds reasonable.
We will render the templates not in pre-start, have one template for each scope, this we already tested and it is working. With that we could go on and test the stuff on real set up.

Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't we have a similar test for "cloud_controller_worker" and "cloud_controller_clock"?

@kathap kathap merged commit d50b357 into develop Oct 30, 2025
2 checks passed
@moleske moleske deleted the azure-storage-cli-integration branch October 30, 2025 15:44
@kathap kathap changed the title Use single blobstore_configs.json + pre-start to write config files Azure storage-cli integration Nov 5, 2025
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.

3 participants