diff --git a/Label_Microservice/Makefile b/Label_Microservice/Makefile index 613c028d07..973a2b51ea 100644 --- a/Label_Microservice/Makefile +++ b/Label_Microservice/Makefile @@ -2,9 +2,9 @@ CONTEXT=issue-label-bot hydrate-prod: - rm -rf .build/prod - mkdir -p .build/prod - kustomize build -o .build/prod deployment/overlays/prod + rm -f ../acm-repos/issue-label-bot/namespaces/label-bot-prod/* + kustomize build -o ../acm-repos/issue-label-bot/namespaces/label-bot-prod deployment/overlays/prod -apply-prod: hydrate-prod - kubectl --context=$(CONTEXT) apply -f .build/prod \ No newline at end of file +update-image: + skaffold build --kube-context=${CONTEXT} -v info --file-output=latest_image.json + cd deployment/overlays/prod && kustomize edit set image gcr.io/issue-label-bot-dev/bot-worker=$(shell yq r latest_image.json builds[0].tag ) diff --git a/Label_Microservice/README.md b/Label_Microservice/README.md index a84ba3ca05..06b692c110 100644 --- a/Label_Microservice/README.md +++ b/Label_Microservice/README.md @@ -84,8 +84,8 @@ The following describes the GCP projects and clusters where the two services are 1. Repo-specific label microservice - **repository**: [kubeflow/code-intelligence](https://github.com/kubeflow/code-intelligence/tree/master/Label_Microservice) - **GCP project**: issue-label-bot-dev - - **cluster**: github-mlapp-test - - **namespace**: default + - **cluster**: label-bot-dev + - **namespace**: labelbot-dev - **yaml files**: [Label\_Microservice/deployment](https://github.com/kubeflow/code-intelligence/tree/master/Label_Microservice/deployment) 1, GitHub bot - **kf-label-bot-dev** @@ -95,6 +95,23 @@ The following describes the GCP projects and clusters where the two services are ## Instructions +### Deploying + +#### Production instance + +1. Build a docker image and update the kustomization + + ``` + CONTEXT= make update-image + ``` + +#### Dev instance of the label bot worker + +Use skaffold + +``` +skaffold --kube-context=${KUBE_CONTEXT} dev -v info +``` ### Installation If you would like to install the new repo-specific label microservice to your repositories, you need to follow the procedures in [the doc](./docs/onboarding_new_repositories.md). diff --git a/Label_Microservice/deployment/base/configs/model_config.yaml b/Label_Microservice/deployment/base/configs/model_config.yaml new file mode 100644 index 0000000000..ad1b2e811e --- /dev/null +++ b/Label_Microservice/deployment/base/configs/model_config.yaml @@ -0,0 +1,4 @@ +# This file describes the models to load +orgs: + - name: kubeflow + automl_model: "projects/976279526634/locations/us-central1/models/TCN654213816573231104" \ No newline at end of file diff --git a/Label_Microservice/deployment/base/deployments.yaml b/Label_Microservice/deployment/base/deployments.yaml index 5c4019d4b9..ba9baa295f 100644 --- a/Label_Microservice/deployment/base/deployments.yaml +++ b/Label_Microservice/deployment/base/deployments.yaml @@ -1,4 +1,4 @@ -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: worker @@ -10,6 +10,9 @@ spec: app: worker spec: volumes: + - name: config + configMap: + name: model-config - name: github-app secret: secretName: github-app @@ -26,6 +29,9 @@ spec: memory: "4Gi" cpu: "4" volumeMounts: + - name: config + mountPath: /var/config + readOnly: true - name: github-app mountPath: /var/secrets/github env: @@ -42,9 +48,8 @@ spec: value: "50112" - name: GITHUB_APP_PEM_KEY value: /var/secrets/github/kf-label-bot-dev.private-key.pem - # TODO(jlewi):Not needed because we use workload identity - #- name: GOOGLE_APPLICATION_CREDENTIALS - # value: /var/secrets/google/user-gcp-sa.json + - name: MODEL_CONFIG + value: /var/config/model_config.yaml restartPolicy: Always # We need to set a service account corresponding to workload # identity diff --git a/Label_Microservice/deployment/base/kustomization.yaml b/Label_Microservice/deployment/base/kustomization.yaml index dc0088c38a..cfe0c5afff 100644 --- a/Label_Microservice/deployment/base/kustomization.yaml +++ b/Label_Microservice/deployment/base/kustomization.yaml @@ -10,3 +10,7 @@ images: resources: - service.yaml - deployments.yaml +configMapGenerator: + - name: model-config + files: + - configs/model_config.yaml \ No newline at end of file diff --git a/Label_Microservice/deployment/overlays/dev/deployments.yaml b/Label_Microservice/deployment/overlays/dev/deployments.yaml index 7cc1a97e14..b662da1891 100644 --- a/Label_Microservice/deployment/overlays/dev/deployments.yaml +++ b/Label_Microservice/deployment/overlays/dev/deployments.yaml @@ -1,4 +1,4 @@ -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: worker diff --git a/Label_Microservice/deployment/overlays/prod/deployments.yaml b/Label_Microservice/deployment/overlays/prod/deployments.yaml index 3f1a47863a..7fa45c14a3 100644 --- a/Label_Microservice/deployment/overlays/prod/deployments.yaml +++ b/Label_Microservice/deployment/overlays/prod/deployments.yaml @@ -1,4 +1,4 @@ -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: worker diff --git a/Label_Microservice/deployment/overlays/prod/kustomization.yaml b/Label_Microservice/deployment/overlays/prod/kustomization.yaml index 1b051a5037..ecd01503e9 100644 --- a/Label_Microservice/deployment/overlays/prod/kustomization.yaml +++ b/Label_Microservice/deployment/overlays/prod/kustomization.yaml @@ -7,7 +7,8 @@ patchesStrategicMerge: - deployments.yaml resources: - ../../base +- namespace.yaml images: -- name: gcr.io/issue-label-bot-dev/bot-worker - newName: gcr.io/issue-label-bot-dev/bot-worker - newTag: 6848ad6 +- digest: sha256:2faaf9d94c9beba082f184790770d1d08cb06a94b1ad4a8e797033f0bccb4cf7 + name: gcr.io/issue-label-bot-dev/bot-worker + newName: gcr.io/issue-label-bot-dev/bot-worker:f0bf8d1-dirty diff --git a/Label_Microservice/deployment/overlays/prod/namespace.yaml b/Label_Microservice/deployment/overlays/prod/namespace.yaml new file mode 100644 index 0000000000..c48aa92ad0 --- /dev/null +++ b/Label_Microservice/deployment/overlays/prod/namespace.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: label-bot-prod \ No newline at end of file diff --git a/Label_Microservice/deployment/requirements.universal_model.txt b/Label_Microservice/deployment/requirements.universal_model.txt index 2eb1e24bac..a5de594a53 100644 --- a/Label_Microservice/deployment/requirements.universal_model.txt +++ b/Label_Microservice/deployment/requirements.universal_model.txt @@ -1,5 +1,9 @@ # Requirements for the universal model. # These requirements are largely copied from # https://github.com/machine-learning-apps/Issue-Label-Bot/blob/master/deployment/Dockerfile - h5py==2.9.0 - ktext==0.34 \ No newline at end of file +h5py==2.9.0 +# Newer versions of Keras appear to require TensorFlow 2.2 +Keras==2.3.1 +Keras-Applications==1.0.8 +Keras-Preprocessing==1.1.0 +ktext==0.34 \ No newline at end of file diff --git a/Label_Microservice/latest_image.json b/Label_Microservice/latest_image.json new file mode 100644 index 0000000000..1469a32242 --- /dev/null +++ b/Label_Microservice/latest_image.json @@ -0,0 +1 @@ +{"builds":[{"imageName":"gcr.io/issue-label-bot-dev/bot-worker","tag":"gcr.io/issue-label-bot-dev/bot-worker:f0bf8d1-dirty@sha256:2faaf9d94c9beba082f184790770d1d08cb06a94b1ad4a8e797033f0bccb4cf7"}]} \ No newline at end of file diff --git a/acm-repos/issue-label-bot/README.md b/acm-repos/issue-label-bot/README.md new file mode 100644 index 0000000000..dc8a9b4f70 --- /dev/null +++ b/acm-repos/issue-label-bot/README.md @@ -0,0 +1,5 @@ +# Anthos Configuration Management Directory + +This is the root directory for Anthos Configuration Management. + +See [our documentation](https://cloud.google.com/anthos-config-management/docs/repo) for how to use each subdirectory. diff --git a/Label_Microservice/.build/prod/extensions_v1beta1_deployment_label-bot-worker.yaml b/acm-repos/issue-label-bot/namespaces/label-bot-prod/apps_v1_deployment_label-bot-worker.yaml similarity index 77% rename from Label_Microservice/.build/prod/extensions_v1beta1_deployment_label-bot-worker.yaml rename to acm-repos/issue-label-bot/namespaces/label-bot-prod/apps_v1_deployment_label-bot-worker.yaml index d75258d8eb..d0ba30e3f3 100644 --- a/Label_Microservice/.build/prod/extensions_v1beta1_deployment_label-bot-worker.yaml +++ b/acm-repos/issue-label-bot/namespaces/label-bot-prod/apps_v1_deployment_label-bot-worker.yaml @@ -1,4 +1,4 @@ -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: labels: @@ -42,18 +42,26 @@ spec: 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:6848ad6 + - name: MODEL_CONFIG + value: /var/config/model_config.yaml + image: gcr.io/issue-label-bot-dev/bot-worker:f0bf8d1-dirty@sha256:2faaf9d94c9beba082f184790770d1d08cb06a94b1ad4a8e797033f0bccb4cf7 name: app resources: requests: cpu: "4" memory: 4Gi volumeMounts: + - mountPath: /var/config + name: config + readOnly: true - mountPath: /var/secrets/github name: github-app restartPolicy: Always serviceAccountName: default-editor volumes: + - configMap: + name: label-bot-model-config-7fdmtg95kc + name: config - name: github-app secret: secretName: github-app diff --git a/acm-repos/issue-label-bot/namespaces/label-bot-prod/~g_v1_configmap_label-bot-model-config-7fdmtg95kc.yaml b/acm-repos/issue-label-bot/namespaces/label-bot-prod/~g_v1_configmap_label-bot-model-config-7fdmtg95kc.yaml new file mode 100644 index 0000000000..1eed3ec244 --- /dev/null +++ b/acm-repos/issue-label-bot/namespaces/label-bot-prod/~g_v1_configmap_label-bot-model-config-7fdmtg95kc.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +data: + model_config.yaml: |- + # This file describes the models to load + orgs: + - name: kubeflow + automl_model: "projects/976279526634/locations/us-central1/models/TCN654213816573231104" +kind: ConfigMap +metadata: + labels: + app: label-bot + environment: prod + service: label-bot + name: label-bot-model-config-7fdmtg95kc + namespace: label-bot-prod diff --git a/acm-repos/issue-label-bot/namespaces/label-bot-prod/~g_v1_namespace_label-bot-prod.yaml b/acm-repos/issue-label-bot/namespaces/label-bot-prod/~g_v1_namespace_label-bot-prod.yaml new file mode 100644 index 0000000000..f4432927bd --- /dev/null +++ b/acm-repos/issue-label-bot/namespaces/label-bot-prod/~g_v1_namespace_label-bot-prod.yaml @@ -0,0 +1,6 @@ +apiVersion: v1 +kind: Namespace +metadata: + labels: + environment: prod + name: label-bot-prod diff --git a/Label_Microservice/.build/prod/~g_v1_service_label-bot-worker.yaml b/acm-repos/issue-label-bot/namespaces/label-bot-prod/~g_v1_service_label-bot-worker.yaml similarity index 100% rename from Label_Microservice/.build/prod/~g_v1_service_label-bot-worker.yaml rename to acm-repos/issue-label-bot/namespaces/label-bot-prod/~g_v1_service_label-bot-worker.yaml diff --git a/acm-repos/issue-label-bot/system/README.md b/acm-repos/issue-label-bot/system/README.md new file mode 100644 index 0000000000..0563002a65 --- /dev/null +++ b/acm-repos/issue-label-bot/system/README.md @@ -0,0 +1,3 @@ +# System + +This directory contains system configs such as the repo version and how resources are synced. diff --git a/acm-repos/issue-label-bot/system/repo.yaml b/acm-repos/issue-label-bot/system/repo.yaml new file mode 100644 index 0000000000..d2196347a0 --- /dev/null +++ b/acm-repos/issue-label-bot/system/repo.yaml @@ -0,0 +1,6 @@ +apiVersion: configmanagement.gke.io/v1 +kind: Repo +metadata: + name: repo +spec: + version: 1.0.0 diff --git a/kubeflow_clusters/issue-label-bot/configsync/config-management-operator.yaml b/kubeflow_clusters/issue-label-bot/configsync/config-management-operator.yaml new file mode 100644 index 0000000000..28eb2f48c6 --- /dev/null +++ b/kubeflow_clusters/issue-label-bot/configsync/config-management-operator.yaml @@ -0,0 +1,258 @@ +# ----- configmanagement_v1_configmanagement.yaml ----- +apiVersion: apiextensions.k8s.io/v1beta1 +kind: CustomResourceDefinition +metadata: + creationTimestamp: null + labels: + controller-tools.k8s.io: "1.0" + name: configmanagements.configmanagement.gke.io +spec: + group: configmanagement.gke.io + names: + kind: ConfigManagement + plural: configmanagements + scope: Cluster + # NOTE TO MAINTAINERS: controller-gen will try to remove these and + # replace it with `version: v1`. Don't let that happen, see + # https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definition-versioning + versions: + - name: v1 + served: true + storage: true + validation: + openAPIV3Schema: + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + properties: + clusterName: + description: ClusterName, if defined, sets the name for this cluster. If + unset, the cluster is considered to be unnamed, and cannot use ClusterSelectors. + type: string + configConnector: + description: ConfigConnector deploys the GCP Config Connector components + as recognized by the "cnrm.cloud.google.com/system" label set to "true". + properties: + enabled: + description: 'Enable or disable the Config Connector. Default: + false.' + type: boolean + type: object + git: + description: Git contains configuration specific to importing policies + from a Git repo. + properties: + policyDir: + description: 'PolicyDir is the absolute path of the directory that + contains the local policy. Default: the root directory of the + repo.' + type: string + proxy: + description: Proxy is a struct that contains options for configuring + access to the Git repo via a proxy. Only has an effect when secretType + is one of ("cookiefile", "none"). Optional. + properties: + httpProxy: + description: HTTPProxy defines a HTTP_PROXY env variable used + to access the Git repo. If both HTTPProxy and HTTPSProxy + are specified, HTTPProxy will be ignored. Optional. + type: string + httpsProxy: + description: HTTPSProxy defines a HTTPS_PROXY env variable used + to access the Git repo. If both HTTPProxy and HTTPSProxy + are specified, HTTPProxy will be ignored. Optional. + type: string + type: object + secretType: + description: SecretType is the type of secret configured for access + to the Git repo. Must be one of ssh, cookiefile, gcenode, token, + or none. Required. The validation of this is case-sensitive. + pattern: ^(ssh|cookiefile|gcenode|token|none)$ + type: string + syncBranch: + description: 'SyncBranch is the branch to sync from. Default: "master".' + type: string + syncRepo: + pattern: ^(((https?|git|ssh):\/\/)|git@) + type: string + syncRev: + description: 'SyncRev is the git revision (tag or hash) to check + out. Default: HEAD.' + type: string + syncWait: + description: 'SyncWaitSeconds is the time duration in seconds between + consecutive syncs. Default: 15 seconds. Note that SyncWaitSecs + is not a time.Duration on purpose. This provides a reminder to + developers that customers specify this value using using integers + like "3" in their ConfigManagement YAML. However, time.Duration + is at a nanosecond granularity, and it''s easy to introduce a + bug where it looks like the code is dealing with seconds but its + actually nanoseconds (or vice versa).' + format: int64 + type: integer + type: object + policyController: + description: Policy Controller enables PolicyController components as + recognized by the "gatekeeper.sh/manifest" label set to "true". + properties: + auditIntervalSeconds: + description: AuditIntervalSeconds. The number of seconds between + audit runs. Defaults to 60 seconds. To disable audit, set this + to 0. + format: int64 + type: integer + enabled: + description: 'Enable or disable the Policy Controller. Default: + false.' + type: boolean + exemptableNamespaces: + description: ExemptableNamespaces. The namespaces in this list are + able to have the admission.gatekeeper.sh/ignore label set. When + the label is set, Policy Controller will not be called for that + namespace or any resources contained in it. `gatekeeper-system` + is always exempted. + items: + type: string + type: array + referentialRulesEnabled: + description: 'ReferentialRulesEnabled. If true, Policy Controller + will allow `data.inventory` references in the contents of ConstraintTemplate + Rego. No effect unless policyController is enabled. Default: + false.' + type: boolean + templateLibraryInstalled: + description: 'TemplateLibraryInstalled. If true, a set of default + ConstraintTemplates will be deployed to the cluster. ConstraintTemplates + will not be deployed if this is explicitly set to false or if + policyController is not enabled. Default: true.' + type: boolean + type: object + sourceFormat: + description: SourceFormat specifies how the repository is formatted. + See documentation for specifics of what these options do. Must be + one of hierarchy, unstructured. Optional. Set to hierarchy if not + specified. The validation of this is case-sensitive. + pattern: ^(hierarchy|unstructured|)$ + type: string + type: object + status: + properties: + configManagementVersion: + description: ConfigManagementVersion is the semantic version number + of the config management system enforced by the currently running + config management operator. + type: string + errors: + items: + type: string + type: array + healthy: + type: boolean + required: + - healthy + type: object + required: + - metadata + - spec +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] +--- +# ----- addons_rolebinding_rbac.yaml ----- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + labels: + k8s-app: config-management-operator + name: config-management-operator + namespace: kube-system +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: config-management-operator +subjects: +- kind: ServiceAccount + name: config-management-operator + namespace: kube-system +--- +# ----- addons_role_rbac.yaml ----- +# The Nomos system creates RBAC rules, so it requires +# full cluster-admin access. Thus, the operator needs +# to be able to grant tha permission to the installed +# Nomos components. +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + labels: + k8s-app: config-management-operator + name: config-management-operator +rules: +- apiGroups: ["*"] + resources: ["*"] + verbs: ["*"] +--- +# ----- manager.yaml ----- +apiVersion: v1 +kind: ServiceAccount +metadata: + labels: + k8s-app: config-management-operator + name: config-management-operator + namespace: kube-system +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: config-management-operator + namespace: kube-system + labels: + k8s-app: config-management-operator +spec: + strategy: + type: Recreate + # must be null due to 3-way merge, as + # rollingUpdate added to the resource by default by the APIServer + rollingUpdate: null + selector: + matchLabels: + k8s-app: config-management-operator + component: config-management-operator + template: + metadata: + labels: + k8s-app: config-management-operator + component: config-management-operator + spec: + containers: + - command: + - /manager + - --private-registry= + name: manager + image: gcr.io/config-management-release/config-management-operator:20200409021017-op + resources: + requests: + cpu: 100m + memory: 20Mi + serviceAccount: config-management-operator +--- +# ----- namespace.yaml ----- +apiVersion: v1 +kind: Namespace +metadata: + name: config-management-system + labels: + configmanagement.gke.io/system: "true" diff --git a/kubeflow_clusters/issue-label-bot/configsync/config-management.yaml b/kubeflow_clusters/issue-label-bot/configsync/config-management.yaml new file mode 100644 index 0000000000..5546564664 --- /dev/null +++ b/kubeflow_clusters/issue-label-bot/configsync/config-management.yaml @@ -0,0 +1,20 @@ +apiVersion: configmanagement.gke.io/v1 +kind: ConfigManagement +metadata: + name: config-management + annotations: + gke.io/cluster: "gke://issue-label-bot-dev/us-east1-d/issue-label-bot" # {"type":"string","x-kustomize":{"setBy":"kpt","partialSetters":[{"name":"gcloud.core.project","value":"kubeflow-ci"},{"name":"name","value":"kf-ci-management"},{"name":"location","value":"us-central1"}]}} +spec: + clusterName: "gke://issue-label-bot-dev/us-east1-d/issue-label-bot" # {"type":"string","x-kustomize":{"setBy":"kpt","partialSetters":[{"name":"gcloud.core.project","value":"kubeflow-ci"},{"name":"name","value":"kf-ci-management"},{"name":"location","value":"us-central1"}]}} + git: + syncRepo: "https://github.com/kubeflow/code-intelligence.git" # {"type":"string","x-kustomize":{"setBy":"kpt","partialSetters":[{"name":"source_repo","value":"https://github.com/jlewi/community-infra.git"}]}} + syncBranch: master + secretType: none + policyDir: "/acm-repos/issue-label-bot" # {"$ref":"#/definitions/io.k8s.cli.setters.sync-repo-dir"} + # Set to true to install and enable Config Connector + # We currently don't use ACM to install config connector because + # 1. ACM 1.3 was installing a version of KCC which is too old + # 2. We already have KCC installed on the management cluster. + configConnector: + enabled: false + sourceFormat: hierarchy diff --git a/py/label_microservice/issue_label_predictor.py b/py/label_microservice/issue_label_predictor.py index 8a07cdab52..31a4544972 100644 --- a/py/label_microservice/issue_label_predictor.py +++ b/py/label_microservice/issue_label_predictor.py @@ -1,4 +1,6 @@ import logging +import os +import yaml from code_intelligence import github_app from code_intelligence import graphql @@ -10,9 +12,6 @@ UNIVERSAL_MODEL_NAME = "universal" -# TODO(jlewi): Lets not hardcode this. -KUBEFLOW_AUTOML_MODEL = "projects/976279526634/locations/us-central1/models/TCN654213816573231104" - def _combined_model_name(org, repo=None): """Return the name of the combined model for a repo or organization. @@ -61,19 +60,31 @@ def _load_models(self): logging.info("Loading the universal model") self._models[UNIVERSAL_MODEL_NAME] = universal_model.UniversalKindLabelModel() - # TODO(jlewi): How should we get a list of all models for which we - # have repo or org specific models. mlbot is doing this based on a config - # file; https://github.com/machine-learning-apps/Issue-Label-Bot/blob/26d8fb65be3b39de244c4be9e32b2838111dac10/flask_app/forward_utils.py#L5 # pylint: disable=line-too-long - for org in ["kubeflow"]: - logging.info(f"Loading AutoML model for org: {org}; model: {KUBEFLOW_AUTOML_MODEL}") + model_config_path = os.getenv("MODEL_CONFIG") + + if model_config_path: + logging.info(f"Loading model config from {model_config_path}") + with open(model_config_path) as fh: + model_config = yaml.load(fh) + else: + logging.info("Environment variable MODEL_CONFIG not set; no config " + "loaded.") + + for org in model_config.get("orgs", []): + org_name = org.get("name") + logging.info(f"Processing model config for org: {org_name}") + if org.get("automl_model"): + model = org.get("automl_model") + logging.info(f"Loading AutoML model for org: {org_name}; " + f"model: {model}") - org_model = automl_model.AutoMLModel(model_name=KUBEFLOW_AUTOML_MODEL) + org_model = automl_model.AutoMLModel(model_name=model) - self._models[f"{org}"] = org_model + self._models[f"{org_name}"] = org_model - combined = combined_model.CombinedLabelModels( - models=[self._models["universal"], org_model]) - self._models[_combined_model_name(org)] = combined + combined = combined_model.CombinedLabelModels( + models=[self._models["universal"], org_model]) + self._models[_combined_model_name(org_name)] = combined def predict_labels_for_data(self, model_name, org, repo, title, text, diff --git a/py/label_microservice/worker.py b/py/label_microservice/worker.py index be7febd7dc..aed926b8ec 100644 --- a/py/label_microservice/worker.py +++ b/py/label_microservice/worker.py @@ -19,7 +19,7 @@ import subprocess import sys -DEFAULT_APP_URL = "https://github.com/marketplace/issue-label-bot" +DEFAULT_APP_URL = "https://label-bot-prod.mlbot.net/" # Repo containing org wide config ORG_CONFIG_REPO = ".github"