cloudfoundry / java-buildpack

Cloud Foundry buildpack for running Java applications
Apache License 2.0
433 stars 2.59k forks source link

Download sealights agent from 'customAgentUrl' #1050

Open ursulaflorianczyk opened 6 months ago

ursulaflorianczyk commented 6 months ago

Download sealights agent from 'customAgentUrl'

Some our customers want to have possibility to download specific Sealights agent from their internal URL instead of public Sealights servers. We want to provide them the easy way to configure it by adding a new parameter 'customAgentUrl'. Sealights buildpacks should support the same parameter for the same template across all technologies that is why we add 'customAgentUrl' instead of 'custom_agent_url'.

This PR contains also:

linux-foundation-easycla[bot] commented 6 months ago

CLA Signed

The committers listed above are authorized under a signed CLA.

ursulaflorianczyk commented 4 months ago

@pivotal-david-osullivan can I ask you for review and merging this PR?

ursulaflorianczyk commented 4 months ago

Hello Java Buildpack Team. We would like to merge this PR to Sealights' buildpack. Could you please give me a suggestion what I should do to get review/approval and merging for this PR? @pivotal-david-osullivan @rhardt-pivotal do you know who I should contact?

anthonydahanne commented 3 months ago

Hello! Sorry for the long time to get back to you - thanks for your contribution. I have to ask you: why didn't you use the "standard" java buildpack way of getting dependencies.

In the case of sealights agent, if you look at the default configuration, you'll guess that the dependency is fetched from the latest in https://agents.sealights.co/pcf/index.yml

So if you rebuilt the java-buildpack changing

repository_root: https://agents.sealights.co/pcf

to

repository_root: https://my-own-bucket.com

and then published at https://my-own-bucket.com/index.yml a file with your own packaging of sealights, you'd be done.

Please let me know why you decided to divert from this way of providing different dependencies. Thank you!

ursulaflorianczyk commented 3 months ago

Hi @anthonydahanne Thank you for your feedback! One of our customers want to use Sealights agent downloaded from his internal URL. We would like to avoid asking him to rebuilt buildpack and providing his own /index.yml (https://his-own-bucket.com/index.yml).

pivotal-david-osullivan commented 3 months ago

Anthony is correct, you must host the index.yml file with the <version>: <dep_uri> syntax. However, you do not need to repackage/rebuild the buildpack. You can set the operator or developer level environment variable to use the custom repository root where the new index is hosted, e.g.

JBP_CONFIG_SEALIGHTS_AGENT '{ repository_root: "<uri>" }'