<msys2, Google Cloud Platform> Linux版をいれてみた。

Google app engineだが、どうもWindows版はよくわからない。
msys2があるので、Linux版をいれてみた。

まずは、ここからtarボールを落とす。

https://cloud.google.com/sdk/docs/#linux

で、condaさんで、python2.7化しておく。

py27 % gunzip google-cloud-sdk-121.0.0-linux-x86_64.tar.gz

py27 % tar xvf google-cloud-sdk-121.0.0-linux-x86_64.tar

py27 % cd google-cloud-sdk/
bin/                 completion.zsh.inc  install.bat  lib/     path.bash.inc  platform/   README
completion.bash.inc  help/               install.sh*  LICENSE  path.zsh.inc   properties  RELEASE_NOTES

py27 % ./install.sh
Welcome to the Google Cloud SDK!

Do you want to help improve the Google Cloud SDK (Y/n)?

Your current Cloud SDK version is: 121.0.0
The latest available version is: 135.0.0


To help improve the quality of this product, we collect anonymized data on how
the SDK is used. You may choose to opt out of this collection now (by choosing
'N' at the below prompt), or at any time in the future by running the following
command:
    gcloud config set disable_usage_reporting true

+----------------------------------------------------------------------------------------------------------------+
|                                                   Components                                                   |
+------------------+------------------------------------------------------+--------------------------+-----------+
|      Status      |                         Name                         |            ID            |    Size   |
+------------------+------------------------------------------------------+--------------------------+-----------+
| Update Available | BigQuery Command Line Tool                           | bq                       |   < 1 MiB |
| Update Available | Cloud SDK Core Libraries                             | core                     |   5.1 MiB |
| Update Available | Cloud Storage Command Line Tool                      | gsutil                   |   2.8 MiB |
| Not Installed    | App Engine Go Extensions                             | app-engine-go            |  47.8 MiB |
| Not Installed    | Cloud Datastore Emulator                             | cloud-datastore-emulator |  15.4 MiB |
| Not Installed    | Cloud Datastore Emulator (Legacy)                    | gcd-emulator             |  38.1 MiB |
| Not Installed    | Cloud Pub/Sub Emulator                               | pubsub-emulator          |  16.3 MiB |
| Not Installed    | Google Container Registry's Docker credential helper | docker-credential-gcr    |   2.1 MiB |
| Not Installed    | gcloud Alpha Commands                                | alpha                    |   < 1 MiB |
| Not Installed    | gcloud Beta Commands                                 | beta                     |   < 1 MiB |
| Not Installed    | gcloud app Java Extensions                           | app-engine-java          | 124.4 MiB |
| Not Installed    | gcloud app PHP Extensions (Windows)                  | app-engine-php-windows   |  19.1 MiB |
| Not Installed    | gcloud app Python Extensions                         | app-engine-python        |   7.2 MiB |
| Not Installed    | kubectl                                              | kubectl                  |  16.0 MiB |
| Installed        | Default set of gcloud commands                       | gcloud                   |           |
+------------------+------------------------------------------------------+--------------------------+-----------+

To install or remove components at your current SDK version [121.0.0], run:
  $ gcloud components install COMPONENT_ID
  $ gcloud components remove COMPONENT_ID

To update your SDK installation to the latest version [135.0.0], run:
  $ gcloud components update

Update %PATH% to include Cloud SDK binaries? (Y/n)?
The installer is unable to automatically update your system PATH. Please add
  C:\msys64\home\Nekoyuki\google-cloud-sdk\bin
to your system PATH to enable easy use of the Cloud SDK Command Line Tools.


For more information on how to get started, please visit:
  https://cloud.google.com/sdk/#Getting_Started

ふーん、、、
Not Installedの項目がいくつかあるが、まあいいか、、、次をやる。
gcloud initをしろとあるので、やってみる。

py27 % ls
bin/                 completion.zsh.inc  install.bat  lib/     path.bash.inc  platform/   README
completion.bash.inc  help/               install.sh*  LICENSE  path.zsh.inc   properties  RELEASE_NOTES

py27 % cd bin/
bootstrapping/  bq*  dev_appserver.py*  gcloud*  git-credential-gcloud.sh*  gsutil*

py27 % ./gcloud init
which: no python2 in (/C/Anaconda3/envs/py27:/C/Anaconda3/envs/py27/Library/mingw-w64/bin:/C/Anaconda3/envs/py27/Library/u:/home/Nekoyuki/.zplug/bin:/c/\Program Files (x86)/Google/Chrome/Application:/c/Go/bin:/c/Anaconda3:/c/Anaconda3/Scripts:/usr/local/bin:/usr/bin:/bin:/opt/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl)
which: no python2.7 in (/C/Anaconda3/envs/py27:/C/Anaconda3/envs/py27/Library/mingw-w64/bin:/C/Anaconda3/envs/py27/Library:/home/Nekoyuki/.zplug/bin:/c/\Program Files (x86)/Google/Chrome/Application:/c/Go/bin:/c/Anaconda3:/c/Anaconda3/Scripts:/usr/local/bin:/usr/bin:/bin:/opt/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl)
Welcome! This command will take you through the configuration of gcloud.

Settings from your current configuration [default] are:
[core]
account = hagehage@gmail.com
disable_usage_reporting = False
Your active configuration is: [default]

なんか、コマンド待ちの状態で終わるので、Ctrl+Cで切る。
ちと、中を見てみたけど、よくわからないので、次をやってみる。

これ。quickstart
https://cloud.google.com/appengine/docs/python/quickstart

これに従いgitとして、dev_appserver.pyしたら次となった。

py27 % ~/google-cloud-sdk/bin/dev_appserver.py
This action requires the installation of components: [app-engine-
python]


Your current Cloud SDK version is: 121.0.0
Installing components from version: 121.0.0

+---------------------------------------------------------------------+
|                 These components will be installed.                 |
+----------------------------------------------+------------+---------+
|                     Name                     |  Version   |   Size  |
+----------------------------------------------+------------+---------+
| Cloud SDK Core Libraries (Platform Specific) | 2016.08.05 | < 1 MiB |
| Windows command line ssh tools               | 2016.05.13 | 1.8 MiB |
| gcloud app Python Extensions                 |     1.9.38 | 7.2 MiB |
+----------------------------------------------+------------+---------+


For the latest full release notes, please visit:
  https://cloud.google.com/sdk/release_notes

Do you want to continue (Y/n)?
#============================================================#
#= Creating update staging area                             =#
#============================================================#
#= Installing: Cloud SDK Core Libraries (Platform Specific) =#
#============================================================#
#= Installing: Windows command line ssh tools               =#
#============================================================#
#= Installing: gcloud app Python Extensions                 =#
#============================================================#
#= Creating backup and activating new installation          =#
#============================================================#

Performing post processing steps...
Performing post processing steps...done.

Update done!

Restarting command:
  $ dev_appserver.py

usage: dev_appserver.py [-h] [-A APP_ID] [--host HOST] [--port PORT]
                        [--admin_host ADMIN_HOST] [--admin_port ADMIN_PORT]
                        [--auth_domain AUTH_DOMAIN] [--storage_path PATH]
                        [--log_level {debug,info,warning,critical,error}]
                        [--max_module_instances MAX_MODULE_INSTANCES]
                        [--use_mtime_file_watcher [USE_MTIME_FILE_WATCHER]]
                        [--threadsafe_override THREADSAFE_OVERRIDE]
                        [--php_executable_path PATH]
                        [--php_remote_debugging [PHP_REMOTE_DEBUGGING]]
                        [--php_gae_extension_path PATH]
                        [--php_xdebug_extension_path PATH]
                        [--appidentity_email_address APPIDENTITY_EMAIL_ADDRESS]
                        [--appidentity_private_key_path APPIDENTITY_PRIVATE_KEY_PATH]
                        [--python_startup_script PYTHON_STARTUP_SCRIPT]
                        [--python_startup_args PYTHON_STARTUP_ARGS]
                        [--jvm_flag JVM_FLAG]
                        [--custom_entrypoint CUSTOM_ENTRYPOINT]
                        [--runtime RUNTIME] [--blobstore_path BLOBSTORE_PATH]
                        [--mysql_host MYSQL_HOST] [--mysql_port MYSQL_PORT]
                        [--mysql_user MYSQL_USER]
                        [--mysql_password MYSQL_PASSWORD]
                        [--mysql_socket MYSQL_SOCKET]
                        [--datastore_path DATASTORE_PATH]
                        [--clear_datastore [CLEAR_DATASTORE]]
                        [--datastore_consistency_policy {consistent,random,time}]
                        [--require_indexes [REQUIRE_INDEXES]]
                        [--auto_id_policy {sequential,scattered}]
                        [--logs_path LOGS_PATH]
                        [--show_mail_body [SHOW_MAIL_BODY]]
                        [--enable_sendmail [ENABLE_SENDMAIL]]
                        [--smtp_host SMTP_HOST] [--smtp_port SMTP_PORT]
                        [--smtp_user SMTP_USER]
                        [--smtp_password SMTP_PASSWORD]
                        [--smtp_allow_tls [SMTP_ALLOW_TLS]]
                        [--prospective_search_path PROSPECTIVE_SEARCH_PATH]
                        [--clear_prospective_search [CLEAR_PROSPECTIVE_SEARCH]]
                        [--search_indexes_path SEARCH_INDEXES_PATH]
                        [--clear_search_indexes [CLEAR_SEARCH_INDEXES]]
                        [--enable_task_running [ENABLE_TASK_RUNNING]]
                        [--allow_skipped_files [ALLOW_SKIPPED_FILES]]
                        [--api_port API_PORT]
                        [--automatic_restart [AUTOMATIC_RESTART]]
                        [--dev_appserver_log_level {debug,info,warning,critical,error}]
                        [--skip_sdk_update_check [SKIP_SDK_UPDATE_CHECK]]
                        [--default_gcs_bucket_name DEFAULT_GCS_BUCKET_NAME]
                        yaml_path [yaml_path ...]
dev_appserver.py: error: too few arguments

なるへそ。
Not Installの項目がインストールされた。

つうことで、再度、

py27 % ~/google-cloud-sdk/bin/dev_appserver.py .

して、ブラウザで、http://localhost:8080/アクセスしたら、Hello, World!がちゃんとでた。

おっけーかな?