@@ -17,6 +17,24 @@ init_arch() {
1717 esac
1818}
1919
20+ init_registry () {
21+ if [[ -z $DRYCC_REGISTRY ]]
22+ echo -e " \\ 033[32m---> Get the fastest drycc registry...\\ 033[0m"
23+ registrys=(quay.io ccr.ccs.tencentyun.com sgccr.ccs.tencentyun.com jpccr.ccs.tencentyun.com uswccr.ccs.tencentyun.com useccr.ccs.tencentyun.com deccr.ccs.tencentyun.com saoccr.ccs.tencentyun.com)
24+ delay=65535
25+ DRYCC_REGISTRY=quay.io
26+ for registry in ${registrys[@]}
27+ do
28+ time_total=$( curl -o /dev/null -s -w " %{time_total}" " https://$registry " )
29+ if [[ ` echo " $delay >$time_total " | bc` -eq 1 ]]; then
30+ delay=$time_total
31+ DRYCC_REGISTRY=$registry
32+ fi
33+ done
34+ fi
35+ echo -e " \\ 033[32m---> The drycc registry is: ${DRYCC_REGISTRY} \\ 033[0m"
36+ }
37+
2038function clean_before_exit {
2139 # delay before exiting, so stdout/stderr flushes through the logging system
2240 rm -rf /tmp/drycc-values.yaml /etc/rancher/k3s/registries.yaml
@@ -25,6 +43,7 @@ function clean_before_exit {
2543}
2644trap clean_before_exit EXIT
2745init_arch
46+ init_registry
2847
2948function install_helm {
3049 if [[ " ${INSTALL_DRYCC_MIRROR} " == " cn" ]] ; then
@@ -280,6 +299,7 @@ imagebuilder:
280299 short-name-mode="permissive"
281300EOF
282301 fi
302+
283303 helm install drycc drycc/workflow \
284304 --set builder.service.type=LoadBalancer \
285305 --set global.clusterDomain=" cluster.local" \
312332 --set database.persistence.enabled=true \
313333 --set database.persistence.size=${DATABASE_PERSISTENCE_SIZE:- 5Gi} \
314334 --set database.persistence.storageClass=${DATABASE_PERSISTENCE_STORAGE_CLASS:- " " } \
335+ --set builder.imageRegistry=${DRYCC_REGISTRY} \
336+ --set controller.imageRegistry=${DRYCC_REGISTRY} \
337+ --set database.imageRegistry=${DRYCC_REGISTRY} \
338+ --set fluentd.imageRegistry=${DRYCC_REGISTRY} \
339+ --set imagebuilder.imageRegistry=${DRYCC_REGISTRY} \
340+ --set influxdb.imageRegistry=${DRYCC_REGISTRY} \
341+ --set logger.imageRegistry=${DRYCC_REGISTRY} \
342+ --set minio.imageRegistry=${DRYCC_REGISTRY} \
343+ --set monitor.imageRegistry=${DRYCC_REGISTRY} \
344+ --set passport.imageRegistry=${DRYCC_REGISTRY} \
345+ --set rabbitmq.imageRegistry=${DRYCC_REGISTRY} \
346+ --set redis.imageRegistry=${DRYCC_REGISTRY} \
347+ --set registry.imageRegistry=${DRYCC_REGISTRY} \
348+ --set registry-proxy.imageRegistry=${DRYCC_REGISTRY} \
315349 --set acme.server=${ACME_SERVER:- " https://acme-v02.api.letsencrypt.org/directory" } \
316350 --set acme.externalAccountBinding.keyID=${ACME_EAB_KEY_ID:- " " } \
317351 --set acme.externalAccountBinding.keySecret=${ACME_EAB_KEY_SECRET:- " " } \
0 commit comments