Do I need to deploy function in gcloud in order to have OCR?











up vote
0
down vote

favorite












This GCloud Tutorial has a "Deploying the function", such as



gcloud functions deploy ocr-extract --trigger-bucket YOUR_IMAGE_BUCKET_NAME --entry-point 


But at Quickstart: Using Client Libraries does not mention it at all, all it needs is



npm install --save @google-cloud/storage


then a few lines of code will work.



So I'm confused, do I need the "deploy" in order to have OCR, in other words what do/don't I get from "deploy"?










share|improve this question




























    up vote
    0
    down vote

    favorite












    This GCloud Tutorial has a "Deploying the function", such as



    gcloud functions deploy ocr-extract --trigger-bucket YOUR_IMAGE_BUCKET_NAME --entry-point 


    But at Quickstart: Using Client Libraries does not mention it at all, all it needs is



    npm install --save @google-cloud/storage


    then a few lines of code will work.



    So I'm confused, do I need the "deploy" in order to have OCR, in other words what do/don't I get from "deploy"?










    share|improve this question


























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      This GCloud Tutorial has a "Deploying the function", such as



      gcloud functions deploy ocr-extract --trigger-bucket YOUR_IMAGE_BUCKET_NAME --entry-point 


      But at Quickstart: Using Client Libraries does not mention it at all, all it needs is



      npm install --save @google-cloud/storage


      then a few lines of code will work.



      So I'm confused, do I need the "deploy" in order to have OCR, in other words what do/don't I get from "deploy"?










      share|improve this question















      This GCloud Tutorial has a "Deploying the function", such as



      gcloud functions deploy ocr-extract --trigger-bucket YOUR_IMAGE_BUCKET_NAME --entry-point 


      But at Quickstart: Using Client Libraries does not mention it at all, all it needs is



      npm install --save @google-cloud/storage


      then a few lines of code will work.



      So I'm confused, do I need the "deploy" in order to have OCR, in other words what do/don't I get from "deploy"?







      google-cloud-platform google-cloud-storage






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 11 at 23:20

























      asked Nov 8 at 4:56









      Jeb50

      518520




      518520
























          2 Answers
          2






          active

          oldest

          votes

















          up vote
          1
          down vote













          The command



          npm install --save @google-cloud/storage


          is an example of installing the Google Cloud Client Library for Node.js in your development environment, in this case, Cloud Storage API. This example is part of Setting Up a Node.js Development Environment tutorial.



          Once you have coded, tested and set all the configurations for the app as described in the tutorial the next step would be the deployment, in this example a Cloud Function:



          gcloud functions deploy ocr-extract --trigger-bucket YOUR_IMAGE_BUCKET_NAME --entry-point 


          So, note that this commands are two different steps to run OCR with Cloud Functions, Cloud Storage and other Cloud Platform components in the tutorial example using Node.js environment.






          share|improve this answer























          • npm install ... is easy to understand to have all libraries/frameworks downloaded to my local box for development. But deploy takes only my imageBucket in as param, so it's like enabling the ocr feature of this bucket, means as long as an app utilizing this bucket, it will be allowed to use the ocr feature of it. Right?
            – Jeb50
            Nov 10 at 17:47






          • 1




            deploy deploys your Cloud Function. During deployment you need to specify the bucket that will be used as the trigger for executing the first Cloud Function because Cloud Storage is the Event Trigger for the CF. The OCR is not a unified "feature", but a functionality that can be achieved by using multiple GCP products, namely: Cloud Functions, Cloud Storage, Vision API, Translation API, Pub/Sub. You will need 1 bucket for uploading images that will undergo the OCR process and another bucket to store the translation results. If this did not help clear confusion, please ask another question.
            – Philipp Sh
            Nov 12 at 16:24


















          up vote
          1
          down vote













          While Cloud Function (CF) is easy to understand, this answers specifically my own question, what does the "Deploy" actually do:




          1. to have the code work for you, they must be deployed/uploaded to the GC. For people like me never done GCF this is new. My understanding was all I need to supply is credentials and satisfy the whatever server/backend (sorry, cloud) settings when my local app calls the remote Web API. That's where I stucked. The key I missed is the sample app itself is a server/backend, and therefore Google requires them to be "deployed" just like when we deploy something during a staging or production release in a traditional corporate environment. So it's a real deploy. If you still don't get it, go to your GC admin page, menu, Cloud Function, "Overview" tab, you will see them. Hence goes to next

          2. The 3 GC deploy command used in the Deploying Functions have ocr-extract ocr-save ocr-translate, they are not switches, they are function names that you can name them anything. Now, still in the Admin page, click on any of 3, "Source". Bang, they are there, deployed (uploaded).


          Google, as this is a tutorial no one has digged into command reference book yet, I recommend adding a piece of note telling readers those 3 ocr-* can be anything you want to name.






          share|improve this answer





















            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53201768%2fdo-i-need-to-deploy-function-in-gcloud-in-order-to-have-ocr%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            1
            down vote













            The command



            npm install --save @google-cloud/storage


            is an example of installing the Google Cloud Client Library for Node.js in your development environment, in this case, Cloud Storage API. This example is part of Setting Up a Node.js Development Environment tutorial.



            Once you have coded, tested and set all the configurations for the app as described in the tutorial the next step would be the deployment, in this example a Cloud Function:



            gcloud functions deploy ocr-extract --trigger-bucket YOUR_IMAGE_BUCKET_NAME --entry-point 


            So, note that this commands are two different steps to run OCR with Cloud Functions, Cloud Storage and other Cloud Platform components in the tutorial example using Node.js environment.






            share|improve this answer























            • npm install ... is easy to understand to have all libraries/frameworks downloaded to my local box for development. But deploy takes only my imageBucket in as param, so it's like enabling the ocr feature of this bucket, means as long as an app utilizing this bucket, it will be allowed to use the ocr feature of it. Right?
              – Jeb50
              Nov 10 at 17:47






            • 1




              deploy deploys your Cloud Function. During deployment you need to specify the bucket that will be used as the trigger for executing the first Cloud Function because Cloud Storage is the Event Trigger for the CF. The OCR is not a unified "feature", but a functionality that can be achieved by using multiple GCP products, namely: Cloud Functions, Cloud Storage, Vision API, Translation API, Pub/Sub. You will need 1 bucket for uploading images that will undergo the OCR process and another bucket to store the translation results. If this did not help clear confusion, please ask another question.
              – Philipp Sh
              Nov 12 at 16:24















            up vote
            1
            down vote













            The command



            npm install --save @google-cloud/storage


            is an example of installing the Google Cloud Client Library for Node.js in your development environment, in this case, Cloud Storage API. This example is part of Setting Up a Node.js Development Environment tutorial.



            Once you have coded, tested and set all the configurations for the app as described in the tutorial the next step would be the deployment, in this example a Cloud Function:



            gcloud functions deploy ocr-extract --trigger-bucket YOUR_IMAGE_BUCKET_NAME --entry-point 


            So, note that this commands are two different steps to run OCR with Cloud Functions, Cloud Storage and other Cloud Platform components in the tutorial example using Node.js environment.






            share|improve this answer























            • npm install ... is easy to understand to have all libraries/frameworks downloaded to my local box for development. But deploy takes only my imageBucket in as param, so it's like enabling the ocr feature of this bucket, means as long as an app utilizing this bucket, it will be allowed to use the ocr feature of it. Right?
              – Jeb50
              Nov 10 at 17:47






            • 1




              deploy deploys your Cloud Function. During deployment you need to specify the bucket that will be used as the trigger for executing the first Cloud Function because Cloud Storage is the Event Trigger for the CF. The OCR is not a unified "feature", but a functionality that can be achieved by using multiple GCP products, namely: Cloud Functions, Cloud Storage, Vision API, Translation API, Pub/Sub. You will need 1 bucket for uploading images that will undergo the OCR process and another bucket to store the translation results. If this did not help clear confusion, please ask another question.
              – Philipp Sh
              Nov 12 at 16:24













            up vote
            1
            down vote










            up vote
            1
            down vote









            The command



            npm install --save @google-cloud/storage


            is an example of installing the Google Cloud Client Library for Node.js in your development environment, in this case, Cloud Storage API. This example is part of Setting Up a Node.js Development Environment tutorial.



            Once you have coded, tested and set all the configurations for the app as described in the tutorial the next step would be the deployment, in this example a Cloud Function:



            gcloud functions deploy ocr-extract --trigger-bucket YOUR_IMAGE_BUCKET_NAME --entry-point 


            So, note that this commands are two different steps to run OCR with Cloud Functions, Cloud Storage and other Cloud Platform components in the tutorial example using Node.js environment.






            share|improve this answer














            The command



            npm install --save @google-cloud/storage


            is an example of installing the Google Cloud Client Library for Node.js in your development environment, in this case, Cloud Storage API. This example is part of Setting Up a Node.js Development Environment tutorial.



            Once you have coded, tested and set all the configurations for the app as described in the tutorial the next step would be the deployment, in this example a Cloud Function:



            gcloud functions deploy ocr-extract --trigger-bucket YOUR_IMAGE_BUCKET_NAME --entry-point 


            So, note that this commands are two different steps to run OCR with Cloud Functions, Cloud Storage and other Cloud Platform components in the tutorial example using Node.js environment.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Nov 8 at 11:25

























            answered Nov 8 at 8:50









            dhauptman

            1055




            1055












            • npm install ... is easy to understand to have all libraries/frameworks downloaded to my local box for development. But deploy takes only my imageBucket in as param, so it's like enabling the ocr feature of this bucket, means as long as an app utilizing this bucket, it will be allowed to use the ocr feature of it. Right?
              – Jeb50
              Nov 10 at 17:47






            • 1




              deploy deploys your Cloud Function. During deployment you need to specify the bucket that will be used as the trigger for executing the first Cloud Function because Cloud Storage is the Event Trigger for the CF. The OCR is not a unified "feature", but a functionality that can be achieved by using multiple GCP products, namely: Cloud Functions, Cloud Storage, Vision API, Translation API, Pub/Sub. You will need 1 bucket for uploading images that will undergo the OCR process and another bucket to store the translation results. If this did not help clear confusion, please ask another question.
              – Philipp Sh
              Nov 12 at 16:24


















            • npm install ... is easy to understand to have all libraries/frameworks downloaded to my local box for development. But deploy takes only my imageBucket in as param, so it's like enabling the ocr feature of this bucket, means as long as an app utilizing this bucket, it will be allowed to use the ocr feature of it. Right?
              – Jeb50
              Nov 10 at 17:47






            • 1




              deploy deploys your Cloud Function. During deployment you need to specify the bucket that will be used as the trigger for executing the first Cloud Function because Cloud Storage is the Event Trigger for the CF. The OCR is not a unified "feature", but a functionality that can be achieved by using multiple GCP products, namely: Cloud Functions, Cloud Storage, Vision API, Translation API, Pub/Sub. You will need 1 bucket for uploading images that will undergo the OCR process and another bucket to store the translation results. If this did not help clear confusion, please ask another question.
              – Philipp Sh
              Nov 12 at 16:24
















            npm install ... is easy to understand to have all libraries/frameworks downloaded to my local box for development. But deploy takes only my imageBucket in as param, so it's like enabling the ocr feature of this bucket, means as long as an app utilizing this bucket, it will be allowed to use the ocr feature of it. Right?
            – Jeb50
            Nov 10 at 17:47




            npm install ... is easy to understand to have all libraries/frameworks downloaded to my local box for development. But deploy takes only my imageBucket in as param, so it's like enabling the ocr feature of this bucket, means as long as an app utilizing this bucket, it will be allowed to use the ocr feature of it. Right?
            – Jeb50
            Nov 10 at 17:47




            1




            1




            deploy deploys your Cloud Function. During deployment you need to specify the bucket that will be used as the trigger for executing the first Cloud Function because Cloud Storage is the Event Trigger for the CF. The OCR is not a unified "feature", but a functionality that can be achieved by using multiple GCP products, namely: Cloud Functions, Cloud Storage, Vision API, Translation API, Pub/Sub. You will need 1 bucket for uploading images that will undergo the OCR process and another bucket to store the translation results. If this did not help clear confusion, please ask another question.
            – Philipp Sh
            Nov 12 at 16:24




            deploy deploys your Cloud Function. During deployment you need to specify the bucket that will be used as the trigger for executing the first Cloud Function because Cloud Storage is the Event Trigger for the CF. The OCR is not a unified "feature", but a functionality that can be achieved by using multiple GCP products, namely: Cloud Functions, Cloud Storage, Vision API, Translation API, Pub/Sub. You will need 1 bucket for uploading images that will undergo the OCR process and another bucket to store the translation results. If this did not help clear confusion, please ask another question.
            – Philipp Sh
            Nov 12 at 16:24












            up vote
            1
            down vote













            While Cloud Function (CF) is easy to understand, this answers specifically my own question, what does the "Deploy" actually do:




            1. to have the code work for you, they must be deployed/uploaded to the GC. For people like me never done GCF this is new. My understanding was all I need to supply is credentials and satisfy the whatever server/backend (sorry, cloud) settings when my local app calls the remote Web API. That's where I stucked. The key I missed is the sample app itself is a server/backend, and therefore Google requires them to be "deployed" just like when we deploy something during a staging or production release in a traditional corporate environment. So it's a real deploy. If you still don't get it, go to your GC admin page, menu, Cloud Function, "Overview" tab, you will see them. Hence goes to next

            2. The 3 GC deploy command used in the Deploying Functions have ocr-extract ocr-save ocr-translate, they are not switches, they are function names that you can name them anything. Now, still in the Admin page, click on any of 3, "Source". Bang, they are there, deployed (uploaded).


            Google, as this is a tutorial no one has digged into command reference book yet, I recommend adding a piece of note telling readers those 3 ocr-* can be anything you want to name.






            share|improve this answer

























              up vote
              1
              down vote













              While Cloud Function (CF) is easy to understand, this answers specifically my own question, what does the "Deploy" actually do:




              1. to have the code work for you, they must be deployed/uploaded to the GC. For people like me never done GCF this is new. My understanding was all I need to supply is credentials and satisfy the whatever server/backend (sorry, cloud) settings when my local app calls the remote Web API. That's where I stucked. The key I missed is the sample app itself is a server/backend, and therefore Google requires them to be "deployed" just like when we deploy something during a staging or production release in a traditional corporate environment. So it's a real deploy. If you still don't get it, go to your GC admin page, menu, Cloud Function, "Overview" tab, you will see them. Hence goes to next

              2. The 3 GC deploy command used in the Deploying Functions have ocr-extract ocr-save ocr-translate, they are not switches, they are function names that you can name them anything. Now, still in the Admin page, click on any of 3, "Source". Bang, they are there, deployed (uploaded).


              Google, as this is a tutorial no one has digged into command reference book yet, I recommend adding a piece of note telling readers those 3 ocr-* can be anything you want to name.






              share|improve this answer























                up vote
                1
                down vote










                up vote
                1
                down vote









                While Cloud Function (CF) is easy to understand, this answers specifically my own question, what does the "Deploy" actually do:




                1. to have the code work for you, they must be deployed/uploaded to the GC. For people like me never done GCF this is new. My understanding was all I need to supply is credentials and satisfy the whatever server/backend (sorry, cloud) settings when my local app calls the remote Web API. That's where I stucked. The key I missed is the sample app itself is a server/backend, and therefore Google requires them to be "deployed" just like when we deploy something during a staging or production release in a traditional corporate environment. So it's a real deploy. If you still don't get it, go to your GC admin page, menu, Cloud Function, "Overview" tab, you will see them. Hence goes to next

                2. The 3 GC deploy command used in the Deploying Functions have ocr-extract ocr-save ocr-translate, they are not switches, they are function names that you can name them anything. Now, still in the Admin page, click on any of 3, "Source". Bang, they are there, deployed (uploaded).


                Google, as this is a tutorial no one has digged into command reference book yet, I recommend adding a piece of note telling readers those 3 ocr-* can be anything you want to name.






                share|improve this answer












                While Cloud Function (CF) is easy to understand, this answers specifically my own question, what does the "Deploy" actually do:




                1. to have the code work for you, they must be deployed/uploaded to the GC. For people like me never done GCF this is new. My understanding was all I need to supply is credentials and satisfy the whatever server/backend (sorry, cloud) settings when my local app calls the remote Web API. That's where I stucked. The key I missed is the sample app itself is a server/backend, and therefore Google requires them to be "deployed" just like when we deploy something during a staging or production release in a traditional corporate environment. So it's a real deploy. If you still don't get it, go to your GC admin page, menu, Cloud Function, "Overview" tab, you will see them. Hence goes to next

                2. The 3 GC deploy command used in the Deploying Functions have ocr-extract ocr-save ocr-translate, they are not switches, they are function names that you can name them anything. Now, still in the Admin page, click on any of 3, "Source". Bang, they are there, deployed (uploaded).


                Google, as this is a tutorial no one has digged into command reference book yet, I recommend adding a piece of note telling readers those 3 ocr-* can be anything you want to name.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 18 at 0:40









                Jeb50

                518520




                518520






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53201768%2fdo-i-need-to-deploy-function-in-gcloud-in-order-to-have-ocr%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    這個網誌中的熱門文章

                    Academy of Television Arts & Sciences

                    L'Équipe

                    1995 France bombings