Skip to content

Commit

Permalink
Merge branch 'master' into git_ignore_fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Archish27 authored Aug 24, 2020
2 parents 5264470 + d91c124 commit bd48623
Show file tree
Hide file tree
Showing 910 changed files with 95,693 additions and 60,936 deletions.
12 changes: 12 additions & 0 deletions .deepsource.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version = 1

test_patterns = ["tests/**"]

exclude_patterns = ["docs/**"]

[[analyzers]]
name = "python"
enabled = true

[analyzers.meta]
runtime_version = "3.x.x"
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ docs
.git*
**/*.pyc
**/__pycache__

!docker/configs
18 changes: 0 additions & 18 deletions .github/ISSUE_TEMPLATE/ask_question.md

This file was deleted.

4 changes: 3 additions & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
labels: 'area:rasa-oss :ferris_wheel:,type:bug :bug:'
assignees: ''

---
Expand All @@ -13,6 +13,8 @@ If you are asking a usage question (e.g. "How do I do xyz") please post your que

**Rasa version**:

**Rasa SDK version** (if used & relevant):

**Rasa X version** (if used & relevant):

**Python version**:
Expand Down
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Ask a question
url: https://forum.rasa.com/
about: If you have a "How do I?" question please ask in the forum https://forum.rasa.com
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Feature request
about: Suggest an idea on how to improve Rasa
title: ''
labels: enhancement
labels: 'area:rasa-oss :ferris_wheel:,type:enhancement :sparkles:'
assignees: ''

---
Expand Down
5 changes: 2 additions & 3 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
- ...

**Status (please check what you already did)**:
- [ ] made PR ready for code review
- [ ] added some tests for the functionality
- [ ] updated the documentation
- [ ] updated the changelog
- [ ] reformat files using `black` (please check [Readme](https://github.com/RasaHQ/rasa_nlu#code-style) for instructions)
- [ ] updated the changelog (please check [changelog](https://github.com/RasaHQ/rasa/tree/master/changelog) for instructions)
- [ ] reformat files using `black` (please check [Readme](https://github.com/RasaHQ/rasa#code-style) for instructions)
32 changes: 32 additions & 0 deletions .github/configs/mr-test-example.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
## Example configuration
#################### syntax #################
## include:
## - dataset: ["<dataset_name>"]
## config: ["<configuration_name>"]
#
## Example:
## include:
## - dataset: ["Carbon Bot"]
## config: ["Sparse + DIET(bow) + ResponseSelector(bow)"]
#
## Shortcut:
## You can use the "all" shortcut to include all available configurations or datasets
#
## Example: Use the "Sparse + EmbeddingIntent + ResponseSelector(bow)" configuration
## for all available datasets
## include:
## - dataset: ["all"]
## config: ["Sparse + DIET(bow) + ResponseSelector(bow)"]
#
## Example: Use all available configurations for the "Carbon Bot" and "Sara" datasets
## and for the "Hermit" dataset use the "Sparse + DIET + ResponseSelector(T2T)" and
## "Sparse + ConveRT + DIET + ResponseSelector(T2T)" configurations:
## include:
## - dataset: ["Carbon Bot", "Sara"]
## config: ["all"]
## - dataset: ["Hermit"]
## config: ["Sparse + DIET(seq) + ResponseSelector(t2t)", "Sparse + ConveRT + DIET(seq) + ResponseSelector(t2t)"]

include:
- dataset: ["Carbon Bot"]
config: ["Sparse + DIET(bow) + ResponseSelector(bow)"]
63 changes: 63 additions & 0 deletions .github/configs/mr-test-schedule.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
##########
## Available datasets
##########
# - "Carbon Bot"
# - "Hermit"
# - "Private 1"
# - "Private 2"
# - "Private 3"
# - "Sara"

##########
## Available configurations
##########
# - "BERT + DIET(bow) + ResponseSelector(bow)"
# - "BERT + DIET(seq) + ResponseSelector(t2t)"
# - "ConveRT + DIET(bow) + ResponseSelector(bow)"
# - "ConveRT + DIET(seq) + ResponseSelector(t2t)"
# - "Spacy + DIET(bow) + ResponseSelector(bow)"
# - "Spacy + DIET(seq) + ResponseSelector(t2t)"
# - "Sparse + ConveRT + DIET(bow) + ResponseSelector(bow)"
# - "Sparse + ConveRT + DIET(seq) + ResponseSelector(t2t)"
# - "Sparse + DIET(bow) + ResponseSelector(bow)"
# - "Sparse + DIET(seq) + ResponseSelector(t2t)"
# - "Sparse + Spacy + DIET(bow) + ResponseSelector(bow)"
# - "Sparse + Spacy + DIET(seq) + ResponseSelector(t2t)"

## Example configuration
#################### syntax #################
## include:
## - dataset: <dataset_name>
## config: <configuration_name>
#
#include:
# - dataset: "Carbon Bot"
# config: "Sparse + EmbeddingIntent + ResponseSelector(bow)"
###
# matrix
###
# dataset: [<dataset>]
# config: [<config>]


dataset:
- "Carbon Bot"
- "Sara"
- "Hermit"
- "Private 1"
- "Private 2"
- "Private 3"

config:
- "BERT + DIET(bow) + ResponseSelector(bow)"
- "BERT + DIET(seq) + ResponseSelector(t2t)"
- "ConveRT + DIET(bow) + ResponseSelector(bow)"
- "ConveRT + DIET(seq) + ResponseSelector(t2t)"
- "Spacy + DIET(bow) + ResponseSelector(bow)"
- "Spacy + DIET(seq) + ResponseSelector(t2t)"
- "Sparse + ConveRT + DIET(bow) + ResponseSelector(bow)"
- "Sparse + ConveRT + DIET(seq) + ResponseSelector(t2t)"
- "Sparse + DIET(bow) + ResponseSelector(bow)"
- "Sparse + DIET(seq) + ResponseSelector(t2t)"
- "Sparse + Spacy + DIET(bow) + ResponseSelector(bow)"
- "Sparse + Spacy + DIET(seq) + ResponseSelector(t2t)"
21 changes: 21 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: 2
updates:
- package-ecosystem: pip
directory: "/"
schedule:
interval: monthly
time: '13:00'
pull-request-branch-name:
separator: "-"
open-pull-requests-limit: 10
reviewers:
- alwx
labels:
- type:dependencies
ignore:
- dependency-name: prompt-toolkit
versions:
- "> 2.0.10"
- dependency-name: pytest-asyncio
versions:
- "> 0.10.0"
2 changes: 1 addition & 1 deletion .github/no-response.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Number of days of inactivity before an Issue is closed for lack of response
daysUntilClose: 14
# Label requiring a response
responseRequiredLabel: more-information-needed
responseRequiredLabel: status:more-details-needed
# Comment to post when closing an Issue for lack of response. Set to `false` to disable
closeComment: >
This issue has been automatically closed because there has been no response
Expand Down
74 changes: 74 additions & 0 deletions .github/runner/github-runner-deployment.yaml.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# GitHub Runner deployment - uses to deploy a github runner
# which is used by the CI for model regression tests
apiVersion: apps/v1
kind: Deployment
metadata:
name: github-runner-{{getenv "GITHUB_RUN_ID"}}
namespace: github-runner
labels:
app: github-runner
pod: github-runner-{{getenv "GITHUB_RUN_ID"}}
spec:
replicas: 1
selector:
matchLabels:
app: github-runner
pod: github-runner-{{getenv "GITHUB_RUN_ID"}}
template:
metadata:
labels:
app: github-runner
pod: github-runner-{{getenv "GITHUB_RUN_ID"}}
spec:
priorityClassName: high-priority
automountServiceAccountToken: false
terminationGracePeriodSeconds: 180
containers:
- name: github-runner
image: us.gcr.io/rasa-platform/github-runner:latest
imagePullPolicy: Always
livenessProbe:
initialDelaySeconds: 30
periodSeconds: 15
failureThreshold: 3
exec:
command:
- /bin/bash
- -c
- "if [[ `curl -sX GET -H \"Authorization: token ${GITHUB_PAT}\" \
https://api.github.com/repos/${GITHUB_OWNER}/${GITHUB_REPOSITORY}/actions/runners | \
jq -r '.runners[] | select(.name == \"'${POD_NAME}'\") | .status'` == \"offline\" ]]; then \
echo \"The GitHub API returns offline status for the ${POD_NAME} runner\" && exit 1; fi"
resources:
limits:
nvidia.com/gpu: 1
requests:
nvidia.com/gpu: 1
memory: 10Gi
env:
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
# RUNNER_LABELS - defines labels
# with which a github-runner will be registered
- name: RUNNER_LABELS
value: "self-hosted,gpu,kubernetes"
# GITHUB_OWNER - a name of the repository owner
- name: GITHUB_OWNER
valueFrom:
secretKeyRef:
name: github-rasa
key: owner
# GITHUB_REPOSITORY - a name of the repository
- name: GITHUB_REPOSITORY
valueFrom:
secretKeyRef:
name: github-rasa
key: repository
# GITHUB_PAT - Personal Access Token
- name: GITHUB_PAT
valueFrom:
secretKeyRef:
name: github-rasa
key: pat
60 changes: 60 additions & 0 deletions .github/scripts/mr_generate_summary.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Collect the results of the various model test runs which are done as part of
# The model regression CI pipeline and dump them as a single file artifact.This artifact will the then be published at the end of the tests.
import json
import os

SUMMARY_FILE = os.environ["SUMMARY_FILE"]
CONFIG = os.environ["CONFIG"]
DATASET = os.environ["DATASET_NAME"]
task_mapping = {
"intent_report.json": "intent_classification",
"CRFEntityExtractor_report.json": "entity_prediction",
"DIETClassifier_report.json": "entity_prediction",
"response_selection_report.json": "response_selection",
}


def generate_json(file, task, data):
if not DATASET in data:
data = {DATASET: {CONFIG: {}}, **data}
elif not CONFIG in data[DATASET]:
data[DATASET] = {CONFIG: {}, **data[DATASET]}

data[DATASET][CONFIG] = {
"accelerator_type": os.environ["ACCELERATOR_TYPE"],
"test_run_time": os.environ["TEST_RUN_TIME"],
"train_run_time": os.environ["TRAIN_RUN_TIME"],
"total_run_time": os.environ["TOTAL_RUN_TIME"],
**data[DATASET][CONFIG],
}

data[DATASET][CONFIG][task] = {**read_results(file)}

return data


def read_results(file):
with open(file) as json_file:
data = json.load(json_file)

keys = ["accuracy", "weighted avg", "macro avg", "micro avg"]
result = {key: data[key] for key in keys if key in data}

return result


if __name__ == "__main__":
data = {}
if os.path.exists(SUMMARY_FILE):
with open(SUMMARY_FILE) as json_file:
data = json.load(json_file)

for dirpath, dirnames, files in os.walk(os.environ["RESULT_DIR"]):
for f in files:
if f not in task_mapping.keys():
continue

data = generate_json(os.path.join(dirpath, f), task_mapping[f], data)

with open(SUMMARY_FILE, "w") as f:
json.dump(data, f, sort_keys=True, indent=2)
Loading

0 comments on commit bd48623

Please sign in to comment.