Commit aae9d035 authored by Takuto Ikuta's avatar Takuto Ikuta Committed by Chromium LUCI CQ

[tools] use luci-go in clobber_cache_utils.py

This is tested with

$ ./tools/infra/named-cache-clobber.py --pool luci.flex.try --cache \
  builder_92e38e4683b296a198f832d7beb78c3cceedbbd43e46b55234be1c386f580943_v2
The following bots will be clobbered:

  luci-flex-try-xenial-11-ebhi
  luci-flex-try-xenial-12-kffs
  luci-flex-try-xenial-15-pkbk

Proceed? [Y/n]
To collect results use:
  swarming collect -server https://chromium-swarm.appspot.com -output-dir out -task-summary-json summary.json 5045ab8f8a419b10
You can also see the task status in
  https://chromium-swarm.appspot.com/task?id=5045ab8f8a419b10
To collect results use:
  swarming collect -server https://chromium-swarm.appspot.com -output-dir out -task-summary-json summary.json 5045ab92f48b1710
You can also see the task status in
  https://chromium-swarm.appspot.com/task?id=5045ab92f48b1710
To collect results use:
  swarming collect -server https://chromium-swarm.appspot.com -output-dir out -task-summary-json summary.json 5045ab9759b16b10
You can also see the task status in
  https://chromium-swarm.appspot.com/task?id=5045ab9759b16b10

Bug: 1142713
Change-Id: I5be98fe520c592bb59b3f453e544253c517acf7b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2573561
Auto-Submit: Takuto Ikuta <tikuta@chromium.org>
Commit-Queue: Takuto Ikuta <tikuta@chromium.org>
Reviewed-by: default avatarGarrett Beaty <gbeaty@chromium.org>
Cr-Commit-Position: refs/heads/master@{#834096}
parent 0e236ec2
......@@ -6,56 +6,47 @@
from __future__ import print_function
import json
import os
import subprocess
import sys
import textwrap
_SRC_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..'))
_SWARMING_CLIENT = os.path.join(_SRC_ROOT, 'tools', 'swarming_client',
'swarming.py')
_SWARMING_CLIENT = os.path.join(_SRC_ROOT, 'tools', 'luci-go', 'swarming')
_SWARMING_SERVER = 'chromium-swarm.appspot.com'
def _get_bots(swarming_server, pool, cache):
cmd = [
sys.executable,
_SWARMING_CLIENT,
'bots',
'-b',
'-S',
swarming_server,
'-d',
'caches',
cache,
'-d',
'pool',
pool,
'-dimension',
'caches=' + cache,
'-dimension',
'pool=' + pool,
]
return subprocess.check_output(cmd).splitlines()
return [bot['bot_id'] for bot in json.loads(subprocess.check_output(cmd))]
def _trigger_clobber(swarming_server, pool, cache, bot, mount_rel_path,
dry_run):
cmd = [
sys.executable,
_SWARMING_CLIENT,
'trigger',
'-S',
swarming_server,
'-d',
'pool',
pool,
'-d',
'id',
bot,
'--cipd-package',
'cpython:infra/python/cpython/${platform}:latest',
'--named-cache',
cache,
mount_rel_path,
'--priority=10',
'--raw-cmd',
'-dimension',
'pool=' + pool,
'-dimension',
'id=' + bot,
'-cipd-package',
'cpython:infra/python/cpython/${platform}=latest',
'-named-cache',
cache + '=' + mount_rel_path,
'-priority',
'10',
'--',
'cpython/bin/python${EXECUTABLE_SUFFIX}',
'-c',
......
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