1
0
Fork 0

Merge pull request #222 from google/custom-constraints

custom agent constraints
This commit is contained in:
Mikhail Goncharov 2020-07-24 18:07:06 +02:00 committed by GitHub
commit d0a78f3c8b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 37 additions and 13 deletions

View file

@ -28,8 +28,8 @@ NAME=$1
gcloud beta compute instances create "${NAME}" \ gcloud beta compute instances create "${NAME}" \
--project="${GCP_PROJECT}" \ --project="${GCP_PROJECT}" \
--zone="${GCP_ZONE}" \ --zone="${GCP_ZONE}" \
--machine-type=n1-standard-16 \ --machine-type=n1-standard-32 \
--local-ssd=device-name=local-ssd-0 \ --local-ssd=device-name=local-ssd-0 \
--image=windows-server-2019-dc-for-containers-v20200609 \ --image=windows-server-2019-dc-for-containers-v20200714 \
--image-project=windows-cloud \ --image-project=windows-cloud \
--boot-disk-size=100GB --boot-disk-size=100GB

View file

@ -191,13 +191,15 @@
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
"ds = jobs[jobs['pipeline'] == 'premerge-checks'][jobs['step_key'] == 'windows'][jobs['state']=='passed'][~jobs['agent_name'].str.startswith('buildkite-')]" "ds = jobs[jobs['pipeline'] == 'premerge-checks'][jobs['step_key'] == 'windows'][jobs['state']=='passed'][~jobs['agent_name'].str.startswith('buildkite-')][jobs['started_at'] > np.datetime64('2020-01-22')]"
] ]
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": {}, "metadata": {
"scrolled": true
},
"outputs": [], "outputs": [],
"source": [ "source": [
"ds" "ds"
@ -206,12 +208,14 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": {}, "metadata": {
"scrolled": false
},
"outputs": [], "outputs": [],
"source": [ "source": [
" fig, ax = plt.subplots(figsize=(10,10)) # size of the plot (width, height)\n", " fig, ax = plt.subplots(figsize=(10,10)) # size of the plot (width, height)\n",
"\n", "\n",
" sns.violinplot(\n", " sns.swarmplot(\n",
" ax=ax,\n", " ax=ax,\n",
" x='run_duration',\n", " x='run_duration',\n",
" y='agent_name',\n", " y='agent_name',\n",
@ -222,7 +226,9 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": {}, "metadata": {
"scrolled": false
},
"outputs": [], "outputs": [],
"source": [ "source": [
"t = pd.pivot_table(ds, values=['run_duration'], index=['agent_name'],\n", "t = pd.pivot_table(ds, values=['run_duration'], index=['agent_name'],\n",

View file

@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import json
import os import os
import yaml import yaml
@ -25,13 +26,17 @@ if __name__ == '__main__':
projects = os.getenv('ph_projects', 'detect') projects = os.getenv('ph_projects', 'detect')
log_level = os.getenv('ph_log_level', 'WARNING') log_level = os.getenv('ph_log_level', 'WARNING')
steps = [] steps = []
linux_agents = {'queue': f'{queue_prefix}linux'}
t = os.getenv('ph_linux_agents')
if t is not None:
linux_agents = json.loads(t)
linux_buld_step = { linux_buld_step = {
'label': ':linux: build and test linux', 'label': ':linux: build and test linux',
'key': 'linux', 'key': 'linux',
'commands': [ 'commands': [
'set -euo pipefail', 'set -euo pipefail',
'ccache --clear' if no_cache else '', 'ccache --clear' if no_cache else '',
'ccache --zero-stats', 'ccache --zero-stats',
'mkdir -p artifacts', 'mkdir -p artifacts',
'dpkg -l >> artifacts/packages.txt', 'dpkg -l >> artifacts/packages.txt',
'export SRC=${BUILDKITE_BUILD_PATH}/llvm-premerge-checks', 'export SRC=${BUILDKITE_BUILD_PATH}/llvm-premerge-checks',
@ -54,7 +59,7 @@ if __name__ == '__main__':
'exit \\$EXIT_STATUS', 'exit \\$EXIT_STATUS',
], ],
'artifact_paths': ['artifacts/**/*', '*_result.json'], 'artifact_paths': ['artifacts/**/*', '*_result.json'],
'agents': {'queue': f'{queue_prefix}linux'}, 'agents': linux_agents,
'timeout_in_minutes': 120, 'timeout_in_minutes': 120,
'retry': {'automatic': [ 'retry': {'automatic': [
{'exit_status': -1, 'limit': 2}, # Agent lost {'exit_status': -1, 'limit': 2}, # Agent lost
@ -64,6 +69,10 @@ if __name__ == '__main__':
clear_sccache = 'powershell -command "sccache --stop-server; ' \ clear_sccache = 'powershell -command "sccache --stop-server; ' \
'Remove-Item -Recurse -Force -ErrorAction Ignore $env:SCCACHE_DIR; ' \ 'Remove-Item -Recurse -Force -ErrorAction Ignore $env:SCCACHE_DIR; ' \
'sccache --start-server"' 'sccache --start-server"'
win_agents = {'queue': f'{queue_prefix}windows'}
t = os.getenv('ph_windows_agents')
if t is not None:
win_agents = json.loads(t)
windows_buld_step = { windows_buld_step = {
'label': ':windows: build and test windows', 'label': ':windows: build and test windows',
'key': 'windows', 'key': 'windows',
@ -88,7 +97,7 @@ if __name__ == '__main__':
'}"', '}"',
], ],
'artifact_paths': ['artifacts/**/*', '*_result.json'], 'artifact_paths': ['artifacts/**/*', '*_result.json'],
'agents': {'queue': f'{queue_prefix}windows'}, 'agents': win_agents,
'timeout_in_minutes': 120, 'timeout_in_minutes': 120,
'retry': {'automatic': [ 'retry': {'automatic': [
{'exit_status': -1, 'limit': 2}, # Agent lost {'exit_status': -1, 'limit': 2}, # Agent lost

View file

@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
import json
import os import os
import yaml import yaml
@ -25,6 +26,10 @@ if __name__ == '__main__':
log_level = os.getenv('ph_log_level', 'WARNING') log_level = os.getenv('ph_log_level', 'WARNING')
notify_emails = list(filter(None, os.getenv('ph_notify_emails', '').split(','))) notify_emails = list(filter(None, os.getenv('ph_notify_emails', '').split(',')))
steps = [] steps = []
linux_agents = {'queue': f'{queue_prefix}linux'}
t = os.getenv('ph_linux_agents')
if t is not None:
linux_agents = json.loads(t)
linux_buld_step = { linux_buld_step = {
'label': ':linux: build and test linux', 'label': ':linux: build and test linux',
'key': 'linux', 'key': 'linux',
@ -48,7 +53,7 @@ if __name__ == '__main__':
'exit \\$EXIT_STATUS', 'exit \\$EXIT_STATUS',
], ],
'artifact_paths': ['artifacts/**/*', '*_result.json'], 'artifact_paths': ['artifacts/**/*', '*_result.json'],
'agents': {'queue': f'{queue_prefix}linux'}, 'agents': linux_agents,
'timeout_in_minutes': 120, 'timeout_in_minutes': 120,
'retry': {'automatic': [ 'retry': {'automatic': [
{'exit_status': -1, 'limit': 2}, # Agent lost {'exit_status': -1, 'limit': 2}, # Agent lost
@ -58,8 +63,12 @@ if __name__ == '__main__':
clear_sccache = 'powershell -command "sccache --stop-server; ' \ clear_sccache = 'powershell -command "sccache --stop-server; ' \
'Remove-Item -Recurse -Force -ErrorAction Ignore $env:SCCACHE_DIR; ' \ 'Remove-Item -Recurse -Force -ErrorAction Ignore $env:SCCACHE_DIR; ' \
'sccache --start-server"' 'sccache --start-server"'
# FIXME: openmp is removed as it constantly fails. # FIXME: openmp is removed as it constantly fails. Make this project list be evaluated through "choose_projects".
projects = os.getenv('ph_projects', 'clang;clang-tools-extra;libc;libcxx;libcxxabi;lld;libunwind;mlir;polly') projects = os.getenv('ph_projects', 'clang;clang-tools-extra;libc;libcxx;libcxxabi;lld;libunwind;mlir;polly')
win_agents = {'queue': f'{queue_prefix}windows'}
t = os.getenv('ph_windows_agents')
if t is not None:
win_agents = json.loads(t)
windows_buld_step = { windows_buld_step = {
'label': ':windows: build and test windows', 'label': ':windows: build and test windows',
'key': 'windows', 'key': 'windows',
@ -85,7 +94,7 @@ if __name__ == '__main__':
'}"', '}"',
], ],
'artifact_paths': ['artifacts/**/*', '*_result.json'], 'artifact_paths': ['artifacts/**/*', '*_result.json'],
'agents': {'queue': f'{queue_prefix}windows'}, 'agents': win_agents,
'timeout_in_minutes': 120, 'timeout_in_minutes': 120,
'retry': {'automatic': [ 'retry': {'automatic': [
{'exit_status': -1, 'limit': 2}, # Agent lost {'exit_status': -1, 'limit': 2}, # Agent lost