This repository has been archived by the owner on Sep 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #163 from Microsoft/master
merge master
- Loading branch information
Showing
116 changed files
with
2,622 additions
and
946 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 |
---|---|---|
@@ -1,36 +1,73 @@ | ||
Python Package Index (PyPI) for NNI | ||
=== | ||
# Python Package Index (PyPI) for NNI | ||
|
||
## 1.Description | ||
This is the PyPI build and upload tool for NNI project. | ||
|
||
## 2.Prepare environment | ||
Before build and upload NNI package, make sure the below OS and tools are available. | ||
``` | ||
Ubuntu 16.04 LTS | ||
make | ||
wget | ||
Python >= 3.5 | ||
Pip | ||
Node.js | ||
Yarn | ||
``` | ||
|
||
## 2.How to build | ||
```bash | ||
make | ||
``` | ||
|
||
## 3.How to upload | ||
|
||
### upload for testing | ||
```bash | ||
TWINE_REPOSITORY_URL=https://test.pypi.org/legacy/ make upload | ||
``` | ||
You may need to input the account and password of https://test.pypi.org during this process. | ||
|
||
### upload for release | ||
```bash | ||
make upload | ||
``` | ||
You may need to input the account and password of https://pypi.org during this process. | ||
## **For Linux** | ||
|
||
* __Prepare environment__ | ||
|
||
Before build and upload NNI package, make sure the below OS and tools are available. | ||
``` | ||
Ubuntu 16.04 LTS | ||
make | ||
wget | ||
Python >= 3.5 | ||
Pip | ||
Node.js | ||
Yarn | ||
``` | ||
|
||
* __How to build__ | ||
|
||
```bash | ||
make | ||
``` | ||
|
||
* __How to upload__ | ||
|
||
**upload for testing** | ||
```bash | ||
TWINE_REPOSITORY_URL=https://test.pypi.org/legacy/ make upload | ||
``` | ||
You may need to input the account and password of https://test.pypi.org during this process. | ||
|
||
**upload for release** | ||
```bash | ||
make upload | ||
``` | ||
You may need to input the account and password of https://pypi.org during this process. | ||
|
||
## **For Windows** | ||
|
||
* __Prepare environment__ | ||
|
||
Before build and upload NNI package, make sure the below OS and tools are available. | ||
``` | ||
Windows 10 | ||
powershell | ||
Python >= 3.5 | ||
Pip | ||
Node.js | ||
Yarn | ||
tar | ||
``` | ||
|
||
* __How to build__ | ||
|
||
```bash | ||
powershell ./install.ps1 | ||
``` | ||
|
||
* __How to upload__ | ||
|
||
**upload for testing** | ||
```bash | ||
powershell ./upload.ps1 | ||
``` | ||
You may need to input the account and password of https://test.pypi.org during this process. | ||
|
||
**upload for release** | ||
```bash | ||
powershell ./upload.ps1 -test $False | ||
``` | ||
You may need to input the account and password of https://pypi.org during this process. |
This file contains 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,7 @@ | ||
$CWD = $PWD | ||
$OS_SPEC = "windows" | ||
Remove-Item $CWD\build -Recurse -Force | ||
Remove-Item $CWD\dist -Recurse -Force | ||
Remove-Item $CWD\nni -Recurse -Force | ||
Remove-Item $CWD\nni.egg-info -Recurse -Force | ||
Remove-Item $CWD\node-$OS_SPEC-x64 -Recurse -Force |
This file contains 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,49 @@ | ||
param([bool]$version_ts=$false) | ||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 | ||
$CWD = $PWD | ||
|
||
$OS_SPEC = "windows" | ||
$WHEEL_SPEC = "win_amd64" | ||
|
||
$TIME_STAMP = date -u "+%y%m%d%H%M" | ||
$NNI_VERSION_VALUE = git describe --tags --abbrev=0 | ||
|
||
# To include time stamp in version value, run: | ||
# make version_ts=true build | ||
|
||
if($version_ts){ | ||
$NNI_VERSION_VALUE = "$NNI_VERSION_VALUE.$TIME_STAMP" | ||
} | ||
|
||
$NNI_VERSION_TEMPLATE = "999.0.0-developing" | ||
|
||
python -m pip install --user --upgrade setuptools wheel | ||
|
||
$nodeUrl = "https://aka.ms/nni/nodejs-download/win64" | ||
$NNI_NODE_ZIP = "$CWD\node-$OS_SPEC-x64.zip" | ||
$NNI_NODE_FOLDER = "$CWD\node-$OS_SPEC-x64" | ||
(New-Object Net.WebClient).DownloadFile($nodeUrl, $NNI_NODE_ZIP) | ||
if(Test-Path $NNI_NODE_FOLDER){ | ||
Remove-Item $NNI_NODE_FOLDER -Recurse -Force | ||
} | ||
New-Item $NNI_NODE_FOLDER -ItemType Directory | ||
cmd /c tar -xf $NNI_NODE_ZIP -C $NNI_NODE_FOLDER --strip-components 1 | ||
|
||
cd $CWD\..\..\src\nni_manager | ||
yarn | ||
yarn build | ||
cd $CWD\..\..\src\webui | ||
yarn | ||
yarn build | ||
if(Test-Path $CWD\nni){ | ||
Remove-Item $CWD\nni -r -fo | ||
} | ||
Copy-Item $CWD\..\..\src\nni_manager\dist $CWD\nni -Recurse | ||
Copy-Item $CWD\..\..\src\webui\build $CWD\nni\static -Recurse | ||
Copy-Item $CWD\..\..\src\nni_manager\package.json $CWD\nni | ||
(Get-Content $CWD\nni\package.json).replace($NNI_VERSION_TEMPLATE, $NNI_VERSION_VALUE) | Set-Content $CWD\nni\package.json | ||
cd $CWD\nni | ||
yarn --prod | ||
cd $CWD | ||
(Get-Content setup.py).replace($NNI_VERSION_TEMPLATE, $NNI_VERSION_VALUE) | Set-Content setup.py | ||
python setup.py bdist_wheel -p $WHEEL_SPEC |
This file contains 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 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,8 @@ | ||
param([bool]$test=$true) | ||
python -m pip install --user --upgrade twine | ||
if($test){ | ||
python -m twine upload --repository-url https://test.pypi.org/legacy/ dist/* | ||
} | ||
else{ | ||
python -m twine upload dist/* | ||
} |
This file contains 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 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
Oops, something went wrong.