Skip to content

Instantly share code, notes, and snippets.

@minhoryang minhoryang/outputfile.py
Last active Aug 1, 2019

Embed
What would you like to do?
"$ selinon inspect" with demo-worker
#!/usr/bin/env python3
# auto-generated using Selinon v1.1.0 on YUNITTO.local at 2019-08-01 08:32:04.649657
from demo_worker.foreach import iter_travis_builds as _foreach__travis_repo_builds_1
from demo_worker.foreach import iter_travis_builds_count as _foreach_travis_repo_logs_1
from demo_worker.foreach import iter_travis_repos as _foreach_travis_org_logs_1
from demo_worker.tasks import HelloTask as HelloTask
from demo_worker.tasks import TravisActiveRepos as TravisActiveRepos
from demo_worker.tasks import TravisRepoBuilds as TravisRepoBuilds
from demo_worker.tasks import TravisLogTxt as TravisLogTxt
from demo_worker.tasks import TravisRepoBuildsCount as TravisRepoBuildsCount
from demo_worker.tasks import TravisLogCleanup as TravisLogCleanup
from selinon.storages.memory import InMemoryStorage
from selinon.storages.redis import Redis
from demo_worker.storages import TravisLogsStorage
from selinon.caches import LRU
from selinon.routines import always_run as _selinon_routines_always_run
import functools
import datetime
from selinon.strategies import constant as _raw_strategy_func_hello
_strategy_func_hello = functools.partial(_raw_strategy_func_hello, retry=2)
from selinon.strategies import constant as _raw_strategy_func__travis_repo_builds
_strategy_func__travis_repo_builds = functools.partial(_raw_strategy_func__travis_repo_builds, retry=2)
from selinon.strategies import constant as _raw_strategy_func_travis_repo_logs
_strategy_func_travis_repo_logs = functools.partial(_raw_strategy_func_travis_repo_logs, retry=2)
from selinon.strategies import constant as _raw_strategy_func_travis_org_logs
_strategy_func_travis_org_logs = functools.partial(_raw_strategy_func_travis_org_logs, retry=2)
from selinon.strategies import constant as _raw_strategy_func_travis_build_logs
_strategy_func_travis_build_logs = functools.partial(_raw_strategy_func_travis_build_logs, retry=2)
strategies = {
'hello': _strategy_func_hello,
'_travis_repo_builds': _strategy_func__travis_repo_builds,
'travis_repo_logs': _strategy_func_travis_repo_logs,
'travis_org_logs': _strategy_func_travis_org_logs,
'travis_build_logs': _strategy_func_travis_build_logs
}
task_classes = {
'HelloTask': HelloTask,
'TravisActiveRepos': TravisActiveRepos,
'TravisRepoBuilds': TravisRepoBuilds,
'TravisLogTxt': TravisLogTxt,
'TravisRepoBuildsCount': TravisRepoBuildsCount,
'TravisLogCleanup': TravisLogCleanup
}
storage_task_name = {
'HelloTask': 'HelloTask',
'TravisActiveRepos': 'TravisActiveRepos',
'TravisRepoBuilds': 'TravisRepoBuilds',
'TravisLogTxt': 'TravisLogTxt',
'TravisRepoBuildsCount': 'TravisRepoBuildsCount',
'TravisLogCleanup': 'TravisLogCleanup'
}
task_queues = {
'HelloTask': 'hello_task',
'TravisActiveRepos': 'travis_active_repos_task',
'TravisRepoBuilds': 'travis_repo_builds_task',
'TravisLogTxt': 'travis_log_txt_task',
'TravisRepoBuildsCount': 'travis_repo_builds_count_task',
'TravisLogCleanup': 'travis_log_cleanup'
}
dispatcher_queues = {
'hello': 'hello_flow',
'_travis_repo_builds': 'travis_repo_builds',
'travis_repo_logs': 'travis_repo_logs',
'travis_org_logs': 'travis_org_logs',
'travis_build_logs': 'travis_build_logs'
}
task2storage_mapping = {
'HelloTask': None,
'TravisActiveRepos': 'Redis',
'TravisRepoBuilds': 'Redis',
'TravisLogTxt': 'Redis',
'TravisRepoBuildsCount': 'Redis',
'TravisLogCleanup': 'TravisLogsStorage'
}
_storage_Memory = InMemoryStorage(echo=False)
_storage_Redis = Redis(host='redis', port=6379, db=1, charset='utf-8')
_storage_TravisLogsStorage = TravisLogsStorage(bucket='travis', aws_access_key_id='PCOMYKL7WQ8ZCESM0TH9', aws_secret_access_key='aHDakH5CK/5LPM2kDnQX6BAlp9CyIOI9V3E+aU+S', region_name='us-east-1', location='us-east-1', endpoint_url='http://minio:80')
storage2instance_mapping = {
'Memory': _storage_Memory,
'Redis': _storage_Redis,
'TravisLogsStorage': _storage_TravisLogsStorage
}
_cache_Memory_LRU = LRU(max_cache_size=0)
_cache_Redis_LRU = LRU(max_cache_size=0)
_cache_TravisLogsStorage_LRU = LRU(max_cache_size=0)
storage2storage_cache = {
'Memory': _cache_Memory_LRU,
'Redis': _cache_Redis_LRU,
'TravisLogsStorage': _cache_TravisLogsStorage_LRU
}
_cache_hello_LRU = LRU(max_cache_size=0)
_cache__travis_repo_builds_LRU = LRU(max_cache_size=0)
_cache_travis_repo_logs_LRU = LRU(max_cache_size=0)
_cache_travis_org_logs_LRU = LRU(max_cache_size=0)
_cache_travis_build_logs_LRU = LRU(max_cache_size=0)
async_result_cache = {
'hello': _cache_hello_LRU,
'_travis_repo_builds': _cache__travis_repo_builds_LRU,
'travis_repo_logs': _cache_travis_repo_logs_LRU,
'travis_org_logs': _cache_travis_org_logs_LRU,
'travis_build_logs': _cache_travis_build_logs_LRU
}
output_schemas = {
}
node_args_from_first = {
'hello': False,
'_travis_repo_builds': False,
'travis_repo_logs': False,
'travis_org_logs': False,
'travis_build_logs': False
}
propagate_node_args = {
'hello': False,
'_travis_repo_builds': False,
'travis_repo_logs': False,
'travis_org_logs': False,
'travis_build_logs': False
}
propagate_parent = {
'hello': False,
'_travis_repo_builds': False,
'travis_repo_logs': False,
'travis_org_logs': False,
'travis_build_logs': False
}
propagate_parent_failures = {
'hello': False,
'_travis_repo_builds': False,
'travis_repo_logs': False,
'travis_org_logs': False,
'travis_build_logs': False
}
propagate_finished = {
'hello': False,
'_travis_repo_builds': False,
'travis_repo_logs': False,
'travis_org_logs': False,
'travis_build_logs': False
}
propagate_compound_finished = {
'hello': False,
'_travis_repo_builds': False,
'travis_repo_logs': False,
'travis_org_logs': False,
'travis_build_logs': False
}
propagate_failures = {
'hello': False,
'_travis_repo_builds': False,
'travis_repo_logs': False,
'travis_org_logs': False,
'travis_build_logs': False
}
propagate_compound_failures = {
'hello': False,
'_travis_repo_builds': False,
'travis_repo_logs': False,
'travis_org_logs': False,
'travis_build_logs': False
}
throttle_tasks = {
'HelloTask': None,
'TravisActiveRepos': None,
'TravisRepoBuilds': None,
'TravisLogTxt': None,
'TravisRepoBuildsCount': None,
'TravisLogCleanup': None
}
throttle_flows = {
'hello': None,
'_travis_repo_builds': None,
'travis_repo_logs': None,
'travis_org_logs': None,
'travis_build_logs': None
}
max_retry = {
'HelloTask': 0,
'TravisActiveRepos': 0,
'TravisRepoBuilds': 0,
'TravisLogTxt': 0,
'TravisRepoBuildsCount': 0,
'TravisLogCleanup': 0,
'hello': 0,
'_travis_repo_builds': 0,
'travis_repo_logs': 0,
'travis_org_logs': 0,
'travis_build_logs': 0
}
retry_countdown = {
'HelloTask': 0,
'TravisActiveRepos': 0,
'TravisRepoBuilds': 0,
'TravisLogTxt': 0,
'TravisRepoBuildsCount': 0,
'TravisLogCleanup': 0,
'hello': 0,
'_travis_repo_builds': 0,
'travis_repo_logs': 0,
'travis_org_logs': 0,
'travis_build_logs': 0
}
storage_readonly = {
'HelloTask': False,
'TravisActiveRepos': False,
'TravisRepoBuilds': False,
'TravisLogTxt': False,
'TravisRepoBuildsCount': False,
'TravisLogCleanup': False
}
selective_run_task = {
'HelloTask': _selinon_routines_always_run,
'TravisActiveRepos': _selinon_routines_always_run,
'TravisRepoBuilds': _selinon_routines_always_run,
'TravisLogTxt': _selinon_routines_always_run,
'TravisRepoBuildsCount': _selinon_routines_always_run,
'TravisLogCleanup': _selinon_routines_always_run
}
nowait_nodes = {
'hello': [],
'_travis_repo_builds': ['travis_build_logs'],
'travis_repo_logs': ['_travis_repo_builds'],
'travis_org_logs': ['travis_repo_logs'],
'travis_build_logs': []
}
eager_failures = {
'hello': [],
'_travis_repo_builds': [],
'travis_repo_logs': [],
'travis_org_logs': [],
'travis_build_logs': []
}
def init(config_cls):
config_cls.trace_by_json()
config_cls.initialized = True
return
def _condition_hello_0_cond(db, node_args):
return True
def _condition__travis_repo_builds_0_cond(db, node_args):
return True
def _condition__travis_repo_builds_1_cond(db, node_args):
return True
def _condition_travis_repo_logs_0_cond(db, node_args):
return True
def _condition_travis_repo_logs_1_cond(db, node_args):
return True
def _condition_travis_org_logs_0_cond(db, node_args):
return True
def _condition_travis_org_logs_1_cond(db, node_args):
return True
def _condition_travis_build_logs_0_cond(db, node_args):
return True
def _condition_travis_build_logs_1_cond(db, node_args):
return True
failures = {
}
selective_run_task = {
'HelloTask': _selinon_routines_always_run,
'TravisActiveRepos': _selinon_routines_always_run,
'TravisRepoBuilds': _selinon_routines_always_run,
'TravisLogTxt': _selinon_routines_always_run,
'TravisRepoBuildsCount': _selinon_routines_always_run,
'TravisLogCleanup': _selinon_routines_always_run
}
nowait_nodes = {
'hello': [],
'_travis_repo_builds': ['travis_build_logs'],
'travis_repo_logs': ['_travis_repo_builds'],
'travis_org_logs': ['travis_repo_logs'],
'travis_build_logs': []
}
migration_dir = 'demo_worker/migration_dir'
def init(config_cls):
config_cls.trace_by_json()
config_cls.initialized = True
return
def _condition_hello_0_cond(db, node_args):
return True
def _condition__travis_repo_builds_0_cond(db, node_args):
return True
def _condition__travis_repo_builds_1_cond(db, node_args):
return True
def _condition_travis_repo_logs_0_cond(db, node_args):
return True
def _condition_travis_repo_logs_1_cond(db, node_args):
return True
def _condition_travis_org_logs_0_cond(db, node_args):
return True
def _condition_travis_org_logs_1_cond(db, node_args):
return True
def _condition_travis_build_logs_0_cond(db, node_args):
return True
def _condition_travis_build_logs_1_cond(db, node_args):
return True
edge_table = {
'hello': [{'from': [], 'to': ['HelloTask'], 'condition': _condition_hello_0_cond, 'condition_str': 'True'}],
'_travis_repo_builds': [{'from': [], 'to': ['TravisRepoBuilds'], 'condition': _condition__travis_repo_builds_0_cond, 'condition_str': 'True'},
{'from': ['TravisRepoBuilds'], 'to': ['travis_build_logs'], 'condition': _condition__travis_repo_builds_1_cond, 'condition_str': 'True', 'foreach': _foreach__travis_repo_builds_1, 'foreach_str': 'foreach demo_worker.foreach.iter_travis_builds', 'foreach_propagate_result': True}],
'travis_repo_logs': [{'from': [], 'to': ['TravisRepoBuildsCount'], 'condition': _condition_travis_repo_logs_0_cond, 'condition_str': 'True'},
{'from': ['TravisRepoBuildsCount'], 'to': ['_travis_repo_builds'], 'condition': _condition_travis_repo_logs_1_cond, 'condition_str': 'True', 'foreach': _foreach_travis_repo_logs_1, 'foreach_str': 'foreach demo_worker.foreach.iter_travis_builds_count', 'foreach_propagate_result': True}],
'travis_org_logs': [{'from': [], 'to': ['TravisActiveRepos'], 'condition': _condition_travis_org_logs_0_cond, 'condition_str': 'True'},
{'from': ['TravisActiveRepos'], 'to': ['travis_repo_logs'], 'condition': _condition_travis_org_logs_1_cond, 'condition_str': 'True', 'foreach': _foreach_travis_org_logs_1, 'foreach_str': 'foreach demo_worker.foreach.iter_travis_repos', 'foreach_propagate_result': True}],
'travis_build_logs': [{'from': [], 'to': ['TravisLogTxt'], 'condition': _condition_travis_build_logs_0_cond, 'condition_str': 'True'},
{'from': ['TravisLogTxt'], 'to': ['TravisLogCleanup'], 'condition': _condition_travis_build_logs_1_cond, 'condition_str': 'True'}]
}
git clone --depth=1 -b 052a4924219be006c626479156e35803ca5545af https://github.com/selinon/demo-worker
cd demo-worker/demo_worker/config/
selinon-cli inspect --nodes-definition nodes.yaml --flow-definitions flows --dump outputfile.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.