Hosting a website and program Google Cloud Platform?

705 views
Skip to first unread message

Wolfram Volpi

unread,
Mar 6, 2017, 3:58:46 PM3/6/17
to Google Cloud Developers
I have developed a program that runs on my local PC, and would like to host the program online so that others may use it.
This is my first time using a cloud API and need some advice on project feasibility and which tools to use.

Here is how the program is to be used online:
    The user writes two files in Google Sheets in their Google Drive account.
    The user writes two files in Google Docs in their Google Drive account.
    The user enters the four files' URLs into my website.
    The program then -
        reads the two Google Sheets files as commas-separated values (.csv)
        reads the two Google Doc files as text (.txt)
        does some processing
        and outputs four C++ text files:
            file1.h
            file2.h
            file3.h
            sketch.ino
        uses Arduinio to compile the above 4 files, which outputs one executable file:
            file.hex
    The user downloads the 5 files.

The program has been tested on my PC; now I want to migrate it to a website.
Maybe "Google Cloud Platform" could host the website and have access to the user's Google Sheets and Google Docs files.
"Google Cloud Platform" has a vast array of services but I don't know where to begin.
What Google services would be useful for this project?

Thank you.

My background: 
C++, Bash, Linux.  Years ago I wrote sites with Coldfusion, html and SQL.
I use gsutil to make backups to Google Cloud Storage.

George (Cloud Platform Support)

unread,
Mar 7, 2017, 12:57:48 PM3/7/17
to google-c...@googlegroups.com

Hello Wolfram,


Google Cloud Platform definitely can host your web site. You have a wealth of choices at your disposal. The one option that requires least code change is simply using a virtual machine offered by the Google Computer Engine to host your OS and application. This option has the advantage that your operating system and the programming language used to create your ap on your PC do not have to change. The “Invoking Legacy Code on Google Cloud Platform” documentation page covers this case in some detail.


Access to your stored files uses the Google Drive API; you may find more details in the "Google Drive APIs" document.


At the other extreme, you may consider re-coding your application completely, let’s say in Java (other languages are available as well), and deploying it in the app engine standard environment. All necessary steps are covered in the “Quickstart for App Engine Standard Environment for Java” documentation page. The re-coding touches your above paragraphs starting with “how the program is to be used online”. These steps do not include the Arduino part, that should remain unchanged.


The app engine standard environment is more constrained and involved, so you may prefer the flexible environment in the end, that offers more choices with respect to the programming languages available. A comparison, in support of your decision, can be read in the “Choosing an App Engine Environment” document.


If you decide, after reading the pros and cons laid out in the above document, to adopt the flexible environment, an easy to follow howto start guide is available through the “Quickstart for Java in the App Engine Flexible Environment” documentation item.


You may choose to look at a more involving introductory example titled “Bookshelf App for Java on App Engine Standard Environment”.


Hoping the above information proves of help to you, I remain at your disposal for eventual more in-depth questions.

Alex Martelli

unread,
Mar 7, 2017, 2:20:55 PM3/7/17
to George (Cloud Platform Support), Google Cloud Developers
Hi George,

I agree that a virtual machine from GCE is likely the simplest way to "lift and shift" a legacy workload onto GCP. I also agree that App Engine (once the code is rewritten in a supported language, such as Java, Python, Go) would offer advantages via the "fully managed" nature of App Engine, but, App Engine does not supply, to the best of my knowledge, a way to perform the step "uses Arduinio to compile", which, I believe, involves running the Arduino compiler in a separate process (App Engine does not allow spawning separate processes).

So, GCE would appear to be the platform of choice for this task. One more caveat is about running the operating system of choice: for simplicity, the OS to run under GCE should be picked among the supported "images" listed at https://pantheon.corp.google.com/compute/images?_ga=1.226336410.1416047412.1481760212&pli=1&project=google.com:stackex&organizationId=433637338589 (several versions of Linux distributions and Windows Server -- some, in particular the Windows versions, require extra expenditure for licensing). It is possible to build and run a "custom image", but it's nowhere as simple as running a supported one.


Alex


On Tue, Mar 7, 2017 at 9:57 AM, 'George (Cloud Platform Support)' via Google Cloud Developers <google-c...@googlegroups.com> wrote:

Hello Wolfram,


Google Cloud Platform definitely can host your web site. You have a wealth of choices at your disposal. The one option that requires least code change is simply using a virtual machine offered by the Google Computer Engine to host your OS and application. This option has the advantage that your operating system and the programming language used to create your ap on your PC do not have to change. The “Invoking Legacy Code on Google Cloud Platform” documentation page covers this case in some detail.


At the other extreme, you may consider re-coding your application completely, let’s say in Java (other languages are available as well), and deploying it in the app engine standard environment. All necessary steps are covered in the “Quickstart for App Engine Standard Environment for Java” documentation page. The re-coding touches your above paragraphs starting with “how the program is to be used online”. These steps do not include the Arduino part, that should remain unchanged.


The app engine standard environment is more constrained and involved, so you may prefer the flexible environment in the end, that offers more choices with respect to the programming languages available. A comparison, in support of your decision, can be read in the “Choosing an App Engine Environment” document.


If you decide, after reading the pros and cons laid out in the above document, to adopt the flexible environment, an easy to follow howto start guide is available through the “Quickstart for Java in the App Engine Flexible Environment” documentation item.


Hoping the above information proves of help to you, I remain at your disposal for eventual more in-depth questions.

--
You received this message because you are subscribed to the Google Groups "Google Cloud Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-dev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-dev/7a13d7ac-ff7e-4294-aa04-16c8c35b46fb%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Sachin Kotwani

unread,
Mar 7, 2017, 2:46:09 PM3/7/17
to Alex Martelli, George (Cloud Platform Support), Google Cloud Developers
Just realized that my initial response didn't go to the entire list, so here it goes. Another option I'd recommend is packaging the app in a Docker container. It makes it easier to test on your local machine and then just deploy the container on a Compute Engine VM.

Depending on how "production-ready" and how much traffic you expect, the answer may vary. Also, have you already written a web server or is that something you plan to do as part of moving the app to the cloud?

Here are a few options I can think of:

Compute Engine: Get a Google Compute Engine VM and do whatever you'd be doing on your local machine but on a cloud-based machine. You can get a VM running Windows or one of many flavors of Linux. This is "the DIY way". The next two options will make your life easier.

App Engine: Write the whole thing as an App Engine app. You can use App Engine Standard or App Engine Flex. It would be best to rewrite the app in one of the supported languages, however. App Engine Standard is very well suited to quick development of web applications without having to worry about infrastructure. It doesn't support C++ modules, however. App Engine Flex allows any language using custom containers, but that would be a steeper learning curve than using App Engine Standard.

- Containerize the application: If you can get the application running on a Linux system you can containerize it into a Docker image, and then deploy the image in the cloud. The "correct" way of doing this is to create a Dockerfile that defines the container, installs any needed dependency, sets up the environment, downloads source code or artifacts, conducts any necessary builds. You would then build a Docker image from the Dockerfile, and finally run an container instance of the image. Another way of going about this (though much more hacky and definitely not following software development best practices) is to create a Docker container, access the container, develop inside the container, save the container, and run the container. You can then deploy the container image to Google Container Engine, or run it manually on any machine or VM that has the Docker runtime installed.

On Tue, Mar 7, 2017 at 11:20 AM, 'Alex Martelli' via Google Cloud Developers <google-c...@googlegroups.com> wrote:
Hi George,

I agree that a virtual machine from GCE is likely the simplest way to "lift and shift" a legacy workload onto GCP. I also agree that App Engine (once the code is rewritten in a supported language, such as Java, Python, Go) would offer advantages via the "fully managed" nature of App Engine, but, App Engine does not supply, to the best of my knowledge, a way to perform the step "uses Arduinio to compile", which, I believe, involves running the Arduino compiler in a separate process (App Engine does not allow spawning separate processes).

So, GCE would appear to be the platform of choice for this task. One more caveat is about running the operating system of choice: for simplicity, the OS to run under GCE should be picked among the supported "images" listed at https://pantheon.corp.google.com/compute/images?_ga=1.226336410.1416047412.1481760212&pli=1&project=google.com:stackex&organizationId=433637338589 (several versions of Linux distributions and Windows Server -- some, in particular the Windows versions, require extra expenditure for licensing). It is possible to build and run a "custom image", but it's nowhere as simple as running a supported one.


Alex


On Tue, Mar 7, 2017 at 9:57 AM, 'George (Cloud Platform Support)' via Google Cloud Developers <google-cloud-dev@googlegroups.com> wrote:

Hello Wolfram,


Google Cloud Platform definitely can host your web site. You have a wealth of choices at your disposal. The one option that requires least code change is simply using a virtual machine offered by the Google Computer Engine to host your OS and application. This option has the advantage that your operating system and the programming language used to create your ap on your PC do not have to change. The “Invoking Legacy Code on Google Cloud Platform” documentation page covers this case in some detail.


At the other extreme, you may consider re-coding your application completely, let’s say in Java (other languages are available as well), and deploying it in the app engine standard environment. All necessary steps are covered in the “Quickstart for App Engine Standard Environment for Java” documentation page. The re-coding touches your above paragraphs starting with “how the program is to be used online”. These steps do not include the Arduino part, that should remain unchanged.


The app engine standard environment is more constrained and involved, so you may prefer the flexible environment in the end, that offers more choices with respect to the programming languages available. A comparison, in support of your decision, can be read in the “Choosing an App Engine Environment” document.


If you decide, after reading the pros and cons laid out in the above document, to adopt the flexible environment, an easy to follow howto start guide is available through the “Quickstart for Java in the App Engine Flexible Environment” documentation item.


Hoping the above information proves of help to you, I remain at your disposal for eventual more in-depth questions.

--
You received this message because you are subscribed to the Google Groups "Google Cloud Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-dev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-dev/7a13d7ac-ff7e-4294-aa04-16c8c35b46fb%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Google Cloud Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-dev+unsubscribe@googlegroups.com.

Alex Martelli

unread,
Mar 7, 2017, 3:20:53 PM3/7/17
to Sachin Kotwani, George (Cloud Platform Support), Google Cloud Developers
Thanks Sachin, your points are very sensible indeed. However I would add that if you've never used Docker before, there may be an initial "learning curve" (which virtual machines don't have) for App Engine Flex or other container-based solution.  Also, same issue as I asked George about...: I'm not very familiar with Arduino, but doesn't the step "compile these four files with Arduino" require spawning a separate process to run the Arduino compiler? If that's indeed the case, how would you do it in App Engine Standard? I can't think of a way...

Thanks,

Alex

On Tue, Mar 7, 2017 at 11:45 AM, 'Sachin Kotwani' via Google Cloud Developers <google-c...@googlegroups.com> wrote:
Just realized that my initial response didn't go to the entire list, so here it goes. Another option I'd recommend is packaging the app in a Docker container. It makes it easier to test on your local machine and then just deploy the container on a Compute Engine VM.

Depending on how "production-ready" and how much traffic you expect, the answer may vary. Also, have you already written a web server or is that something you plan to do as part of moving the app to the cloud?

Here are a few options I can think of:

Compute Engine: Get a Google Compute Engine VM and do whatever you'd be doing on your local machine but on a cloud-based machine. You can get a VM running Windows or one of many flavors of Linux. This is "the DIY way". The next two options will make your life easier.

App Engine: Write the whole thing as an App Engine app. You can use App Engine Standard or App Engine Flex. It would be best to rewrite the app in one of the supported languages, however. App Engine Standard is very well suited to quick development of web applications without having to worry about infrastructure. It doesn't support C++ modules, however. App Engine Flex allows any language using custom containers, but that would be a steeper learning curve than using App Engine Standard.

- Containerize the application: If you can get the application running on a Linux system you can containerize it into a Docker image, and then deploy the image in the cloud. The "correct" way of doing this is to create a Dockerfile that defines the container, installs any needed dependency, sets up the environment, downloads source code or artifacts, conducts any necessary builds. You would then build a Docker image from the Dockerfile, and finally run an container instance of the image. Another way of going about this (though much more hacky and definitely not following software development best practices) is to create a Docker container, access the container, develop inside the container, save the container, and run the container. You can then deploy the container image to Google Container Engine, or run it manually on any machine or VM that has the Docker runtime installed.
Reply all
Reply to author
Forward
0 new messages