在 Spark 中,发布经理的角色意味着您负责一些不同的事情
如果您是新的发布经理,您可以阅读以下内容了解该流程
如果您已经上传了密钥,则可以跳过此部分。
这是一个 gpg 2.0.12 的示例。 如果您使用 gpg 1 系列版本,请参阅 generate-key 了解详细信息。
$ gpg --full-gen-key
gpg (GnuPG) 2.0.12; Copyright (C) 2009 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Please select what kind of key you want:
(1) RSA and RSA (default)
(2) DSA and Elgamal
(3) DSA (sign only)
(4) RSA (sign only)
Your selection? 1
RSA keys may be between 1024 and 4096 bits long.
What keysize do you want? (2048) 4096
Requested keysize is 4096 bits
Please specify how long the key should be valid.
0 = key does not expire
<n> = key expires in n days
<n>w = key expires in n weeks
<n>m = key expires in n months
<n>y = key expires in n years
Key is valid for? (0)
Key does not expire at all
Is this correct? (y/N) y
GnuPG needs to construct a user ID to identify your key.
Real name: Robert Burrell Donkin
Email address: rdonkin@apache.org
Comment: CODE SIGNING KEY
You selected this USER-ID:
"Robert Burrell Donkin (CODE SIGNING KEY) <rdonkin@apache.org>"
Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? O
We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.
We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.
gpg: key 04B3B5C426A27D33 marked as ultimately trusted
gpg: revocation certificate stored as '/home/ubuntu/.gnupg/openpgp-revocs.d/08071B1E23C8A7E2CA1E891A04B3B5C426A27D33.rev'
public and secret key created and signed.
pub rsa4096 2021-08-19 [SC]
08071B1E23C8A7E2CA1E891A04B3B5C426A27D33
uid Jack (test) <Jack@mail.com>
sub rsa4096 2021-08-19 [E]
请注意,公钥的最后 8 位数字 (26A27D33) 是密钥 ID。
生成公钥后,我们应该将其上传到公钥服务器
$ gpg --keyserver hkps://keys.openpgp.org --send-key 26A27D33
有关详细信息,请参阅 keyserver-upload。
要获取代码签名密钥(也称为 ASCII 装甲公钥),请运行命令
$ gpg --export --armor 26A27D33
然后通过以下方式将生成的密钥附加到 KEYS 文件
# Move dev/ to release/ when the voting is completed. See Finalize the Release below
svn co --depth=files "https://dist.apache.org/repos/dist/dev/spark" svn-spark
# edit svn-spark/KEYS file
svn ci --username $ASF_USERNAME --password "$ASF_PASSWORD" -m"Update KEYS"
如果您想在另一台机器上进行发布,您可以通过 gpg --export-secret-keys
和 gpg --import
命令将您的私钥传输到该机器。
创建发布候选版本的脚本通过 docker 运行。 在运行这些脚本之前,您需要安装 docker。 请确保您可以作为非 root 用户运行 docker。 有关更多详细信息,请参阅 https://docs.docker.net.cn/install/linux/linux-postinstall。
准备发布的主要步骤是创建发布分支。 这是通过标准的 Git 分支机制完成的,并且一旦创建分支,就应该向社区宣布。
如果这不是第一个 RC,则确保自上次 RC 以来已解决的 JIRA 问题被标记为 Resolved
并且已将 Target Versions
设置为此发布版本。
要跟踪任何针对此版本具有待处理 PR 的问题,请在 JIRA 中创建一个过滤器,其查询如下所示 project = SPARK AND "Target Version/s" = "12340470" AND status in (Open, Reopened, "In Progress")
对于要使用的目标版本字符串值,通过查找具有该目标版本的现有问题并单击该版本的“目标版本”字段来查找与该版本对应的数值(例如,查找以 2.2.1 为目标的问题,然后单击其“目标版本”字段的版本链接)
从 git log
验证它们是否真的进入了新的 RC。 检查带有 release-notes
标签的 JIRA 问题,并确保它们记录在相关迁移指南中以进行重大更改或稍后在网站上的发布新闻中记录。
要创建发布候选版本,有 4 个步骤
创建发布候选版本的流程已通过 dev/create-release/do-release-docker.sh
脚本自动完成。 运行此脚本,输入它需要的信息,然后等待它完成。 您还可以通过 -s
选项执行单个步骤。 请运行 do-release-docker.sh -h
并查看更多详细信息。
发布投票在 Apache Spark 开发者邮件列表中进行(PMC 正在投票)。 查看过去的投票主题以了解此过程如何进行。 该电子邮件应遵循此格式。
投票完成后,您还应该发送一封总结邮件,其中包含总数,主题类似于 [VOTE][RESULT] ...
。
请注意,dev/create-release/do-release-docker.sh
脚本(finalize
步骤)自动执行以下大多数步骤,除了
请在每个步骤后手动验证结果。
小心!
此步骤是不可逆转的,因此请确保您选择了正确的暂存存储库。 一旦您将项目移动到发布文件夹中,它们就无法被删除。
投票通过后,要将二进制文件上传到 Apache 镜像,您需要将二进制文件从 dev 目录(这应该是投票的目录)移动到发布目录。 这种“移动”是您可以将内容添加到实际发布目录的唯一方法。 (注意:只有 PMC 才能移动到发布目录)
# Move the sub-directory in "dev" to the
# corresponding directory in "release"
$ export SVN_EDITOR=vim
$ svn mv https://dist.apache.org/repos/dist/dev/spark/v1.1.1-rc2-bin https://dist.apache.org/repos/dist/release/spark/spark-1.1.1
# If you've added your signing key to the KEYS file, also update the release copy.
svn co --depth=files "https://dist.apache.org/repos/dist/release/spark" svn-spark
curl "https://dist.apache.org/repos/dist/dev/spark/KEYS" > svn-spark/KEYS
(cd svn-spark && svn ci --username $ASF_USERNAME --password "$ASF_PASSWORD" -m"Update KEYS")
验证资源是否存在于 https://apache.org/dist/spark/ 中。 它们可能需要一段时间才能显示。 这将在整个 Apache 网络中进行镜像。 在 https://checker.apache.org/projs/spark.html 检查发布的发布检查器结果。
对于 Maven Central Repository,您可以从 Apache Nexus Repository Manager 发布。 这已经通过 release-build.sh publish-release
步骤填充。 登录,打开 Staging Repositories,找到投票通过的(例如,orgapachespark-1257,对应 https://repository.apache.org/content/repositories/orgapachespark-1257/),选择并单击 Release 并确认。 如果成功,它应该显示在 https://repository.apache.org/content/repositories/releases/org/apache/spark/spark-core_2.11/2.2.1/ 和 https://repository.apache.org/content/groups/maven-staging-group/org/apache/spark/spark-core_2.11/2.2.1/ 下(查找正确的发布版本)。 一段时间后,这将被自动同步到 Maven Central。
您需要您自己的 PyPI 帐户。 如果您没有 PyPI 帐户,并且该帐户无权访问 PyPI 上的 pyspark
和 pyspark-connect
项目,请请求 PMC 授予两者权限。
可以使用 twine 上传项目。 只需运行
twine upload -u __token__ -p $PYPI_API_TOKEN \
--repository-url https://upload.pypi.org/legacy/ \
"pyspark-$PYSPARK_VERSION.tar.gz" \
"pyspark-$PYSPARK_VERSION.tar.gz.asc"
调整命令以匹配新版本的文件的命令。 如果由于某种原因 twine 上传不正确(例如,http 失败或其他问题),您可以将项目重命名为 pyspark-version.post0.tar.gz
,从 PyPI 中删除旧项目并重新上传。
注意! 如果您没有为批准的 RC 制作文档备份,这是您可以制作备份的最后一次机会。 这将用于在接下来的几个步骤中将文档上传到网站。 在删除目录之前,从 svn 检出文档。
投票通过并且您将批准的 RC 移动到发布存储库后,您应该从暂存存储库中删除 RC 目录。 例如
RC=v3.5.2-rc3 && \
svn rm https://dist.apache.org/repos/dist/dev/spark/"${RC}"-bin/ \
https://dist.apache.org/repos/dist/dev/spark/"${RC}"-docs/ \
-m"Removing RC artifacts."
确保还从 Apache Nexus Repository Manager 中删除未发布的暂存存储库。
Spark 始终在镜像网络中保留每个分支的最新维护版本。 要删除旧版本,只需使用 svn rm
$ svn rm https://dist.apache.org/repos/dist/release/spark/spark-1.1.0
您还需要更新 js/download.js
以指示该版本不再被镜像,以便在网站上生成正确的链接。
检出已通过的发布候选版本的标记提交,并应用正确的版本标签。
$ git tag v1.1.1 v1.1.1-rc2 # the RC that passed
$ git push apache v1.1.1
Spark 文档网站上的搜索框利用了 Algolia 爬虫。 在发布之前,请在 Algolia Crawler Admin Console 上使用新版本更新 Apache Spark 的爬虫配置。 如果您无权访问该配置,请联系 Gengliang Wang 或 Xiao Li 寻求帮助。
网站存储库位于 https://github.com/apache/spark-website。
建议不要删除最新 RC 的生成的文档,这样我们可以直接将其复制到 spark-website,否则您需要重新构建文档。
# Build the latest docs
$ git checkout v1.1.1
$ cd docs
$ PRODUCTION=1 bundle exec jekyll build
# Copy the new documentation to Apache
$ git clone https://github.com/apache/spark-website
...
$ cp -R _site spark-website/site/docs/1.1.1
# Update the "latest" link
$ cd spark-website/site/docs
$ rm latest
$ ln -s 1.1.1 latest
接下来,更新 Spark 网站的其余部分。 了解以前的发布是如何记录的(所有 HTML 文件更改都由 jekyll
生成)。 特别是
_layouts/global.html
documentation.md
,添加指向新版本文档的链接js/downloads.js
(注意版本顺序)site/static/versions.json
(注意版本顺序) [适用于 PySpark
文档的 spark version drop down
]security.md
,看看是否有需要更新的内容$ git add 1.1.1
$ git commit -m "Add docs for Spark 1.1.1"
然后,创建发行说明。进入 JIRA 中的发布页面,从列表中选择发布版本,然后单击“Release Notes”。复制此 URL,然后在 s.apache.org 上创建一个短 URL,登录到您的 Apache 帐户,并将 ID 设置为类似于 spark-2.1.2
的名称。在 releases/_posts
下创建一个新的版本帖子,以包含此短 URL。帖子的日期应该是您创建它的日期。
然后运行 bundle exec jekyll build
来更新 site
目录。
考虑到 Pull Request 可能会很大,请将代码更改的提交和生成的 site
目录分开提交,以便更轻松地进行审查。
将更改合并到 asf-site
分支后,您可能需要创建一个后续的空提交,以强制 ASF 的 git 和网站以及 GitHub 镜像之间的同步。由于某些原因,此存储库的同步似乎不太可靠。
顺便提一下,请确保在 JIRA 上将该版本标记为已发布。像上面一样找到发布页面,例如 https://issues.apache.org/jira/projects/SPARK/versions/12340295
,然后单击右侧的“Release”按钮并输入发布日期。
(通常,这仅适用于主要版本和次要版本,而不适用于补丁版本)贡献者列表可以通过 此脚本 自动生成。它接受与当前版本对应的标签和与上一个版本(不包括维护版本)对应的另一个标签。例如,如果您要发布 Spark 1.2.0,请将当前标签设置为 v1.2.0-rc2,并将上一个标签设置为 v1.1.0。生成初始贡献者列表后,很可能会出现关于作者姓名未正确翻译的警告。要解决此问题,请运行 此其他脚本,该脚本从 GitHub 和 JIRA 获取潜在的替换项。例如
$ cd dev/create-release
# Set RELEASE_TAG and PREVIOUS_RELEASE_TAG
$ export RELEASE_TAG=v1.1.1
$ export PREVIOUS_RELEASE_TAG=v1.1.0
# Generate initial contributors list, likely with warnings
$ ./generate-contributors.py
# Set GITHUB_OAUTH_KEY.
$ export GITHUB_OAUTH_KEY=blabla
# Set either JIRA_ACCESS_TOKEN (for 4.0.0 and later) or JIRA_USERNAME / JIRA_PASSWORD.
$ export JIRA_ACCESS_TOKEN=blabla
$ export JIRA_USERNAME=blabla
$ export JIRA_PASSWORD=blabla
# Translate names generated in the previous step, reading from known_translations if necessary
$ ./translate-contributors.py
此外,如果您希望对较大补丁的开发人员给予更具体的认可,您可以使用以下命令来识别大型补丁。必须格外小心,以确保不计算先前版本的提交,因为 git 无法轻易地将回传到不同分支的提交关联起来。
# Determine PR numbers closed only in the new release
$ git log v1.1.1 | grep "Closes #" | cut -d " " -f 5,6 | grep Closes | sort > closed_1.1.1
$ git log v1.1.0 | grep "Closes #" | cut -d " " -f 5,6 | grep Closes | sort > closed_1.1.0
$ diff --new-line-format="" --unchanged-line-format="" closed_1.1.1 closed_1.1.0 > diff.txt
# Grep expression with all new patches
$ EXPR=$(cat diff.txt | awk '{ print "\\("$1" "$2" \\)"; }' | tr "\n" "|" | sed -e "s/|/\\\|/g" | sed "s/\\\|$//")
# Contributor list
$ git shortlog v1.1.1 --grep "$EXPR" > contrib.txt
# Large patch list (300+ lines)
$ git log v1.1.1 --grep "$expr" --shortstat --oneline | grep -B 1 -e "[3-9][0-9][0-9] insert" -e "[1-9][1-9][1-9][1-9] insert" | grep SPARK > large-patches.txt
apache/spark-docker 为发布的 Spark Docker 镜像提供 Dockerfile 和 GitHub Action,请按照 说明 创建和上传 docker 镜像。
一旦一切正常(网站文档,网站更改),在网站上创建一个公告,然后向邮件列表发送一封主题类似于 [ANNOUNCE] ...
的电子邮件。要创建公告,请在 news/_posts
下创建一个帖子,然后运行 bundle exec jekyll build
。
享受您选择的成人饮料,并祝贺您发布 Spark 版本。