Unverified Commit fb18f0d4 authored by Yuge Zhang's avatar Yuge Zhang Committed by GitHub
Browse files

Fix pipeline node version for unittests (#1721)

* try to fix pipeline

* locate npm and node version

* override with node in local dir

* refactor path set

* fix install SMAC on macOS
parent 3e0ef005
...@@ -52,6 +52,7 @@ $(shell mkdir -p $(NNI_DEPENDENCY_FOLDER)) ...@@ -52,6 +52,7 @@ $(shell mkdir -p $(NNI_DEPENDENCY_FOLDER))
NNI_NODE_TARBALL ?= $(NNI_DEPENDENCY_FOLDER)/nni-node-$(OS_SPEC)-x64.tar.xz NNI_NODE_TARBALL ?= $(NNI_DEPENDENCY_FOLDER)/nni-node-$(OS_SPEC)-x64.tar.xz
NNI_NODE_FOLDER = $(NNI_DEPENDENCY_FOLDER)/nni-node-$(OS_SPEC)-x64 NNI_NODE_FOLDER = $(NNI_DEPENDENCY_FOLDER)/nni-node-$(OS_SPEC)-x64
NNI_NODE ?= $(BIN_FOLDER)/node NNI_NODE ?= $(BIN_FOLDER)/node
NNI_NPM ?= $(BIN_FOLDER)/npm
NNI_YARN_TARBALL ?= $(NNI_DEPENDENCY_FOLDER)/nni-yarn.tar.gz NNI_YARN_TARBALL ?= $(NNI_DEPENDENCY_FOLDER)/nni-yarn.tar.gz
NNI_YARN_FOLDER ?= $(NNI_DEPENDENCY_FOLDER)/nni-yarn NNI_YARN_FOLDER ?= $(NNI_DEPENDENCY_FOLDER)/nni-yarn
NNI_YARN ?= PATH=$(BIN_FOLDER):$${PATH} $(NNI_YARN_FOLDER)/bin/yarn NNI_YARN ?= PATH=$(BIN_FOLDER):$${PATH} $(NNI_YARN_FOLDER)/bin/yarn
...@@ -149,8 +150,9 @@ install-dependencies: $(NNI_NODE_TARBALL) $(NNI_YARN_TARBALL) ...@@ -149,8 +150,9 @@ install-dependencies: $(NNI_NODE_TARBALL) $(NNI_YARN_TARBALL)
mkdir $(NNI_NODE_FOLDER) mkdir $(NNI_NODE_FOLDER)
tar -xf $(NNI_NODE_TARBALL) -C $(NNI_NODE_FOLDER) --strip-components 1 tar -xf $(NNI_NODE_TARBALL) -C $(NNI_NODE_FOLDER) --strip-components 1
mkdir -p $(BIN_FOLDER) mkdir -p $(BIN_FOLDER)
rm -f $(NNI_NODE) rm -f $(NNI_NODE) $(NNI_NPM)
cp $(NNI_NODE_FOLDER)/bin/node $(NNI_NODE) ln -s $(NNI_NODE_FOLDER)/bin/node $(NNI_NODE)
ln -s $(NNI_NODE_FOLDER)/bin/npm $(NNI_NPM)
#$(_INFO) Extracting Yarn $(_END) #$(_INFO) Extracting Yarn $(_END)
rm -rf $(NNI_YARN_FOLDER) rm -rf $(NNI_YARN_FOLDER)
......
...@@ -12,6 +12,7 @@ jobs: ...@@ -12,6 +12,7 @@ jobs:
python3 -m pip install --upgrade pip setuptools --user python3 -m pip install --upgrade pip setuptools --user
python3 -m pip install pylint==2.3.1 astroid==2.2.5 --user python3 -m pip install pylint==2.3.1 astroid==2.2.5 --user
python3 -m pip install coverage --user python3 -m pip install coverage --user
echo "##vso[task.setvariable variable=PATH]${HOME}/.local/bin:${PATH}"
displayName: 'Install python tools' displayName: 'Install python tools'
- script: | - script: |
source install.sh source install.sh
...@@ -23,8 +24,8 @@ jobs: ...@@ -23,8 +24,8 @@ jobs:
python3 -m pip install keras==2.1.6 --user python3 -m pip install keras==2.1.6 --user
python3 -m pip install gym onnx --user python3 -m pip install gym onnx --user
sudo apt-get install swig -y sudo apt-get install swig -y
PATH=$HOME/.local/bin:$PATH nnictl package install --name=SMAC nnictl package install --name=SMAC
PATH=$HOME/.local/bin:$PATH nnictl package install --name=BOHB nnictl package install --name=BOHB
displayName: 'Install dependencies' displayName: 'Install dependencies'
- script: | - script: |
set -e set -e
...@@ -42,25 +43,23 @@ jobs: ...@@ -42,25 +43,23 @@ jobs:
displayName: 'Run flake8 tests to find Python syntax errors and undefined names' displayName: 'Run flake8 tests to find Python syntax errors and undefined names'
- script: | - script: |
cd test cd test
sudo apt install -y swig
PATH=$HOME/.local/bin:$PATH nnictl package install --name=SMAC
source unittest.sh source unittest.sh
displayName: 'Unit test' displayName: 'Unit test'
- script: | - script: |
cd test cd test
PATH=$HOME/.local/bin:$PATH python3 naive_test.py python3 naive_test.py
displayName: 'Naive test' displayName: 'Naive test'
- script: | - script: |
cd test cd test
PATH=$HOME/.local/bin:$PATH python3 tuner_test.py python3 tuner_test.py
displayName: 'Built-in tuners / assessors tests' displayName: 'Built-in tuners / assessors tests'
- script: | - script: |
cd test cd test
PATH=$HOME/.local/bin:$PATH python3 metrics_test.py python3 metrics_test.py
displayName: 'Trial job metrics test' displayName: 'Trial job metrics test'
- script: | - script: |
cd test cd test
PATH=$HOME/.local/bin:$PATH python3 cli_test.py python3 cli_test.py
displayName: 'nnicli test' displayName: 'nnicli test'
- job: 'basic_test_pr_macOS' - job: 'basic_test_pr_macOS'
...@@ -74,33 +73,34 @@ jobs: ...@@ -74,33 +73,34 @@ jobs:
steps: steps:
- script: python3 -m pip install --upgrade pip setuptools - script: python3 -m pip install --upgrade pip setuptools
displayName: 'Install python tools' displayName: 'Install python tools'
- script: |
python3 -m pip install torch==0.4.1 --user
python3 -m pip install torchvision==0.2.1 --user
python3 -m pip install tensorflow==1.13.1 --user
displayName: 'Install dependencies'
- script: | - script: |
source install.sh source install.sh
echo "##vso[task.setvariable variable=PATH]${HOME}/Library/Python/3.7/bin:${PATH}"
displayName: 'Install nni toolkit via source code' displayName: 'Install nni toolkit via source code'
- script: | - script: |
cd test python3 -m pip install torch==0.4.1 --user
python3 -m pip install torchvision==0.2.1 --user
python3 -m pip install tensorflow==1.13.1 --user
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null
brew install swig@3 brew install swig@3
ln -s /usr/local/opt/swig\@3/bin/swig /usr/local/bin/swig ln -s /usr/local/opt/swig\@3/bin/swig /usr/local/bin/swig
PATH=$HOME/Library/Python/3.7/bin:$PATH nnictl package install --name=SMAC nnictl package install --name=SMAC
PATH=$HOME/Library/Python/3.7/bin:$PATH source unittest.sh displayName: 'Install dependencies'
- script: |
cd test
source unittest.sh
displayName: 'Unit test' displayName: 'Unit test'
- script: | - script: |
cd test cd test
PATH=$HOME/Library/Python/3.7/bin:$PATH python3 naive_test.py python3 naive_test.py
displayName: 'Naive test' displayName: 'Naive test'
- script: | - script: |
cd test cd test
PATH=$HOME/Library/Python/3.7/bin:$PATH python3 tuner_test.py python3 tuner_test.py
displayName: 'Built-in tuners / assessors tests' displayName: 'Built-in tuners / assessors tests'
- script: | - script: |
cd test cd test
PATH=$HOME/Library/Python/3.7/bin:$PATH python3 cli_test.py python3 cli_test.py
displayName: 'nnicli test' displayName: 'nnicli test'
- job: 'basic_test_pr_Windows' - job: 'basic_test_pr_Windows'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment