Skip to content

Commit 02722e0

Browse files
committed
Concurrently export/import charts/images
Signed-off-by: sami <sami@appscode.com>
1 parent a499384 commit 02722e0

8 files changed

Lines changed: 88 additions & 37 deletions

File tree

catalog/copy-images.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,12 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
set -x
17+
set -euo pipefail
1818

19-
if [ -z "${IMAGE_REGISTRY}" ]; then
19+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
20+
source "$SCRIPT_DIR/concurrency-utils.sh"
21+
22+
if [ -z "${IMAGE_REGISTRY:-}" ]; then
2023
echo "IMAGE_REGISTRY is not set"
2124
exit 1
2225
fi
@@ -33,7 +36,7 @@ curl -sL "https://github.com/google/go-containerregistry/releases/latest/downloa
3336
tar -zxvf /tmp/go-containerregistry.tar.gz -C /tmp/
3437
mv /tmp/crane .
3538

36-
CMD="./crane"
39+
CMD="run_async ./crane"
3740

3841
$CMD cp --allow-nondistributable-artifacts --insecure ghcr.io/appscode-charts/ace-installer:v2026.3.30 $IMAGE_REGISTRY/appscode-charts/ace-installer:v2026.3.30
3942
$CMD cp --allow-nondistributable-artifacts --insecure ghcr.io/appscode-charts/ace:v2026.3.30 $IMAGE_REGISTRY/appscode-charts/ace:v2026.3.30
@@ -301,3 +304,5 @@ $CMD cp --allow-nondistributable-artifacts --insecure ghcr.io/appscode-charts/va
301304
$CMD cp --allow-nondistributable-artifacts --insecure ghcr.io/appscode-charts/virtual-secrets-server:v2026.2.27 $IMAGE_REGISTRY/appscode-charts/virtual-secrets-server:v2026.2.27
302305
$CMD cp --allow-nondistributable-artifacts --insecure ghcr.io/appscode-charts/voyager-gateway:v2026.1.15 $IMAGE_REGISTRY/appscode-charts/voyager-gateway:v2026.1.15
303306
$CMD cp --allow-nondistributable-artifacts --insecure ghcr.io/appscode-charts/voyager:v2026.3.23 $IMAGE_REGISTRY/appscode-charts/voyager:v2026.3.23
307+
308+
wait_all

catalog/export-images.sh

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
set -x
17+
set -euo pipefail
18+
19+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
20+
source "$SCRIPT_DIR/concurrency-utils.sh"
1821

1922
mkdir -p images
2023

@@ -30,7 +33,8 @@ curl -sL "https://github.com/google/go-containerregistry/releases/latest/downloa
3033
tar -zxvf /tmp/go-containerregistry.tar.gz -C /tmp/
3134
mv /tmp/crane images
3235

33-
CMD="./images/crane"
36+
CMD="run_async ./images/crane"
37+
EXPECTED_COUNT=$(grep -cE '^\$CMD pull ' "${BASH_SOURCE[0]}")
3438

3539
$CMD pull --allow-nondistributable-artifacts --insecure ghcr.io/appscode-charts/ace-installer:v2026.3.30 images/appscode-charts-ace-installer-v2026.3.30.tar
3640
$CMD pull --allow-nondistributable-artifacts --insecure ghcr.io/appscode-charts/ace:v2026.3.30 images/appscode-charts-ace-v2026.3.30.tar
@@ -299,4 +303,15 @@ $CMD pull --allow-nondistributable-artifacts --insecure ghcr.io/appscode-charts/
299303
$CMD pull --allow-nondistributable-artifacts --insecure ghcr.io/appscode-charts/voyager-gateway:v2026.1.15 images/appscode-charts-voyager-gateway-v2026.1.15.tar
300304
$CMD pull --allow-nondistributable-artifacts --insecure ghcr.io/appscode-charts/voyager:v2026.3.23 images/appscode-charts-voyager-v2026.3.23.tar
301305

306+
if ! wait_all; then
307+
exit 1
308+
fi
309+
310+
actual=$(find images -name '*.tar' | wc -l)
311+
if [[ "$actual" -ne "$EXPECTED_COUNT" ]]; then
312+
printf '\033[31mValidation failed: expected %d files, got %d\033[0m\n' "$EXPECTED_COUNT" "$actual" >&2
313+
exit 1
314+
fi
315+
printf '\033[32mValidation passed: %d files\033[0m\n' "$actual" >&2
316+
302317
tar -czvf images.tar.gz images

catalog/import-images.sh

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,33 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
set -x
17+
set -euo pipefail
1818

19-
if [ -z "${IMAGE_REGISTRY}" ]; then
19+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
20+
source "$SCRIPT_DIR/concurrency-utils.sh"
21+
22+
if [ -z "${IMAGE_REGISTRY:-}" ]; then
2023
echo "IMAGE_REGISTRY is not set"
2124
exit 1
2225
fi
2326

2427
TARBALL=${1:-}
25-
tar -zxvf $TARBALL
28+
if [ -n "$TARBALL" ]; then
29+
if [ ! -f "$TARBALL" ]; then
30+
echo "Error: Tarball '$TARBALL' does not exist."
31+
exit 1
32+
fi
33+
echo "Extracting $TARBALL..."
34+
tar -zxvf "$TARBALL"
35+
elif [ -d "images" ] && [ -f "images/crane" ] && ls images/*.tar >/dev/null 2>&1; then
36+
echo "Found existing images directory with tarballs and crane binary. Skipping extraction..."
37+
else
38+
echo "Usage: $0 [images.tar.gz]"
39+
echo "Error: No tarball provided and valid images directory not found."
40+
exit 1
41+
fi
2642

27-
CMD="./crane"
43+
CMD="run_async ./images/crane"
2844

2945
$CMD push --allow-nondistributable-artifacts --insecure images/appscode-charts-ace-installer-v2026.3.30.tar $IMAGE_REGISTRY/appscode-charts/ace-installer:v2026.3.30
3046
$CMD push --allow-nondistributable-artifacts --insecure images/appscode-charts-ace-v2026.3.30.tar $IMAGE_REGISTRY/appscode-charts/ace:v2026.3.30
@@ -292,3 +308,5 @@ $CMD push --allow-nondistributable-artifacts --insecure images/appscode-charts-v
292308
$CMD push --allow-nondistributable-artifacts --insecure images/appscode-charts-virtual-secrets-server-v2026.2.27.tar $IMAGE_REGISTRY/appscode-charts/virtual-secrets-server:v2026.2.27
293309
$CMD push --allow-nondistributable-artifacts --insecure images/appscode-charts-voyager-gateway-v2026.1.15.tar $IMAGE_REGISTRY/appscode-charts/voyager-gateway:v2026.1.15
294310
$CMD push --allow-nondistributable-artifacts --insecure images/appscode-charts-voyager-v2026.3.23.tar $IMAGE_REGISTRY/appscode-charts/voyager:v2026.3.23
311+
312+
wait_all

catalog/import-into-k3s.sh

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,28 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
set -x
17+
set -euxo pipefail
1818

19-
if [ -z "${IMAGE_REGISTRY}" ]; then
19+
if [ -z "${IMAGE_REGISTRY:-}" ]; then
2020
echo "IMAGE_REGISTRY is not set"
2121
exit 1
2222
fi
2323

2424
TARBALL=${1:-}
25-
tar -zxvf $TARBALL
25+
if [ -n "$TARBALL" ]; then
26+
if [ ! -f "$TARBALL" ]; then
27+
echo "Error: Tarball '$TARBALL' does not exist."
28+
exit 1
29+
fi
30+
echo "Extracting $TARBALL..."
31+
tar -zxvf "$TARBALL"
32+
elif [ -d "images" ] && ls images/*.tar >/dev/null 2>&1; then
33+
echo "Found existing images directory with tarballs. Skipping extraction..."
34+
else
35+
echo "Usage: $0 [images.tar.gz]"
36+
echo "Error: No tarball provided and valid images directory not found."
37+
exit 1
38+
fi
2639

2740
k3s ctr images import images/appscode-charts-ace-installer-v2026.3.30.tar
2841
k3s ctr images import images/appscode-charts-ace-v2026.3.30.tar

catalog/sync-gcp-mp-images.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
set -x
17+
set -euxo pipefail
1818

19-
if [ -z "${IMAGE_REGISTRY}" ]; then
19+
if [ -z "${IMAGE_REGISTRY:-}" ]; then
2020
echo "IMAGE_REGISTRY is not set"
2121
exit 1
2222
fi
23-
if [ -z "${TAG}" ]; then
23+
if [ -z "${TAG:-}" ]; then
2424
echo "TAG is not set"
2525
exit 1
2626
fi

charts/ace-installer-certified-crds/README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
# ACE Installer
1+
# ace-installer-certified-crds
22

3-
[ACE Installer](https://github.com/appscode-cloud/installer) - ACE Installer
3+
[ace-installer-certified-crds](https://github.com/appscode-cloud/installer) - ACE Installer
44

55
## TL;DR;
66

77
```bash
88
$ helm repo add appscode https://charts.appscode.com/stable/
99
$ helm repo update
10-
$ helm search repo appscode/ace-installer --version=v2026.3.30
11-
$ helm upgrade -i ace-installer appscode/ace-installer -n kubeops --create-namespace --version=v2026.3.30
10+
$ helm search repo appscode/ace-installer-certified-crds --version=2026.3.30
11+
$ helm upgrade -i ace-installer-certified-crds appscode/ace-installer-certified-crds -n kubeops --create-namespace --version=2026.3.30
1212
```
1313

1414
## Introduction
@@ -21,10 +21,10 @@ This chart deploys charts for ACE on a [Kubernetes](http://kubernetes.io) cluste
2121

2222
## Installing the Chart
2323

24-
To install/upgrade the chart with the release name `ace-installer`:
24+
To install/upgrade the chart with the release name `ace-installer-certified-crds`:
2525

2626
```bash
27-
$ helm upgrade -i ace-installer appscode/ace-installer -n kubeops --create-namespace --version=v2026.3.30
27+
$ helm upgrade -i ace-installer-certified-crds appscode/ace-installer-certified-crds -n kubeops --create-namespace --version=2026.3.30
2828
```
2929

3030
The command deploys charts for ACE on the Kubernetes cluster in the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation.
@@ -33,17 +33,17 @@ The command deploys charts for ACE on the Kubernetes cluster in the default conf
3333
3434
## Uninstalling the Chart
3535

36-
To uninstall the `ace-installer`:
36+
To uninstall the `ace-installer-certified-crds`:
3737

3838
```bash
39-
$ helm uninstall ace-installer -n kubeops
39+
$ helm uninstall ace-installer-certified-crds -n kubeops
4040
```
4141

4242
The command removes all the Kubernetes components associated with the chart and deletes the release.
4343

4444
## Configuration
4545

46-
The following table lists the configurable parameters of the `ace-installer` chart and their default values.
46+
The following table lists the configurable parameters of the `ace-installer-certified-crds` chart and their default values.
4747

4848
| Parameter | Description | Default |
4949
|-------------------------------------------------------|----------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
@@ -149,12 +149,12 @@ The following table lists the configurable parameters of the `ace-installer` cha
149149
Specify each parameter using the `--set key=value[,key=value]` argument to `helm upgrade -i`. For example:
150150

151151
```bash
152-
$ helm upgrade -i ace-installer appscode/ace-installer -n kubeops --create-namespace --version=v2026.3.30 --set image.proxies.appscode=r.appscode.com
152+
$ helm upgrade -i ace-installer-certified-crds appscode/ace-installer-certified-crds -n kubeops --create-namespace --version=2026.3.30 --set image.proxies.appscode=r.appscode.com
153153
```
154154

155155
Alternatively, a YAML file that specifies the values for the parameters can be provided while
156156
installing the chart. For example:
157157

158158
```bash
159-
$ helm upgrade -i ace-installer appscode/ace-installer -n kubeops --create-namespace --version=v2026.3.30 --values values.yaml
159+
$ helm upgrade -i ace-installer-certified-crds appscode/ace-installer-certified-crds -n kubeops --create-namespace --version=2026.3.30 --values values.yaml
160160
```

charts/ace-installer-certified/README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
# ACE Installer
1+
# ace-installer-certified
22

3-
[ACE Installer](https://github.com/appscode-cloud/installer) - ACE Installer
3+
[ace-installer-certified](https://github.com/appscode-cloud/installer) - ACE Installer
44

55
## TL;DR;
66

77
```bash
88
$ helm repo add appscode https://charts.appscode.com/stable/
99
$ helm repo update
10-
$ helm search repo appscode/ace-installer --version=v2026.3.30
11-
$ helm upgrade -i ace-installer appscode/ace-installer -n kubeops --create-namespace --version=v2026.3.30
10+
$ helm search repo appscode/ace-installer-certified --version=2026.3.30
11+
$ helm upgrade -i ace-installer-certified appscode/ace-installer-certified -n kubeops --create-namespace --version=2026.3.30
1212
```
1313

1414
## Introduction
@@ -21,10 +21,10 @@ This chart deploys charts for ACE on a [Kubernetes](http://kubernetes.io) cluste
2121

2222
## Installing the Chart
2323

24-
To install/upgrade the chart with the release name `ace-installer`:
24+
To install/upgrade the chart with the release name `ace-installer-certified`:
2525

2626
```bash
27-
$ helm upgrade -i ace-installer appscode/ace-installer -n kubeops --create-namespace --version=v2026.3.30
27+
$ helm upgrade -i ace-installer-certified appscode/ace-installer-certified -n kubeops --create-namespace --version=2026.3.30
2828
```
2929

3030
The command deploys charts for ACE on the Kubernetes cluster in the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation.
@@ -33,17 +33,17 @@ The command deploys charts for ACE on the Kubernetes cluster in the default conf
3333
3434
## Uninstalling the Chart
3535

36-
To uninstall the `ace-installer`:
36+
To uninstall the `ace-installer-certified`:
3737

3838
```bash
39-
$ helm uninstall ace-installer -n kubeops
39+
$ helm uninstall ace-installer-certified -n kubeops
4040
```
4141

4242
The command removes all the Kubernetes components associated with the chart and deletes the release.
4343

4444
## Configuration
4545

46-
The following table lists the configurable parameters of the `ace-installer` chart and their default values.
46+
The following table lists the configurable parameters of the `ace-installer-certified` chart and their default values.
4747

4848
| Parameter | Description | Default |
4949
|-------------------------------------------------------|----------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
@@ -149,12 +149,12 @@ The following table lists the configurable parameters of the `ace-installer` cha
149149
Specify each parameter using the `--set key=value[,key=value]` argument to `helm upgrade -i`. For example:
150150

151151
```bash
152-
$ helm upgrade -i ace-installer appscode/ace-installer -n kubeops --create-namespace --version=v2026.3.30 --set image.proxies.appscode=r.appscode.com
152+
$ helm upgrade -i ace-installer-certified appscode/ace-installer-certified -n kubeops --create-namespace --version=2026.3.30 --set image.proxies.appscode=r.appscode.com
153153
```
154154

155155
Alternatively, a YAML file that specifies the values for the parameters can be provided while
156156
installing the chart. For example:
157157

158158
```bash
159-
$ helm upgrade -i ace-installer appscode/ace-installer -n kubeops --create-namespace --version=v2026.3.30 --values values.yaml
159+
$ helm upgrade -i ace-installer-certified appscode/ace-installer-certified -n kubeops --create-namespace --version=2026.3.30 --values values.yaml
160160
```

0 commit comments

Comments
 (0)