This repository was archived by the owner on Nov 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
[WIP] [v1.x] Create tool for building source archives #19972
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
7716d76
Fix command for running rat check in v1.x branch.
josephevans 467402b
Add script for creating source archives.
josephevans 123cb72
Remove references to mx-theme and mathjax in LICENSE file, since we w…
josephevans 7acfe5b
Create a list of artifacts to be removed from source archive and use …
josephevans fcee001
Revert "Remove references to mx-theme and mathjax in LICENSE file, si…
josephevans 4f6170c
Use --exclude-vcs option to tar instead of find to remove most .git* …
josephevans c79b063
Check out tag directly with submodules and limited depth to make it f…
josephevans 9e94560
Verify that all files listed in the LICENSE file actually exist in th…
josephevans ecb8e88
Remove 2 files from LICENSE that are no longer present in source tree.
josephevans 577558a
Remove lines from LICENSE file for items that are removed during sour…
josephevans File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,106 @@ | ||
| #!/bin/bash | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
|
|
||
| set -e | ||
|
|
||
| MXNET_TAG=$1 | ||
| CMD=$(basename $0) | ||
|
|
||
| if [[ -z "$MXNET_TAG" ]]; then | ||
| echo "Usage: $CMD <tag>" | ||
| echo " where <tag> is the git tag you want to build a release for." | ||
| echo "" | ||
| echo " example: $CMD 1.8.0.rc3" | ||
| exit -1 | ||
| fi | ||
|
|
||
| TAR=tar | ||
| if [[ $(uname) == "Darwin" ]]; then | ||
| TAR=gtar | ||
| fi | ||
|
|
||
| # make sure gnu tar is installed | ||
| which $TAR > /dev/null | ||
| if [[ $? -ne 0 ]]; then | ||
| echo "It looks like you don't have GNU tar installed." | ||
| echo "" | ||
| echo "For OSX users, please install gnu-tar using the command 'brew install gnu-tar'" | ||
| exit -1 | ||
| fi | ||
|
|
||
| SRCDIR=apache-mxnet-src-$MXNET_TAG-incubating | ||
| TARBALL=$SRCDIR.tar.gz | ||
|
|
||
| # clone the repo and checkout the tag | ||
| echo "Cloning the MXNet repository..." | ||
| git clone -b $MXNET_TAG --depth 1 --recurse-submodules \ | ||
| --shallow-submodules https://github.com/apache/incubator-mxnet.git \ | ||
| $SRCDIR | ||
| pushd $SRCDIR | ||
|
|
||
| #### IMPORTANT #### | ||
| # Remove artifacts which do not comply with the Apache Licensing Policy | ||
| echo "Removing unwanted artifacts..." | ||
| for d in $(cat tools/source-exclude-artifacts.txt | grep -v "^#"); do | ||
| if [[ -e $d ]]; then | ||
| echo "Removing $d from source archive..." | ||
| rm -rf $d | ||
| fi | ||
| done | ||
|
|
||
| # Remove lines from LICENSE file for artifacts removed from source tree | ||
| echo "Removing lines from LICENSE for artifacts removed from source archive..." | ||
| for d in $(cat tools/source-exclude-artifacts.txt | grep -v "^#"); do | ||
| line=$(grep "$d" LICENSE) | ||
| if [[ $? -eq 0 && ! -z "$line" ]]; then | ||
| echo "Removing line from LICENSE: $line" | ||
| cat LICENSE | grep -v "$d" > LICENSE.new | ||
| mv -f LICENSE.new LICENSE | ||
| fi | ||
| done | ||
|
|
||
| # Remove other artifacts we do not want contained in the source archive | ||
| rm -rf .DS_Store | ||
| rm -rf CODEOWNERS | ||
| rm -rf .github | ||
|
|
||
| # make sure all files referenced in LICENSE file still exist | ||
| echo "Making sure all paths referenced in LICENSE file exist..." | ||
| for f in $(cat LICENSE | grep "^\s*[0-9A-Za-z]*/[0-9A-Za-z]*" | awk '{print $1}'); do | ||
| echo "Checking if $f exists in source..." | ||
| if [[ ! -e $f ]]; then | ||
| echo -n "ERROR: Path $f is referenced in LICENSE file, but is not present " | ||
| echo "in source directory. Please update the LICENSE file." | ||
| exit -1 | ||
| fi | ||
| done | ||
|
|
||
| # run Apache RAT license checker to verify all source files are compliant | ||
| echo "Running Apache RAT License Checker..." | ||
| ci/build.py -p ubuntu_rat /work/runtime_functions.sh nightly_test_rat_check | ||
|
|
||
|
|
||
| popd | ||
|
|
||
| echo "Creating tarball $TARBALL..." | ||
| $TAR --exclude-vcs -czf $TARBALL $SRCDIR | ||
|
|
||
| # sign the release tarball and create checksum file | ||
| gpg --armor --output $TARBALL.asc --detach-sig $TARBALL | ||
| shasum -a 512 $TARBALL > $TARBALL.sha512 | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
|
|
||
| # NOTE: | ||
| # This is a list of artifacts in the repository that should | ||
| # not be included in source release archives due to licensing | ||
| # restrictions. | ||
|
|
||
| R-package | ||
| 3rdparty/mkldnn/doc | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.