diff --git a/.github/workflows/001-tester-ubuntu-make-test-auraed.yml b/.github/workflows/001-tester-ubuntu-make-test-auraed.yml index 9baf16a19..6704e0043 100644 --- a/.github/workflows/001-tester-ubuntu-make-test-auraed.yml +++ b/.github/workflows/001-tester-ubuntu-make-test-auraed.yml @@ -30,7 +30,7 @@ # # When this build passes we should have a "clean cargo" output! # -name: "Tester (001) [ubuntu:latest] [auraed]" +name: "(001) [ubuntu:latest] make auraed-test" on: push: branches: main @@ -63,38 +63,9 @@ jobs: with: toolchain: stable components: clippy, rustfmt - - name: Install protoc-gen-doc in [ubuntu:latest] - run: | - wget https://github.com/pseudomuto/protoc-gen-doc/releases/download/v1.5.1/protoc-gen-doc_1.5.1_linux_amd64.tar.gz - tar -xzf protoc-gen-doc_1.5.1_linux_amd64.tar.gz - chmod +x protoc-gen-doc - cp protoc-gen-doc /usr/local/bin/protoc-gen-doc - sudo apt-get update - sudo apt-get install -y protobuf-compiler - - name: Install compile time dependencies (musl-tools) in [ubuntu:latest] - # - # Do not add GNU libraries here! Do not add GNU libraries here! - # - # Please (seriously please) be careful about adding commands here. - # This is our core way of validating that our binary is "healthy" - # If we need to install anything with the word "lib" in it to get - # the build to pass, we likely should be having other discussions - # instead of adding commands here. - # - # Do not add GNU libraries here! Do not add GNU libraries here! - # - # For example, we should NOT be adding libraries such as "libseccomp" - # or "libdbus". - # - # If in doubt, please ask in Discord in the build channel. - # - # Do not at GNU libraries here! Do not add GNU libraries here! - run: | - sudo apt-get update - sudo apt-get install -y musl-tools - name: Cargo build, lint, test [make test] # This should remain the only command we execute as this matches the title of the file. # The goal is for this to be easy to find from the GitHub dashboard. # Instead of adding more commands here, consider another make target or a new YAML file # named with a good name. - run: make auraed-test + run: make os-deps auraed-test diff --git a/Makefile b/Makefile index 45f95e665..c9b767a2f 100644 --- a/Makefile +++ b/Makefile @@ -36,13 +36,13 @@ ociopts = DOCKER_BUILDKIT=1 uid = $(shell id -u) uname_m = $(shell uname -m) cri_version = release-1.26 -clh_version = 30.0 -vm_kernel = 6.1.6 -vm_image = https://cloud-images.ubuntu.com/focal/current/focal-server-cloudimg-amd64.img +clh_version = 30.0 +vm_kernel = 6.1.6 +vm_image = https://cloud-images.ubuntu.com/focal/current/focal-server-cloudimg-amd64.img ifeq ($(uid), 0) -root_cargo = cargo +root_cargo = cargo else -root_cargo = sudo -E `which cargo` +root_cargo = sudo -E `which cargo` endif # Configuration Options @@ -134,6 +134,9 @@ config: certs ## Set up default config mkdir -p $(HOME)/.aurae/pki cp -v pki/* $(HOME)/.aurae/pki +.PHONY: os-deps ## install os dependencies for building aurae +os-deps: ; ./hack/install-build-deps.sh + #------------------------------------------------------------------------------# # Clean Commands diff --git a/hack/install-build-deps.sh b/hack/install-build-deps.sh new file mode 100755 index 000000000..a38bd7160 --- /dev/null +++ b/hack/install-build-deps.sh @@ -0,0 +1,66 @@ +#!/usr/bin/env bash +# ---------------------------------------------------------------------------- # +# | █████╗ ██╗ ██╗██████╗ █████╗ ███████╗ | # +# | ██╔══██╗██║ ██║██╔══██╗██╔══██╗██╔════╝ | # +# | ███████║██║ ██║██████╔╝███████║█████╗ | # +# | ██╔══██║██║ ██║██╔══██╗██╔══██║██╔══╝ | # +# | ██║ ██║╚██████╔╝██║ ██║██║ ██║███████╗ | # +# | ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝ | # +# +--------------------------------------------+ # +# # +# Distributed Systems Runtime # +# ---------------------------------------------------------------------------- # +# Copyright 2022 - 2024, the aurae contributors # +# SPDX-License-Identifier: Apache-2.0 # +# ---------------------------------------------------------------------------- # + +# Do not add GNU libraries here! Do not add GNU libraries here! +# +# Please (seriously please) be careful about adding commands here. +# This is our core way of validating that our binary is "healthy" +# If we need to install anything with the word "lib" in it to get +# the build to pass, we likely should be having other discussions +# instead of adding commands here. +# +# Do not add GNU libraries here! Do not add GNU libraries here! +# +# For example, we should NOT be adding libraries such as "libseccomp" +# or "libdbus". +# +# If in doubt, please ask in Discord in the build channel. +# +# Do not at GNU libraries here! Do not add GNU libraries here! +sudo apt-get update && \ + sudo apt-get install -y musl-tools + +# install buf 1.32.0 +if ! hash buf +then + BUILD_PREFIX=$(mktemp -d) + PREFIX="/usr/local" + VERSION="1.32.0" + URL_BASE=https://github.com/bufbuild/buf/releases/download + DOWNLOAD_SLUG="v${VERSION}/buf-$(uname -s)-$(uname -m).tar.gz" + pushd "$BUILD_PREFIX" && \ + curl -sSL "${URL_BASE}/${DOWNLOAD_SLUG}" | \ + sudo tar -xvzf - -C "${PREFIX}" --strip-components 1 && \ + popd && \ + sudo rm -rf "$BUILD_PREFIX" +fi + +# install protobuf deps +if ! hash protoc-gen-doc +then + BUILD_PREFIX=$(mktemp -d) + URL_BASE=https://github.com/pseudomuto/protoc-gen-doc/releases/download + DOWNLOAD_SLUG=v1.5.1/protoc-gen-doc_1.5.1_linux_amd64.tar.gz + pushd "$BUILD_PREFIX" && \ + wget "${URL_BASE}/${DOWNLOAD_SLUG}" && \ + tar -xzf protoc-gen-doc_1.5.1_linux_amd64.tar.gz && \ + chmod +x protoc-gen-doc && \ + sudo mv protoc-gen-doc /usr/local/bin/protoc-gen-doc && \ + sudo apt-get update && \ + sudo apt-get install -y protobuf-compiler && \ + popd && \ + sudo rm -rf "$BUILD_PREFIX" +fi