Skip to content

Commit

Permalink
modify auto build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
Stevent-fei committed Jan 18, 2023
1 parent f0edc77 commit 65455dc
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 35 deletions.
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,57 +27,57 @@ images, so make sure it is a valid value.

### default build

this is will build the Clusterimage named "kubernetes:v1.22.8" without CNI plugin. and both have two platform: amd64 and
arm64 platform. that means you got four Clusterimages at the same time.
this is will build the sealer image named "kubernetes:v1.22.15" without CNI plugin. and both have two platform: amd64 and
arm64 platform. that means you got four sealer image at the same time.

```shell
auto-build --k8s-version=v1.22.8
```

### build with specify platform

This will build a Clusterimage with amd64 platform, default is linux/amd64,linux/arm64.
This will build a sealer image with amd64 platform, default is linux/amd64,linux/arm64.

```shell
auto-build --k8s-version=v1.22.8 --platform=amd64
```

### build with specified name

this will build a Clusterimage with amd64 platform.
this will build a sealer image with amd64 platform.

```shell
auto-build --k8s-version=v1.22.8 --buildName=registry.cn-qingdao.aliyuncs.com/sealer-io/kubernetes:v1.22.8
auto-build --k8s-version=v1.22.8 --buildName=docker.io/sealerio/kubernetes:v1.22.8
```

### build with specify CRI

this will build a Clusterimage with containerd. if user not specify the CRI ,we use containerd as Clusterimage default cri.
this will build a sealer image with containerd. if user not specify the CRI ,we use docker as sealer image default cri.

```shell
auto-build --k8s-version=v1.22.8 --cri=docker
```

### build with customized Clusterimage name

this will build a Clusterimage named `registry.cn-qingdao.aliyuncs.com/sealer-io/myk8s:v1.22.8`
this will build a sealer image named `docker.io/sealerio/myk8s:v1.22.8`

```shell
auto-build --k8s-version=v1.22.8 --buildName=registry.cn-qingdao.aliyuncs.com/sealer-io/myk8s:v1.22.8
auto-build --k8s-version=v1.22.8 --buildName=docker.io/sealerio/myk8s:v1.22.8
```

### build without pushing

if `--push`, push the clusterimage to the image registry. The image name must contain the full name of the repository.
if `--push`, push the sealer image to the image registry. The image name must contain the full name of the repository.

```shell
auto-build --k8s-version=v1.22.8 --buildName=registry.cn-qingdao.aliyuncs.com/sealer-io/kubernetes:v1.22.8 --push
auto-build --k8s-version=v1.22.8 --buildName=docker.io/sealerio/kubernetes:v1.22.8 --push
```

The image warehouse address is registry.cn-qingdao.aliyuncs.com.

If you do not log in to the mirror warehouse, you need to use -u and -p to specify the username and password

```shell
auto-build --k8s-version=v1.22.8 --buildName=registry.cn-qingdao.aliyuncs.com/sealer-io/kubernetes:v1.22.8 --push --username=specifyUser --password=specifyPasswd
auto-build --k8s-version=v1.22.8 --buildName=docker.io/sealerio/kubernetes:v1.22.8 --push --username=specifyUser --password=specifyPasswd
```
9 changes: 5 additions & 4 deletions context/Kubefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FROM scratch
COPY rootfs .
COPY amd64 .
COPY imageList manifests
COPY tigera-operator.yaml applications/tigera-operator.yaml
COPY custom-resources.yaml applications/custom-resources.yaml
APP calico local://calico.sh
LABEL "cluster.alpha.sealer.io/cluster-runtime-version"="v1.22.15"
LABEL "cluster.alpha.sealer.io/cluster-runtime-type"="kubernetes"
LABEL "cluster.alpha.sealer.io/container-runtime-type"="docker"
LABEL "cluster.alpha.sealer.io/container-runtime-version"="19.03.14"
CNI calico local://tigera-operator.yaml local://custom-resources.yaml
LAUNCH ["calico"]
Binary file removed context/amd64/cri/docker.tar.gz
Binary file not shown.
Binary file removed context/arm64/cri/docker.tar.gz
Binary file not shown.
4 changes: 0 additions & 4 deletions context/calico.sh

This file was deleted.

14 changes: 7 additions & 7 deletions context/docker/rootfs/scripts/docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ set -e
# shellcheck disable=SC2006
scripts_path=$(cd `dirname "$0"`; pwd)
image_dir="$scripts_path/../images"
DOCKER_VERSION="19.03.15"
DOCKER_VERSION="19.03.14-sealer"

# shellcheck disable=SC1091
get_distribution() {
Expand Down Expand Up @@ -53,6 +53,12 @@ load_images() {
done
}

# shellcheck disable=SC2145
utils_info()
{
echo -e "\033[1;32m$@\033[0m"
}

# shellcheck disable=SC2006
check_docker_valid() {
if ! docker info 2>&1; then
Expand All @@ -65,12 +71,6 @@ check_docker_valid() {
fi
}

# shellcheck disable=SC2145
utils_info()
{
echo -e "\033[1;32m$@\033[0m"
}

storage=${1:-/var/lib/docker}
mkdir -p "$storage"
if ! utils_command_exists docker; then
Expand Down
9 changes: 4 additions & 5 deletions context/download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,8 @@ install_url="https://sealer.oss-cn-beijing.aliyuncs.com/auto-build"
##https://github.com/osemp/moby/releases/download/v19.03.14/docker-amd64.tar.gz
##registry ${ARCH} image: ghcr.io/osemp/distribution-amd64/distribution:latest
if [ "${cri}" = "docker" ]; then
docker_version="19.03.15"
#docker_url="https://github.com/osemp/moby"
docker_url="https://github.com/moby/moby"
docker_version="19.03.14"
docker_url="https://github.com/osemp/moby"
cri_tarball_amd64="docker-amd64.tar.gz"
cri_tarball_arm64="docker-arm64.tar.gz"
cri_tarball_amd64_url="${docker_url}/releases/download/v${docker_version}/${cri_tarball_amd64}"
Expand Down Expand Up @@ -110,8 +109,8 @@ wget -q "${seautil_tarball_amd64_url}" && tar zxvf "${seautil_tarball_amd64}" -C
wget -q "${seautil_tarball_arm64_url}" && tar zxvf "${seautil_tarball_arm64}" -C "arm64/bin"

echo "download cri with ${cri}"
wget -q "${cri_tarball_amd64_url}" && mv "${cri_tarball_amd64}" "amd64/cri"
wget -q "${cri_tarball_arm64_url}" && mv "${cri_tarball_arm64}" "arm64/cri"
wget -q "${cri_tarball_amd64_url}" && mv "${cri_tarball_amd64}" "amd64/cri/docker.tar.gz"
wget -q "${cri_tarball_arm64_url}" && mv "${cri_tarball_arm64}" "arm64/cri/docker.tar.gz"

echo "download distribution image ${registry_tarball_amd64}"
wget -q "${registry_tarball_amd64_url}" && mv "${registry_tarball_amd64}" "amd64/images"
Expand Down
3 changes: 1 addition & 2 deletions context/imageList
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
ack-agility-registry.cn-shanghai.cr.aliyuncs.com/sealer/lvscare:v1.1.3-beta.8
quay.io/tigera/operator:v1.25.3
docker.io/sealer/lvscare:v1.1.3-beta.8
calico/node:v3.22.1
calico/pod2daemon-flexvol:v3.22.1
calico/cni:v3.22.1
Expand Down
2 changes: 1 addition & 1 deletion context/tigera-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5855,7 +5855,7 @@ spec:
dnsPolicy: ClusterFirstWithHostNet
containers:
- name: tigera-operator
image: sea.hub:5000/tigera/operator:v1.25.3
image: quay.io/tigera/operator:v1.25.3
imagePullPolicy: IfNotPresent
command:
- operator
Expand Down
2 changes: 1 addition & 1 deletion context/version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ export crictl_version=${crictl_version:-"1.24.1"}

export containerd_version=${containerd_version:-"1.6.12"}

export seautil_version=${seautil_version:-"0.9.0"}
export seautil_version=${seautil_version:-"0.9.1"}

##export docker_version="19.03.14"

0 comments on commit 65455dc

Please sign in to comment.