Skip to content

Commit 7f4186b

Browse files
committed
feat: make ensure_current_artifacts_are_set_up a devtool command
The command is used internally in the `devtool` to make sure there are at lest some current artifacts set up. This behaviour is also required in the popular docker test, so convert it to a callable command. Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
1 parent dd4b267 commit 7f4186b

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

.buildkite/pipeline_docker_popular.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
pipeline.build_group(
2929
":whale: Docker Popular Containers",
3030
[
31-
"./tools/devtool download_ci_artifacts",
31+
"./tools/devtool ensure_current_artifacts_are_set_up",
3232
f'buildkite-agent artifact download "{ROOTFS_TAR}" .',
3333
f'tar xzf "{ROOTFS_TAR}" -C tools/test-popular-containers',
3434
'./tools/devtool sh "cd ./tools/test-popular-containers; PYTHONPATH=../../tests ./test-docker-rootfs.py"',

tools/devtool

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,10 @@ cmd_help() {
460460
echo " like `download_ci_artifacts` cmd. Alternatively it is possible to manually write local "
461461
echo " path to artifacts directory into $LOCAL_ARTIFACTS_CURRENT_DIR_FILE file"
462462
echo ""
463+
echo " ensure_current_artifacts_are_set_up"
464+
echo " Makes sure there are some artifacts setup as current ones. If no current artifacts are setup"
465+
echo " downloads latest artifacts and sets them up as current."
466+
echo ""
463467

464468
cat <<EOF
465469
test_debug [-- [<pytest args>]]
@@ -633,7 +637,7 @@ cmd_set_current_artifacts() {
633637
fi
634638
}
635639

636-
ensure_current_artifacts_are_set_up() {
640+
cmd_ensure_current_artifacts_are_set_up() {
637641
if [ -f $LOCAL_ARTIFACTS_CURRENT_DIR_FILE ]; then
638642
say "Current artifacts already setup at " $(cat $LOCAL_ARTIFACTS_CURRENT_DIR_FILE)
639643
else
@@ -820,7 +824,7 @@ cmd_test() {
820824
[ $do_kvm_check != 0 ] && ensure_kvm
821825
ensure_devctr
822826
ensure_build_dir
823-
[ $do_artifacts_check != 0 ] && ensure_current_artifacts_are_set_up
827+
[ $do_artifacts_check != 0 ] && cmd_ensure_current_artifacts_are_set_up
824828

825829
if [ $do_build != 0 ]; then
826830
cmd_build --release
@@ -1002,7 +1006,7 @@ cmd_sh() {
10021006

10031007
cmd_sandbox() {
10041008
cmd_build --release
1005-
ensure_current_artifacts_are_set_up
1009+
cmd_ensure_current_artifacts_are_set_up
10061010
cmd_sh "tmux new env PYTEST_ADDOPTS=--pdbcls=IPython.terminal.debugger:TerminalPdb PYTHONPATH=tests IPYTHONDIR=\$PWD/.ipython ipython -i ./tools/sandbox.py $@"
10071011
cmd_fix_perms ".ipython"
10081012
}
@@ -1024,12 +1028,12 @@ cmd_sandbox_native() {
10241028
pip3.11 install ipython requests requests_unixsocket2 psutil tenacity filelock
10251029
pip3.11 install jsonschema aws_embedded_metrics
10261030
pip3.11 install packaging pytest
1027-
ensure_current_artifacts_are_set_up
1031+
cmd_ensure_current_artifacts_are_set_up
10281032
tmux neww sudo --preserve-env=HOME,PATH,TMUX env PYTHONPATH=tests IPYTHONDIR=\$PWD/.ipython ipython -i ./tools/sandbox.py $@
10291033
}
10301034

10311035
cmd_test_debug() {
1032-
ensure_current_artifacts_are_set_up
1036+
cmd_ensure_current_artifacts_are_set_up
10331037
cmd_sh "tmux new ./tools/test.sh --pdb $@"
10341038
}
10351039

0 commit comments

Comments
 (0)