Skip to content

Commit 4ee7edf

Browse files
Consume fileserver with mounting buildpacks (#432)
* Use fileserver with buildpacks mount Co-authored-by: Ralf Pannemans <ralf.pannemans@sap.com> * Adjust buildpack yaml structure Co-authored-by: Nicolas Bender <nicolas.bender@sap.com> * Update sync-cf-deployment script with buildpacks * Buildpack renaming Co-authored-by: Ralf Pannemans <ralf.pannemans@sap.com> * Use upstream diego Co-authored-by: Nicolas Bender <nicolas.bender@sap.com> * Remove comment Co-authored-by: Ralf Pannemans <ralf.pannemans@sap.com> * Use correct version Co-authored-by: Nicolas Bender <nicolas.bender@sap.com> * Use underscores in all buildpack names Co-authored-by: Ralf Pannemans <ralf.pannemans@sap.com> Co-authored-by: Nicolas Bender <nicolas.bender@sap.com> --------- Co-authored-by: Nicolas Bender <nicolas.bender@sap.com>
1 parent 874d5f8 commit 4ee7edf

4 files changed

Lines changed: 65 additions & 18 deletions

File tree

helmfile.yaml.gotmpl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,12 @@ releases:
314314
enabled: true
315315
certificateSecret: all-in-one-tls
316316
- fileserver:
317+
buildpacks:
318+
{{ range $name, $buildpack := .Values.buildpacks }}
319+
{{ $name }}:
320+
image: {{ $buildpack.image }}
321+
tag: {{ $buildpack.tag }}
322+
{{ end }}
317323
enabled: true
318324
- sshProxy:
319325
enabled: true

scripts/sync-cf-deployment-versions.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
"routing": "routing",
1818
"uaa": "uaa",
1919
}
20+
21+
BUILDPACKS = [ "java-buildpack", "nodejs-buildpack", "go-buildpack", "binary-buildpack", "dotnet-core-buildpack", "nginx-buildpack", "php-buildpack", "python-buildpack", "r-buildpack", "ruby-buildpack", "staticfile-buildpack"]
2022

2123

2224
def latest_cf_deployment_release() -> str:
@@ -68,16 +70,20 @@ def main():
6870
release_versions["cf-deployment"] = manifest_version
6971

7072
for r in releases:
71-
if r["name"] not in BOSH_RELEASES:
73+
if (r["name"] not in BOSH_RELEASES) and (r["name"] not in BUILDPACKS):
7274
print(f"Skipping release update of '{r['name']}': not a managed release", file=sys.stderr)
7375
continue
74-
yaml_key = BOSH_RELEASES[r["name"]]
75-
if yaml_key not in values.get("charts", {}):
76-
print(f"error in release update of '{r['name']}': no value found", file=sys.stderr)
77-
sys.exit(1)
76+
yaml_key = BOSH_RELEASES.get(r["name"], "unknown")
77+
if yaml_key in values.get("charts", {}):
78+
values["charts"][yaml_key]["version"] = str(r["version"])
79+
print(f"Updated release '{r['name']}' to version {r['version']}")
80+
elif r["name"] in BUILDPACKS and r["name"] in values.get("buildpacks", {}):
81+
values["buildpacks"][r["name"]]["tag"] = str(r["version"])
82+
print(f"Updated buildpack '{r['name']}' to version {r['version']}")
83+
else:
84+
print(f"error in release update of '{r['name']}': no value found", file=sys.stderr)
85+
sys.exit(1)
7886

79-
values["charts"][yaml_key]["version"] = str(r["version"])
80-
print(f"Updated release '{r['name']}' to version {r['version']}")
8187

8288
with open(values_file, "w") as f:
8389
yaml.dump(values, f)

scripts/upload_buildpacks.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@
22

33
set -e
44

5-
INSTALLED_BUILPACKS=$(cf curl /v3/buildpacks | jq -r '.resources[] | "#" + .name + "#"')
5+
INSTALLED_BUILDPACKS=$(cf curl /v3/buildpacks | jq -r '.resources[] | "#" + .name + "#"')
66

7-
buildpacks=("java_buildpack" "nodejs_buildpack" "go_buildpack" "binary_buildpack")
7+
buildpacks=("java-buildpack" "nodejs-buildpack" "go-buildpack" "binary-buildpack")
88
position=1
99

1010
if [[ $ALL_BUILDPACKS == "true" ]]; then
11-
buildpacks+=("dotnet-core_buildpack" "nginx_buildpack" "php_buildpack" "python_buildpack" "r_buildpack" "ruby_buildpack" "staticfile_buildpack")
11+
buildpacks+=("dotnet-core-buildpack" "nginx-buildpack" "php-buildpack" "python-buildpack" "r-buildpack" "ruby-buildpack" "staticfile-buildpack")
1212
fi
1313

14-
1514
for buildpack in "${buildpacks[@]}"; do
16-
if [[ $INSTALLED_BUILPACKS =~ "#$buildpack#" ]]; then
17-
cf update-buildpack "$buildpack" -p "http://fileserver.127-0-0-1.nip.io/${buildpack}-cflinuxfs4.zip"
15+
buildpack_name=$(echo "$buildpack" | sed 's/-buildpack/_buildpack/')
16+
if [[ $INSTALLED_BUILDPACKS =~ "#$buildpack_name#" ]]; then
17+
cf update-buildpack "$buildpack_name" -p "http://fileserver.127-0-0-1.nip.io/${buildpack}/${buildpack}.zip"
1818
else
19-
cf create-buildpack "$buildpack" "http://fileserver.127-0-0-1.nip.io/${buildpack}-cflinuxfs4.zip" "$position"
19+
cf create-buildpack "$buildpack_name" "http://fileserver.127-0-0-1.nip.io/${buildpack}/${buildpack}.zip" "$position"
2020
fi
2121
((position++))
2222
done

versions.yaml

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ charts:
44
version: 1.235.0
55
cfNetworking:
66
url: cloudfoundry-k8s/cf-networking
7-
version: 3.114.0
7+
version: 3.115.0
88
cilium:
99
url: cilium/cilium
1010
version: 1.18.4
@@ -13,7 +13,7 @@ charts:
1313
version: 2.15.8
1414
diego:
1515
url: cloudfoundry-k8s/diego
16-
version: 0.23.0
16+
version: 2.138.0
1717
istioBase:
1818
url: istio/base
1919
version: 1.29.1
@@ -26,7 +26,7 @@ charts:
2626
version: 0.6.3
2727
logCache:
2828
url: cloudfoundry-k8s/log-cache
29-
version: 3.2.8
29+
version: 3.2.10
3030
loggregator:
3131
url: cloudfoundry-k8s/loggregator
3232
version: 107.0.31
@@ -52,7 +52,42 @@ charts:
5252
version: 16.7.27
5353
routing:
5454
url: cloudfoundry-k8s/routing
55-
version: 0.382.0
55+
version: 0.384.0
5656
uaa:
5757
url: cloudfoundry-k8s/uaa
5858
version: 78.16.0
59+
60+
buildpacks:
61+
binary-buildpack:
62+
image: ghcr.io/cloudfoundry/k8s/binary-buildpack
63+
tag: 1.1.26
64+
dotnet-core-buildpack:
65+
image: ghcr.io/cloudfoundry/k8s/dotnet-core-buildpack
66+
tag: 2.4.51
67+
java-buildpack:
68+
image: ghcr.io/cloudfoundry/k8s/java-buildpack
69+
tag: 5.0.4
70+
go-buildpack:
71+
image: ghcr.io/cloudfoundry/k8s/go-buildpack
72+
tag: 1.10.47
73+
nginx-buildpack:
74+
image: ghcr.io/cloudfoundry/k8s/nginx-buildpack
75+
tag: 1.2.38
76+
nodejs-buildpack:
77+
image: ghcr.io/cloudfoundry/k8s/nodejs-buildpack
78+
tag: 1.9.2
79+
php-buildpack:
80+
image: ghcr.io/cloudfoundry/k8s/php-buildpack
81+
tag: 5.0.6
82+
python-buildpack:
83+
image: ghcr.io/cloudfoundry/k8s/python-buildpack
84+
tag: 1.9.1
85+
r-buildpack:
86+
image: ghcr.io/cloudfoundry/k8s/r-buildpack
87+
tag: 1.2.28
88+
ruby-buildpack:
89+
image: ghcr.io/cloudfoundry/k8s/ruby-buildpack
90+
tag: 1.11.1
91+
staticfile-buildpack:
92+
image: ghcr.io/cloudfoundry/k8s/staticfile-buildpack
93+
tag: 1.6.38

0 commit comments

Comments
 (0)