Skip to content

Commit b6835cc

Browse files
committed
chore(workflow): add select fastest drycc registry
1 parent b548d0d commit b6835cc

2 files changed

Lines changed: 48 additions & 0 deletions

File tree

_scripts/install.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
2038
function 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
}
2644
trap clean_before_exit EXIT
2745
init_arch
46+
init_registry
2847

2948
function install_helm {
3049
if [[ "${INSTALL_DRYCC_MIRROR}" == "cn" ]] ; then
@@ -280,6 +299,7 @@ imagebuilder:
280299
short-name-mode="permissive"
281300
EOF
282301
fi
302+
283303
helm install drycc drycc/workflow \
284304
--set builder.service.type=LoadBalancer \
285305
--set global.clusterDomain="cluster.local" \
@@ -312,6 +332,20 @@ EOF
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:-""} \

src/quickstart/install-workflow.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,20 @@ For RHEL, CentOS, and EKS with EKS Kubernetes Worker AMI with AmazonLinux2 image
7474
$ yum install curl
7575
```
7676

77+
### Installing bc
78+
79+
For Debian and Ubuntu, use this command:
80+
81+
```
82+
$ apt-get install bc
83+
```
84+
85+
For RHEL, CentOS, and EKS with EKS Kubernetes Worker AMI with AmazonLinux2 image, use this command:
86+
87+
```
88+
$ yum install bc
89+
```
90+
7791
## Hardware
7892

7993
Hardware requirements scale based on the size of your deployments. Minimum recommendations are outlined here.

0 commit comments

Comments
 (0)