diff --git a/INSTALL.md b/INSTALL.md index 64c2dd108..03014361c 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -4,22 +4,44 @@ Notes for development environment installation. ## Dependencies -For running on Ubuntu 22.04, 24.04 and 25.10. +The current supported OS that is validated and tested includes: + +* Ubuntu 22.04 +* Ubuntu 24.04 +* Ubuntu 25.10 + +For the development preview please use one of the supported versions above. + +## Download + +Create the base directory for the Hive development environment. + +```bash +mkdir -p ~/Development/mulga/ +cd ~/Development/mulga/ +git clone https://github.com/mulgadc/hive.git +``` + ### Quick Install +To bootstrap the dependencies of Hive in one simple step (QEMU, Go, AWS CLI) + ```bash +cd hive make quickinstall ``` ### Manual Install +Alternatively, run the following steps to manually setup the required dependencies. + ```bash sudo add-apt-repository universe sudo apt install nbdkit nbdkit-plugin-dev pkg-config qemu-system qemu-utils qemu-kvm libvirt-daemon-system libvirt-clients libvirt-dev make gcc unzip xz-utils file ``` -Ensure the Go toolkit is installed, recommended to install the latest directly from [https://go.dev/dl/](https://go.dev/dl/). +Ensure the Go toolkit is installed for version 1.25.5 or higher. Recommended to install the latest directly from [https://go.dev/dl/](https://go.dev/dl/). Confirm go is correctly installed, and set in your $PATH. @@ -45,14 +67,6 @@ aws --version ## Build -Create the base directory for the Hive development environment. - -```bash -mkdir -p ~/Development/mulga/ -cd ~/Development/mulga/ -git clone https://github.com/mulgadc/hive.git -``` - Setup the dev environment and package dependencies on [viperblock](https://github.com/mulgadc/viperblock/) and [predastore](https://github.com/mulgadc/predastore/). ```bash diff --git a/Makefile b/Makefile index ea275d3c4..d428657bf 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,25 @@ GO_PROJECT_NAME := hive +# Detect architecture for cross-platform support +ARCH := $(shell uname -m) +ifeq ($(ARCH),x86_64) + GO_ARCH := amd64 + AWS_ARCH := x86_64 + # On x86, we can run ARM VMs via emulation + QEMU_PACKAGES := qemu-system-x86 qemu-system-arm +else ifeq ($(ARCH),aarch64) + GO_ARCH := arm64 + AWS_ARCH := aarch64 + # On ARM, we can run x86 VMs via emulation + QEMU_PACKAGES := qemu-system-aarch64 qemu-system-x86 +else ifeq ($(ARCH),arm64) + GO_ARCH := arm64 + AWS_ARCH := aarch64 + QEMU_PACKAGES := qemu-system-aarch64 qemu-system-x86 +else + $(error Unsupported architecture: $(ARCH). Only x86_64 and aarch64/arm64 are supported.) +endif + # Ask Go whether workspace mode is active IN_WORKSPACE := $(shell go env GOWORK) @@ -41,25 +61,26 @@ clean: rm ./bin/$(GO_PROJECT_NAME) install-system: - @echo "\n....Installing system dependencies...." + @echo "\n....Installing system dependencies for $(ARCH)...." + @echo "QEMU packages: $(QEMU_PACKAGES)" apt-get update && apt-get install -y \ - nbdkit nbdkit-plugin-dev pkg-config qemu-system-x86 qemu-utils qemu-kvm \ + nbdkit nbdkit-plugin-dev pkg-config $(QEMU_PACKAGES) qemu-utils qemu-kvm \ libvirt-daemon-system libvirt-clients libvirt-dev make gcc jq curl \ iproute2 netcat-openbsd openssh-client wget git unzip sudo xz-utils file install-go: - @echo "\n....Installing Go 1.25.5...." + @echo "\n....Installing Go 1.25.5 for $(ARCH) ($(GO_ARCH))...." @if [ ! -d "/usr/local/go" ]; then \ - curl -L https://go.dev/dl/go1.25.5.linux-amd64.tar.gz | tar -C /usr/local -xz; \ + curl -L https://go.dev/dl/go1.25.5.linux-$(GO_ARCH).tar.gz | tar -C /usr/local -xz; \ else \ echo "Go already installed in /usr/local/go"; \ fi @echo "Go version: $$(go version)" install-aws: - @echo "\n....Installing AWS CLI v2...." + @echo "\n....Installing AWS CLI v2 for $(ARCH) ($(AWS_ARCH))...." @if ! command -v aws >/dev/null 2>&1; then \ - curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"; \ + curl "https://awscli.amazonaws.com/awscli-exe-linux-$(AWS_ARCH).zip" -o "awscliv2.zip"; \ unzip -o awscliv2.zip; \ ./aws/install; \ rm -rf awscliv2.zip aws/; \ @@ -68,7 +89,9 @@ install-aws: fi quickinstall: install-system install-go install-aws - @echo "\n✅ Quickinstall complete. Please ensure /usr/local/go/bin is in your PATH." + @echo "\n✅ Quickinstall complete for $(ARCH)." + @echo " Please ensure /usr/local/go/bin is in your PATH." + @echo " Installed: Go ($(GO_ARCH)), AWS CLI ($(AWS_ARCH)), QEMU ($(QEMU_PACKAGES))" security: @echo "\n....Running security checks for $(GO_PROJECT_NAME)...."