LoginSignup
17
18

More than 5 years have passed since last update.

Google Cloud Developer Shell αスタート

Last updated at Posted at 2015-06-05

GCPのコンソールってちょいちょいアップデートかかるんだけども
今日の機能追加は、いい感じだったのでQiitaに起こしてみる。

GCPのほとんどのサービスに関しては、最近cliの一本化が進んでおりgcloudコマンドで大抵のことが出来るようになっている。

ただgcloudコマンドをローカルにインストールしたり、複数のプロジェクトを使わけていたりする場合に若干運用がたるいなぁという時があった。

GCPのコンソール上では、アクセスログ見たり課金状態見たりのが主な利用方法で、具体的な操作はCi上からやローカルのコマンドから行うのが通例だったけども、今日のアップデートで一部運用が変わるかもしれない。

API_ライブラリ_-_chaos.png

コンソール左上に、ナゾのアイコンが追加になっている。

ポチッとすると

App_Engine_のバージョン_-_chaos.png

どうやら「Webから簡単に使えるよ。あるふぁー版だよ、しばし無料だよ」というDialogがでる。さらにポチッと

API_ライブラリ_-_chaos.png

ドーンッ! コンソールの下にDevToolみたいにTerminalが開いて、gcloudコマンドが使えるようになってる。

仕組み的には、見ないGCE領域にVMが1台上がってgcloudコマンド等がインストールされており。コンソールにログインしたユーザーで当該プロジェクトにアサインされた状態で使用可能となっている。

ローカルのリソースがいらない場合には、ここからやるのが便利そう。

ドキュメント

各種情報

$ uname -a
Linux dev-con-cloud-devshell-6656 3.16.0-0.bpo.4-amd64 #1 SMP Debian 3.16.7-ckt9-3~deb8u1~bpo70+1 (2015-04-27) x86_64 GNU/Linux
# ps -ef
UID        PID  PPID  C STIME TTY          TIME CMD
root         1     0  0 12:09 ?        00:00:00 /bin/bash /google/scripts/onrun.sh sleep infinity
root        10     1  0 12:09 ?        00:00:00 /usr/sbin/rsyslogd
root       121     1  0 12:09 ?        00:00:00 /usr/bin/docker -d -p /var/run/docker.pid
root       192     1  0 12:09 ?        00:00:00 /usr/sbin/sshd -p 22 -o AuthorizedKeysCommand=/google/devshell/authorized_keys.sh -o Authorize
root       198     1  0 12:09 ?        00:00:00 cron
root       223     1  0 12:09 ?        00:00:00 /usr/bin/python /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf
root       226     1  0 12:09 ?        00:00:00 sleep infinity
root       227   192  0 12:10 ?        00:00:00 sshd: atusi [priv]                                                                            
root       232   223  0 12:10 ?        00:00:00 /google/workspace-sync/ws-daemon -start -credential_helper=/google/credentials/get_creds.sh
root       233   223  0 12:10 ?        00:00:00 python /google/credentials/credential_service.py
atusi      244   227  0 12:10 ?        00:00:00 sshd: atusi@pts/0                                                                             
atusi      245   244  0 12:10 pts/0    00:00:00 /bin/bash --login
root       431   245  0 12:25 pts/0    00:00:00 sudo -s
root       432   431  0 12:25 pts/0    00:00:00 /bin/bash
root       437   432  0 12:26 pts/0    00:00:00 ps -ef
$ top
top - 12:26:04 up 15:57,  1 user,  load average: 0.09, 0.06, 0.05
Tasks:  15 total,   1 running,  14 sleeping,   0 stopped,   0 zombie
%Cpu(s):  2.0 us,  0.3 sy,  0.0 ni, 97.7 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem:    608496 total,   522400 used,    86096 free,    98012 buffers
KiB Swap:        0 total,        0 used,        0 free.   248832 cached Mem
  PID USER      PR  NI    VIRT    RES    SHR S %CPU %MEM     TIME+ COMMAND                                                                    
    1 root      20   0   20056   2888   2608 S  0.0  0.5   0:00.02 bash                                                                       
   10 root      20   0  258664   2596   2108 S  0.0  0.4   0:00.00 rsyslogd                                                                   
  121 root      20   0  190720  14520  12336 S  0.0  2.4   0:00.13 docker                                                                     
  192 root      20   0   55164   2844   2184 S  0.0  0.5   0:00.00 sshd                                                                       
  198 root      20   0   25892   2164   1936 S  0.0  0.4   0:00.00 cron                                                                       
  223 root      20   0   46880  12536   3876 S  0.0  2.1   0:00.13 supervisord                                                                
  226 root      20   0    4228    664    588 S  0.0  0.1   0:00.00 sleep                                                                      
  227 root      20   0   82668   5788   4940 S  0.0  1.0   0:00.01 sshd                                                                       
  232 root      20   0   47152  11480  10212 S  0.0  1.9   0:00.01 ws-daemon                                                                  
  233 root      20   0  108816  11728   6172 S  0.0  1.9   0:00.31 python                                                                     
  244 atusi     20   0   82668   4464   3608 S  0.0  0.7   0:00.06 sshd                                                                       
  245 atusi     20   0   23736   5800   3440 S  0.0  1.0   0:00.09 bash                                                                       
  431 root      20   0   40524   3484   3100 S  0.0  0.6   0:00.00 sudo                                                                       
  432 root      20   0   21892   3740   3208 S  0.0  0.6   0:00.00 bash                                                                       
17
18
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
17
18