This is an automated email from the ASF dual-hosted git repository.
wilfred-s pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/yunikorn-release.git
The following commit(s) were added to refs/heads/master by this push:
new d98257f [YUNIKORN-3309] run go mod tidy as part of release build
(#228)
d98257f is described below
commit d98257fb6e5c95c78b19192e5d8b042f3eb9057c
Author: Wilfred Spiegelenburg <[email protected]>
AuthorDate: Mon Jun 29 17:25:25 2026 +1000
[YUNIKORN-3309] run go mod tidy as part of release build (#228)
cleanup newline inconsistency between def (python style guide)
Closes: #228
Signed-off-by: Wilfred Spiegelenburg <[email protected]>
---
release-tools/build-release.py | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/release-tools/build-release.py b/release-tools/build-release.py
index fe6e1db..ea06874 100755
--- a/release-tools/build-release.py
+++ b/release-tools/build-release.py
@@ -23,11 +23,11 @@ import os
import re
import shutil
import subprocess
+import sys
import tarfile
from tempfile import mkstemp
import git
-import sys
# fail the execution
@@ -230,6 +230,7 @@ def download_sourcecode(base_path, repo_meta):
update_dep_ref(name, os.path.join(base_path, alias))
return sha
+
# Run distclean on the source code path
def clean_release(local_repo_path):
print("ensuring local source repo is clean")
@@ -240,6 +241,7 @@ def clean_release(local_repo_path):
fail("failed to clean staging repo")
os.chdir(path)
+
# Unpack tarball into tmp dir
def unpack_staging_tarball(staging_dir, dest_dir, release_name):
path = os.getcwd()
@@ -256,6 +258,7 @@ def unpack_staging_tarball(staging_dir, dest_dir,
release_name):
fail("failed to unpack tarball")
os.chdir(path)
+
# Generate binaries for yunikorn-web and compute checksums
def build_web_and_generate_hashes(staging_dir, release_name, arch):
print("generating reproducible build artifacts for yunikorn-web (%s)" %
arch)
@@ -276,6 +279,7 @@ def build_web_and_generate_hashes(staging_dir,
release_name, arch):
os.chdir(path)
return hash
+
# Generate binaries for yunikorn-k8shim and compute checksums
def build_shim_and_generate_hashes(staging_dir, release_name, arch):
print("generating reproducible build artifacts for yunikorn-k8shim (%s)" %
arch)
@@ -298,6 +302,7 @@ def build_shim_and_generate_hashes(staging_dir,
release_name, arch):
os.chdir(path)
return hash
+
# K8shim depends on yunikorn-core and scheduler-interface
def update_dep_ref_k8shim(local_repo_path):
print("updating dependency for k8shim")
@@ -312,8 +317,13 @@ def update_dep_ref_k8shim(local_repo_path):
retcode = subprocess.call(command)
if retcode:
fail("failed to update k8shim go.mod references")
+ command = ['go', 'mod', 'tidy']
+ retcode = subprocess.call(command)
+ if retcode:
+ fail("failed to update k8shim go.sum references (tidy)")
os.chdir(path)
+
# core depends on scheduler-interface
def update_dep_ref_core(local_repo_path):
print("updating dependency for core")
@@ -327,6 +337,10 @@ def update_dep_ref_core(local_repo_path):
retcode = subprocess.call(command)
if retcode:
fail("failed to update core go.mod references")
+ command = ['go', 'mod', 'tidy']
+ retcode = subprocess.call(command)
+ if retcode:
+ fail("failed to update core go.sum references (tidy)")
os.chdir(path)
@@ -395,6 +409,7 @@ def update_required_go_version(base_path, local_repo_path):
print(f" - go version: {go_version}")
replace(os.path.join(base_path, "README.md"), 'Go 1.16', 'Go ' +
go_version)
+
# update reproducible build information in README
def update_reproducible_build_info(base_path, go_version, hashes_amd64,
hashes_arm64):
print("recording go compiler used for reproducible builds")
@@ -404,6 +419,7 @@ def update_reproducible_build_info(base_path, go_version,
hashes_amd64, hashes_a
print("recording build artifact hashes (arm64)")
replace(os.path.join(base_path, "README.md"), '@ARM64_BINARIES@',
hashes_arm64)
+
# update required Node.js and angular versions in the README.md
def update_required_node_and_angular_versions(base_path, local_repo_path):
print("updating required Node.js version")
@@ -466,6 +482,7 @@ def write_checksum(tarball_file, tarball_name):
sha_file.close()
print("sha512 checksum: %s" % sha)
+
# Generate a checksum for a file
def get_checksum(file_path, file_name):
print("generating sha512 checksum for %s" % file_name)
@@ -480,6 +497,7 @@ def get_checksum(file_path, file_name):
sha = h.hexdigest()
return "%s %s" % (sha, file_name)
+
# Sign the source archive if an email is provided
def call_gpg(tarball_file, email_address):
cmd = shutil.which("gpg")
@@ -494,6 +512,7 @@ def call_gpg(tarball_file, email_address):
if retcode:
fail("failed to create gpg signature")
+
# Determine the specific go compiler in use
def get_go_version():
command = ['go', 'env', 'GOVERSION']
@@ -503,6 +522,7 @@ def get_go_version():
output = re.sub(r'^go', r'', result.stdout.strip())
return output
+
# Package the helm chart and sign if an email is provided
def call_helm(staging_dir, base_path, version, email_address):
cmd = shutil.which("helm")
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]