diff --git a/.gitignore b/.gitignore index 866ebade6d..f1bc3e7a01 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ tests/__pycache__ /installer/build/ .tox_env/ __pycache__/ +microk8s_*.txt #Remote build log diff --git a/scripts/wrappers/common/utils.py b/scripts/wrappers/common/utils.py index aa0b43bf25..e77e5f3346 100644 --- a/scripts/wrappers/common/utils.py +++ b/scripts/wrappers/common/utils.py @@ -15,7 +15,7 @@ def get_current_arch(): # architecture mapping - arch_mapping = {"aarch64": "arm64", "x86_64": "amd64"} + arch_mapping = {"aarch64": "arm64", "armv7l": "armhf", "x86_64": "amd64"} return arch_mapping[platform.machine()] diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 264e14549f..a9de8dd465 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -185,10 +185,25 @@ parts: etcd: plugin: dump source: build-scripts/ + build-snaps: [go] override-build: | . ./set-env-variables.sh - curl -LO https://github.com/etcd-io/etcd/releases/download/${ETCD_VERSION}/etcd-${ETCD_VERSION}-linux-$KUBE_ARCH.tar.gz - tar -xzvf etcd-*.tar.gz --strip-components=1 + case ${SNAPCRAFT_ARCH_TRIPLET%%-*} in + x86_64|aarch64) + echo "Supported arch by etcd - use official binary" + curl -LO https://github.com/etcd-io/etcd/releases/download/${ETCD_VERSION}/etcd-${ETCD_VERSION}-linux-$KUBE_ARCH.tar.gz + tar -xzvf etcd-*.tar.gz --strip-components=1 + ;; + *) + echo "Unsupported arch by etcd - build from sources" + curl -LO https://github.com/etcd-io/etcd/archive/${ETCD_VERSION}.tar.gz + tar -xzf *.tar.gz + cd etcd-* + go mod vendor + ./build + cp -av bin/* ../ + echo "End of build" + esac snapcraftctl build stage: - etcd @@ -454,9 +469,9 @@ parts: cp $KUBE_SNAP_ROOT/microk8s-resources/wrappers/* . cp -r $KUBE_SNAP_ROOT/microk8s-resources/actions . - if [ "${ARCH}" = "arm64" ] + if [ "${ARCH}" != "amd64" ] then - # Some actions are not available on arm64 + # Some actions are only available on amd64 # Nvidia support rm "actions/enable.gpu.sh" rm "actions/disable.gpu.sh"