Skip to content

Instantly share code, notes, and snippets.

View kinow's full-sized avatar
💭
😬

Bruno P. Kinoshita kinow

💭
😬
View GitHub Profile
@kinow
kinow / performance.md
Last active August 18, 2020 03:14
Performance tests between Cylc UI + deltas, and Cylc UI + deltas + infinite tree

Environment

Thinkpad T530 16GB 8cores. Ubuntu LTS 18.04 up to date. Anaconda Python 3.7.7, with a venv virtual environment activated.

Latest branches of cylc-flow (9d60d6858113322f607b408fb3ead34b3f98a142) and cylc-uiserver (0eba8f3af77ed3adfb10a2f6510b247beaa1fcdc).

Chromium 84. As Cylc UI was built for production mode, VueDevTools doesn't interfere with the performance tests, as it won't be activated either during the tests. I will use only the browser default development tools and lighthouse. Also disabled uBlock origin for localhost.

See file suite.rc for complex workflow source.

@kinow
kinow / debug-conda-install.md
Last active July 21, 2020 22:27
Debugging conda install

Check out conda/conda, and create a venv. Activate it, and run pip install -e ..

Then create a file test.py with the following contents:

from conda.cli.main import main
main('install', '--dry-run', '--use-index-cache', 'cylc==8.0a2')

Now you should be able to debug it. The --use-index-cache is important to skip downloading the

@kinow
kinow / logger.log
Created July 10, 2020 02:22
reconcile_update right after adding a graph widget, waiting a couple seconds, then stopping the workflow
[D 2020-07-10T14:20:29.387 JupyterHub provider:194] Deleting oauth code 4FM... for jupyterhub-user-kinow
[I 2020-07-10T14:20:29.401 JupyterHub log:174] 200 POST /hub/api/oauth2/token (kinow@127.0.0.1) 50.51ms
[I 2020-07-10T14:20:29.423 JupyterHub log:174] 200 GET /hub/api/authorizations/token/[secret] (kinow@127.0.0.1) 18.76ms
2020-07-10 14:20:40,650 cylc.uiserver.data_store_mgr INFO reconcile_update for topic=$family_proxies, delta=time: 1594347640.310939
checksum: 1239951977
updated {
stamp: "kinow|five|20130814T1200+12|root@1594347640.3102195"
id: "kinow|five|20130814T1200+12|root"
state: "running"
is_held: false
#!jinja2
# A somewhat complex suite put together for the IS-ENES2 Workshop in Lisbon
# 2016.
{% if not batch_system is defined %}
{% set batch_system = 'background' %}
{% endif %}
{% if not sleep_time is defined %}
{% set sleep_time = 1 %}
@kinow
kinow / query.gql
Created June 15, 2020 02:22
query.gql
subscription OnWorkflowDeltasData ($workflowId: ID) {
deltas (workflows: [$workflowId], stripNull: true) {
...WorkflowTreeDeltas
}
}
# TREE DELTAS BEGIN
fragment WorkflowTreeDeltas on Deltas {
id
@kinow
kinow / delta1.js
Last active June 14, 2020 23:17
deltas out of order?
{
"id": "kinow|families2",
"shutdown": false,
"added": {
"__typename": "Added"
},
"updated": {
"taskProxies": [
{
"id": "kinow|families2|22910615T0946+12|qux",
subscription OnWorkflowDeltasData($workflowId: ID) {
deltas(workflows: [$workflowId], stripNull: true) {
...WorkflowTreeDeltas
__typename
}
}
fragment WorkflowTreeDeltas on Deltas {
id
shutdown
subscription OnWorkflowDeltasData ($workflowId: ID) {
deltas (workflows: [$workflowId]) {
...WorkflowTreeDeltas
...WorkflowGraphDeltas
}
}
# GRAPH DELTAS BEGIN
# TODO: incomplete as the graph component is not using deltas (yet!)
# but useful for testing the subscription and fragments
import tracemalloc
import os
import linecache
import logging
import time
import concurrent
import re
import gc
from typing import List
from io import StringIO
@kinow
kinow / profiling-master.md
Last active May 31, 2025 07:17
Testing branches with deltas, and UI with deltas and cylc-tree js object

Used the same technique that I tried on spawn-on-demand (here).

I changed main.py in Cylc UI Server to include near the top

import tracemalloc
tracemalloc.start()