Skip to content

Commit

Permalink
Add hack/install-build-deps.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
bpmooch committed Aug 9, 2024
1 parent 9cffe36 commit cdd90b8
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 36 deletions.
33 changes: 2 additions & 31 deletions .github/workflows/001-tester-ubuntu-make-test-auraed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
13 changes: 8 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
66 changes: 66 additions & 0 deletions hack/install-build-deps.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit cdd90b8

Please sign in to comment.