From 3d8226d5568f37229c2f599777921f77d73453b7 Mon Sep 17 00:00:00 2001 From: Dhanush Patel Date: Thu, 27 Feb 2020 00:39:58 -0800 Subject: [PATCH] minor import change --- cloudbuild.yaml | 21 --------------------- test1.py | 4 +++- 2 files changed, 3 insertions(+), 22 deletions(-) delete mode 100644 cloudbuild.yaml diff --git a/cloudbuild.yaml b/cloudbuild.yaml deleted file mode 100644 index 4f45eca..0000000 --- a/cloudbuild.yaml +++ /dev/null @@ -1,21 +0,0 @@ -steps: - # build the container image - - name: "gcr.io/cloud-builders/docker" - args: ["build", "-t", "gcr.io/$PROJECT_ID/shakti0:$COMMIT_SHA", "."] - # push the container image to Container Registry - - name: "gcr.io/cloud-builders/docker" - args: ["push", "gcr.io/$PROJECT_ID/shakti0:$COMMIT_SHA"] - # Deploy container image to Cloud Run - - name: "gcr.io/cloud-builders/gcloud" - args: - - "run" - - "deploy" - - "shakti0" - - "--image" - - "gcr.io/$PROJECT_ID/shakti0:$COMMIT_SHA" - - "--region" - - "us-east1" - - "--platform" - - "managed" -images: - - "gcr.io/$PROJECT_ID/shakti0:$COMMIT_SHA" diff --git a/test1.py b/test1.py index 4177925..632cc26 100644 --- a/test1.py +++ b/test1.py @@ -1,8 +1,9 @@ import os from flask import Flask, jsonify -from gcp_utils.googlebucket import gcs_download_file +from shaktiutils.gcp_utils.googlebucket import gcs_download_file from joblib import load +from dotenv import load_dotenv app = Flask(__name__) @@ -12,6 +13,7 @@ @app.before_request def load_resources(): '''Flask template is currently only for scikit-learn models''' + load_dotenv() if not model: model_path = gcs_download_file(os.environ.get("MODEL_PATH")) model = load(model_path)