Skip to content

Commit 41ce8f2

Browse files
authored
[jvm-packages] Add Scala version suffix to xgboost-jvm package (dmlc#9776)
* Update JVM script (dmlc#9714) * Bump version to 2.0.2; revamp pom.xml * Update instructions in prepare_jvm_release.py * Fix formatting
1 parent 0ffc52e commit 41ce8f2

File tree

15 files changed

+217
-70
lines changed

15 files changed

+217
-70
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cmake_minimum_required(VERSION 3.18 FATAL_ERROR)
2-
project(xgboost LANGUAGES CXX C VERSION 2.0.1)
2+
project(xgboost LANGUAGES CXX C VERSION 2.0.2)
33
include(cmake/Utils.cmake)
44
list(APPEND CMAKE_MODULE_PATH "${xgboost_SOURCE_DIR}/cmake/modules")
55
cmake_policy(SET CMP0022 NEW)

R-package/DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: xgboost
22
Type: Package
33
Title: Extreme Gradient Boosting
4-
Version: 2.0.1.1
4+
Version: 2.0.2.1
55
Date: 2023-10-12
66
Authors@R: c(
77
person("Tianqi", "Chen", role = c("aut"),

R-package/configure

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#! /bin/sh
22
# Guess values for system-dependent variables and create Makefiles.
3-
# Generated by GNU Autoconf 2.71 for xgboost 2.0.1.
3+
# Generated by GNU Autoconf 2.71 for xgboost 2.0.2.
44
#
55
#
66
# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation,
@@ -607,8 +607,8 @@ MAKEFLAGS=
607607
# Identity of this package.
608608
PACKAGE_NAME='xgboost'
609609
PACKAGE_TARNAME='xgboost'
610-
PACKAGE_VERSION='2.0.1'
611-
PACKAGE_STRING='xgboost 2.0.1'
610+
PACKAGE_VERSION='2.0.2'
611+
PACKAGE_STRING='xgboost 2.0.2'
612612
PACKAGE_BUGREPORT=''
613613
PACKAGE_URL=''
614614

@@ -1225,7 +1225,7 @@ if test "$ac_init_help" = "long"; then
12251225
# Omit some internal or obsolete options to make the list less imposing.
12261226
# This message is too long to be a string in the A/UX 3.1 sh.
12271227
cat <<_ACEOF
1228-
\`configure' configures xgboost 2.0.1 to adapt to many kinds of systems.
1228+
\`configure' configures xgboost 2.0.2 to adapt to many kinds of systems.
12291229
12301230
Usage: $0 [OPTION]... [VAR=VALUE]...
12311231
@@ -1287,7 +1287,7 @@ fi
12871287

12881288
if test -n "$ac_init_help"; then
12891289
case $ac_init_help in
1290-
short | recursive ) echo "Configuration of xgboost 2.0.1:";;
1290+
short | recursive ) echo "Configuration of xgboost 2.0.2:";;
12911291
esac
12921292
cat <<\_ACEOF
12931293
@@ -1367,7 +1367,7 @@ fi
13671367
test -n "$ac_init_help" && exit $ac_status
13681368
if $ac_init_version; then
13691369
cat <<\_ACEOF
1370-
xgboost configure 2.0.1
1370+
xgboost configure 2.0.2
13711371
generated by GNU Autoconf 2.71
13721372
13731373
Copyright (C) 2021 Free Software Foundation, Inc.
@@ -1533,7 +1533,7 @@ cat >config.log <<_ACEOF
15331533
This file contains any messages produced by compilers while
15341534
running configure, to aid debugging if configure makes a mistake.
15351535
1536-
It was created by xgboost $as_me 2.0.1, which was
1536+
It was created by xgboost $as_me 2.0.2, which was
15371537
generated by GNU Autoconf 2.71. Invocation command line was
15381538
15391539
$ $0$ac_configure_args_raw
@@ -3412,7 +3412,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
34123412
# report actual input values of CONFIG_FILES etc. instead of their
34133413
# values after options handling.
34143414
ac_log="
3415-
This file was extended by xgboost $as_me 2.0.1, which was
3415+
This file was extended by xgboost $as_me 2.0.2, which was
34163416
generated by GNU Autoconf 2.71. Invocation command line was
34173417
34183418
CONFIG_FILES = $CONFIG_FILES
@@ -3467,7 +3467,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
34673467
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
34683468
ac_cs_config='$ac_cs_config_escaped'
34693469
ac_cs_version="\\
3470-
xgboost config.status 2.0.1
3470+
xgboost config.status 2.0.2
34713471
configured by $0, generated by GNU Autoconf 2.71,
34723472
with options \\"\$ac_cs_config\\"
34733473

R-package/configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
AC_PREREQ(2.69)
44

5-
AC_INIT([xgboost],[2.0.1],[],[xgboost],[])
5+
AC_INIT([xgboost],[2.0.2],[],[xgboost],[])
66

77
: ${R_HOME=`R RHOME`}
88
if test -z "${R_HOME}"; then

dev/prepare_jvm_release.py

Lines changed: 97 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@ def normpath(path):
2121
else:
2222
return normalized
2323

24+
2425
def cp(source, target):
2526
source = normpath(source)
2627
target = normpath(target)
2728
print("cp {0} {1}".format(source, target))
2829
shutil.copy(source, target)
2930

31+
3032
def maybe_makedirs(path):
3133
path = normpath(path)
3234
print("mkdir -p " + path)
@@ -36,6 +38,7 @@ def maybe_makedirs(path):
3638
if e.errno != errno.EEXIST:
3739
raise
3840

41+
3942
@contextmanager
4043
def cd(path):
4144
path = normpath(path)
@@ -47,57 +50,76 @@ def cd(path):
4750
finally:
4851
os.chdir(cwd)
4952

53+
5054
def run(command, **kwargs):
5155
print(command)
5256
subprocess.check_call(command, shell=True, **kwargs)
5357

58+
5459
def get_current_git_tag():
5560
out = subprocess.check_output(["git", "tag", "--points-at", "HEAD"])
5661
return out.decode().split("\n")[0]
5762

63+
5864
def get_current_commit_hash():
5965
out = subprocess.check_output(["git", "rev-parse", "HEAD"])
6066
return out.decode().split("\n")[0]
6167

68+
6269
def get_current_git_branch():
6370
out = subprocess.check_output(["git", "log", "-n", "1", "--pretty=%d", "HEAD"])
6471
m = re.search(r"release_[0-9\.]+", out.decode())
6572
if not m:
6673
raise ValueError("Expected branch name of form release_xxx")
6774
return m.group(0)
6875

76+
6977
def retrieve(url, filename=None):
7078
print(f"{url} -> {filename}")
7179
return urlretrieve(url, filename)
7280

81+
7382
def main():
7483
parser = argparse.ArgumentParser()
75-
parser.add_argument("--release-version", type=str, required=True,
76-
help="Version of the release being prepared")
84+
parser.add_argument(
85+
"--release-version",
86+
type=str,
87+
required=True,
88+
help="Version of the release being prepared",
89+
)
7790
args = parser.parse_args()
7891

79-
if sys.platform != "darwin" or platform.machine() != "x86_64":
80-
raise NotImplementedError("Please run this script using an Intel Mac")
92+
if sys.platform != "darwin" or platform.machine() != "arm64":
93+
raise NotImplementedError("Please run this script using an M1 Mac")
8194

8295
version = args.release_version
8396
expected_git_tag = "v" + version
8497
current_git_tag = get_current_git_tag()
8598
if current_git_tag != expected_git_tag:
8699
if not current_git_tag:
87-
raise ValueError(f"Expected git tag {expected_git_tag} but current HEAD has no tag. "
88-
f"Run: git checkout {expected_git_tag}")
89-
raise ValueError(f"Expected git tag {expected_git_tag} but current HEAD is at tag "
90-
f"{current_git_tag}. Run: git checkout {expected_git_tag}")
100+
raise ValueError(
101+
f"Expected git tag {expected_git_tag} but current HEAD has no tag. "
102+
f"Run: git checkout {expected_git_tag}"
103+
)
104+
raise ValueError(
105+
f"Expected git tag {expected_git_tag} but current HEAD is at tag "
106+
f"{current_git_tag}. Run: git checkout {expected_git_tag}"
107+
)
91108

92109
commit_hash = get_current_commit_hash()
93110
git_branch = get_current_git_branch()
94-
print(f"Using commit {commit_hash} of branch {git_branch}, git tag {current_git_tag}")
111+
print(
112+
f"Using commit {commit_hash} of branch {git_branch}, git tag {current_git_tag}"
113+
)
95114

96115
with cd("jvm-packages/"):
97116
print("====copying pure-Python tracker====")
98117
for use_cuda in [True, False]:
99118
xgboost4j = "xgboost4j-gpu" if use_cuda else "xgboost4j"
100-
cp("../python-package/xgboost/tracker.py", f"{xgboost4j}/src/main/resources")
119+
cp(
120+
"../python-package/xgboost/tracker.py",
121+
f"{xgboost4j}/src/main/resources",
122+
)
101123

102124
print("====copying resources for testing====")
103125
with cd("../demo/CLI/regression"):
@@ -115,60 +137,98 @@ def main():
115137
cp(file, f"{xgboost4j_spark}/src/test/resources")
116138

117139
print("====Creating directories to hold native binaries====")
118-
for os_ident, arch in [("linux", "x86_64"), ("windows", "x86_64"), ("macos", "x86_64")]:
140+
for os_ident, arch in [
141+
("linux", "x86_64"),
142+
("windows", "x86_64"),
143+
("macos", "x86_64"),
144+
]:
119145
output_dir = f"xgboost4j/src/main/resources/lib/{os_ident}/{arch}"
120146
maybe_makedirs(output_dir)
121147
for os_ident, arch in [("linux", "x86_64")]:
122148
output_dir = f"xgboost4j-gpu/src/main/resources/lib/{os_ident}/{arch}"
123149
maybe_makedirs(output_dir)
124150

125151
print("====Downloading native binaries from CI====")
126-
nightly_bucket_prefix = "https://s3-us-west-2.amazonaws.com/xgboost-nightly-builds"
127-
maven_repo_prefix = "https://s3-us-west-2.amazonaws.com/xgboost-maven-repo/release/ml/dmlc"
128-
129-
retrieve(url=f"{nightly_bucket_prefix}/{git_branch}/xgboost4j_{commit_hash}.dll",
130-
filename="xgboost4j/src/main/resources/lib/windows/x86_64/xgboost4j.dll")
152+
nightly_bucket_prefix = (
153+
"https://s3-us-west-2.amazonaws.com/xgboost-nightly-builds"
154+
)
155+
maven_repo_prefix = (
156+
"https://s3-us-west-2.amazonaws.com/xgboost-maven-repo/release/ml/dmlc"
157+
)
158+
159+
retrieve(
160+
url=f"{nightly_bucket_prefix}/{git_branch}/libxgboost4j/xgboost4j_{commit_hash}.dll",
161+
filename="xgboost4j/src/main/resources/lib/windows/x86_64/xgboost4j.dll",
162+
)
163+
retrieve(
164+
url=f"{nightly_bucket_prefix}/{git_branch}/libxgboost4j/libxgboost4j_{commit_hash}.dylib",
165+
filename="xgboost4j/src/main/resources/lib/macos/x86_64/libxgboost4j.dylib",
166+
)
131167

132168
with tempfile.TemporaryDirectory() as tempdir:
133169
# libxgboost4j.so for Linux x86_64, CPU only
134170
zip_path = os.path.join(tempdir, "xgboost4j_2.12.jar")
135171
extract_dir = os.path.join(tempdir, "xgboost4j")
136-
retrieve(url=f"{maven_repo_prefix}/xgboost4j_2.12/{version}/"
137-
f"xgboost4j_2.12-{version}.jar",
138-
filename=zip_path)
172+
retrieve(
173+
url=f"{maven_repo_prefix}/xgboost4j_2.12/{version}/"
174+
f"xgboost4j_2.12-{version}.jar",
175+
filename=zip_path,
176+
)
139177
os.mkdir(extract_dir)
140178
with zipfile.ZipFile(zip_path, "r") as t:
141179
t.extractall(extract_dir)
142-
cp(os.path.join(extract_dir, "lib", "linux", "x86_64", "libxgboost4j.so"),
143-
"xgboost4j/src/main/resources/lib/linux/x86_64/libxgboost4j.so")
180+
cp(
181+
os.path.join(extract_dir, "lib", "linux", "x86_64", "libxgboost4j.so"),
182+
"xgboost4j/src/main/resources/lib/linux/x86_64/libxgboost4j.so",
183+
)
144184

145185
# libxgboost4j.so for Linux x86_64, GPU support
146186
zip_path = os.path.join(tempdir, "xgboost4j-gpu_2.12.jar")
147187
extract_dir = os.path.join(tempdir, "xgboost4j-gpu")
148-
retrieve(url=f"{maven_repo_prefix}/xgboost4j-gpu_2.12/{version}/"
149-
f"xgboost4j-gpu_2.12-{version}.jar",
150-
filename=zip_path)
188+
retrieve(
189+
url=f"{maven_repo_prefix}/xgboost4j-gpu_2.12/{version}/"
190+
f"xgboost4j-gpu_2.12-{version}.jar",
191+
filename=zip_path,
192+
)
151193
os.mkdir(extract_dir)
152194
with zipfile.ZipFile(zip_path, "r") as t:
153195
t.extractall(extract_dir)
154-
cp(os.path.join(extract_dir, "lib", "linux", "x86_64", "libxgboost4j.so"),
155-
"xgboost4j-gpu/src/main/resources/lib/linux/x86_64/libxgboost4j.so")
156-
196+
cp(
197+
os.path.join(extract_dir, "lib", "linux", "x86_64", "libxgboost4j.so"),
198+
"xgboost4j-gpu/src/main/resources/lib/linux/x86_64/libxgboost4j.so",
199+
)
157200

158201
print("====Next Steps====")
159202
print("1. Gain upload right to Maven Central repo.")
160203
print("1-1. Sign up for a JIRA account at Sonatype: ")
161-
print("1-2. File a JIRA ticket: "
162-
"https://issues.sonatype.org/secure/CreateIssue.jspa?issuetype=21&pid=10134. Example: "
163-
"https://issues.sonatype.org/browse/OSSRH-67724")
164-
print("2. Store the Sonatype credentials in .m2/settings.xml. See insturctions in "
165-
"https://central.sonatype.org/publish/publish-maven/")
166-
print("3. Now on a Mac machine, run:")
204+
print(
205+
"1-2. File a JIRA ticket: "
206+
"https://issues.sonatype.org/secure/CreateIssue.jspa?issuetype=21&pid=10134. Example: "
207+
"https://issues.sonatype.org/browse/OSSRH-67724"
208+
)
209+
print(
210+
"2. Store the Sonatype credentials in .m2/settings.xml. See insturctions in "
211+
"https://central.sonatype.org/publish/publish-maven/"
212+
)
213+
print(
214+
"3. Now on a M1 Mac machine, run the following to build Scala 2.12 artifacts:"
215+
)
167216
print(" GPG_TTY=$(tty) mvn deploy -Prelease -DskipTests")
168-
print("4. Log into https://oss.sonatype.org/. On the left menu panel, click Staging "
169-
"Repositories. Visit the URL https://oss.sonatype.org/content/repositories/mldmlc-1085 "
170-
"to inspect the staged JAR files. Finally, press Release button to publish the "
171-
"artifacts to the Maven Central repository.")
217+
print(
218+
"4. Log into https://oss.sonatype.org/. On the left menu panel, click Staging "
219+
"Repositories. Visit the URL https://oss.sonatype.org/content/repositories/mldmlc-xxxx "
220+
"to inspect the staged JAR files. Finally, press Release button to publish the "
221+
"artifacts to the Maven Central repository. The top-level metapackage should be "
222+
"named xgboost-jvm_2.12."
223+
)
224+
print("5. Remove the Scala 2.12 artifacts and build Scala 2.13 artifacts:")
225+
print(" rm -rf targets/")
226+
print(" GPG_TTY=$(tty) mvn deploy -Prelease-cpu-only,scala-2.13 -DskipTests")
227+
print(
228+
"6. Go to https://oss.sonatype.org/ to release the Scala 2.13 artifacts."
229+
"The top-level metapackage should be named xgboost-jvm_2.13."
230+
)
231+
172232

173233
if __name__ == "__main__":
174234
main()

include/xgboost/version_config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66

77
#define XGBOOST_VER_MAJOR 2 /* NOLINT */
88
#define XGBOOST_VER_MINOR 0 /* NOLINT */
9-
#define XGBOOST_VER_PATCH 1 /* NOLINT */
9+
#define XGBOOST_VER_PATCH 2 /* NOLINT */
1010

1111
#endif // XGBOOST_VERSION_CONFIG_H_

0 commit comments

Comments
 (0)