Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-21: Add release CI #122

Merged
merged 6 commits into from
Sep 17, 2024
Merged

GH-21: Add release CI #122

merged 6 commits into from
Sep 17, 2024

Conversation

kou
Copy link
Member

@kou kou commented Sep 12, 2024

Fix GH-21

This is based on
https://github.com/apache/arrow-julia/tree/main/dev/release and https://github.com/apache/arrow-adbc/tree/main/dev/release .

Workflow:

Cut a RC:

  1. Update PkgVersion in arrow/doc.go
  2. Run dev/release/release_rc.sh
    1. dev/release/release_rc.sh pushes v${version}-rc${rc} tag
    2. .github/workflows/rc.yml creates apache-arrow-go-${version}.tar.gz{,.sha256,.sha512}
    3. .github/workflows/rc.yml uploads apache-arrow-go-${version}.tar.gz{,.sha256,.sha512} to GitHub Releases
    4. dev/release/release_rc.sh downloads apache-arrow-go-${version}.tar.gz from GitHub Releases
    5. dev/release/release_rc.sh signs apache-arrow-go-${version}.tar.gz as apache-arrow-go-${version}.tar.gz.asc
    6. dev/release/release_rc.sh uploads apache-arrow-go-${version}.tar.gz.asc to GitHub Releases
  3. Start a vote

(GitHub Actions instead of
https://dist.apache.org/repos/dist/dev/arrow/ is used like ADBC.)

Verify a RC:

  1. Run dev/release/verify_rc.sh

Release an approved RC:

  1. Run dev/release/release.sh
    1. dev/release/release.sh pushes v${version} tag that refers that same commit ID as v${version}-rc${rc}
    2. dev/release/release.sh downloads apache-arrow-go-${version}.tar.gz{,.asc,.sha256,.sha512} from GitHub Actions
    3. dev/release/release.sh uploads apache-arrow-go-${version}.tar.gz{,.asc,.sha256,.sha512} to https://dist.apache.org/repos/dist/release/arrow
    4. dev/release/release.sh removes old releases from https://dist.apache.org/repos/dist/release/arrow
  2. Add this release to ASF's report database: https://reporter.apache.org/addrelease.html?arrow

Follow-up tasks:

  • Add support for running integration test in the verification script
  • Add support for releasing a release note
  • Add support for creating "v${version}"'s GitHub Releases
    • We can copy "v${version}-rc${rc}"'s GitHub Releases and adjust it for the official release

@kou kou requested a review from raulcd September 13, 2024 05:10
Copy link
Member

@raulcd raulcd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor comments but looks good! Great work @kou I've tested the verification script locally against the uploaded RC to your fork and have validated successfully.

dev/release/release_rc.sh Show resolved Hide resolved
dev/release/release_rc.sh Outdated Show resolved Hide resolved
const PkgVersion = "18.0.0-SNAPSHOT"
const PkgVersion = "18.0.0"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesn't have to change for this PR, only when releasing, right? or do we want this to be 17.0.0 and increment on the new release?
I think we should probably continue using SNAPSHOT and just remove the SNAPSHOT bit when releasing.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesn't have to change for this PR, only when releasing, right?

No.

or do we want this to be 17.0.0 and increment on the new release?

No.

My suggestions:

  • Don't use -SNAPSHOT suffix for unreleased version
  • We don't update this just after we release a new version
    • Because we can't know the next version (18.0.1? 18.1.0? 19.0.0?) just after we release a new version
  • We update this just before we release a new version, when we add a new compatible feature (minor version up) or when we add an incompatible change (major version up)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good to me to update just before releasing

.github/workflows/rc.yml Outdated Show resolved Hide resolved
.github/workflows/rc.yml Show resolved Hide resolved
dev/release/README.md Show resolved Hide resolved
dev/release/README.md Outdated Show resolved Hide resolved
dev/release/README.md Outdated Show resolved Hide resolved
dev/release/README.md Outdated Show resolved Hide resolved
dev/release/release.sh Show resolved Hide resolved
Copy link
Member

@zeroshade zeroshade left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a few nitpicks from me

sed \
-e 's/^const PkgVersion = "//' \
-e 's/"$//')
rc=100
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why rc=100?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just want to use RC that is never used for normal RCs.
We can use 1000, $(date %Y%m%d) or something instead of 100 here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, gotcha. $(date %Y%m%d) is probably best i think?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. I'll use it.

Comment on lines +50 to +55
go clean -modcache || :
if [ "${VERIFY_SUCCESS}" = "yes" ]; then
rm -rf "${VERIFY_TMPDIR}"
else
echo "Failed to verify release candidate. See ${VERIFY_TMPDIR} for details."
fi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of calling go clean -modcache we could try just setting the GOCACHE and GOMODCACHE env vars to point to directories in the tmpdir. That way we still get clean caches, but we don't blow up the users cache dirs.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing cache isn't the main purpose of it.
It's for avoiding a permission problem. See also: apache/arrow#38222

BTW, do we need to set GOCACHE/GOMODCACHE explicitly when we set GOPATH? Can GOCACHE/GOMODCACHE be set automatically under GOPATH?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah gotcha.

BTW, do we need to set GOCACHE/GOMODCACHE explicitly when we set GOPATH? Can GOCACHE/GOMODCACHE be set automatically under GOPATH?

GOMODCACHE should generally be ${GOPATH}/pkg/mod, we might not need to change it explicitly since we set GOPATH.

GOCACHE can be anywhere though and typically is set to ~/.cache/go-build, if we're not running go clean -cache or otherwise cleaning the build cache, and only using go clean -modcache then we're probably fine here without issue.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. Let's use go clean -modcache here.

Comment on lines 114 to 135
if [ -d "${TOP_SOURCE_DIR}/arrow-testing/data" ]; then
cp -a "${TOP_SOURCE_DIR}/arrow-testing" "${ARCHIVE_BASE_NAME}/"
else
git clone \
https://github.com/apache/arrow-testing.git \
"${ARCHIVE_BASE_NAME}/arrow-testing"
fi
if [ -d "${TOP_SOURCE_DIR}/parquet-testing/data" ]; then
cp -a "${TOP_SOURCE_DIR}/parquet-testing" "${ARCHIVE_BASE_NAME}/"
else
git clone \
https://github.com/apache/parquet-testing.git \
"${ARCHIVE_BASE_NAME}/parquet-testing"
fi

ARROW_TEST_DATA="${ARCHIVE_BASE_NAME}/arrow-testing/data"
export ARROW_TEST_DATA
PARQUET_TEST_DATA="${ARCHIVE_BASE_NAME}/parquet-testing/data"
export PARQUET_TEST_DATA
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to add PARQUET_TEST_BAD_DATA now as per #124

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. I'll add it.

kou and others added 5 commits September 14, 2024 06:11
Fix apacheGH-21

This is based on
https://github.com/apache/arrow-julia/tree/main/dev/release and
https://github.com/apache/arrow-adbc/tree/main/dev/release .

Workflow:

Cut a RC:

1. Update `PkgVersion` in `arrow/doc.go`
2. Run `dev/release/release_rc.sh`
   1. `dev/release/release_rc.sh` pushes `v${version}-rc${rc}` tag
   2. `.github/workflows/rc.yml` creates
      `apache-arrow-go-${version}.tar.gz{,.sha256,.sha512}`
   3. `.github/workflows/rc.yml` uploads
      `apache-arrow-go-${version}.tar.gz{,.sha256,.sha512}` to
      GitHub Releases
   4. `dev/release/release_rc.sh` downloads
      `apache-arrow-go-${version}.tar.gz` from
      GitHub Releases
   5. `dev/release/release_rc.sh` signs
      `apache-arrow-go-${version}.tar.gz` as
      `apache-arrow-go-${version}.tar.gz.asc`
   6. `dev/release/release_rc.sh` uploads
      `apache-arrow-go-${version}.tar.gz.asc` to
      GitHub Releases
3. Start a vote

(GitHub Actions instead of
https://dist.apache.org/repos/dist/dev/arrow/ is used like ADBC.)

Verify a RC:

1. Run `dev/release/verify_rc.sh`

Release an approved RC:

1. Run `dev/release/release.sh`
   1. `dev/release/release.sh` pushes `v${version}` tag that
      refers that same commit ID as `v${version}-rc${rc}`
   2. `dev/release/release.sh` downloads
      `apache-arrow-go-${version}.tar.gz{,.asc,.sha256,.sha512}` from
      GitHub Actions
   3. `dev/release/release.sh` uploads
      `apache-arrow-go-${version}.tar.gz{,.asc,.sha256,.sha512}` to
      https://dist.apache.org/repos/dist/release/arrow
   4. `dev/release/release.sh` removes old releases from
      https://dist.apache.org/repos/dist/release/arrow
2. Add this release to ASF's report database:
   https://reporter.apache.org/addrelease.html?arrow

Follow-up tasks:
* Add support for running integration test in the verification script
* Add support for releasing a release note
* Add support for creating "v${version}"'s GitHub Releases
  * We can copy "v${version}-rc${rc}"'s GitHub Releases and adjust
    it for the official release
Copy link
Member

@raulcd raulcd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @kou

with:
submodules: recursive
- name: Prepare for tag
if: github.ref_type == 'tag'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be ${{ github.ref_type }} ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can omit ${{ ... }}: https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#jobsjob_idif

When you use expressions in an if conditional, you can, optionally, omit the ${{ }} expression syntax because GitHub Actions automatically evaluates the if conditional as an expression. However, this exception does not apply everywhere.

You must always use the ${{ }} expression syntax or escape with '', "", or () when the expression starts with !, since ! is reserved notation in YAML format.

@kou
Copy link
Member Author

kou commented Sep 17, 2024

I'll merge this.

@kou kou merged commit c6d372a into apache:main Sep 17, 2024
23 checks passed
@kou kou deleted the release branch September 17, 2024 02:11
@kou kou mentioned this pull request Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add release CI
3 participants