Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
nni
Commits
080ae00d
Unverified
Commit
080ae00d
authored
Mar 26, 2019
by
SparkSnail
Committed by
GitHub
Mar 26, 2019
Browse files
Merge pull request #149 from Microsoft/master
Fix remote integration test pipeline (#914)
parents
ec41d563
c29a0cc3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
13 deletions
+23
-13
test/pipelines-it-remote.yml
test/pipelines-it-remote.yml
+9
-10
test/remote_docker.py
test/remote_docker.py
+14
-3
No files found.
test/pipelines-it-remote.yml
View file @
080ae00d
...
...
@@ -4,6 +4,12 @@ jobs:
steps
:
-
script
:
python3 -m pip install --upgrade pip setuptools --user
displayName
:
'
Install
python
tools'
-
script
:
|
cd deployment/pypi
echo 'building prerelease package...'
make build
ls $(Build.SourcesDirectory)/deployment/pypi/dist/
displayName
:
'
build
nni
bdsit_wheel'
-
script
:
|
source install.sh
displayName
:
'
Install
nni
toolkit
via
source
code'
...
...
@@ -14,17 +20,10 @@ jobs:
-
task
:
CopyFilesOverSSH@0
inputs
:
sshEndpoint
:
remote_nni-ci-gpu-01
sourceFolder
:
src/sdk/pynni
targetFolder
:
/tmp/nnitest/$(Build.BuildId)/pynni
overwrite
:
true
displayName
:
'
Copy
sdk
files
to
remote
machine'
-
task
:
CopyFilesOverSSH@0
inputs
:
sshEndpoint
:
remote_nni-ci-gpu-01
sourceFolder
:
tools
targetFolder
:
/tmp/nnitest/$(Build.BuildId)/tools
sourceFolder
:
deployment/pypi/dist/
targetFolder
:
/tmp/nnitest/$(Build.BuildId)/dist
overwrite
:
true
displayName
:
'
Copy
tool
files
to
remote
machine'
displayName
:
'
Copy
dist
files
to
remote
machine'
-
task
:
CopyFilesOverSSH@0
inputs
:
sshEndpoint
:
remote_nni-ci-gpu-01
...
...
test/remote_docker.py
View file @
080ae00d
...
...
@@ -3,6 +3,7 @@ import argparse
from
subprocess
import
check_output
,
check_call
import
socket
import
random
import
re
def
detect_port
(
port
):
'''Detect if the port is used, return True if the port is used'''
...
...
@@ -21,6 +22,14 @@ def find_port():
port
=
random
.
randint
(
10000
,
20000
)
return
port
def
find_wheel_package
(
dir
):
'''Find the wheel package uploaded to this machine'''
regular
=
re
.
compile
(
'^nni-.*\.whl$'
)
for
file_name
in
os
.
listdir
(
dir
):
if
regular
.
search
(
file_name
):
return
file_name
return
None
def
start_container
(
image
,
name
):
'''Start docker container, generate a port in /tmp/nnitest/{name}/port file'''
port
=
find_port
()
...
...
@@ -28,10 +37,12 @@ def start_container(image, name):
run_cmds
=
[
'docker'
,
'run'
,
'-d'
,
'-p'
,
str
(
port
)
+
':22'
,
'--name'
,
name
,
'--mount'
,
'type=bind,source='
+
source_dir
+
',target=/tmp/nni'
,
image
]
output
=
check_output
(
run_cmds
)
commit_id
=
output
.
decode
(
'utf-8'
)
sdk_cmds
=
[
'docker'
,
'exec'
,
name
,
'python3'
,
'-m'
,
'pip'
,
'install'
,
'--user'
,
'--no-cache-dir'
,
'/tmp/nni/pynni/'
]
wheel_name
=
find_wheel_package
(
os
.
path
.
join
(
source_dir
,
'dist'
))
if
not
wheel_name
:
print
(
'Error: could not find wheel package in {0}'
.
format
(
source_dir
))
exit
(
1
)
sdk_cmds
=
[
'docker'
,
'exec'
,
name
,
'python3'
,
'-m'
,
'pip'
,
'install'
,
'/tmp/nni/dist/{0}'
.
format
(
wheel_name
)]
check_call
(
sdk_cmds
)
tools_cmds
=
[
'docker'
,
'exec'
,
name
,
'python3'
,
'-m'
,
'pip'
,
'install'
,
'--user'
,
'--no-cache-dir'
,
'/tmp/nni/tools'
]
check_call
(
tools_cmds
)
with
open
(
source_dir
+
'/port'
,
'w'
)
as
file
:
file
.
write
(
str
(
port
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment