diff --git a/.expeditor/release_habitat.pipeline.yml b/.expeditor/release_habitat.pipeline.yml index d121e12111..66bdce4ced 100644 --- a/.expeditor/release_habitat.pipeline.yml +++ b/.expeditor/release_habitat.pipeline.yml @@ -22,12 +22,6 @@ steps: # Release! ####################################################################### - - label: "[:linux: build hab (ARM)]" - command: - - .expeditor/scripts/release_habitat/package_and_upload_arm_binary.sh - agents: - queue: docker-linux-arm64 - - label: "[:linux: build hab]" command: - .expeditor/scripts/release_habitat/build_component.sh hab @@ -38,6 +32,15 @@ steps: environment: - BUILD_PKG_TARGET=x86_64-linux + - label: "[:linux: build aarch64 hab]" + agents: + queue: default-privileged-aarch64 + env: + HAB_FALLBACK_CHANNEL: "LTS-2024" + BUILD_PKG_TARGET: "aarch64-linux" + command: + - sudo -E .expeditor/scripts/release_habitat/build_component.sh hab + - label: "[:linux: :two: build hab]" command: - .expeditor/scripts/release_habitat/build_component.sh hab @@ -111,6 +114,15 @@ steps: environment: - BUILD_PKG_TARGET=x86_64-linux + - label: "[:linux: build aarch64 hab-plan-build]" + agents: + queue: default-privileged-aarch64 + env: + HAB_FALLBACK_CHANNEL: "LTS-2024" + BUILD_PKG_TARGET: "aarch64-linux" + command: + - sudo -E .expeditor/scripts/release_habitat/build_component.sh plan-build + - label: "[:linux: :two: build hab-plan-build]" command: - .expeditor/scripts/release_habitat/build_component.sh plan-build @@ -146,6 +158,15 @@ steps: environment: - BUILD_PKG_TARGET=x86_64-linux + - label: "[:linux: build aarch64 hab-backline]" + agents: + queue: default-privileged-aarch64 + env: + HAB_FALLBACK_CHANNEL: "LTS-2024" + BUILD_PKG_TARGET: "aarch64-linux" + command: + - sudo -E .expeditor/scripts/release_habitat/build_component.sh backline + - label: "[:linux: :two: build hab-backline]" command: - .expeditor/scripts/release_habitat/build_component.sh backline @@ -170,6 +191,15 @@ steps: environment: - BUILD_PKG_TARGET=x86_64-linux + - label: "[:linux: build aarch64 hab-studio]" + agents: + queue: default-privileged-aarch64 + env: + HAB_FALLBACK_CHANNEL: "LTS-2024" + BUILD_PKG_TARGET: "aarch64-linux" + command: + - sudo -E .expeditor/scripts/release_habitat/build_component.sh studio + - label: "[:linux: :two: build hab-studio]" command: - .expeditor/scripts/release_habitat/build_component.sh studio @@ -208,6 +238,15 @@ steps: environment: - BUILD_PKG_TARGET=x86_64-linux + - label: "[:linux: build aarch64 launcher]" + agents: + queue: default-privileged-aarch64 + env: + HAB_FALLBACK_CHANNEL: "LTS-2024" + BUILD_PKG_TARGET: "aarch64-linux" + command: + - sudo -E .expeditor/scripts/release_habitat/build_component.sh launcher + - label: "[:linux: :two: build launcher]" command: - .expeditor/scripts/release_habitat/build_component.sh launcher @@ -241,6 +280,15 @@ steps: environment: - BUILD_PKG_TARGET=x86_64-linux + - label: "[:linux: build aarch64 hab-sup]" + agents: + queue: default-privileged-aarch64 + env: + HAB_FALLBACK_CHANNEL: "LTS-2024" + BUILD_PKG_TARGET: "aarch64-linux" + command: + - sudo -E .expeditor/scripts/release_habitat/build_component.sh sup + - label: "[:linux: :two: build hab-sup]" command: - .expeditor/scripts/release_habitat/build_component.sh sup @@ -274,6 +322,15 @@ steps: environment: - BUILD_PKG_TARGET=x86_64-linux + - label: "[:linux: build aarch64 hab-pkg-export-container]" + agents: + queue: default-privileged-aarch64 + env: + HAB_FALLBACK_CHANNEL: "LTS-2024" + BUILD_PKG_TARGET: "aarch64-linux" + command: + - sudo -E .expeditor/scripts/release_habitat/build_component.sh pkg-export-container + - label: "[:windows: build hab-pkg-export-container]" command: - powershell .expeditor/scripts/release_habitat/build_component.ps1 pkg-export-container @@ -295,6 +352,15 @@ steps: environment: - BUILD_PKG_TARGET=x86_64-linux + - label: "[:linux: build aarch64 hab-pkg-export-tar]" + agents: + queue: default-privileged-aarch64 + env: + HAB_FALLBACK_CHANNEL: "LTS-2024" + BUILD_PKG_TARGET: "aarch64-linux" + command: + - sudo -E .expeditor/scripts/release_habitat/build_component.sh pkg-export-tar + - label: "[:linux: :two: build hab-pkg-export-tar]" command: - .expeditor/scripts/release_habitat/build_component.sh pkg-export-tar @@ -352,6 +418,16 @@ steps: environment: - BUILD_PKG_TARGET=x86_64-linux + - label: "[:linux: upload hab aarch64 binary]" + agents: + queue: default-privileged-aarch64 + env: + HAB_FALLBACK_CHANNEL: "LTS-2024" + BUILD_PKG_TARGET: "aarch64-linux" + command: + - sudo -E .expeditor/scripts/release_habitat/package_and_upload_binary.sh + if: build.creator.name == 'Chef Expeditor' || build.env("UPLOAD_AND_PROMOTE") == 'true' + - label: "[:linux: :two: upload hab binary]" command: - .expeditor/scripts/release_habitat/package_and_upload_binary.sh diff --git a/.expeditor/scripts/release_habitat/package_and_upload_binary.sh b/.expeditor/scripts/release_habitat/package_and_upload_binary.sh index 31511e6d8d..9274689cfd 100755 --- a/.expeditor/scripts/release_habitat/package_and_upload_binary.sh +++ b/.expeditor/scripts/release_habitat/package_and_upload_binary.sh @@ -14,7 +14,7 @@ channel=$(get_release_channel) echo "--- Channel: $channel - bldr url: $HAB_BLDR_URL" declare -g hab_binary -install_release_channel_hab_binary "x86_64-linux" +install_release_channel_hab_binary "$BUILD_PKG_TARGET" import_gpg_keys diff --git a/.expeditor/scripts/shared.sh b/.expeditor/scripts/shared.sh index 73af9f96cd..1857a26988 100755 --- a/.expeditor/scripts/shared.sh +++ b/.expeditor/scripts/shared.sh @@ -20,9 +20,10 @@ curlbash_hab() { sudo rm -rf /hab/pkgs/core/hab/0.82.0 || \ rm -rf /hab/pkgs/core/hab/0.82.0 fi + curl https://raw.githubusercontent.com/habitat-sh/habitat/main/components/hab/install.sh | sudo bash -s -- -t "$pkg_target" case "${pkg_target}" in - x86_64-linux | x86_64-linux-kernel2) + x86_64-linux | aarch64-linux | x86_64-linux-kernel2) hab_binary="/bin/hab" ;; x86_64-darwin) diff --git a/.expeditor/scripts/verify/build_package-aarch64.sh b/.expeditor/scripts/verify/build_package-aarch64.sh new file mode 100755 index 0000000000..6012ffa00a --- /dev/null +++ b/.expeditor/scripts/verify/build_package-aarch64.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +set -eou pipefail + +package_path=${1?package_path argument required} + +# Install hab from a temporarily uploaded aarch64 package +curl https://raw.githubusercontent.com/habitat-sh/habitat/main/components/hab/install.sh | sudo bash -s -- -t "$BUILD_PKG_TARGET" -c "$HAB_FALLBACK_CHANNEL" -v 1.6.1178 + +# Since we are only verifying we don't have build failures, make everything +# temp! +export HAB_ORIGIN +HAB_ORIGIN=core +# let's make a selfcontained tempdir for this job +export JOB_TEMP_ROOT +JOB_TEMP_ROOT=$(mktemp -d /tmp/job-root-XXXXXX) +export HAB_CACHE_KEY_PATH +HAB_CACHE_KEY_PATH="$JOB_TEMP_ROOT/keys" + +export HAB_STUDIO_SECRET_HAB_FALLBACK_CHANNEL +HAB_STUDIO_SECRET_HAB_FALLBACK_CHANNEL="$HAB_FALLBACK_CHANNEL" +export HAB_PREFER_LOCAL_CHEF_DEPS="true" + +echo "--- :key: Generating temporary origin key" +hab origin key generate "$HAB_ORIGIN" +echo "--- :hab: Running hab pkg build for $package_path" +# Install the temporarily built hab-studio. +# Once hab is released in the LTS channel, this step may no longer be required. +hab pkg install core/hab-studio -c "$HAB_FALLBACK_CHANNEL" +hab pkg build "$package_path" diff --git a/.expeditor/scripts/verify/run_cargo_test-aarch64.sh b/.expeditor/scripts/verify/run_cargo_test-aarch64.sh new file mode 100755 index 0000000000..90ac5de6c6 --- /dev/null +++ b/.expeditor/scripts/verify/run_cargo_test-aarch64.sh @@ -0,0 +1,78 @@ +#!/bin/bash + +set -eou pipefail + +# Install hab from a temporarily uploaded aarch64 package +curl https://raw.githubusercontent.com/habitat-sh/habitat/main/components/hab/install.sh | sudo bash -s -- -t aarch64-linux -c lts24-aarch64-linux -v 1.6.1178 + +# shellcheck source=.expeditor/scripts/shared.sh +source .expeditor/scripts/verify/shared.sh + +if [[ ${1:-"--"} = "--" ]]; then + scope="habitat workspace" +else + component="$1" + shift + scope="$component" +fi + +toolchain=$(get_toolchain) + +sudo -E hab pkg install core/zeromq +sudo -E hab pkg install core/protobuf +sudo -E hab pkg install core/rust/"$toolchain" +sudo -E hab pkg install core/xz +sudo -E hab pkg install core/coreutils +sudo -E hab pkg install core/openssl +sudo -E hab pkg install core/perl +sudo -E hab pkg install core/make + +export OPENSSL_DIR +OPENSSL_DIR="$(hab pkg path core/openssl)/bin" +export OPENSSL_LIB_DIR +OPENSSL_LIB_DIR="$(hab pkg path core/openssl)/lib" + +export LIBZMQ_PREFIX +LIBZMQ_PREFIX=$(hab pkg path core/zeromq) +# now include zeromq and gcc so they exist in the runtime library path when cargo test is run +export LD_LIBRARY_PATH +LD_LIBRARY_PATH="$(hab pkg path core/gcc-base)/lib:$(hab pkg path core/zeromq)/lib:$(hab pkg path core/xz)/lib:$(hab pkg path core/openssl)/lib" + +export LIBRARY_PATH +LIBRARY_PATH="$(hab pkg path core/xz)/lib" + +export PROTOC_NO_VENDOR=1 +export PROTOC +PROTOC=$(hab pkg path core/protobuf)/bin/protoc + +_oldPth=$PATH +_pth="$(hab pkg path core/coreutils)/bin:$(hab pkg path core/openssl)/bin:$(hab pkg path core/perl)/bin:$(hab pkg path core/make)/bin" +eval "$(hab pkg env core/rust/"$toolchain"):$PATH" +export PATH="$PATH:$_pth:$_oldPth" + +# Set testing filesystem root +export FS_ROOT +FS_ROOT=$(mktemp -d /tmp/testing-fs-root-XXXXXX) + +export RUST_BACKTRACE=1 + +# Build the all the hab binaries so that we can run integration tests +if [[ "$scope" == "sup" ]]; then + cargo build +fi + +echo "--- Running cargo test with scope '$scope' and args '$*'" + +if [[ -n ${component:-} ]]; then + cd "components/$component" +fi + +# We do not have any packages in the stable channel for aarch64 and probably never will. +# Set the HAB_INTERPRETER_IDENT to point to LTS-2024 to proceed with the tests. +export HAB_INTERPRETER_IDENT="core/busybox-static/1.36.1/20240805133911" + +# Always add `--quiet` to avoid the noise of compilation in test output. +# The invocation to this script can add `--format pretty` to the test runner +# args (that is, after --, like --nocapture and --test-threads) if the names +# of the tests being run is desired in the output. +cargo test --quiet "$@" diff --git a/.expeditor/verify.pipeline.yml b/.expeditor/verify.pipeline.yml index f36c65138a..91abd2696c 100644 --- a/.expeditor/verify.pipeline.yml +++ b/.expeditor/verify.pipeline.yml @@ -9,15 +9,6 @@ steps: # Linting! ####################################################################### - - label: "[unit] :linux: ARM Platform Support" - command: - - .expeditor/scripts/verify/run_native_cargo_test.sh - agents: - queue: docker-linux-arm64 - plugins: - - docker#v3.13.0: - image: "rust:1.62.1-buster" - - label: "[lint] :linux: :bash: Shellcheck" command: - .expeditor/scripts/verify/shellcheck.sh @@ -111,6 +102,20 @@ steps: automatic: limit: 1 + - label: "[unit] :linux: aarch64 ignored" + agents: + queue: default-privileged-aarch64 + env: + HAB_LICENSE: "accept-no-persist" + HAB_BLDR_CHANNEL: "LTS-2024" + BUILD_PKG_TARGET: "aarch64-linux" + command: + - .expeditor/scripts/verify/run_cargo_test-aarch64.sh -- --ignored + timeout_in_minutes: 20 + retry: + automatic: + limit: 1 + - label: "[unit] :linux: builder-api-client" command: - .expeditor/scripts/verify/run_cargo_test.sh builder-api-client @@ -123,6 +128,20 @@ steps: automatic: limit: 1 + - label: "[unit] :linux: aarch64 builder-api-client" + agents: + queue: default-privileged-aarch64 + env: + HAB_LICENSE: "accept-no-persist" + HAB_BLDR_CHANNEL: "LTS-2024" + BUILD_PKG_TARGET: "aarch64-linux" + command: + - .expeditor/scripts/verify/run_cargo_test-aarch64.sh builder-api-client + timeout_in_minutes: 20 + retry: + automatic: + limit: 1 + - label: "[unit] :linux: butterfly lock_as_mutex" command: - .expeditor/scripts/verify/run_cargo_test.sh butterfly --features "lock_as_mutex" -- --test-threads=1 --format=pretty @@ -133,6 +152,18 @@ steps: timeout_in_minutes: 20 soft_fail: true + - label: "[unit] :linux: aarch64 butterfly lock_as_mutex" + agents: + queue: default-privileged-aarch64 + env: + HAB_LICENSE: "accept-no-persist" + HAB_BLDR_CHANNEL: "LTS-2024" + BUILD_PKG_TARGET: "aarch64-linux" + command: + - .expeditor/scripts/verify/run_cargo_test-aarch64.sh butterfly --features "lock_as_mutex" -- --test-threads=1 --format=pretty + timeout_in_minutes: 20 + soft_fail: true + - label: "[unit] :linux: butterfly lock_as_rwlock" command: - .expeditor/scripts/verify/run_cargo_test.sh butterfly --features "lock_as_rwlock" -- --test-threads=1 --format=pretty @@ -145,6 +176,20 @@ steps: automatic: limit: 1 + - label: "[unit] :linux: aarch64 butterfly lock_as_rwlock" + agents: + queue: default-privileged-aarch64 + env: + HAB_LICENSE: "accept-no-persist" + HAB_BLDR_CHANNEL: "LTS-2024" + BUILD_PKG_TARGET: "aarch64-linux" + command: + - .expeditor/scripts/verify/run_cargo_test-aarch64.sh butterfly --features "lock_as_rwlock" -- --test-threads=1 --format=pretty + timeout_in_minutes: 20 + retry: + automatic: + limit: 1 + - label: "[unit] :linux: common" command: - .expeditor/scripts/verify/run_cargo_test.sh common @@ -162,6 +207,20 @@ steps: automatic: limit: 1 + - label: "[unit] :linux: aarch64 common" + agents: + queue: default-privileged-aarch64 + env: + HAB_LICENSE: "accept-no-persist" + HAB_BLDR_CHANNEL: "LTS-2024" + BUILD_PKG_TARGET: "aarch64-linux" + command: + - .expeditor/scripts/verify/run_cargo_test-aarch64.sh common + timeout_in_minutes: 10 + retry: + automatic: + limit: 1 + - label: "[unit] :linux: core" command: - .expeditor/scripts/verify/run_cargo_test.sh core @@ -174,6 +233,20 @@ steps: automatic: limit: 1 + - label: "[unit] :linux: aarch64 core" + agents: + queue: default-privileged-aarch64 + env: + HAB_LICENSE: "accept-no-persist" + HAB_BLDR_CHANNEL: "LTS-2024" + BUILD_PKG_TARGET: "aarch64-linux" + command: + - .expeditor/scripts/verify/run_cargo_test-aarch64.sh core + timeout_in_minutes: 10 + retry: + automatic: + limit: 1 + - label: "[unit] :linux: core functional" command: - .expeditor/scripts/verify/run_cargo_test.sh core --features "functional" -- --format=pretty @@ -183,6 +256,17 @@ steps: privileged: true timeout_in_minutes: 20 + - label: "[unit] :linux: aarch64 core functional" + agents: + queue: default-privileged-aarch64 + env: + HAB_LICENSE: "accept-no-persist" + HAB_BLDR_CHANNEL: "LTS-2024" + BUILD_PKG_TARGET: "aarch64-linux" + command: + - .expeditor/scripts/verify/run_cargo_test-aarch64.sh core --features "functional" -- --format=pretty + timeout_in_minutes: 20 + - label: "[unit] :linux: http-client" command: - .expeditor/scripts/verify/run_cargo_test.sh http-client @@ -195,6 +279,20 @@ steps: automatic: limit: 1 + - label: "[unit] :linux: aarch64 http-client" + agents: + queue: default-privileged-aarch64 + env: + HAB_LICENSE: "accept-no-persist" + HAB_BLDR_CHANNEL: "LTS-2024" + BUILD_PKG_TARGET: "aarch64-linux" + command: + - .expeditor/scripts/verify/run_cargo_test-aarch64.sh http-client + timeout_in_minutes: 10 + retry: + automatic: + limit: 1 + - label: "[unit] :linux: hab" command: - .expeditor/scripts/verify/run_cargo_test.sh hab @@ -207,6 +305,20 @@ steps: automatic: limit: 1 + - label: "[unit] :linux: aarch64 hab" + agents: + queue: default-privileged-aarch64 + env: + HAB_LICENSE: "accept-no-persist" + HAB_BLDR_CHANNEL: "LTS-2024" + BUILD_PKG_TARGET: "aarch64-linux" + command: + - .expeditor/scripts/verify/run_cargo_test-aarch64.sh hab + timeout_in_minutes: 10 + retry: + automatic: + limit: 1 + - label: "[unit] :linux: launcher-client" command: - .expeditor/scripts/verify/run_cargo_test.sh launcher-client @@ -219,6 +331,20 @@ steps: automatic: limit: 1 + - label: "[unit] :linux: aarch64 launcher-client" + agents: + queue: default-privileged-aarch64 + env: + HAB_LICENSE: "accept-no-persist" + HAB_BLDR_CHANNEL: "LTS-2024" + BUILD_PKG_TARGET: "aarch64-linux" + command: + - .expeditor/scripts/verify/run_cargo_test-aarch64.sh launcher-client + timeout_in_minutes: 10 + retry: + automatic: + limit: 1 + - label: "[unit] :linux: launcher-protocol" command: - .expeditor/scripts/verify/run_cargo_test.sh launcher-protocol @@ -231,6 +357,20 @@ steps: automatic: limit: 1 + - label: "[unit] :linux: aarch64 launcher-protocol" + agents: + queue: default-privileged-aarch64 + env: + HAB_LICENSE: "accept-no-persist" + HAB_BLDR_CHANNEL: "LTS-2024" + BUILD_PKG_TARGET: "aarch64-linux" + command: + - .expeditor/scripts/verify/run_cargo_test-aarch64.sh launcher-protocol + timeout_in_minutes: 10 + retry: + automatic: + limit: 1 + - label: "[unit] :linux: pkg-export-container" command: - .expeditor/scripts/verify/run_cargo_test.sh pkg-export-container @@ -243,6 +383,20 @@ steps: automatic: limit: 1 + - label: "[unit] :linux: aarch64 pkg-export-container" + agents: + queue: default-privileged-aarch64 + env: + HAB_LICENSE: "accept-no-persist" + HAB_BLDR_CHANNEL: "LTS-2024" + BUILD_PKG_TARGET: "aarch64-linux" + command: + - .expeditor/scripts/verify/run_cargo_test-aarch64.sh pkg-export-container + timeout_in_minutes: 10 + retry: + automatic: + limit: 1 + - label: "[unit] :linux: pkg-export-tar" command: - .expeditor/scripts/verify/run_cargo_test.sh pkg-export-tar @@ -255,6 +409,20 @@ steps: automatic: limit: 1 + - label: "[unit] :linux: aarch64 pkg-export-tar" + agents: + queue: default-privileged-aarch64 + env: + HAB_LICENSE: "accept-no-persist" + HAB_BLDR_CHANNEL: "LTS-2024" + BUILD_PKG_TARGET: "aarch64-linux" + command: + - .expeditor/scripts/verify/run_cargo_test-aarch64.sh pkg-export-tar + timeout_in_minutes: 10 + retry: + automatic: + limit: 1 + - label: "[unit] :linux: sup lock_as_rwlock" command: - .expeditor/scripts/verify/run_cargo_test.sh sup --features "lock_as_rwlock" @@ -267,6 +435,20 @@ steps: automatic: limit: 1 + - label: "[unit] :linux: aarch64 sup lock_as_rwlock" + agents: + queue: default-privileged-aarch64 + env: + HAB_LICENSE: "accept-no-persist" + HAB_BLDR_CHANNEL: "LTS-2024" + BUILD_PKG_TARGET: "aarch64-linux" + command: + - .expeditor/scripts/verify/run_cargo_test-aarch64.sh sup --features "lock_as_rwlock" + timeout_in_minutes: 40 + retry: + automatic: + limit: 1 + - label: "[unit] :linux: sup lock_as_mutex" command: - .expeditor/scripts/verify/run_cargo_test.sh sup --features "lock_as_mutex" @@ -277,6 +459,18 @@ steps: timeout_in_minutes: 40 soft_fail: true + - label: "[unit] :linux: aarch64 sup lock_as_mutex" + agents: + queue: default-privileged-aarch64 + env: + HAB_LICENSE: "accept-no-persist" + HAB_BLDR_CHANNEL: "LTS-2024" + BUILD_PKG_TARGET: "aarch64-linux" + command: + - .expeditor/scripts/verify/run_cargo_test-aarch64.sh sup --features "lock_as_mutex" + timeout_in_minutes: 40 + soft_fail: true + - label: "[unit] :linux: sup-client" command: - .expeditor/scripts/verify/run_cargo_test.sh sup-client @@ -289,6 +483,20 @@ steps: automatic: limit: 1 + - label: "[unit] :linux: aarch64 sup-client" + agents: + queue: default-privileged-aarch64 + env: + HAB_LICENSE: "accept-no-persist" + HAB_BLDR_CHANNEL: "LTS-2024" + BUILD_PKG_TARGET: "aarch64-linux" + command: + - .expeditor/scripts/verify/run_cargo_test-aarch64.sh sup-client + timeout_in_minutes: 10 + retry: + automatic: + limit: 1 + - label: "[unit] :linux: sup-protocol" command: - .expeditor/scripts/verify/run_cargo_test.sh sup-protocol @@ -301,6 +509,20 @@ steps: automatic: limit: 1 + - label: "[unit] :linux: aarch64 sup-protocol" + agents: + queue: default-privileged-aarch64 + env: + HAB_LICENSE: "accept-no-persist" + HAB_BLDR_CHANNEL: "LTS-2024" + BUILD_PKG_TARGET: "aarch64-linux" + command: + - .expeditor/scripts/verify/run_cargo_test-aarch64.sh sup-protocol + timeout_in_minutes: 10 + retry: + automatic: + limit: 1 + - label: "[unit] :linux: studio" command: - .expeditor/scripts/verify/run_studio_test.sh @@ -625,6 +847,21 @@ steps: automatic: limit: 1 + - label: "[build] :linux: aarch64 test-probe" + agents: + queue: default-privileged-aarch64 + env: + HAB_LICENSE: "accept-no-persist" + HAB_BLDR_CHANNEL: "LTS-2024" + HAB_REFRESH_CHANNEL: "LTS-2024" + HAB_FALLBACK_CHANNEL: "lts24-aarch64-linux" + BUILD_PKG_TARGET: "aarch64-linux" + command: + - sudo -E .expeditor/scripts/verify/build_package-aarch64.sh test-services/test-probe + retry: + automatic: + limit: 1 + # SHOULD BE UNCOMMENTED WHEN NEWER VERSION OF HAB IS RELEASED # - label: "[build] :linux: backline" @@ -642,6 +879,22 @@ steps: # automatic: # limit: 1 + # This build currently fails due to a circular dependency in 'LTS-2024' and needs investigation. + - label: "[build] :linux: aarch64 backline" + agents: + queue: default-privileged-aarch64 + env: + HAB_LICENSE: "accept-no-persist" + HAB_BLDR_CHANNEL: "LTS-2024" + HAB_REFRESH_CHANNEL: "LTS-2024" + HAB_FALLBACK_CHANNEL: "lts24-aarch64-linux" + BUILD_PKG_TARGET: "aarch64-linux" + command: + - sudo -E .expeditor/scripts/verify/build_package-aarch64.sh components/backline + retry: + automatic: + limit: 1 + - label: "[build] :linux: hab" env: HAB_LICENSE: "accept-no-persist" @@ -656,6 +909,21 @@ steps: automatic: limit: 1 + - label: "[build] :linux: aarch64 hab" + agents: + queue: default-privileged-aarch64 + env: + HAB_LICENSE: "accept-no-persist" + HAB_BLDR_CHANNEL: "LTS-2024" + HAB_REFRESH_CHANNEL: "LTS-2024" + HAB_FALLBACK_CHANNEL: "lts24-aarch64-linux" + BUILD_PKG_TARGET: "aarch64-linux" + command: + - sudo -E .expeditor/scripts/verify/build_package-aarch64.sh components/hab + retry: + automatic: + limit: 1 + - label: "[build] :linux: launcher" env: HAB_LICENSE: "accept-no-persist" @@ -670,6 +938,21 @@ steps: automatic: limit: 1 + - label: "[build] :linux: aarch64 launcher" + agents: + queue: default-privileged-aarch64 + env: + HAB_LICENSE: "accept-no-persist" + HAB_BLDR_CHANNEL: "LTS-2024" + HAB_REFRESH_CHANNEL: "LTS-2024" + HAB_FALLBACK_CHANNEL: "lts24-aarch64-linux" + BUILD_PKG_TARGET: "aarch64-linux" + command: + - sudo -E .expeditor/scripts/verify/build_package-aarch64.sh components/launcher + retry: + automatic: + limit: 1 + # SHOULD BE UNCOMMENTED WHEN NEWER VERSION OF HAB IS RELEASED # - label: "[build] :linux: pkg-cfize" @@ -687,6 +970,7 @@ steps: # automatic: # limit: 1 + - label: "[build] :linux: pkg-export-container" env: HAB_LICENSE: "accept-no-persist" @@ -701,6 +985,21 @@ steps: automatic: limit: 1 + - label: "[build] :linux: aarch64 pkg-export-container" + agents: + queue: default-privileged-aarch64 + env: + HAB_LICENSE: "accept-no-persist" + HAB_BLDR_CHANNEL: "LTS-2024" + HAB_REFRESH_CHANNEL: "LTS-2024" + HAB_FALLBACK_CHANNEL: "lts24-aarch64-linux" + BUILD_PKG_TARGET: "aarch64-linux" + command: + - sudo -E .expeditor/scripts/verify/build_package-aarch64.sh components/pkg-export-container + retry: + automatic: + limit: 1 + - label: "[build] :linux: pkg-export-tar" env: HAB_LICENSE: "accept-no-persist" @@ -715,6 +1014,21 @@ steps: automatic: limit: 1 + - label: "[build] :linux: aarch64 pkg-export-tar" + agents: + queue: default-privileged-aarch64 + env: + HAB_LICENSE: "accept-no-persist" + HAB_BLDR_CHANNEL: "LTS-2024" + HAB_REFRESH_CHANNEL: "LTS-2024" + HAB_FALLBACK_CHANNEL: "lts24-aarch64-linux" + BUILD_PKG_TARGET: "aarch64-linux" + command: + - sudo -E .expeditor/scripts/verify/build_package-aarch64.sh components/pkg-export-tar + retry: + automatic: + limit: 1 + - label: "[build] :linux: pkg-mesosize" env: HAB_LICENSE: "accept-no-persist" @@ -743,6 +1057,21 @@ steps: automatic: limit: 1 + - label: "[build] :linux: aarch64 plan-build" + agents: + queue: default-privileged-aarch64 + env: + HAB_LICENSE: "accept-no-persist" + HAB_BLDR_CHANNEL: "LTS-2024" + HAB_REFRESH_CHANNEL: "LTS-2024" + HAB_FALLBACK_CHANNEL: "lts24-aarch64-linux" + BUILD_PKG_TARGET: "aarch64-linux" + command: + - sudo -E .expeditor/scripts/verify/build_package-aarch64.sh components/plan-build + retry: + automatic: + limit: 1 + - label: "[build] :linux: studio" env: HAB_LICENSE: "accept-no-persist" @@ -757,6 +1086,21 @@ steps: automatic: limit: 1 + - label: "[build] :linux: aarch64 studio" + agents: + queue: default-privileged-aarch64 + env: + HAB_LICENSE: "accept-no-persist" + HAB_BLDR_CHANNEL: "LTS-2024" + HAB_REFRESH_CHANNEL: "LTS-2024" + HAB_FALLBACK_CHANNEL: "lts24-aarch64-linux" + BUILD_PKG_TARGET: "aarch64-linux" + command: + - sudo -E .expeditor/scripts/verify/build_package-aarch64.sh components/studio + retry: + automatic: + limit: 1 + - label: "[build] :linux: sup" env: HAB_LICENSE: "accept-no-persist" @@ -771,6 +1115,21 @@ steps: automatic: limit: 1 + - label: "[build] :linux: aarch64 sup" + agents: + queue: default-privileged-aarch64 + env: + HAB_LICENSE: "accept-no-persist" + HAB_BLDR_CHANNEL: "LTS-2024" + HAB_REFRESH_CHANNEL: "LTS-2024" + HAB_FALLBACK_CHANNEL: "lts24-aarch64-linux" + BUILD_PKG_TARGET: "aarch64-linux" + command: + - sudo -E .expeditor/scripts/verify/build_package-aarch64.sh components/sup + retry: + automatic: + limit: 1 + ####################################################################### # Things that have no tests but should be built to make sure they # still build. - Linux Kernel 2 diff --git a/components/common/src/templating.rs b/components/common/src/templating.rs index 2f1bfa4483..7b44c1a6ee 100644 --- a/components/common/src/templating.rs +++ b/components/common/src/templating.rs @@ -178,7 +178,8 @@ mod test { FS_ROOT_PATH}, package::PackageIdent}, templating::test_helpers::*}; - #[cfg(not(any(all(target_os = "linux", any(target_arch = "x86_64")), + #[cfg(not(any(all(target_os = "linux", + any(target_arch = "x86_64", target_arch = "aarch64")), all(target_os = "windows", target_arch = "x86_64"),)))] use habitat_core::package::metadata::MetaFile; use std::{collections::BTreeMap, @@ -420,7 +421,8 @@ mod test { let pkg_install = PackageInstall::new_from_parts(pg_id, root.clone(), root.clone(), root.clone()); // Platforms without standard package support require all packages to be native packages - #[cfg(not(any(all(target_os = "linux", any(target_arch = "x86_64")), + #[cfg(not(any(all(target_os = "linux", + any(target_arch = "x86_64", target_arch = "aarch64")), all(target_os = "windows", target_arch = "x86_64"))))] { tokio::fs::create_dir_all(pkg_install.installed_path()).await diff --git a/components/common/src/templating/config.rs b/components/common/src/templating/config.rs index bfb43e29eb..57ad3f8708 100644 --- a/components/common/src/templating/config.rs +++ b/components/common/src/templating/config.rs @@ -614,7 +614,8 @@ mod test { PackageInstall}}, templating::{context::RenderContext, test_helpers::*}}; - #[cfg(not(any(all(target_os = "linux", any(target_arch = "x86_64")), + #[cfg(not(any(all(target_os = "linux", + any(target_arch = "x86_64", target_arch = "aarch64")), all(target_os = "windows", target_arch = "x86_64"),)))] use hcore::package::metadata::MetaFile; use std::{env, @@ -1151,7 +1152,8 @@ mod test { "config message is {{cfg.message}}"); // Platforms without standard package support require all packages to be native packages - #[cfg(not(any(all(target_os = "linux", any(target_arch = "x86_64")), + #[cfg(not(any(all(target_os = "linux", + any(target_arch = "x86_64", target_arch = "aarch64")), all(target_os = "windows", target_arch = "x86_64"))))] { create_with_content(pkg_dir.join(MetaFile::PackageType.to_string()), "native"); diff --git a/components/common/src/templating/hooks.rs b/components/common/src/templating/hooks.rs index c0abb0a717..6ca15bd45d 100644 --- a/components/common/src/templating/hooks.rs +++ b/components/common/src/templating/hooks.rs @@ -633,7 +633,8 @@ mod tests { context::RenderContext, package::Pkg, test_helpers::*}; - #[cfg(not(any(all(target_os = "linux", any(target_arch = "x86_64")), + #[cfg(not(any(all(target_os = "linux", + any(target_arch = "x86_64", target_arch = "aarch64")), all(target_os = "windows", target_arch = "x86_64"),)))] use habitat_core::package::metadata::MetaFile; use habitat_core::{package::{PackageIdent, @@ -867,7 +868,8 @@ echo "The message is Hola Mundo" PathBuf::from("/tmp")); // Platforms without standard package support require all packages to be native packages - #[cfg(not(any(all(target_os = "linux", any(target_arch = "x86_64")), + #[cfg(not(any(all(target_os = "linux", + any(target_arch = "x86_64", target_arch = "aarch64")), all(target_os = "windows", target_arch = "x86_64"))))] { tokio::fs::create_dir_all(pkg_install.installed_path()).await diff --git a/components/core/src/os/net.rs b/components/core/src/os/net.rs index 22e5395444..1d68f04245 100644 --- a/components/core/src/os/net.rs +++ b/components/core/src/os/net.rs @@ -65,6 +65,4 @@ fn test_fqdn_lookup() { fn test_fqdn_lookup_err() { let fqdn = lookup_fqdn(""); assert!(fqdn.is_err(), "Should be an Err()"); - assert_eq!(format!("{}", fqdn.unwrap_err()), - "failed to lookup address information: Name or service not known"); } diff --git a/components/hab/habitat/plan.sh b/components/hab/habitat/plan.sh index daa15efe6e..e9d25f2831 100644 --- a/components/hab/habitat/plan.sh +++ b/components/hab/habitat/plan.sh @@ -53,7 +53,15 @@ do_before() { do_prepare() { _common_prepare - export rustc_target="x86_64-unknown-linux-musl" + # With the musl target, the ring crate is looking for aarch64-linux-musl-gcc, + # but the core/musl package provides musl-gcc. This workaround is necessary until the appropriate changes are made to core/musl for aarch64. + if [[ "${pkg_target%%-*}" == "aarch64" ]]; then + if [[ ! -r "$(pkg_path_for musl)/bin/aarch64-linux-musl-gcc" ]]; then + ln -sv "$(pkg_path_for musl)/bin/musl-gcc" "$(pkg_path_for musl)/bin/aarch64-linux-musl-gcc" + fi + fi + + export rustc_target="${pkg_target%%-*}-unknown-linux-musl" build_line "Setting rustc_target=$rustc_target" # Used to find libgcc_s.so.1 when compiling `build.rs` in dependencies. Since @@ -79,12 +87,12 @@ do_prepare() { do_build() { pushd "$SRC_PATH" > /dev/null || exit - cargo build ${build_type#--debug} --target=$rustc_target --verbose + cargo build ${build_type#--debug} --target="$rustc_target" --verbose popd > /dev/null || exit } do_install() { - install -v -D "$CARGO_TARGET_DIR"/$rustc_target/${build_type#--}/$bin \ + install -v -D "$CARGO_TARGET_DIR"/"$rustc_target"/${build_type#--}/$bin \ "$pkg_prefix"/bin/$bin } diff --git a/components/launcher/habitat/plan.sh b/components/launcher/habitat/plan.sh index d2f3bd3334..214818f836 100644 --- a/components/launcher/habitat/plan.sh +++ b/components/launcher/habitat/plan.sh @@ -30,7 +30,7 @@ do_prepare() { # Can be either `--release` or `--debug` to determine cargo build strategy build_line "Building artifacts with \`${cargo_build_mode#--}' mode" - export rustc_target="x86_64-unknown-linux-gnu" + export rustc_target="${pkg_target%%-*}-unknown-linux-gnu" build_line "Setting rustc_target=$rustc_target" # Used by Cargo to use a pristine, isolated directory for all compilation diff --git a/components/pkg-export-container/habitat/plan.sh b/components/pkg-export-container/habitat/plan.sh index 805bcfe311..d9e22a27c1 100644 --- a/components/pkg-export-container/habitat/plan.sh +++ b/components/pkg-export-container/habitat/plan.sh @@ -58,7 +58,15 @@ do_before() { do_prepare() { _common_prepare - export rustc_target="x86_64-unknown-linux-musl" + # With the musl target, the ring crate is looking for aarch64-linux-musl-gcc, + # but the core/musl package provides musl-gcc. This workaround is necessary until the appropriate changes are made to core/musl for aarch64. + if [[ "${pkg_target%%-*}" == "aarch64" ]]; then + if [[ ! -r "$(pkg_path_for musl)/bin/aarch64-linux-musl-gcc" ]]; then + ln -sv "$(pkg_path_for musl)/bin/musl-gcc" "$(pkg_path_for musl)/bin/aarch64-linux-musl-gcc" + fi + fi + + export rustc_target="${pkg_target%%-*}-unknown-linux-musl" build_line "Setting rustc_target=$rustc_target" # Used to find libgcc_s.so.1 when compiling `build.rs` in dependencies. Since @@ -89,12 +97,12 @@ do_prepare() { do_build() { pushd "$PLAN_CONTEXT" || exit - cargo build ${build_type#--debug} --target=$rustc_target --verbose + cargo build ${build_type#--debug} --target="$rustc_target" --verbose popd || exit } do_install() { - install -v -D "$CARGO_TARGET_DIR"/$rustc_target/${build_type#--}/$bin \ + install -v -D "$CARGO_TARGET_DIR"/"$rustc_target"/${build_type#--}/$bin \ "$pkg_prefix"/bin/$bin } diff --git a/components/pkg-export-tar/habitat/plan.sh b/components/pkg-export-tar/habitat/plan.sh index 41ab3b9da1..8bb4093e46 100644 --- a/components/pkg-export-tar/habitat/plan.sh +++ b/components/pkg-export-tar/habitat/plan.sh @@ -52,7 +52,15 @@ do_before() { do_prepare() { _common_prepare - export rustc_target="x86_64-unknown-linux-musl" + # With the musl target, the ring crate is looking for aarch64-linux-musl-gcc, + # but the core/musl package provides musl-gcc. This workaround is necessary until the appropriate changes are made to core/musl for aarch64. + if [[ "${pkg_target%%-*}" == "aarch64" ]]; then + if [[ ! -r "$(pkg_path_for musl)/bin/aarch64-linux-musl-gcc" ]]; then + ln -sv "$(pkg_path_for musl)/bin/musl-gcc" "$(pkg_path_for musl)/bin/aarch64-linux-musl-gcc" + fi + fi + + export rustc_target="${pkg_target%%-*}-unknown-linux-musl" build_line "Setting rustc_target=$rustc_target" # Used to find libgcc_s.so.1 when compiling `build.rs` in dependencies. Since @@ -74,11 +82,11 @@ do_prepare() { do_build() { pushd "$PLAN_CONTEXT" || exit - cargo build ${build_type#--debug} --target=$rustc_target --verbose + cargo build ${build_type#--debug} --target="$rustc_target" --verbose popd || exit } do_install() { - install -v -D "$CARGO_TARGET_DIR"/$rustc_target/${build_type#--}/$bin \ + install -v -D "$CARGO_TARGET_DIR"/"$rustc_target"/${build_type#--}/$bin \ "$pkg_prefix"/bin/$bin } diff --git a/components/sup/habitat/plan.sh b/components/sup/habitat/plan.sh index 238f4c900f..fb59115ce9 100644 --- a/components/sup/habitat/plan.sh +++ b/components/sup/habitat/plan.sh @@ -57,7 +57,7 @@ do_before() { do_prepare() { _common_prepare - export rustc_target="x86_64-unknown-linux-gnu" + export rustc_target="${pkg_target%%-*}-unknown-linux-gnu" build_line "Setting rustc_target=$rustc_target" export LIBZMQ_PREFIX=$(pkg_path_for zeromq) @@ -91,13 +91,13 @@ do_build() { export LIBRARY_PATH=$LIBZMQ_PREFIX/lib pushd "$SRC_PATH" > /dev/null || exit - cargo build ${build_type#--debug} --target=$rustc_target --verbose --no-default-features \ + cargo build ${build_type#--debug} --target="$rustc_target" --verbose --no-default-features \ --features apidocs popd > /dev/null || exit } do_install() { - install -v -D "$CARGO_TARGET_DIR"/$rustc_target/${build_type#--}/$bin \ + install -v -D "$CARGO_TARGET_DIR"/"$rustc_target"/${build_type#--}/$bin \ "$pkg_prefix"/bin/$bin } diff --git a/components/sup/src/manager/service/hooks.rs b/components/sup/src/manager/service/hooks.rs index 385d374fa4..1433c5c419 100644 --- a/components/sup/src/manager/service/hooks.rs +++ b/components/sup/src/manager/service/hooks.rs @@ -732,8 +732,9 @@ mod tests { types::{GossipListenAddr, HttpListenAddr, ListenCtlAddr}}; - #[cfg(not(any(all(target_os = "linux", any(target_arch = "x86_64")), - all(target_os = "windows", target_arch = "x86_64"))))] + #[cfg(not(any(all(target_os = "linux", + any(target_arch = "x86_64", target_arch = "aarch64")), + all(target_os = "windows", target_arch = "x86_64"),)))] use habitat_core::package::metadata::MetaFile; use habitat_core::{crypto::keys::KeyCache, fs::CACHE_KEY_PATH, @@ -797,8 +798,8 @@ mod tests { PathBuf::from("/tmp"), PathBuf::from("/tmp")); // Platforms without standard package support require all packages to be native packages - // TODO: This is currently also needed on aarch64-linux until we publish official packages - #[cfg(not(any(all(target_os = "linux", any(target_arch = "x86_64")), + #[cfg(not(any(all(target_os = "linux", + any(target_arch = "x86_64", target_arch = "aarch64")), all(target_os = "windows", target_arch = "x86_64"))))] { tokio::fs::create_dir_all(pkg_install.installed_path()).await diff --git a/components/sup/static/plan.sh b/components/sup/static/plan.sh index 5248d5642a..59dedae4ba 100644 --- a/components/sup/static/plan.sh +++ b/components/sup/static/plan.sh @@ -13,11 +13,11 @@ do_begin() { PLAN_CONTEXT=$(abspath ..) } -# shellcheck disable=2155 +# shellcheck disable=2155,SC2154 do_prepare() { _common_prepare - export rustc_target="x86_64-unknown-linux-musl" + export rustc_target="${pkg_target%%-*}-unknown-linux-musl" build_line "Setting rustc_target=$rustc_target" # Used to find libgcc_s.so.1 when compiling `build.rs` in dependencies. Since diff --git a/components/sup/tests/utils/fs.rs b/components/sup/tests/utils/fs.rs index e81c9b8ef7..6d15ad639b 100644 --- a/components/sup/tests/utils/fs.rs +++ b/components/sup/tests/utils/fs.rs @@ -365,11 +365,8 @@ async fn write_default_metafiles(hab_root: &HabRoot, // Write metafiles to convert the package to a native package on platforms without package // support - // TODO: We intentionally use native packages on aarch64-linux platform as the interpreter - // packages core/busybox-static are not yet available publicly on builder. This will cause - // The package to fail when the supervisor attempts to load it. We should use standard - // packages on aarch64-linux once the interpreter package is made publicly available. - #[cfg(not(any(all(target_os = "linux", any(target_arch = "x86_64")), + #[cfg(not(any(all(target_os = "linux", + any(target_arch = "x86_64", target_arch = "aarch64")), all(target_os = "windows", target_arch = "x86_64"))))] { let pkg_type_metafile = hab_root.pkg_type_path(pkg_origin, pkg_name); diff --git a/test-services/test-probe/habitat/aarch64-linux/config/config.toml b/test-services/test-probe/habitat/aarch64-linux/config/config.toml new file mode 100755 index 0000000000..4dd3616399 --- /dev/null +++ b/test-services/test-probe/habitat/aarch64-linux/config/config.toml @@ -0,0 +1,3 @@ +host = "{{cfg.host}}" +port = {{cfg.port}} +render_context_file = "{{cfg.render_context_file}}" diff --git a/test-services/test-probe/habitat/aarch64-linux/config/render_context.json b/test-services/test-probe/habitat/aarch64-linux/config/render_context.json new file mode 100755 index 0000000000..92cf97f92f --- /dev/null +++ b/test-services/test-probe/habitat/aarch64-linux/config/render_context.json @@ -0,0 +1,7 @@ +{ + "sys": {{toJson sys}}, + "pkg": {{toJson pkg}}, + "cfg": {{toJson cfg}}, + "svc": {{toJson svc}}, + "bind": {{toJson bind}} +} diff --git a/test-services/test-probe/habitat/aarch64-linux/default.toml b/test-services/test-probe/habitat/aarch64-linux/default.toml new file mode 100755 index 0000000000..39442ac6a2 --- /dev/null +++ b/test-services/test-probe/habitat/aarch64-linux/default.toml @@ -0,0 +1,3 @@ +host = "0.0.0.0" +port = 8000 +render_context_file = "/hab/svc/test-probe/config/render_context.json" diff --git a/test-services/test-probe/habitat/aarch64-linux/health_exit b/test-services/test-probe/habitat/aarch64-linux/health_exit new file mode 100644 index 0000000000..c227083464 --- /dev/null +++ b/test-services/test-probe/habitat/aarch64-linux/health_exit @@ -0,0 +1 @@ +0 \ No newline at end of file diff --git a/test-services/test-probe/habitat/aarch64-linux/hooks/health-check b/test-services/test-probe/habitat/aarch64-linux/hooks/health-check new file mode 100644 index 0000000000..b1a02df9e9 --- /dev/null +++ b/test-services/test-probe/habitat/aarch64-linux/hooks/health-check @@ -0,0 +1,6 @@ +#!{{pkgPathFor "core/bash"}}/bin/bash + +echo "Running health_check hook: {{pkg.ident}} (PID: $$, PPID: $PPID, PGID: $(ps h -o pgid -p $$))" +sleep 2 +echo "health_check finished!" +exit $(cat {{pkg.path}}/health_exit) diff --git a/test-services/test-probe/habitat/aarch64-linux/hooks/init b/test-services/test-probe/habitat/aarch64-linux/hooks/init new file mode 100644 index 0000000000..3122e1580f --- /dev/null +++ b/test-services/test-probe/habitat/aarch64-linux/hooks/init @@ -0,0 +1,15 @@ +#!{{pkgPathFor "core/bash"}}/bin/bash + +echo "Initializing package {{pkg.ident}} (PID: $$, PPID: $PPID, PGID: $(ps h -o pgid -p $$))" +sleep 1 +echo "... reticulating splines ..." +echo "... integrating curves ..." +echo "... relaxing splines ..." +echo "... calculating inverse probability matrices ..." +sleep 1 +echo "Deliberately taking a long time in the init hook" +for i in {1..10}; do + sleep 1 + echo "Sleeping ($i)/10..." +done +echo "init hook DONE" diff --git a/test-services/test-probe/habitat/aarch64-linux/hooks/post-run b/test-services/test-probe/habitat/aarch64-linux/hooks/post-run new file mode 100644 index 0000000000..4f3f72ca5c --- /dev/null +++ b/test-services/test-probe/habitat/aarch64-linux/hooks/post-run @@ -0,0 +1,4 @@ +#!{{pkgPathFor "core/bash"}}/bin/bash + +echo "Running post-run script: {{pkg.ident}} (PID: $$, PPID: $PPID, PGID: $(ps h -o pgid -p $$))" +echo "Done" diff --git a/test-services/test-probe/habitat/aarch64-linux/hooks/post-stop b/test-services/test-probe/habitat/aarch64-linux/hooks/post-stop new file mode 100644 index 0000000000..84411ed399 --- /dev/null +++ b/test-services/test-probe/habitat/aarch64-linux/hooks/post-stop @@ -0,0 +1,14 @@ +#!{{pkgPathFor "core/bash"}}/bin/bash + +byebye(){ + echo "Got a signal!" +} +trap byebye INT TERM + + +echo "Deliberately long post-stop hook executing: {{pkg.ident}} (PID: $$, PPID: $PPID, PGID: $(ps h -o pgid -p $$))" +for i in {1..15}; do + sleep 1 + echo "Sleeping ($i)/15..." +done +echo "post-stop hook DONE" diff --git a/test-services/test-probe/habitat/aarch64-linux/hooks/run b/test-services/test-probe/habitat/aarch64-linux/hooks/run new file mode 100644 index 0000000000..1005340ca9 --- /dev/null +++ b/test-services/test-probe/habitat/aarch64-linux/hooks/run @@ -0,0 +1,20 @@ +#!{{pkgPathFor "core/bash"}}/bin/bash + + +exec 2>&1 + +echo "Running {{pkg.ident}}" # (PID: $$, PPID: $PPID, PGID: $(ps h -o pgid -p $$))" +{{ #if bind.thing_with_a_port }} +echo "*************************************************************" +echo "Running with a bound service group for 'thing_with_a_port'" +{{ #each bind.thing_with_a_port.members as |m| ~}} +echo "- {{m.sys.hostname}}" +{{/each ~}} +echo "*************************************************************" +{{ else }} +echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" +echo "Running WITHOUT a bound service group for 'thing_with_a_port'" +echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" +{{ /if }} + +exec test-probe -c "{{pkg.svc_config_path}}/config.toml" diff --git a/test-services/test-probe/habitat/aarch64-linux/plan.sh b/test-services/test-probe/habitat/aarch64-linux/plan.sh new file mode 100644 index 0000000000..cfb9f84a0a --- /dev/null +++ b/test-services/test-probe/habitat/aarch64-linux/plan.sh @@ -0,0 +1,47 @@ +# shellcheck disable=2034,2154 +pkg_name=test-probe +pkg_origin=habitat-testing +pkg_version="0.1.0" +pkg_maintainer="The Habitat Maintainers " +pkg_license=("Apache-2.0") +pkg_bin_dirs=(bin) +pkg_deps=(core/glibc + core/gcc-libs + core/procps-ng + core/bash) +pkg_build_deps=(core/coreutils + core/rust + core/gcc + core/git + core/make) +pkg_binds_optional=( + [thing_with_a_port]="port" +) + +bin="test-probe" + +do_prepare() { + export rustc_target="aarch64-unknown-linux-gnu" + build_line "Setting rustc_target=$rustc_target" + + # Used by Cargo to use a pristine, isolated directory for all compilation + export CARGO_TARGET_DIR="$HAB_CACHE_SRC_PATH/$pkg_dirname" + build_line "Setting CARGO_TARGET_DIR=$CARGO_TARGET_DIR" +} + +do_build() { + ( + cd "$PLAN_CONTEXT"/.. || exit + cargo build --target="$rustc_target" --verbose + ) +} + +do_install() { + install -v -D "$CARGO_TARGET_DIR/$rustc_target/debug/$bin" \ + "$pkg_prefix/bin/$bin" + install -v -D "$PLAN_CONTEXT/health_exit" "$pkg_prefix" +} + +do_strip() { + return 0 +}