Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Commit

Permalink
Upgrade node and yarn (#2894)
Browse files Browse the repository at this point in the history
* Upgrade node and yarn (not finished)

* Update makefile and install.ps1 in deployment

* Update indent

* Use a fixed version of yarn

* Upgrade to 10.22.1

* Avoid using latest
  • Loading branch information
ultmaster authored Sep 16, 2020
1 parent 7217b50 commit 66057ba
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ _END := $(shell echo -e '\033[0m')
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S), Linux)
OS_SPEC := linux
NODE_URL := https://nodejs.org/dist/v10.22.1/node-v10.22.1-linux-x64.tar.xz
else ifeq ($(UNAME_S), Darwin)
OS_SPEC := darwin
NODE_URL := https://nodejs.org/dist/v10.22.1/node-v10.22.1-darwin-x64.tar.xz
else
$(error platform $(UNAME_S) not supported)
$(error platform $(UNAME_S) not supported)
endif

## Install directories
Expand Down Expand Up @@ -143,11 +145,11 @@ clean:

$(NNI_NODE_TARBALL):
#$(_INFO) Downloading Node.js $(_END)
wget https://aka.ms/nni/nodejs-download/$(OS_SPEC) -O $(NNI_NODE_TARBALL)
wget $(NODE_URL) -O $(NNI_NODE_TARBALL)

$(NNI_YARN_TARBALL):
#$(_INFO) Downloading Yarn $(_END)
wget https://aka.ms/yarn-download -O $(NNI_YARN_TARBALL)
wget https://github.com/yarnpkg/yarn/releases/download/v1.22.5/yarn-v1.22.5.tar.gz -O $(NNI_YARN_TARBALL)

.PHONY: install-dependencies
install-dependencies: $(NNI_NODE_TARBALL) $(NNI_YARN_TARBALL)
Expand Down
6 changes: 4 additions & 2 deletions deployment/pypi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S), Linux)
OS_SPEC := linux
WHEEL_SPEC := manylinux1_x86_64
NODE_URL := https://nodejs.org/dist/v10.22.1/node-v10.22.1-linux-x64.tar.xz
else ifeq ($(UNAME_S), Darwin)
OS_SPEC := darwin
WHEEL_SPEC := macosx_10_9_x86_64
NODE_URL := https://nodejs.org/dist/v10.22.1/node-v10.22.1-darwin-x64.tar.xz
else
$(error platform $(UNAME_S) not supported)
endif
Expand All @@ -28,11 +30,11 @@ NNI_YARN := PATH=$(CWD)node-$(OS_SPEC)-x64/bin:$${PATH} $(NNI_YARN_FOLDER)/bin/y
build:
# Building version $(NNI_VERSION_VALUE)
python3 -m pip install --user --upgrade setuptools wheel
wget -q https://aka.ms/nni/nodejs-download/$(OS_SPEC) -O $(CWD)node-$(OS_SPEC)-x64.tar.xz
wget -q $(NODE_URL) -O $(CWD)node-$(OS_SPEC)-x64.tar.xz
rm -rf $(CWD)node-$(OS_SPEC)-x64
mkdir $(CWD)node-$(OS_SPEC)-x64
tar xf $(CWD)node-$(OS_SPEC)-x64.tar.xz -C node-$(OS_SPEC)-x64 --strip-components 1
wget -q https://aka.ms/yarn-download -O $(NNI_YARN_TARBALL)
wget -q https://github.com/yarnpkg/yarn/releases/download/v1.22.5/yarn-v1.22.5.tar.gz -O $(NNI_YARN_TARBALL)
rm -rf $(NNI_YARN_FOLDER)
mkdir $(NNI_YARN_FOLDER)
tar -xf $(NNI_YARN_TARBALL) -C $(NNI_YARN_FOLDER) --strip-components 1
Expand Down
5 changes: 3 additions & 2 deletions deployment/pypi/install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ $OS_SPEC = "windows"
if($version_os -eq 64){
$OS_VERSION = 'win64'
$WHEEL_SPEC = 'win_amd64'
$NODE_URL = 'https://nodejs.org/download/release/v10.22.1/node-v10.22.1-win-x64.zip'
}
else{
$OS_VERSION = 'win32'
$WHEEL_SPEC = 'win32'
$NODE_URL = 'https://nodejs.org/download/release/v10.22.1/node-v10.22.1-win-x86.zip'
}

$TIME_STAMP = date -u "+%y%m%d%H%M"
Expand All @@ -28,11 +30,10 @@ $NNI_VERSION_TEMPLATE = "999.0.0-developing"

python -m pip install --upgrade setuptools wheel

$nodeUrl = "https://aka.ms/nni/nodejs-download/" + $OS_VERSION
$NNI_NODE_ZIP = "$CWD\node-$OS_SPEC.zip"
$NNI_NODE_FOLDER = "$CWD\node-$OS_SPEC"
$unzipNodeDir = "node-v*"
(New-Object Net.WebClient).DownloadFile($nodeUrl, $NNI_NODE_ZIP)
(New-Object Net.WebClient).DownloadFile($NODE_URL, $NNI_NODE_ZIP)
if(Test-Path $NNI_NODE_FOLDER){
Remove-Item $NNI_NODE_FOLDER -Recurse -Force
}
Expand Down
5 changes: 3 additions & 2 deletions install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ $install_yarn = $true

if ([Environment]::Is64BitOperatingSystem) {
$OS_VERSION = 'win64'
$nodeUrl = "https://nodejs.org/download/release/v10.22.1/node-v10.22.1-win-x64.zip"
}
else {
$OS_VERSION = 'win32'
$nodeUrl = "https://nodejs.org/download/release/v10.22.1/node-v10.22.1-win-x86.zip"
}
# nodejs
$nodeUrl = "https://aka.ms/nni/nodejs-download/" + $OS_VERSION
$yarnUrl = "https://yarnpkg.com/latest.tar.gz"
$yarnUrl = "https://github.com/yarnpkg/yarn/releases/download/v1.22.5/yarn-v1.22.5.tar.gz"
$unzipNodeDir = "node-v*"
$unzipYarnDir = "yarn-v*"

Expand Down

0 comments on commit 66057ba

Please sign in to comment.