コード例 #1
0
ファイル: pyflyte.py プロジェクト: pingsutw/flytekit
def update_configuration_file(config_file_path):
    """
    Changes the configuration singleton object to read from another file if specified, which should be
    at the base of the repository.

    :param Text config_file_path:
    """
    configuration_file = Path(config_file_path or CONFIGURATION_PATH.get())
    if configuration_file.is_file():
        click.secho('Using configuration file at {}'.format(configuration_file.absolute().as_posix()),
                    fg='green')
        set_flyte_config_file(configuration_file.as_posix())
    else:
        click.secho("Configuration file '{}' could not be loaded. Using values from environment.".format(CONFIGURATION_PATH.get()),
                    color='yellow')
        set_flyte_config_file(None)
    click.secho('Flyte Admin URL {}'.format(_URL.get()), fg='green')
コード例 #2
0
PROJECT = 'flytetester'
DOMAIN = 'development'

# These are the names of the launch plans (workflows) kicked off in the run.sh script
# This is what we'll be looking for in Admin.
EXPECTED_EXECUTIONS = [
    'app.workflows.failing_workflows.DivideByZeroWf',
    'app.workflows.work.WorkflowWithIO',
    'app.workflows.failing_workflows.RetrysWf',
    'app.workflows.failing_workflows.FailingDynamicNodeWF',
    'app.workflows.failing_workflows.RunToCompletionWF',
]

# This tells Python where admin is, and also to hit Minio instead of the real S3
update_configuration_file('end2end/end2end.config')
client = SynchronousFlyteClient(URL.get(), insecure=INSECURE.get())


# For every workflow that we test on in run.sh, have a function that can validate the execution response
# It will be supplied an execution object, a node execution list, and a task execution list
# Should return
#  - True, if the execution has completed and everything checks out
#  - False, if things have failed for whatever reason, either the execution failed, or the outputs are wrong, whatever
#  - None, if things aren't complete yet
def workflow_with_io_validator(execution, node_execution_list,
                               task_execution_list):
    """
    Validation logic for app.workflows.work.WorkflowWithIO
    :param flytekit.models.execution.Execution execution:
    :param list[flytekit.models.node_execution.NodeExecution] node_execution_list:
    :param list[flytekit.models.admin.task_execution.TaskExecution] task_execution_list:
コード例 #3
0
ファイル: credentials.py プロジェクト: fediazgon/flytekit
def get_authorization_endpoints(flyte_client_url):
    discovery_endpoint = _get_discovery_endpoint(
        _HTTP_URL.get(), flyte_client_url or _URL.get(), _INSECURE.get())
    discovery_client = _DiscoveryClient(discovery_url=discovery_endpoint)
    return discovery_client.get_authorization_endpoints()