Skip to content

Commit 0a48a1d

Browse files
Ops: Bump ubuntu and centos versions for building and testing (#6378)
Co-authored-by: John Lee <john@onetechnical.com> Co-authored-by: John Lee <john.lee@algorand.com>
1 parent 94de30f commit 0a48a1d

34 files changed

+154
-764
lines changed

.circleci/config.yml

Lines changed: 0 additions & 653 deletions
This file was deleted.

.github/workflows/codegen_verification.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
pull_request:
77
jobs:
88
codegen_verification:
9-
runs-on: ubuntu-22.04
9+
runs-on: ubuntu-24.04
1010
services:
1111
converter:
1212
image: swaggerapi/swagger-converter@sha256:dcfd1c2537f5f271cb4ec942d08aa59ca41b9a24078040061a772afca7e548ae # v1.0.4

.github/workflows/container.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
jobs:
1111
build-and-push:
1212
name: Build and Push to DockerHub
13-
runs-on: ubuntu-22.04
13+
runs-on: ubuntu-24.04
1414
steps:
1515
- name: Checkout Code
1616
uses: actions/checkout@v4

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:20.04 as builder
1+
FROM ubuntu:24.04 AS builder
22

33
ARG GO_VERSION="1.23.9"
44

@@ -41,7 +41,7 @@ RUN /dist/files/build/install.sh \
4141
-b "${BRANCH}" \
4242
-s "${SHA}"
4343

44-
FROM debian:bookworm-20240311-slim as final
44+
FROM debian:bookworm-20250630-slim AS final
4545

4646
ENV PATH="/node/bin:${PATH}" ALGOD_PORT="8080" KMD_PORT="7833" ALGORAND_DATA="/algod/data"
4747

Makefile

Lines changed: 53 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@ else
88
export GOPATH := $(shell go env GOPATH)
99
GOPATH1 := $(firstword $(subst :, ,$(GOPATH)))
1010
endif
11+
GOBIN := $(if $(shell go env GOBIN),$(shell go env GOBIN),$(GOPATH1)/bin)
1112
SRCPATH := $(shell pwd)
1213
ARCH := $(shell ./scripts/archtype.sh)
1314
OS_TYPE := $(shell ./scripts/ostype.sh)
1415
# overrides for cross-compiling platform-specific binaries
1516
ifdef CROSS_COMPILE_ARCH
1617
ARCH := $(CROSS_COMPILE_ARCH)
17-
GO_INSTALL := CGO_ENABLED=1 GOOS=$(OS_TYPE) GOARCH=$(ARCH) go build -o $(GOPATH1)/bin-$(OS_TYPE)-$(ARCH)
18+
GO_INSTALL := CGO_ENABLED=1 GOOS=$(OS_TYPE) GOARCH=$(ARCH) go build -o $(GOBIN)
1819
else
1920
GO_INSTALL := go install
2021
endif
@@ -105,10 +106,10 @@ fmt:
105106
./scripts/check_license.sh -i
106107

107108
fix: build
108-
$(GOPATH1)/bin/algofix */
109+
$(GOBIN)/algofix */
109110

110111
lint: deps
111-
$(GOPATH1)/bin/golangci-lint run -c .golangci.yml
112+
$(GOBIN)/golangci-lint run -c .golangci.yml
112113

113114
expectlint:
114115
cd test/e2e-go/cli/goal/expect && python3 expect_linter.py *.exp
@@ -139,7 +140,7 @@ prof:
139140
cd node && go test $(GOTAGS) -cpuprofile=cpu.out -memprofile=mem.out -mutexprofile=mutex.out
140141

141142
generate: deps
142-
PATH=$(GOPATH1)/bin:$$PATH go generate ./...
143+
PATH=$(GOBIN):$$PATH go generate ./...
143144

144145
msgp: $(patsubst %,%/msgp_gen.go,$(MSGP_GENERATE))
145146

@@ -153,9 +154,9 @@ logic:
153154
%/msgp_gen.go: deps ALWAYS
154155
@set +e; \
155156
printf "msgp: $(@D)..."; \
156-
$(GOPATH1)/bin/msgp -file ./$(@D) -o $@ -warnmask github.com/algorand/go-algorand > ./$@.out 2>&1; \
157+
$(GOBIN)/msgp -file ./$(@D) -o $@ -warnmask github.com/algorand/go-algorand > ./$@.out 2>&1; \
157158
if [ "$$?" != "0" ]; then \
158-
printf "failed:\n$(GOPATH1)/bin/msgp -file ./$(@D) -o $@ -warnmask github.com/algorand/go-algorand\n"; \
159+
printf "failed:\n$(GOBIN)/msgp -file ./$(@D) -o $@ -warnmask github.com/algorand/go-algorand\n"; \
159160
cat ./$@.out; \
160161
rm ./$@.out; \
161162
exit 1; \
@@ -178,29 +179,42 @@ crypto/libs/$(OS_TYPE)/$(ARCH)/lib/libsodium.a:
178179
universal:
179180
ifeq ($(OS_TYPE),darwin)
180181
# build amd64 Mac binaries
181-
mkdir -p $(GOPATH1)/bin-darwin-amd64
182-
CROSS_COMPILE_ARCH=amd64 GOBIN=$(GOPATH1)/bin-darwin-amd64 MACOSX_DEPLOYMENT_TARGET=13.0 EXTRA_CONFIGURE_FLAGS='CFLAGS="-arch x86_64 -mmacos-version-min=13.0" --host=x86_64-apple-darwin' $(MAKE)
182+
mkdir -p $(GOBIN)-darwin-amd64
183+
CROSS_COMPILE_ARCH=amd64 GOBIN=$(GOBIN)-darwin-amd64 MACOSX_DEPLOYMENT_TARGET=13.0 EXTRA_CONFIGURE_FLAGS='CFLAGS="-arch x86_64 -mmacos-version-min=13.0" --host=x86_64-apple-darwin' $(MAKE)
183184

184185
# build arm64 Mac binaries
185-
mkdir -p $(GOPATH1)/bin-darwin-arm64
186-
CROSS_COMPILE_ARCH=arm64 GOBIN=$(GOPATH1)/bin-darwin-arm64 MACOSX_DEPLOYMENT_TARGET=13.0 EXTRA_CONFIGURE_FLAGS='CFLAGS="-arch arm64 -mmacos-version-min=13.0" --host=aarch64-apple-darwin' $(MAKE)
186+
mkdir -p $(GOBIN)-darwin-arm64
187+
CROSS_COMPILE_ARCH=arm64 GOBIN=$(GOBIN)-darwin-arm64 MACOSX_DEPLOYMENT_TARGET=13.0 EXTRA_CONFIGURE_FLAGS='CFLAGS="-arch arm64 -mmacos-version-min=13.0" --host=aarch64-apple-darwin' $(MAKE)
187188

188189
# same for buildsrc-special
189190
cd tools/block-generator && \
190-
CROSS_COMPILE_ARCH=amd64 GOBIN=$(GOPATH1)/bin-darwin-amd64 MACOSX_DEPLOYMENT_TARGET=13.0 EXTRA_CONFIGURE_FLAGS='CFLAGS="-arch x86_64 -mmacos-version-min=13.0" --host=x86_64-apple-darwin' $(MAKE)
191-
CROSS_COMPILE_ARCH=arm64 GOBIN=$(GOPATH1)/bin-darwin-arm64 MACOSX_DEPLOYMENT_TARGET=13.0 EXTRA_CONFIGURE_FLAGS='CFLAGS="-arch arm64 -mmacos-version-min=13.0" --host=aarch64-apple-darwin' $(MAKE)
191+
CROSS_COMPILE_ARCH=amd64 GOBIN=$(GOBIN)-darwin-amd64 MACOSX_DEPLOYMENT_TARGET=13.0 EXTRA_CONFIGURE_FLAGS='CFLAGS="-arch x86_64 -mmacos-version-min=13.0" --host=x86_64-apple-darwin' $(MAKE)
192+
CROSS_COMPILE_ARCH=arm64 GOBIN=$(GOBIN)-darwin-arm64 MACOSX_DEPLOYMENT_TARGET=13.0 EXTRA_CONFIGURE_FLAGS='CFLAGS="-arch arm64 -mmacos-version-min=13.0" --host=aarch64-apple-darwin' $(MAKE)
192193

193194
# lipo together
194-
mkdir -p $(GOPATH1)/bin
195-
for binary in $$(ls $(GOPATH1)/bin-darwin-arm64); do \
196-
if [ -f $(GOPATH1)/bin-darwin-amd64/$$binary ]; then \
197-
lipo -create -output $(GOPATH1)/bin/$$binary \
198-
$(GOPATH1)/bin-darwin-arm64/$$binary \
199-
$(GOPATH1)/bin-darwin-amd64/$$binary; \
195+
mkdir -p $(GOBIN)
196+
for binary in $$(ls $(GOBIN)-darwin-arm64); do \
197+
skip=false; \
198+
for nongo_file in $(NONGO_BIN_FILES) $(GOBIN)/update.sh ; do \
199+
if [ "$(GOBIN)/$$binary" = "$$nongo_file" ]; then \
200+
echo "Skipping non-binary file: $$binary"; \
201+
skip=true; \
202+
break; \
203+
fi; \
204+
done; \
205+
if [ "$$skip" = "true" ]; then \
206+
continue; \
207+
fi; \
208+
if [ -f $(GOBIN)-darwin-amd64/$$binary ]; then \
209+
lipo -create -output $(GOBIN)/$$binary \
210+
$(GOBIN)-darwin-arm64/$$binary \
211+
$(GOBIN)-darwin-amd64/$$binary; \
200212
else \
201213
echo "Warning: Binary $$binary exists in arm64 but not in amd64"; \
202-
fi \
214+
fi; \
203215
done
216+
# for node_exporter cross-compilation is using universal binary already
217+
cp -f $(GOBIN)-darwin-arm64/node_exporter $(GOBIN)/node_exporter
204218
else
205219
echo "OS_TYPE must be darwin for universal builds, skipping"
206220
endif
@@ -220,7 +234,7 @@ $(KMD_API_SWAGGER_SPEC): $(KMD_API_FILES) crypto/libs/$(OS_TYPE)/$(ARCH)/lib/lib
220234
cd daemon/kmd/lib/kmdapi && \
221235
python3 genSwaggerWrappers.py $(KMD_API_SWAGGER_WRAPPER)
222236
cd daemon/kmd && \
223-
PATH=$(GOPATH1)/bin:$$PATH \
237+
PATH=$(GOBIN):$$PATH \
224238
go generate ./...
225239
rm daemon/kmd/lib/kmdapi/$(KMD_API_SWAGGER_WRAPPER)
226240

@@ -274,23 +288,23 @@ check-go-version:
274288
## We overwrite bin-race/kmd with a non -race version due to
275289
## the incredible performance impact of -race on Scrypt.
276290
build-race: build
277-
@mkdir -p $(GOPATH1)/bin-race
278-
GOBIN=$(GOPATH1)/bin-race go install $(GOTRIMPATH) $(GOTAGS) -race -ldflags="$(GOLDFLAGS)" ./...
279-
cp $(GOPATH1)/bin/kmd $(GOPATH1)/bin-race
291+
@mkdir -p $(GOBIN)-race
292+
GOBIN=$(GOBIN)-race go install $(GOTRIMPATH) $(GOTAGS) -race -ldflags="$(GOLDFLAGS)" ./...
293+
cp $(GOBIN)/kmd $(GOBIN)-race
280294

281-
NONGO_BIN_FILES=$(GOPATH1)/bin/find-nodes.sh $(GOPATH1)/bin/update.sh $(GOPATH1)/bin/COPYING $(GOPATH1)/bin/ddconfig.sh
295+
NONGO_BIN_FILES=$(GOBIN)/find-nodes.sh $(GOBIN)/update.sh $(GOBIN)/COPYING $(GOBIN)/ddconfig.sh
282296

283297
NONGO_BIN: $(NONGO_BIN_FILES)
284298

285-
$(GOPATH1)/bin/find-nodes.sh: scripts/find-nodes.sh
299+
$(GOBIN)/find-nodes.sh: scripts/find-nodes.sh
286300

287-
$(GOPATH1)/bin/update.sh: cmd/updater/update.sh
301+
$(GOBIN)/update.sh: cmd/updater/update.sh
288302

289-
$(GOPATH1)/bin/COPYING: COPYING
303+
$(GOBIN)/COPYING: COPYING
290304

291-
$(GOPATH1)/bin/ddconfig.sh: scripts/ddconfig.sh
305+
$(GOBIN)/ddconfig.sh: scripts/ddconfig.sh
292306

293-
$(GOPATH1)/bin/%:
307+
$(GOBIN)/%:
294308
cp -f $< $@
295309

296310
test: build
@@ -315,7 +329,7 @@ testall: fulltest integration
315329

316330
clean:
317331
go clean -i ./...
318-
rm -f $(GOPATH1)/bin/node_exporter
332+
rm -f $(GOBIN)/node_exporter
319333
cd crypto/libsodium-fork && \
320334
test ! -e Makefile || make clean
321335
rm -rf crypto/lib
@@ -326,17 +340,17 @@ clean:
326340
# clean without crypto
327341
cleango:
328342
go clean -i ./...
329-
rm -f $(GOPATH1)/bin/node_exporter
343+
rm -f $(GOBIN)/node_exporter
330344

331345
# assign the phony target node_exporter the dependency of the actual executable.
332-
node_exporter: $(GOPATH1)/bin/node_exporter
346+
node_exporter: $(GOBIN)/node_exporter
333347

334348
# The recipe for making the node_exporter is by extracting it from the gzipped&tar file.
335349
# The file is was taken from the S3 cloud and it traditionally stored at
336350
# /travis-build-artifacts-us-ea-1.algorand.network/algorand/node_exporter/latest/node_exporter-stable-linux-x86_64.tar.gz
337-
$(GOPATH1)/bin/node_exporter:
338-
mkdir -p $(GOPATH1)/bin && \
339-
cd $(GOPATH1)/bin && \
351+
$(GOBIN)/node_exporter:
352+
mkdir -p $(GOBIN) && \
353+
cd $(GOBIN) && \
340354
if [ -z "$(CROSS_COMPILE_ARCH)" ]; then \
341355
tar -xzvf $(SRCPATH)/installer/external/node_exporter-stable-$(shell ./scripts/ostype.sh)-$(shell uname -m | tr '[:upper:]' '[:lower:]').tar.gz; \
342356
else \
@@ -358,7 +372,7 @@ gen/%/genesis.dump: gen/%/genesis.json
358372
./scripts/dump_genesis.sh $< > $@
359373

360374
gen/%/genesis.json: gen/%.json gen/generate.go buildsrc
361-
$(GOPATH1)/bin/genesis -q $(SHORT_PART_PERIOD_FLAG) -n $(shell basename $(shell dirname $@)) -c $< -d $(subst .json,,$<)
375+
$(GOBIN)/genesis -q $(SHORT_PART_PERIOD_FLAG) -n $(shell basename $(shell dirname $@)) -c $< -d $(subst .json,,$<)
362376

363377
gen: $(addsuffix gen, $(NETWORKS)) mainnetgen
364378

@@ -376,15 +390,15 @@ mainnetgen: gen/mainnet/genesis.dump
376390
# This target is preserved as part of the history on how mainnet genesis.json was generated from the CSV file.
377391
gen/mainnet/genesis.json: gen/pregen/mainnet/genesis.csv buildsrc
378392
mkdir -p gen/mainnet
379-
cat gen/pregen/mainnet/genesis.csv | $(GOPATH1)/bin/incorporate -m gen/pregen/mainnet/metadata.json > gen/mainnet/genesis.json
393+
cat gen/pregen/mainnet/genesis.csv | $(GOBIN)/incorporate -m gen/pregen/mainnet/metadata.json > gen/mainnet/genesis.json
380394

381395
capabilities: build
382-
sudo setcap cap_ipc_lock+ep $(GOPATH1)/bin/kmd
396+
sudo setcap cap_ipc_lock+ep $(GOBIN)/kmd
383397

384398
dump: $(addprefix gen/,$(addsuffix /genesis.dump, $(NETWORKS)))
385399

386400
install: build
387-
scripts/dev_install.sh -p $(GOPATH1)/bin
401+
scripts/dev_install.sh -p $(GOBIN)
388402

389403
.PHONY: default fmt lint check_shell sanity cover prof deps build test fulltest shorttest clean cleango deploy node_exporter install %gen gen NONGO_BIN check-go-version rebuild_kmd_swagger universal
390404

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Development is done using the Go Programming Language. The Go version is specifi
2121

2222
### Linux / OSX
2323

24-
We currently strive to support Debian-based distributions, with Ubuntu 20.04 as our official release target. Building on Arch Linux also works well. Our core engineering team uses Linux and OSX, so both environments are well-supported for development.
24+
We currently strive to support Debian-based distributions, with Ubuntu 24.04 as our official release target. Building on Arch Linux also works well. Our core engineering team uses Linux and OSX, so both environments are well-supported for development.
2525

2626
**OSX Only**: [Homebrew (brew)](https://brew.sh) must be installed before continuing. [Here](https://docs.brew.sh/Installation) are the installation requirements.
2727

cmd/updater/update.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,8 @@ function backup_binaries() {
495495
BACKUPFILES="algod kmd carpenter doberman goal update.sh updater diagcfg"
496496
# add node_exporter to the files list we're going to backup, but only we if had it previously deployed.
497497
[ -f "${BINDIR}/node_exporter" ] && BACKUPFILES="${BACKUPFILES} node_exporter"
498+
# If we have algotmpl, we should back it up too
499+
[ -f "${BINDIR}/algotmpl" ] && BACKUPFILES="${BACKUPFILES} algotmpl"
498500
tar -zcf "${BINDIR}/backup/bin-v${CURRENTVER}.tar.gz" -C "${BINDIR}" ${BACKUPFILES} >/dev/null 2>&1
499501
}
500502

docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:22.04
1+
FROM ubuntu:24.04
22
ARG GOLANG_VERSION
33
ENV DEBIAN_FRONTEND noninteractive
44

docker/build/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:20.04
1+
FROM ubuntu:24.04
22
ARG GOLANG_VERSION
33

44
RUN apt-get update && apt-get install -y git wget autoconf build-essential shellcheck

docker/build/Dockerfile-deploy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM --platform=linux/amd64 ubuntu:20.04
1+
FROM --platform=linux/amd64 ubuntu:24.04
22
ARG GOLANG_VERSION
33

44
RUN apt-get update && apt-get install -y git wget autoconf jq bsdmainutils shellcheck make python3 libtool g++

0 commit comments

Comments
 (0)