Skip to content

Instantly share code, notes, and snippets.

View kinow's full-sized avatar
💭
😬

Bruno P. Kinoshita kinow

💭
😬
View GitHub Profile
@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 ([email protected]) 50.51ms
[I 2020-07-10T14:20:29.423 JupyterHub log:174] 200 GET /hub/api/authorizations/token/[secret] ([email protected]) 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|[email protected]"
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 7, 2020 09:57
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()
@kinow
kinow / RemoveMetadata.java
Created April 13, 2020 02:54
Removing metadata from JPEG with Commons Imaging
package org.apache.commons.imaging.formats.jpeg.xmp;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;