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
e0208145
Unverified
Commit
e0208145
authored
Dec 21, 2020
by
liuzhe-lz
Committed by
GitHub
Dec 21, 2020
Browse files
Fix bugs found in integration test (#3214)
parent
a1016a6c
Changes
25
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
59 additions
and
0 deletions
+59
-0
test/vso_tools/build_wheel.py
test/vso_tools/build_wheel.py
+3
-0
test/vso_tools/generate_nni_version.py
test/vso_tools/generate_nni_version.py
+6
-0
test/vso_tools/install_nni.py
test/vso_tools/install_nni.py
+11
-0
test/vso_tools/start_docker.py
test/vso_tools/start_docker.py
+32
-0
test/vso_tools/stop_docker.py
test/vso_tools/stop_docker.py
+7
-0
No files found.
test/vso_tools/build_wheel.py
0 → 100644
View file @
e0208145
from
_common
import
build_wheel
build_wheel
()
test/vso_tools/generate_nni_version.py
0 → 100644
View file @
e0208145
from
datetime
import
datetime
from
_common
import
set_variable
time
=
datetime
.
now
().
strftime
(
'%Y%m%d%H%M%S'
)
set_variable
(
'NNI_RELEASE'
,
'999.'
+
time
)
test/vso_tools/install_nni.py
0 → 100644
View file @
e0208145
import
sys
from
_common
import
build_wheel
,
run_command
if
len
(
sys
.
argv
)
<=
2
:
extra_dep
=
''
else
:
extra_dep
=
f
'[
{
sys
.
argv
[
2
]
}
]'
wheel
=
build_wheel
()
run_command
(
f
'
{
sys
.
executable
}
-m pip install
{
wheel
}{
extra_dep
}
'
)
test/vso_tools/start_docker.py
0 → 100644
View file @
e0208145
"""
Build docker image, start container, then set its SSH service port to VSO variable "docker_port".
Usage:
python start_docker.py <nni-version> <container-name> <password-in-docker>
"""
import
random
import
socket
import
sys
from
_common
import
build_wheel
,
run_command
,
set_variable
# find idle port
port
=
random
.
randint
(
10000
,
20000
)
while
True
:
sock
=
socket
.
socket
()
if
sock
.
connect_ex
((
'localhost'
,
port
))
!=
0
:
break
# failed to connect, so this is idle
sock
.
close
()
port
=
random
.
randint
(
10000
,
20000
)
version
=
sys
.
argv
[
1
]
container
=
sys
.
argv
[
2
]
password
=
sys
.
argv
[
3
]
run_command
(
f
'docker build --build-arg NNI_RELEASE=
{
version
}
-t nnidev/nni-nightly .'
)
run_command
(
f
'docker run -d -t -p
{
port
}
:22 --name
{
container
}
nnidev/nni-nightly'
)
run_command
(
f
'docker exec
{
container
}
useradd --create-home --password
{
password
}
nni'
)
run_command
([
'docker'
,
'exec'
,
container
,
'bash'
,
'-c'
,
f
'echo "nni:
{
password
}
" | chpasswd'
])
run_command
(
f
'docker exec
{
container
}
service ssh start'
)
set_variable
(
'docker_port'
,
port
)
test/vso_tools/stop_docker.py
0 → 100644
View file @
e0208145
import
sys
from
_common
import
run_command
name
=
sys
.
argv
[
1
]
run_command
(
f
'docker container stop
{
name
}
'
)
run_command
(
f
'docker container rm
{
name
}
'
)
Prev
1
2
Next
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