Using Elixir on Google Cloud Platform - google-app-engine

Does anyone know if it's possible to use Elixir on Google Cloud Platform? Specifically I'd like to know how to deploy an app to App Engine, and how to access the Cloud Storage API.

No custom runtime required any more. Elixir is supported natively on Google Cloud Platform: https://cloud.google.com/elixir/
Quickstart dock: https://cloud.google.com/community/tutorials/elixir-phoenix-on-google-app-engine/
Check this community-tutorial on how to
Create an OTP release for your app using Distillery
Wrap your app release in a Docker image
Deploy your app on Google Kubernetes Engine
Phoenix/Elixir on Google Cloud
Accessing the Cloud Storage API is preferably done via JSON nowadays. Without more information I provide more customized information; see the Google Cloud Storage JSON API for more info.

Use a custom runtime in the App Engine flexible environment to use an
alternative implementation of Java, Python, Node.js, or Go, or write
code in any other language.
Source: https://cloud.google.com/appengine/docs/flexible/custom-runtimes/
Config application for Google App Engine. See https://cloud.google.com/appengine/docs/flexible/custom-runtimes/
Use Dockerfile for Elixir (https://elixir-lang.org/), pick one of these:
https://hub.docker.com/search/?isAutomated=0&isOfficial=0&page=1&pullCount=0&q=elixir&starCount=0
Deploy Dockerfile to Google App engine.
Use Google Cloud Storage JSON API to interactive with Google Cloud storage service by Elixir code via JSON:
https://cloud.google.com/storage/docs/json_api/

Related

Why can't I deploy a React app to Google Cloud Storage?

In the past when I've created a client-side web app using a framework like React, I can create a browser build and push it to a static hosting platform like AWS S3.
For Google Cloud Platform, it seems like the go-to approach is to deploy it to App Engine. If I'm understanding correctly, GAE is a combination of storage and compute resources.
Why can't I simply host the JavaScript app as prepared by webpack?
Google Cloud Storage (GCS) would be the way to go to host your static website on Google Cloud Platform (GCP). Notice that in order to use GCS you'll need to have a domain as well as a GCP project. The documentation is very straightforward on how to achieve this. Here you can find some examples and other useful information.
You could also host your static website on Google App Engine (GAE). But in this case you'll need to cleverly build your app.yaml file in order to manage your URL handlers, as well as structuring your project in a particular way. Simply uploading the JS app as prepared by webpack won't work. You can find all the useful information here in order to use GAE to host your static website.

Is it possible to implement create a web project in Spring Boot + Datastore?

I'm currently new to web developing and right now I started with a Spring Boot application which I converted to standard App Engine project. I'm wondering if it is possible to not convert my Spring Boot application to my App Engine project and still use Datastore as database?
Yes, it's possible to use the Cloud Datastore from an app in the GAE flexible environment, from outside GAE or even from outside the Google Cloud. From Cloud Datastore (emphasis mine):
You can access Cloud Datastore from anywhere using the Cloud
Datastore API. Use the Google Cloud client libraries to store and
retrieve data from Cloud Datastore.
The same Cloud Datastore data is available regardless of if you use
the App Engine libraries, the Google Cloud client libraries, or call
the API directly.
But you can't use the GAE Standard Environment Client Libraries, you have to use either the Cloud Datastore Client Libraries or the Cloud Datastore API v1.
Potentially of interest: the Deploying to the App Engine Flexible Environment guide happens to use a spring boot app as example.

Is it possible to use the appengine/datastore package on the GAE flex environment?

There are two different datastore packages for Google App Engine:
google.golang.org/appengine/datastore and cloud.google.com/go/datastore.
The documentation for the appengine/datastore package uses the standard environment while the documentation for the cloud package uses the flex environment.
I have a Go application which uses the appengine/datastore package on the standard GAE environment. If I want to migrate this application from the standard environment to the flex environment do I need to switch to the cloud.google.com/go/datastore package, or can I continue using the appengine/datastore package? If not, why not?
You need to migrate to cloud.google.com/go/datastore.
From Migrating Services from the Standard Environment to the Flexible Environment:
The App Engine flexible environment does not provide the API libraries
present in the App Engine SDK. If you decide to migrate your
application from the App Engine standard environment to the flexible
environment, you must update your code to use services and APIs
that are available across all Google Cloud Platform environments.
And from Cloud Datastore:
You can access Google Cloud Datastore from anywhere using the
Cloud Datastore API. Use the Google Cloud client libraries to
store and retrieve data from Cloud Datastore.
The same Cloud Datastore data is available regardless of if you use
the App Engine libraries, the Google Cloud client libraries, or call
the API directly.
At this time ORM libraries that available in the standard environment
such as ndb and Objectify are not supported outside of the
standard environment.
For more information, see the following guide:
Using Cloud Datastore

Using Amazon SDK on Google App Engine

We are using amazon sdk for sns push notifications. We deployed our app on Google App engine. While using amazon sdk we are getting following exception
Could not initialize class com.amazonaws.ClientConfiguration
at com.amazonaws.services.sns.AmazonSNSClient.<init>(AmazonSNSClient.java:128)
Looks like is it because of Sockets/Threads using by Amazon SDK.
Is there anyway to use amazon sdk on google app engine application.
Which App Engine environment are you using? (standard or flex). App Engine standard may require the use of the Sockets API or UrlFetch for outbound connections, which won't always work with open source libraries (today).
One option here is to deploy your app to App Engine Flexible, which won't have the same requirements.

Using Google App Engine services outside of uploaded application

I am looking to use Google Cloud Storage services outside of launching a google app engine application. My application is designed for running on a hosted server of our own, and I would like to still use the cloud storage service.
I've written a dev app that did this, and ran it with dev_appserver.py in the python GAE framework. It seems the dev_appserver.py is necessary as it fills in how to perform the RPC functions the cloud storage provides.
Is there a way to easily use google cloud storage service without the rest of it?
There is gsutil command line tool:
https://developers.google.com/storage/docs/gsutil
There is an xml/json restful service all at:
https://developers.google.com/storage/index
You'll need to enable the google cloud storage on the google console at:
https://code.google.com/apis/console/ and get the necessary api keys.

Resources