Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PMM-13540 Fix pmm client v3 build for nomad. #3298

Merged
merged 3 commits into from
Nov 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions build/scripts/build-client-binary
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,21 @@ gobuild_component() {
local component_path=$4
local result_file=${5:-bin/$(basename ${component_path:-$extract_path})}

# Set target for Nomad accordingly
local target
case "$(uname -m)" in
x86_64)
target="linux_amd64"
;;
aarch64)
target="linux_arm64"
;;
*)
echo "Unsupported architecture: $(uname -m)"
exit 1
;;
esac

if [ ${component} = 'azure_metrics_exporter' ]; then
result_file=${result_file/_metrics/}
fi
Expand All @@ -38,7 +53,7 @@ gobuild_component() {
elif [ ${component} = 'percona-toolkit' ]; then
build_command="cd /tmp/go/src/${extract_path}/${component_path} && go build -o \${binary_dir}/${result_file} ."
elif [ ${component} = 'nomad' ]; then
build_command="cd /tmp/go/src/${extract_path} && TARGETS=linux_amd64 make deps release"
build_command="cd /tmp/go/src/${extract_path} && TARGETS=${target} make deps release"
else
build_command="go build -o \${binary_dir}/${result_file} ./src/${extract_path}/${component_path}"
fi
Expand Down Expand Up @@ -130,7 +145,7 @@ main() {
gobuild_component "percona-toolkit" "" "github.com/percona/percona-toolkit" "src/go/pt-mongodb-summary"
gobuild_component "percona-toolkit" "" "github.com/percona/percona-toolkit" "src/go/pt-pg-summary"

cp -r ${tmp_dir}/go/src/github.com/hashicorp/nomad/pkg/linux_amd64/nomad ${binary_dir}/bin/nomad
cp -r ${tmp_dir}/go/src/github.com/hashicorp/nomad/pkg/linux_*/nomad ${binary_dir}/bin/nomad

rm -rf ${binary_tarball}
mkdir -p $(dirname ${binary_tarball}) || :
Expand Down
Loading