forked from kubeflow/code-intelligence
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use the AutoML Model and the universal model to generate predictions. (…
…kubeflow#134) Create an AutoML Model class to generate predictions using AutoML. * Create a new class/module automl_model to generate predictions using AutoML models * Change the function signature of predict_labels to include org and repo because we want org and repo to be features because they can be highly informative. * Also change predict_issue_labels to take in a list of strings for the body text because in follow on PRs we will start taking into additional comments and not just the first one. * Define github_util.build_issue_doc to construct a text document out of the various features. Testing * Dev instance successfully used AutoML model. kubeflow#131 (comment) * Check in hydrated configs for prod. * prod has also been updated and looks to be using the new model correctly. Related issues: * Hopefully this model is an improvement. Miscellaneous changes Add logging and monitoring instructions. Update automl notebook to use the new code to build an issue.
- Loading branch information
Showing
20 changed files
with
544 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
Label_Microservice/.build/prod/extensions_v1beta1_deployment_label-bot-worker.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
apiVersion: extensions/v1beta1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
app: label-bot | ||
environment: prod | ||
service: label-bot | ||
name: label-bot-worker | ||
namespace: label-bot-prod | ||
spec: | ||
replicas: 5 | ||
selector: | ||
matchLabels: | ||
app: label-bot | ||
environment: prod | ||
service: label-bot | ||
template: | ||
metadata: | ||
labels: | ||
app: label-bot | ||
environment: prod | ||
service: label-bot | ||
spec: | ||
containers: | ||
- command: | ||
- python3 | ||
- -m | ||
- label_microservice.worker | ||
- subscribe_from_env | ||
env: | ||
- name: PORT | ||
value: "80" | ||
- name: ISSUE_EMBEDDING_SERVICE | ||
value: http://issue-embedding-server | ||
- name: PROJECT | ||
value: issue-label-bot-dev | ||
- name: ISSUE_EVENT_TOPIC | ||
value: event_queue | ||
- name: ISSUE_EVENT_SUBSCRIPTION | ||
value: label_bot_prod | ||
- name: GITHUB_APP_ID | ||
value: "27079" | ||
- name: GITHUB_APP_PEM_KEY | ||
value: /var/secrets/github/issue-label-bot-github-app.private-key.pem | ||
image: gcr.io/issue-label-bot-dev/bot-worker:011a589 | ||
name: app | ||
resources: | ||
requests: | ||
cpu: "4" | ||
memory: 4Gi | ||
volumeMounts: | ||
- mountPath: /var/secrets/github | ||
name: github-app | ||
restartPolicy: Always | ||
serviceAccountName: default-editor | ||
volumes: | ||
- name: github-app | ||
secret: | ||
secretName: github-app |
20 changes: 20 additions & 0 deletions
20
Label_Microservice/.build/prod/~g_v1_service_label-bot-worker.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
app: label-bot | ||
environment: prod | ||
service: label-bot | ||
name: label-bot-worker | ||
namespace: label-bot-prod | ||
spec: | ||
ports: | ||
- name: http | ||
port: 80 | ||
protocol: TCP | ||
targetPort: 80 | ||
selector: | ||
app: label-bot | ||
environment: prod | ||
service: label-bot | ||
type: ClusterIP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
CONTEXT=issue-label-bot | ||
|
||
hydrate-prod: | ||
rm -rf .build/prod | ||
mkdir -p .build/prod | ||
kustomize build -o .build/prod deployment/overlays/prod | ||
|
||
apply-prod: hydrate-prod | ||
kubectl --context=$(CONTEXT) apply -f .build/prod |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Logging and Monitoring | ||
|
||
|
||
## Stackdriver logs | ||
|
||
* Label bot workers use structured json logs | ||
* You can search the logs in stackdrive some examples below | ||
* There is also a BigQuery sink for the stackdriver logs to facilitate analysis and querying | ||
|
||
|
||
Use a label like the following to see messages for | ||
a specific issue | ||
|
||
``` | ||
jsonPayload.repo_owner = "kubeflow" | ||
jsonPayload.repo_name = "code-intelligence" | ||
jsonPayload.issue_num = "132" | ||
resource.labels.namespace_name = "label-bot-prod" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.