All Projects β†’ RasaHQ β†’ rasa-train-test-gha

RasaHQ / rasa-train-test-gha

Licence: Apache-2.0 license
A GitHub action to run easily rasa train and rasa test in the CIs.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to rasa-train-test-gha

drevops
πŸ’§ + 🐳 + βœ“βœ“βœ“ + πŸ€– + ❀️ Build, Test, Deploy scripts for Drupal using Docker and CI/CD
Stars: ✭ 55 (+111.54%)
Mutual labels:  continuous-integration, ci, test
xray-action
... a GitHub action to import test results into "Xray" - A complete Test Management tool for Jira.
Stars: ✭ 16 (-38.46%)
Mutual labels:  continuous-integration, ci, test
landkid
Your friendly neighborhood async merging robot goat.
Stars: ✭ 80 (+207.69%)
Mutual labels:  continuous-integration, ci
CI-Report-Converter
The tool converts different error reporting standards for deep compatibility with popular CI systems (TeamCity, IntelliJ IDEA, GitHub Actions, etc).
Stars: ✭ 17 (-34.62%)
Mutual labels:  ci, test
swarmci
Swarm CI - Docker Swarm-based CI system or enhancement to existing systems.
Stars: ✭ 48 (+84.62%)
Mutual labels:  continuous-integration, ci
jenkinsapi
A Python API for accessing resources and configuring Hudson & Jenkins continuous-integration servers
Stars: ✭ 790 (+2938.46%)
Mutual labels:  continuous-integration, ci
phpci-installer
PHPCI Easy Installer for Laravel Homestead
Stars: ✭ 19 (-26.92%)
Mutual labels:  continuous-integration, ci
python-test-reporter
DEPRECATED Uploads Python test coverage data to Code Climate
Stars: ✭ 18 (-30.77%)
Mutual labels:  continuous-integration, ci
flagsmith-java-client
Java Client for Flagsmith. Ship features with confidence using feature flags and remote config. Host yourself or use our hosted version at https://www.flagsmith.com/
Stars: ✭ 16 (-38.46%)
Mutual labels:  continuous-integration, ci
npm-audit-ci
www.npmjs.com/package/npm-audit-ci
Stars: ✭ 18 (-30.77%)
Mutual labels:  continuous-integration, ci
www.go.cd
Github pages repo
Stars: ✭ 39 (+50%)
Mutual labels:  continuous-integration, ci
github-create-release-action
Create a GitHub release from a Tag
Stars: ✭ 33 (+26.92%)
Mutual labels:  continuous-integration, ci
makefiles
No description or website provided.
Stars: ✭ 23 (-11.54%)
Mutual labels:  continuous-integration, ci
developer-ci-benefits
Talk docsβ€”includes CI (Continuous Integration) benefits, description, and setup tips πŸ’‘πŸ’ͺ
Stars: ✭ 29 (+11.54%)
Mutual labels:  continuous-integration, ci
build-plugin-template
Template repository to create new Netlify Build plugins.
Stars: ✭ 26 (+0%)
Mutual labels:  continuous-integration, ci
flow-platform-x
Continuous Integration Platform
Stars: ✭ 21 (-19.23%)
Mutual labels:  continuous-integration, ci
kahoy
Simple Kubernetes raw manifests deployment tool
Stars: ✭ 33 (+26.92%)
Mutual labels:  continuous-integration, ci
gitavscan
Git Anti-Virus Scan Action - Detect trojans, viruses, malware & other malicious threats.
Stars: ✭ 23 (-11.54%)
Mutual labels:  continuous-integration, ci
prettier
πŸ”¨ Native, blazingly-fast Prettier CLI on Github Actions
Stars: ✭ 19 (-26.92%)
Mutual labels:  continuous-integration, ci
action-junit-report
Reports junit test results as GitHub Pull Request Check
Stars: ✭ 103 (+296.15%)
Mutual labels:  ci, test

Rasa Train-Test Model GitHub Action

The GitHub action to run easily rasa train and rasa test in the CIs.

Input Arguments

In order to pass the input parameters to the GH action, you have to use the with argument in a step that uses the GH action, e.g.:

jobs:
  my_first_job:
    name: My first job
    runs-on: ubuntu-latest
    steps:
      # Checks-out GitHub repository
      # more: https://github.com/actions/checkout
      - uses: actions/checkout@v2

      # Run rasa train and rasa test
      - name: My first step
        uses: RasaHQ/rasa-train-test-gha@main
        with:
          test_type: nlu
Input Description Default
rasa_version The Rasa Open Source version used to run test and train latest-full
rasa_image Custom Rasa Docker image. Useful if you use Rasa with custom Python modules. none
rasa_train Run rasa train true
rasa_test Run rasa test true
data_validate Validates domain and data files to check for possible mistakes true
data_validate_args Additional arguments passed to the rasa data validate command none
fine_tune Fine-tune an existing model with new training dataset false
workspace The root directory containing your Rasa Open Source project ${{ github.workspace }}
train_type The types of training (available types: core/nlu/all) all
train_args Additional arguments passed to the rasa train command none
test_type The types of tests to run (available types: core/nlu/all) all
test_nlu_args Additional arguments passed to the rasa test nlu command none
test_core_args Additional arguments passed to the rasa test core command none
publish_summary Publish tests summary as a PR comment true
github_token GitHub Token - required to add a comment with summary none
configuration Model configuration file config.yml
model Path to a file with a model. Use existing model instead of training a new one none
cross_validation Switch on cross validation mode. Any provided model will be ignored false
configuration_name Configuration name used in summary. If not provided a file name is used none
data_name Data name used in summary. If not provided a directory name is used default
compare_report Path to a report that will be used to compare results none
result_directory Directory name where results are stored in results
report_directory Directory name where reports are stored in reports
gomplate_image Custom gomplate image. Useful if you use custom gomplate image hairyhenderson/gomplate
tmpfs_directory The directory location where tmpfs mounts /.config

Outputs

The list of available output variables:

Output Description
report Return report as JSON

Report

The GH action generates two reports, a report with a summary of run tests, the report is available as JSON and CSV file. The example of a report generated by the GH action can be found here.

Example Usage

In the example below, we are using the Rasa Demo data.

jobs:
    train_and_test:
        # ...
        steps:
            # ...
            - name: Train and Test Rasa Demo
              uses: RasaHQ/rasa-train-test-gha@main
              with:
                # List of available tags: https://hub.docker.com/r/rasa/rasa/tags
                rasa_version: '2.0.0-full'
                # In order to add a PR comment with summary
                # a GH Token has to be pass to the GH action
                github_token: ${{ secrets.GITHUB_TOKEN }}
            # ...

The GitHub action by default adds a PR comment with summary (the summary comment can be disabled by setting the publish_summary input argument to false):

Summary

Use JSON report in GH workflow

The GH action returns a JSON report as an output. The following example shows how to use the output in a GH workflow.

jobs:
    train_and_test:
        # ...
        steps:
            # ...
            - name: Train and Test Rasa Demo
              id: action
              uses: RasaHQ/rasa-train-test-gha@main
              with:
                # List of available tags: https://hub.docker.com/r/rasa/rasa/tags
                rasa_version: '2.0.0-full'
                # In order to add a PR comment with summary
                # a GH Token has to be pass to the GH action
                github_token: ${{ secrets.GITHUB_TOKEN }}

            # We have to convert the output to JSON by using fromJSON built-in function
            # more: https://docs.github.com/en/free-pro-team@latest/actions/reference/context-and-expression-syntax-for-github-actions#fromjson
            # syntax: fromJSON(steps.action.outputs.report).<data_name>[<configuration_name|configuration>]
            # example: fromJSON(steps.action.outputs.report).default['config.yml']
            - name: Check output
              if: fromJSON(steps.action.outputs.report).default['config.yml'].intent_classification.accuracy >= 0.8
              run: |
                echo "I'm doing extra work..."
                echo ${{ fromJSON(steps.action.outputs.report).default['config.yml'].intent_classification.accuracy }}

Advanced examples

Compare results with the base report

It possible to compare results to the other report, the feature is useful for example to see that a model is better than before changes. The difference against the report that we compare to is included in brackets.

jobs:
    train_and_test:
        # ...
        steps:
            # ...
            - name: Train and Test Rasa Demo
              uses: RasaHQ/rasa-train-test-gha@main
              with:
                # List of available tags: https://hub.docker.com/r/rasa/rasa/tags
                rasa_version: '2.0.0-full'
                # In order to add a PR comment with summary
                # a GH Token has to be pass to the GH action
                github_token: ${{ secrets.GITHUB_TOKEN }}
                # A path to the report that we want to compare to
                compare_report: 'report_to_compare.json'
                test_type: 'nlu'
            # ...

Compare

Use the existing model

It's possible to use the existing model instead of training a new one.

jobs:
    test:
        # ...
        steps:
            # ...
            - name: Download Rasa X model
              run: |
                wget https://github.com/RasaHQ/rasa-x-demo/blob/0.33.0/models/model.tar.gz?raw=true \
                  -O test_model.tar.gz

            - name: Train and Test Rasa Demo
              uses: RasaHQ/rasa-train-test-gha@main
              with:
                # List of available tags: https://hub.docker.com/r/rasa/rasa/tags
                rasa_version: '2.0.0-full'
                # In order to add a PR comment with summary
                # a GH Token has to be pass to the GH action
                github_token: ${{ secrets.GITHUB_TOKEN }}
                # If a file with the model is provided, training is disabled automatically
                model: test_model.tar.gz
            # ...

Fine-tune the existing model

You can fine-tune an existing model with new training dataset. Please see incremental training for more details.

jobs:
    train_and_test:
        # ...
        steps:
            # ...
            - name: Train and Test Rasa Demo
              uses: RasaHQ/rasa-train-test-gha@main
              with:
                # List of available tags: https://hub.docker.com/r/rasa/rasa/tags
                rasa_version: '2.0.0-full'
                # In order to add a PR comment with summary
                # a GH Token has to be pass to the GH action
                github_token: ${{ secrets.GITHUB_TOKEN }}
                # By default, the number of epoches is defined in model configuration
                # You can shorten the epoches by using the --epoch-fraction flag
                fine_tune: 'true'
                train_args: >-
                  --epoch-fraction 0.5
                # ...

Cross-validate NLU model

jobs:
    train_and_test:
        # ...
        steps:
            # ...
            - name: Train and Test Rasa Demo
              uses: RasaHQ/rasa-train-test-gha@main
              with:
                # List of available tags: https://hub.docker.com/r/rasa/rasa/tags
                rasa_version: '2.0.0-full'
                # In order to add a PR comment with summary
                # a GH Token has to be pass to the GH action
                github_token: ${{ secrets.GITHUB_TOKEN }}
                # Switch on cross validation mode. Any provided model will be ignored
                cross_validation: 'true'
                # Number of cross validation folds (cross validation only)
                # All available arguments: rasa test nlu --help
                test_nlu_args: '--folds 3'
                test_type: 'nlu'
            # ...

In a case where the cross-validation mode is enabled, a summary published as a PR comment includes Intent Cross-Validation Results and Entity Cross-Validation Results, e.g.

Intent Cross-Validation Results

Entity Cross-Validation Results

Upload results and reports as artifacts

jobs:
    train_and_test:
        # ...
        steps:
            # ...
            - name: Train and Test Rasa Demo
              id: action
              uses: RasaHQ/rasa-train-test-gha@main
              with:
                # List of available tags: https://hub.docker.com/r/rasa/rasa/tags
                rasa_version: '2.0.0-full'
                # In order to add a PR comment with summary
                # a GH Token has to be pass to the GH action
                github_token: ${{ secrets.GITHUB_TOKEN }}

            # The 'actions/upload-artifact' action to upload files
            # More: https://github.com/actions/upload-artifact
            - uses: actions/upload-artifact@v2
              with:
                name: rasa-demo-cfg
                path: |
                  results
                  reports
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].