Skip to content

Commit ccd1bd1

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 <[email protected]>
1 parent 4603f96 commit ccd1bd1

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>]]
@@ -632,7 +636,7 @@ cmd_set_current_artifacts() {
632636
say "Current artifacts setup at " $local_artifacts_path
633637
}
634638

635-
ensure_current_artifacts_are_set_up() {
639+
cmd_ensure_current_artifacts_are_set_up() {
636640
if [ -f $LOCAL_ARTIFACTS_CURRENT_DIR_FILE ]; then
637641
say "Current artifacts already setup at " $(cat $LOCAL_ARTIFACTS_CURRENT_DIR_FILE)
638642
else
@@ -819,7 +823,7 @@ cmd_test() {
819823
[ $do_kvm_check != 0 ] && ensure_kvm
820824
ensure_devctr
821825
ensure_build_dir
822-
[ $do_artifacts_check != 0 ] && ensure_current_artifacts_are_set_up
826+
[ $do_artifacts_check != 0 ] && cmd_ensure_current_artifacts_are_set_up
823827

824828
if [ $do_build != 0 ]; then
825829
cmd_build --release
@@ -1001,7 +1005,7 @@ cmd_sh() {
10011005

10021006
cmd_sandbox() {
10031007
cmd_build --release
1004-
ensure_current_artifacts_are_set_up
1008+
cmd_ensure_current_artifacts_are_set_up
10051009
cmd_sh "tmux new env PYTEST_ADDOPTS=--pdbcls=IPython.terminal.debugger:TerminalPdb PYTHONPATH=tests IPYTHONDIR=\$PWD/.ipython ipython -i ./tools/sandbox.py $@"
10061010
cmd_fix_perms ".ipython"
10071011
}
@@ -1023,12 +1027,12 @@ cmd_sandbox_native() {
10231027
pip3.11 install ipython requests requests_unixsocket2 psutil tenacity filelock
10241028
pip3.11 install jsonschema aws_embedded_metrics
10251029
pip3.11 install packaging pytest
1026-
ensure_current_artifacts_are_set_up
1030+
cmd_ensure_current_artifacts_are_set_up
10271031
tmux neww sudo --preserve-env=HOME,PATH,TMUX env PYTHONPATH=tests IPYTHONDIR=\$PWD/.ipython ipython -i ./tools/sandbox.py $@
10281032
}
10291033

10301034
cmd_test_debug() {
1031-
ensure_current_artifacts_are_set_up
1035+
cmd_ensure_current_artifacts_are_set_up
10321036
cmd_sh "tmux new ./tools/test.sh --pdb $@"
10331037
}
10341038

0 commit comments

Comments
 (0)