From a6f2420e85482712ac7e7ae8f75d815b9c2044ef Mon Sep 17 00:00:00 2001 From: Justin Chan Date: Thu, 11 May 2023 16:05:45 -0400 Subject: [PATCH] Update Dockerfile to use 1.18-bullseye (#4229) * Update Dockerfile to use 1.18-bullseye * Update `.ci` submodule to include python3 change --- .ci | 2 +- Dockerfile | 2 +- Makefile | 22 +++++++++---------- scripts/proto-gen.sh | 4 ++-- src/aggregator/aggregator/counter_elem_gen.go | 2 +- src/aggregator/aggregator/gauge_elem_gen.go | 2 +- src/aggregator/aggregator/timer_elem_gen.go | 2 +- .../generated/proto/kvtest/kvtest.pb.go | 2 +- src/dbnode/generated/thrift/rpc/rpc.go | 2 +- 9 files changed, 20 insertions(+), 20 deletions(-) diff --git a/.ci b/.ci index a8766d6d55..53a70df5b1 160000 --- a/.ci +++ b/.ci @@ -1 +1 @@ -Subproject commit a8766d6d55c6ad4491d681ddd0bdf5018cc81a32 +Subproject commit 53a70df5b14add46dbcbcbc28d91dbf6fd7cd683 diff --git a/Dockerfile b/Dockerfile index a9c6a392f4..fdf0bb22bc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,3 @@ -FROM golang:1.18-stretch +FROM golang:1.18-bullseye RUN apt-get update && apt-get install -y lsof diff --git a/Makefile b/Makefile index b905fae94b..129d11ecb7 100644 --- a/Makefile +++ b/Makefile @@ -287,37 +287,37 @@ define SUBDIR_RULES mock-gen-$(SUBDIR): install-tools @echo "--- Generating mocks $(SUBDIR)" @[ ! -d src/$(SUBDIR)/$(mocks_rules_dir) ] || \ - PATH=$(combined_bin_paths):$(PATH) PACKAGE=$(m3_package) $(auto_gen) src/$(SUBDIR)/$(mocks_output_dir) src/$(SUBDIR)/$(mocks_rules_dir) + PATH="$(combined_bin_paths):$(PATH)" PACKAGE=$(m3_package) $(auto_gen) src/$(SUBDIR)/$(mocks_output_dir) src/$(SUBDIR)/$(mocks_rules_dir) .PHONY: thrift-gen-$(SUBDIR) thrift-gen-$(SUBDIR): install-tools @echo "--- Generating thrift files $(SUBDIR)" @[ ! -d src/$(SUBDIR)/$(thrift_rules_dir) ] || \ - PATH=$(combined_bin_paths):$(PATH) PACKAGE=$(m3_package) $(auto_gen) src/$(SUBDIR)/$(thrift_output_dir) src/$(SUBDIR)/$(thrift_rules_dir) + PATH="$(combined_bin_paths):$(PATH)" PACKAGE=$(m3_package) $(auto_gen) src/$(SUBDIR)/$(thrift_output_dir) src/$(SUBDIR)/$(thrift_rules_dir) .PHONY: proto-gen-$(SUBDIR) proto-gen-$(SUBDIR): install-tools @echo "--- Generating protobuf files $(SUBDIR)" - @[ ! -d src/$(SUBDIR)/$(proto_rules_dir) ] || \ - PATH=$(combined_bin_paths):$(PATH) PACKAGE=$(m3_package) $(auto_gen) src/$(SUBDIR)/$(proto_output_dir) src/$(SUBDIR)/$(proto_rules_dir) + [ ! -d src/$(SUBDIR)/$(proto_rules_dir) ] || \ + PATH="$(combined_bin_paths):$(PATH)" PACKAGE=$(m3_package) $(auto_gen) src/$(SUBDIR)/$(proto_output_dir) src/$(SUBDIR)/$(proto_rules_dir) .PHONY: asset-gen-$(SUBDIR) asset-gen-$(SUBDIR): install-tools @echo "--- Generating asset files $(SUBDIR)" @[ ! -d src/$(SUBDIR)/$(assets_rules_dir) ] || \ - PATH=$(combined_bin_paths):$(PATH) PACKAGE=$(m3_package) $(auto_gen) src/$(SUBDIR)/$(assets_output_dir) src/$(SUBDIR)/$(assets_rules_dir) + PATH="$(combined_bin_paths):$(PATH)" PACKAGE=$(m3_package) $(auto_gen) src/$(SUBDIR)/$(assets_output_dir) src/$(SUBDIR)/$(assets_rules_dir) .PHONY: genny-gen-$(SUBDIR) genny-gen-$(SUBDIR): install-tools @echo "--- Generating genny files $(SUBDIR)" @[ ! -f $(SELF_DIR)/src/$(SUBDIR)/generated-source-files.mk ] || \ - PATH=$(combined_bin_paths):$(PATH) make -f $(SELF_DIR)/src/$(SUBDIR)/generated-source-files.mk $(genny_target) - @PATH=$(combined_bin_paths):$(PATH) bash -c "source ./scripts/auto-gen-helpers.sh && gen_cleanup_dir '*_gen.go' $(SELF_DIR)/src/$(SUBDIR)/ && gen_cleanup_dir '*_gen_test.go' $(SELF_DIR)/src/$(SUBDIR)/" + PATH="$(combined_bin_paths):$(PATH)" make -f $(SELF_DIR)/src/$(SUBDIR)/generated-source-files.mk $(genny_target) + @PATH="$(combined_bin_paths):$(PATH)" bash -c "source ./scripts/auto-gen-helpers.sh && gen_cleanup_dir '*_gen.go' $(SELF_DIR)/src/$(SUBDIR)/ && gen_cleanup_dir '*_gen_test.go' $(SELF_DIR)/src/$(SUBDIR)/" .PHONY: license-gen-$(SUBDIR) license-gen-$(SUBDIR): install-tools @echo "--- Updating license in files $(SUBDIR)" - @find $(SELF_DIR)/src/$(SUBDIR) -name '*.go' | PATH=$(combined_bin_paths):$(PATH) xargs -I{} update-license {} + @find $(SELF_DIR)/src/$(SUBDIR) -name '*.go' | PATH="$(combined_bin_paths):$(PATH)" xargs -I{} update-license {} .PHONY: all-gen-$(SUBDIR) # NB(prateek): order matters here, mock-gen needs to be after proto/thrift because we sometimes @@ -404,7 +404,7 @@ $(foreach SUBDIR_TARGET, $(SUBDIR_TARGETS), $(eval $(SUBDIR_TARGET_RULE))) kube-gen-all: install-tools @echo "--- Generating kube bundle" @./kube/scripts/build_bundle.sh - find kube -name '*.yaml' -print0 | PATH=$(combined_bin_paths):$(PATH) xargs -0 kubeval -v=1.12.0 + find kube -name '*.yaml' -print0 | PATH="$(combined_bin_paths):$(PATH)" xargs -0 kubeval -v=1.12.0 .PHONY: go-mod-tidy go-mod-tidy: @@ -474,12 +474,12 @@ test-all-gen: all-gen # Runs a fossa license report .PHONY: fossa fossa: install-tools - PATH=$(combined_bin_paths):$(PATH) fossa analyze --verbose --no-ansi + PATH="$(combined_bin_paths):$(PATH)" fossa analyze --verbose --no-ansi # Waits for the result of a fossa test and exits success if pass or fail if fails .PHONY: fossa-test fossa-test: fossa - PATH=$(combined_bin_paths):$(PATH) fossa test + PATH="$(combined_bin_paths):$(PATH)" fossa test .PHONY: clean-build clean-build: diff --git a/scripts/proto-gen.sh b/scripts/proto-gen.sh index b806a7cce5..d108b15fed 100755 --- a/scripts/proto-gen.sh +++ b/scripts/proto-gen.sh @@ -9,7 +9,7 @@ set -e PROTOC_IMAGE_VERSION=${PROTOC_IMAGE_VERSION:-"znly/protoc:0.2.0"} # ensure docker is running -docker run --rm hello-world >/dev/null +docker run --platform linux/amd64 --rm hello-world >/dev/null UID_FLAGS="-u $(id -u)" if [[ -n "$BUILDKITE" ]]; then @@ -29,7 +29,7 @@ for i in "${GOPATH}/src/${PROTO_SRC}"/*; do m3db_path=$(realpath $GOPATH/src/github.com/m3db/m3) resolve_protos="Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/wrappers.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/any.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/struct.proto=github.com/gogo/protobuf/types" - docker run --rm -w /src -v $GOPATH/src:/src -v ${m3db_path}:/src/github.com/m3db/m3 \ + docker run --platform linux/amd64 --rm -w /src -v $GOPATH/src:/src -v ${m3db_path}:/src/github.com/m3db/m3 \ $UID_FLAGS $PROTOC_IMAGE_VERSION \ --gogofaster_out=${resolve_protos},plugins=grpc:/src \ -I/src -I/src/github.com/m3db/m3/vendor ${proto_files} diff --git a/src/aggregator/aggregator/counter_elem_gen.go b/src/aggregator/aggregator/counter_elem_gen.go index abccbbb657..6d409673ed 100644 --- a/src/aggregator/aggregator/counter_elem_gen.go +++ b/src/aggregator/aggregator/counter_elem_gen.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Uber Technologies, Inc. +// Copyright (c) 2023 Uber Technologies, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/aggregator/aggregator/gauge_elem_gen.go b/src/aggregator/aggregator/gauge_elem_gen.go index 2586ef42dd..8a3774cb9d 100644 --- a/src/aggregator/aggregator/gauge_elem_gen.go +++ b/src/aggregator/aggregator/gauge_elem_gen.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Uber Technologies, Inc. +// Copyright (c) 2023 Uber Technologies, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/aggregator/aggregator/timer_elem_gen.go b/src/aggregator/aggregator/timer_elem_gen.go index 8205b2a3a2..ac559a7150 100644 --- a/src/aggregator/aggregator/timer_elem_gen.go +++ b/src/aggregator/aggregator/timer_elem_gen.go @@ -1,4 +1,4 @@ -// Copyright (c) 2022 Uber Technologies, Inc. +// Copyright (c) 2023 Uber Technologies, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/cluster/generated/proto/kvtest/kvtest.pb.go b/src/cluster/generated/proto/kvtest/kvtest.pb.go index bf32eb3292..88232ec873 100644 --- a/src/cluster/generated/proto/kvtest/kvtest.pb.go +++ b/src/cluster/generated/proto/kvtest/kvtest.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: github.com/m3db/m3/src/cluster/generated/proto/kvtest/kvtest.proto -// Copyright (c) 2018 Uber Technologies, Inc. +// Copyright (c) 2023 Uber Technologies, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/src/dbnode/generated/thrift/rpc/rpc.go b/src/dbnode/generated/thrift/rpc/rpc.go index 4316ff0736..bb1dff9426 100644 --- a/src/dbnode/generated/thrift/rpc/rpc.go +++ b/src/dbnode/generated/thrift/rpc/rpc.go @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Uber Technologies, Inc. +// Copyright (c) 2023 Uber Technologies, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal