Route url to GAE Flex server while rest of site runs on GAE Standard












1














Using Google App Engine Standard Python 2.7, I have a path in my dispatch.yaml to specify all urls of type "*/flex/*" to route to the flex service.



dispatch.yaml
dispatch:



- url: '*/flex/*'
module: flex


The flex environment is a custom python 3.7 runtime which is executed normally using:



python dev_appserver.py flex.yaml --custom_entrypoint="docker run -p 9090:8080 flex_app".



With other services in my environment, I attempt to launch a dev environment with the command:
python dev_appserver.py dispatch.yaml default.yaml sync.yaml task.yaml flex.yaml --custom_entrypoint="docker run -p 9090:8080 flex_app" --port=8080 --skip_sdk_update_check"



However, when this starts, it starts assigning local ip addresses to each service when I need the flex service to be accessed from port 9090.



Example server output:



INFO     devappserver2.py:278] Skipping SDK update check.
INFO dispatcher.py:223] Starting dispatcher running at: http://0.0.0.0:8080
INFO dispatcher.py:256] Starting module "default" running at: http://0.0.0.0:8081
INFO dispatcher.py:256] Starting module "sync" running at: http://0.0.0.0:8082
INFO dispatcher.py:256] Starting module "task" running at: http://0.0.0.0:8083
INFO dispatcher.py:256] Starting module "flex" running at: http://0.0.0.0:8084


I am able to successfully access the flex app if I hit the URL localhost:9090. However, if I access localhost:8084 or localhost:8080/flex/, I receive the error:



503 - This request has timed out.



The server logs reflect this but do not show an actual error:



INFO module.py:861] flex: "GET / HTTP/1.1" 503 59



Is it possible to dispatch urls from GAE Standard Environments to a Flex environment and have it route from its designated port to the desired port needed? I would think this is possible as Google App Engine's Doc specifies it is possible to mix the environments together. I've also attempted to solve this by forcing docker to run on port 8084 but the ports can't be shared.










share|improve this question



























    1














    Using Google App Engine Standard Python 2.7, I have a path in my dispatch.yaml to specify all urls of type "*/flex/*" to route to the flex service.



    dispatch.yaml
    dispatch:



    - url: '*/flex/*'
    module: flex


    The flex environment is a custom python 3.7 runtime which is executed normally using:



    python dev_appserver.py flex.yaml --custom_entrypoint="docker run -p 9090:8080 flex_app".



    With other services in my environment, I attempt to launch a dev environment with the command:
    python dev_appserver.py dispatch.yaml default.yaml sync.yaml task.yaml flex.yaml --custom_entrypoint="docker run -p 9090:8080 flex_app" --port=8080 --skip_sdk_update_check"



    However, when this starts, it starts assigning local ip addresses to each service when I need the flex service to be accessed from port 9090.



    Example server output:



    INFO     devappserver2.py:278] Skipping SDK update check.
    INFO dispatcher.py:223] Starting dispatcher running at: http://0.0.0.0:8080
    INFO dispatcher.py:256] Starting module "default" running at: http://0.0.0.0:8081
    INFO dispatcher.py:256] Starting module "sync" running at: http://0.0.0.0:8082
    INFO dispatcher.py:256] Starting module "task" running at: http://0.0.0.0:8083
    INFO dispatcher.py:256] Starting module "flex" running at: http://0.0.0.0:8084


    I am able to successfully access the flex app if I hit the URL localhost:9090. However, if I access localhost:8084 or localhost:8080/flex/, I receive the error:



    503 - This request has timed out.



    The server logs reflect this but do not show an actual error:



    INFO module.py:861] flex: "GET / HTTP/1.1" 503 59



    Is it possible to dispatch urls from GAE Standard Environments to a Flex environment and have it route from its designated port to the desired port needed? I would think this is possible as Google App Engine's Doc specifies it is possible to mix the environments together. I've also attempted to solve this by forcing docker to run on port 8084 but the ports can't be shared.










    share|improve this question

























      1












      1








      1







      Using Google App Engine Standard Python 2.7, I have a path in my dispatch.yaml to specify all urls of type "*/flex/*" to route to the flex service.



      dispatch.yaml
      dispatch:



      - url: '*/flex/*'
      module: flex


      The flex environment is a custom python 3.7 runtime which is executed normally using:



      python dev_appserver.py flex.yaml --custom_entrypoint="docker run -p 9090:8080 flex_app".



      With other services in my environment, I attempt to launch a dev environment with the command:
      python dev_appserver.py dispatch.yaml default.yaml sync.yaml task.yaml flex.yaml --custom_entrypoint="docker run -p 9090:8080 flex_app" --port=8080 --skip_sdk_update_check"



      However, when this starts, it starts assigning local ip addresses to each service when I need the flex service to be accessed from port 9090.



      Example server output:



      INFO     devappserver2.py:278] Skipping SDK update check.
      INFO dispatcher.py:223] Starting dispatcher running at: http://0.0.0.0:8080
      INFO dispatcher.py:256] Starting module "default" running at: http://0.0.0.0:8081
      INFO dispatcher.py:256] Starting module "sync" running at: http://0.0.0.0:8082
      INFO dispatcher.py:256] Starting module "task" running at: http://0.0.0.0:8083
      INFO dispatcher.py:256] Starting module "flex" running at: http://0.0.0.0:8084


      I am able to successfully access the flex app if I hit the URL localhost:9090. However, if I access localhost:8084 or localhost:8080/flex/, I receive the error:



      503 - This request has timed out.



      The server logs reflect this but do not show an actual error:



      INFO module.py:861] flex: "GET / HTTP/1.1" 503 59



      Is it possible to dispatch urls from GAE Standard Environments to a Flex environment and have it route from its designated port to the desired port needed? I would think this is possible as Google App Engine's Doc specifies it is possible to mix the environments together. I've also attempted to solve this by forcing docker to run on port 8084 but the ports can't be shared.










      share|improve this question













      Using Google App Engine Standard Python 2.7, I have a path in my dispatch.yaml to specify all urls of type "*/flex/*" to route to the flex service.



      dispatch.yaml
      dispatch:



      - url: '*/flex/*'
      module: flex


      The flex environment is a custom python 3.7 runtime which is executed normally using:



      python dev_appserver.py flex.yaml --custom_entrypoint="docker run -p 9090:8080 flex_app".



      With other services in my environment, I attempt to launch a dev environment with the command:
      python dev_appserver.py dispatch.yaml default.yaml sync.yaml task.yaml flex.yaml --custom_entrypoint="docker run -p 9090:8080 flex_app" --port=8080 --skip_sdk_update_check"



      However, when this starts, it starts assigning local ip addresses to each service when I need the flex service to be accessed from port 9090.



      Example server output:



      INFO     devappserver2.py:278] Skipping SDK update check.
      INFO dispatcher.py:223] Starting dispatcher running at: http://0.0.0.0:8080
      INFO dispatcher.py:256] Starting module "default" running at: http://0.0.0.0:8081
      INFO dispatcher.py:256] Starting module "sync" running at: http://0.0.0.0:8082
      INFO dispatcher.py:256] Starting module "task" running at: http://0.0.0.0:8083
      INFO dispatcher.py:256] Starting module "flex" running at: http://0.0.0.0:8084


      I am able to successfully access the flex app if I hit the URL localhost:9090. However, if I access localhost:8084 or localhost:8080/flex/, I receive the error:



      503 - This request has timed out.



      The server logs reflect this but do not show an actual error:



      INFO module.py:861] flex: "GET / HTTP/1.1" 503 59



      Is it possible to dispatch urls from GAE Standard Environments to a Flex environment and have it route from its designated port to the desired port needed? I would think this is possible as Google App Engine's Doc specifies it is possible to mix the environments together. I've also attempted to solve this by forcing docker to run on port 8084 but the ports can't be shared.







      python google-app-engine google-app-engine-python






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 13 '18 at 7:29









      crossfuse999crossfuse999

      508




      508
























          2 Answers
          2






          active

          oldest

          votes


















          1














          Found this by looking in dev_appserver.py --help. Turns out the answer to this was simply changing the custom_entrypoint to the command docker run -p {port}:8080 flex_app and this would automatically forward GAE's randomly assigned port to the docker instance.



          --custom_entrypoint CUSTOM_ENTRYPOINT
          specify an entrypoint for custom runtime modules. This
          is required when such modules are present. Include
          "{port}" in the string (without quotes) to pass the
          port number in as an argument.





          share|improve this answer































            0














            The development server can only be used for the 1st generation standard environment apps, it doesn't work with flexible apps, see How to use Python 3 with Google App Engine's Local Development Server.



            I think your attempt just ends up running the service as a standard environment one, not a flexible one (chances of it running correctly are pretty slim).



            To run correctly you'd have to drop it from the local dev_server execution. Cross-service links to the flexible service would need some sort of hack locally to use the 9090 port (via env variables or simply some hardcoded values), you won't be able to use the dispatch.yaml routing in this case (since the local devserver won't know about the flexible service's existence).






            share|improve this answer





















            • This actually ran fine and I added the solution I found to have both GAE Flex and Standard to work seamlessly.
              – crossfuse999
              Nov 13 '18 at 16:52










            • Hm, good to know this is changing, Not yet documented. And I guess the server figures out which is the flex_app service mentioned in --custom_entrypoint from the flex.yaml file. I guess I need to play with this a bit :)
              – Dan Cornilescu
              Nov 13 '18 at 17:43











            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',
            autoActivateHeartbeat: false,
            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%2f53275902%2froute-url-to-gae-flex-server-while-rest-of-site-runs-on-gae-standard%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









            1














            Found this by looking in dev_appserver.py --help. Turns out the answer to this was simply changing the custom_entrypoint to the command docker run -p {port}:8080 flex_app and this would automatically forward GAE's randomly assigned port to the docker instance.



            --custom_entrypoint CUSTOM_ENTRYPOINT
            specify an entrypoint for custom runtime modules. This
            is required when such modules are present. Include
            "{port}" in the string (without quotes) to pass the
            port number in as an argument.





            share|improve this answer




























              1














              Found this by looking in dev_appserver.py --help. Turns out the answer to this was simply changing the custom_entrypoint to the command docker run -p {port}:8080 flex_app and this would automatically forward GAE's randomly assigned port to the docker instance.



              --custom_entrypoint CUSTOM_ENTRYPOINT
              specify an entrypoint for custom runtime modules. This
              is required when such modules are present. Include
              "{port}" in the string (without quotes) to pass the
              port number in as an argument.





              share|improve this answer


























                1












                1








                1






                Found this by looking in dev_appserver.py --help. Turns out the answer to this was simply changing the custom_entrypoint to the command docker run -p {port}:8080 flex_app and this would automatically forward GAE's randomly assigned port to the docker instance.



                --custom_entrypoint CUSTOM_ENTRYPOINT
                specify an entrypoint for custom runtime modules. This
                is required when such modules are present. Include
                "{port}" in the string (without quotes) to pass the
                port number in as an argument.





                share|improve this answer














                Found this by looking in dev_appserver.py --help. Turns out the answer to this was simply changing the custom_entrypoint to the command docker run -p {port}:8080 flex_app and this would automatically forward GAE's randomly assigned port to the docker instance.



                --custom_entrypoint CUSTOM_ENTRYPOINT
                specify an entrypoint for custom runtime modules. This
                is required when such modules are present. Include
                "{port}" in the string (without quotes) to pass the
                port number in as an argument.






                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Nov 13 '18 at 16:58

























                answered Nov 13 '18 at 16:51









                crossfuse999crossfuse999

                508




                508

























                    0














                    The development server can only be used for the 1st generation standard environment apps, it doesn't work with flexible apps, see How to use Python 3 with Google App Engine's Local Development Server.



                    I think your attempt just ends up running the service as a standard environment one, not a flexible one (chances of it running correctly are pretty slim).



                    To run correctly you'd have to drop it from the local dev_server execution. Cross-service links to the flexible service would need some sort of hack locally to use the 9090 port (via env variables or simply some hardcoded values), you won't be able to use the dispatch.yaml routing in this case (since the local devserver won't know about the flexible service's existence).






                    share|improve this answer





















                    • This actually ran fine and I added the solution I found to have both GAE Flex and Standard to work seamlessly.
                      – crossfuse999
                      Nov 13 '18 at 16:52










                    • Hm, good to know this is changing, Not yet documented. And I guess the server figures out which is the flex_app service mentioned in --custom_entrypoint from the flex.yaml file. I guess I need to play with this a bit :)
                      – Dan Cornilescu
                      Nov 13 '18 at 17:43
















                    0














                    The development server can only be used for the 1st generation standard environment apps, it doesn't work with flexible apps, see How to use Python 3 with Google App Engine's Local Development Server.



                    I think your attempt just ends up running the service as a standard environment one, not a flexible one (chances of it running correctly are pretty slim).



                    To run correctly you'd have to drop it from the local dev_server execution. Cross-service links to the flexible service would need some sort of hack locally to use the 9090 port (via env variables or simply some hardcoded values), you won't be able to use the dispatch.yaml routing in this case (since the local devserver won't know about the flexible service's existence).






                    share|improve this answer





















                    • This actually ran fine and I added the solution I found to have both GAE Flex and Standard to work seamlessly.
                      – crossfuse999
                      Nov 13 '18 at 16:52










                    • Hm, good to know this is changing, Not yet documented. And I guess the server figures out which is the flex_app service mentioned in --custom_entrypoint from the flex.yaml file. I guess I need to play with this a bit :)
                      – Dan Cornilescu
                      Nov 13 '18 at 17:43














                    0












                    0








                    0






                    The development server can only be used for the 1st generation standard environment apps, it doesn't work with flexible apps, see How to use Python 3 with Google App Engine's Local Development Server.



                    I think your attempt just ends up running the service as a standard environment one, not a flexible one (chances of it running correctly are pretty slim).



                    To run correctly you'd have to drop it from the local dev_server execution. Cross-service links to the flexible service would need some sort of hack locally to use the 9090 port (via env variables or simply some hardcoded values), you won't be able to use the dispatch.yaml routing in this case (since the local devserver won't know about the flexible service's existence).






                    share|improve this answer












                    The development server can only be used for the 1st generation standard environment apps, it doesn't work with flexible apps, see How to use Python 3 with Google App Engine's Local Development Server.



                    I think your attempt just ends up running the service as a standard environment one, not a flexible one (chances of it running correctly are pretty slim).



                    To run correctly you'd have to drop it from the local dev_server execution. Cross-service links to the flexible service would need some sort of hack locally to use the 9090 port (via env variables or simply some hardcoded values), you won't be able to use the dispatch.yaml routing in this case (since the local devserver won't know about the flexible service's existence).







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Nov 13 '18 at 10:42









                    Dan CornilescuDan Cornilescu

                    27.7k113162




                    27.7k113162












                    • This actually ran fine and I added the solution I found to have both GAE Flex and Standard to work seamlessly.
                      – crossfuse999
                      Nov 13 '18 at 16:52










                    • Hm, good to know this is changing, Not yet documented. And I guess the server figures out which is the flex_app service mentioned in --custom_entrypoint from the flex.yaml file. I guess I need to play with this a bit :)
                      – Dan Cornilescu
                      Nov 13 '18 at 17:43


















                    • This actually ran fine and I added the solution I found to have both GAE Flex and Standard to work seamlessly.
                      – crossfuse999
                      Nov 13 '18 at 16:52










                    • Hm, good to know this is changing, Not yet documented. And I guess the server figures out which is the flex_app service mentioned in --custom_entrypoint from the flex.yaml file. I guess I need to play with this a bit :)
                      – Dan Cornilescu
                      Nov 13 '18 at 17:43
















                    This actually ran fine and I added the solution I found to have both GAE Flex and Standard to work seamlessly.
                    – crossfuse999
                    Nov 13 '18 at 16:52




                    This actually ran fine and I added the solution I found to have both GAE Flex and Standard to work seamlessly.
                    – crossfuse999
                    Nov 13 '18 at 16:52












                    Hm, good to know this is changing, Not yet documented. And I guess the server figures out which is the flex_app service mentioned in --custom_entrypoint from the flex.yaml file. I guess I need to play with this a bit :)
                    – Dan Cornilescu
                    Nov 13 '18 at 17:43




                    Hm, good to know this is changing, Not yet documented. And I guess the server figures out which is the flex_app service mentioned in --custom_entrypoint from the flex.yaml file. I guess I need to play with this a bit :)
                    – Dan Cornilescu
                    Nov 13 '18 at 17:43


















                    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%2f53275902%2froute-url-to-gae-flex-server-while-rest-of-site-runs-on-gae-standard%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







                    Popular posts from this blog

                    Xamarin.iOS Cant Deploy on Iphone

                    Glorious Revolution

                    Dulmage-Mendelsohn matrix decomposition in Python