<commit_before>version: "2.0" # mistral version
name: arteria-packs.ngi_uu_workflow
description: The ngi workflow, from sequencer to remote system...

workflows:
    main:
        type: direct
        input:
            - host
            - runfolder
            - ignore_sisyphus_qc_result
            - bcl2fastq_version
            - barcode_mismatches
            - tiles
            - use_base_mask
            - bcl2fastq_additional_arguments
        output:
            output_the_whole_workflow_context: <% $ %>
        task-defaults:
            on-error:
                - oh_shit_error
                - mark_as_failed

        tasks:
            ### GENERAL TASKS START ###
            note_workflow_repo_version:
              action: core.local
              input:
                cmd: git rev-parse HEAD
                cwd: /opt/stackstorm/packs/arteria-packs/
              on-success:
                - get_config

            get_config:
              action: arteria-packs.get_pack_config
              publish:
                hermes_base_url: <% task(get_config).result.result.hermes_base_url %>
                hermes_user: <% task(get_config).result.result.hermes_user %>
                hermes_token: <% task(get_config).result.result.hermes_token %>
                remote_host: <% task(get_config).result.result.remote_host %>
                remote_user: <% task(get_config).result.result.remote_user%>
                remote_destination: <% task(get_config).result.result.remote_destination %>
                summary_host: <% task(get_config).result.result.summary_host %>
                summary_user: <% task(get_config).result.result.summary_user %>
                summary_destination: <% task(get_config).result.result.summary_destination %>
                siswrap_service_port: <% task(get_config).result.result.siswrap_service_port %>
                bcl2fastq_service_port: <% task(get_config).result.result.bcl2fastq_service_port %>
                runfolder_service_port: <% task(get_config).result.result.runfolder_service_port %>
                send_mail_to: <% task(get_config).result.result.send_mail_to %>
                remote_sisyphus_location: <% task(get_config).result.result.remote_sisyphus_location %>
                nestor_remote_path: <% task(get_config).result.result.nestor_remote_path %>
                irma_remote_path: <% task(get_config).result.result.irma_remote_path %>
                irma_api_key: <% task(get_config).result.result.irma_api_key %>
                irma_checksum_base_url: <% task(get_config).result.result.irma_checksum_base_url %>
                irma_siswrap_base_url: <% task(get_config).result.result.irma_siswrap_base_url %>
                ngi_pipeline_url: <% task(get_config).result.result.ngi_pipeline_url %>
                irma_replace_expressions: <% task(get_config).result.result.irma_replace_expressions %>
              on-success:
                 - mark_as_started

            mark_as_started:
              action: core.http
              input:               
                url: http://<% $.host %>:<% $.runfolder_service_port %>/api/1.0/runfolders/path<% $.runfolder %>
                body: '{"state": "started"}'
                method: "POST"
              on-success:
                - get_runfolder_name

            get_runfolder_name:
              action: core.local
              input:
                cmd: python -c 'import sys; sys.stdout.write("<% $.runfolder %>".split("/")[-1])'
              publish:
                runfolder_name: "<% task(get_runfolder_name).result.stdout %>"
              on-success:
                - get_flowcell_name

            get_flowcell_name:
                action: arteria-packs.get_flowcell_from_runfolder_name
                input:<commit_msg>Remove nestor config value pickup<commit_after>version: "2.0" # mistral version
name: arteria-packs.ngi_uu_workflow
description: The ngi workflow, from sequencer to remote system...

workflows:
    main:
        type: direct
        input:
            - host
            - runfolder
            - ignore_sisyphus_qc_result
            - bcl2fastq_version
            - barcode_mismatches
            - tiles
            - use_base_mask
            - bcl2fastq_additional_arguments
        output:
            output_the_whole_workflow_context: <% $ %>
        task-defaults:
            on-error:
                - oh_shit_error
                - mark_as_failed

        tasks:
            ### GENERAL TASKS START ###
            note_workflow_repo_version:
              action: core.local
              input:
                cmd: git rev-parse HEAD
                cwd: /opt/stackstorm/packs/arteria-packs/
              on-success:
                - get_config

            get_config:
              action: arteria-packs.get_pack_config
              publish:
                hermes_base_url: <% task(get_config).result.result.hermes_base_url %>
                hermes_user: <% task(get_config).result.result.hermes_user %>
                hermes_token: <% task(get_config).result.result.hermes_token %>
                remote_host: <% task(get_config).result.result.remote_host %>
                remote_user: <% task(get_config).result.result.remote_user%>
                remote_destination: <% task(get_config).result.result.remote_destination %>
                summary_host: <% task(get_config).result.result.summary_host %>
                summary_user: <% task(get_config).result.result.summary_user %>
                summary_destination: <% task(get_config).result.result.summary_destination %>
                siswrap_service_port: <% task(get_config).result.result.siswrap_service_port %>
                bcl2fastq_service_port: <% task(get_config).result.result.bcl2fastq_service_port %>
                runfolder_service_port: <% task(get_config).result.result.runfolder_service_port %>
                send_mail_to: <% task(get_config).result.result.send_mail_to %>
                remote_sisyphus_location: <% task(get_config).result.result.remote_sisyphus_location %>
                irma_remote_path: <% task(get_config).result.result.irma_remote_path %>
                irma_api_key: <% task(get_config).result.result.irma_api_key %>
                irma_checksum_base_url: <% task(get_config).result.result.irma_checksum_base_url %>
                irma_siswrap_base_url: <% task(get_config).result.result.irma_siswrap_base_url %>
                ngi_pipeline_url: <% task(get_config).result.result.ngi_pipeline_url %>
                irma_replace_expressions: <% task(get_config).result.result.irma_replace_expressions %>
              on-success:
                 - mark_as_started

            mark_as_started:
              action: core.http
              input:               
                url: http://<% $.host %>:<% $.runfolder_service_port %>/api/1.0/runfolders/path<% $.runfolder %>
                body: '{"state": "started"}'
                method: "POST"
              on-success:
                - get_runfolder_name

            get_runfolder_name:
              action: core.local
              input:
                cmd: python -c 'import sys; sys.stdout.write("<% $.runfolder %>".split("/")[-1])'
              publish:
                runfolder_name: "<% task(get_runfolder_name).result.stdout %>"
              on-success:
                - get_flowcell_name

            get_flowcell_name:
                action: arteria-packs.get_flowcell_from_runfolder_name
                input:
{'fraction_non_alphanumeric': 0.09949588750331653, 'fraction_numerical': 0.0023879013000795966, 'mean_word_length': 1.8363431151241536, 'pattern_counts': {'":': 2, '<': 56, '<?xml version=': 0, '>': 56, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7134750', 'n_tokens_mistral': 2306, 'n_tokens_neox': 2149, 'n_words': 273}