概要
microclimateは今年の3から4月ごろICP2.1に導入し触っていたが、以降は気になりつつも触る機会がなかった。あれから8ヶ月経過して、改めて触ってみようと思い、まずはローカルに入れて動かしてみた。(できたら、続編でICP等にHelmで導入して動かしたい。)
2018年4月に試行された方の参考情報が以下。
Microclimateローカル版でアプリケーションの開発を試す
環境
- Microclimate 18.12
- Ubuntu 17.10
- Docker 17.12.0-ce
- docker-compose 1.8.0
- git 2.14.1
作業ログ
前提条件の確認
下記を参考にした。(以降に抜粋した情報は2018/12/26現在の情報)
Installing Microclimate locally
- Linux or MacOS, on x86_64 architecture only
- The downloaded Microclimate compressed file
- Git
- Docker Version 17.06 minimum
- Docker Compose
- On Linux, follow the post-installation steps to run Docker as a non-root user.
- You must be connected to the internet to perform this task. Microclimate downloads software for creating and configuring your environment.
インストール実行
作業ステップ
- ファイルをダウンロードし展開し、ディレクトリーに移動する
- 導入スクリプトを実行する
- Microclimateを始動する
- ライセンスに同意する
ファイルをダウンロードし展開し、ディレクトリーに移動する
$ ls -la microclimate-18.12.zip
-rw-r--r-- 1 nykym nykym 557443 Dec 26 04:43 microclimate-18.12.zip
$ unzip microclimate-18.12.zip
(略)
$ ls
microclimate-18.12
$ cd microclimate-18.12/
$
導入スクリプトを実行する
nykym@mydocker:~/microclimate-18.12$ cd cli/
nykym@mydocker:~/microclimate-18.12/cli$ ls -la install.sh
-rwxr-xr-x 1 nykym nykym 9871 Dec 14 12:13 install.sh
nykym@mydocker:~/microclimate-18.12/cli$
nykym@mydocker:~/microclimate-18.12/cli$ sudo ./install.sh
******************************************************
** **
** Running Microclimate installer **
** **
******************************************************
Running Microclimate CLI uninstaller.
Microclimate has been uninstalled.
Step 1: Create workspace directory
Creating the '/home/nykym/microclimate-workspace' directory (your workspace).
Verifying the workspace has been created successfully.
'/home/nykym/microclimate-workspace' directory exists.
Checking the workspace permissions.
'/home/nykym/microclimate-workspace' directory permissions correct.
Step 2: Create config directory
Creating the '/home/nykym/microclimate-workspace/.config' directory (your workspace).
Verifying the workspace has been created successfully.
'/home/nykym/microclimate-workspace/.config' directory exists.
Checking the config permissions.
'/home/nykym/microclimate-workspace/.config' directory permissions correct.
Step 3: Save Git config
Git config will be located at in:
'/home/nykym/microclimate-workspace/.config/git.config'
'/home/nykym/microclimate-workspace/.config/git.config' file exists.
Removing to overwrite the data.
Adding username and email address.
Note: If no Github username or password is given, Microclimate will use its defaults.
Git username will be: Hanako Yamada
Git email address will be: hanako@example.com
Verifying Git setup has executed successfully.
'/home/nykym/microclimate-workspace/.config/git.config' file exists.
Moving Microclimate files.
Step 4: Making microclimate directory at '/home/nykym/.microclimate'
Microclimate directory made in '/home/nykym/.microclimate'.
Step 5: Copying 'mcdev' to '/home/nykym/.microclimate'
Successfully copied to '/home/nykym/.microclimate'.
Step 6: Copying 'docker-compose.yaml' to '/home/nykym/.microclimate'
Successfully copied 'docker-compose.yaml' to '/home/nykym/.microclimate'.
Step 7: Copying 'dockerfiles' to '/home/nykym/.microclimate'
Successfully copied 'dockerfiles' to '/home/nykym/.microclimate'.
Step 8: Pulling the latest websphere-liberty
Pulling the latest websphere-liberty:webProfile7 docker image
Successfully pulled the latest liberty docker image
Step 9: Pre-building the Liberty app image
Successfully pre-built the liberty app image
Step 10: Pre-building the Spring app image
Successfully pre-built the spring app image
Step 11: Copying '.env' to '/home/nykym/.microclimate'
Successfully copied '.env' to '/home/nykym/.microclimate'.
Step 12: Adding workspace location to '.env' file.
Successfully added workspace location to '.env' file.
Step 13: Adding Microclimate to path.
mcdev symlinked to 'usr/local/bin' and is now on path.
=====================
INSTALLATION COMPLETE
Microclimate has been successfully installed.
Run 'mcdev start' to start microclimate.
nykym@mydocker:~/microclimate-18.12/cli$
Microclimateを始動する
PATHに/home/<user_name>/.microclimate/mcdev
を追加
$ vi ~/.profile
$ source ~/.profile
Microclimateを開始する(初回はイメージのpullで時間がかかる。GUI無しの環境で-oオプションを指定したため最後にオプションが有効でないことを指摘するコメントが出力されている。更にConnection Poolの警告あり。)
nykym@mydocker:~$ mcdev start -o
Starting Microclimate
Creating network "microclimate_network" with the default driver
Pulling microclimate-theia (ibmcom/microclimate-theia-amd64:1812)...
1812: Pulling from ibmcom/microclimate-theia-amd64
32802c0cfa4d: Pull complete
da1315cffa03: Pull complete
fa83472a3562: Pull complete
f85999a86bef: Pull complete
57137032f10b: Pull complete
3918f9dc0ce5: Pull complete
4163b2edddc2: Pull complete
0f39b98a939a: Pull complete
4b2451b53e70: Pull complete
6c15ab0cb330: Pull complete
fd91a1e585b9: Pull complete
f04a2ee6b974: Pull complete
64ff1a91b9ee: Pull complete
1b2e857eb136: Pull complete
6b056ad2699f: Pull complete
21a53d128541: Pull complete
c376fdfe9a39: Pull complete
c57ca215d32f: Pull complete
5927f9e60979: Pull complete
Digest: sha256:82426be8badc911378a4ebca297ee97e7d2a20508a54e831dcf57907b494e971
Status: Downloaded newer image for ibmcom/microclimate-theia-amd64:1812
Pulling microclimate-loadrunner (ibmcom/microclimate-loadrunner-amd64:1812)...
1812: Pulling from ibmcom/microclimate-loadrunner-amd64
4fe2ade4980c: Pull complete
eeb7d76f44e7: Pull complete
e35f88fcc259: Pull complete
cbc7b3658d12: Pull complete
226909114120: Pull complete
e501a2bce312: Pull complete
19abbd36031e: Pull complete
91503d0555ec: Pull complete
Digest: sha256:65c2e9178ea6f0a923ef48c33d9097e81ddc50ca9f7deba2e431baf77b34b990
Status: Downloaded newer image for ibmcom/microclimate-loadrunner-amd64:1812
Pulling microclimate-file-watcher (ibmcom/microclimate-file-watcher-amd64:1812)...
1812: Pulling from ibmcom/microclimate-file-watcher-amd64
4fe2ade4980c: Already exists
eeb7d76f44e7: Already exists
e35f88fcc259: Already exists
483b9ebefdec: Pull complete
eb7808f9f95a: Pull complete
b5824d420a67: Pull complete
b0c9d1ad9f53: Pull complete
e196a3c9c142: Pull complete
37e63626f091: Pull complete
cba155916598: Pull complete
405945ce4fbf: Pull complete
46af77449d30: Pull complete
a1908370b568: Pull complete
840f040310bf: Pull complete
81cbdc672122: Pull complete
64ae1dbf2dd0: Pull complete
8ca07eaa76c7: Pull complete
068d50fa8939: Pull complete
da0c169924f2: Pull complete
eca6fe078595: Pull complete
90abafa531f8: Pull complete
d1c16d22fa37: Pull complete
8a870bb6a5cb: Pull complete
30e6b345aee2: Pull complete
Digest: sha256:c15adb17dda018e1675d07a336e7000d4c18714e7b8b949dff4eb11994c3e671
Status: Downloaded newer image for ibmcom/microclimate-file-watcher-amd64:1812
Pulling microclimate-portal (ibmcom/microclimate-portal-amd64:1812)...
1812: Pulling from ibmcom/microclimate-portal-amd64
4fe2ade4980c: Already exists
eeb7d76f44e7: Already exists
e35f88fcc259: Already exists
499ce22c0be8: Pulling fs layer
eef03d3847b3: Pulling fs layer
7641043f0bfc: Pulling fs layer
bb424ad81826: Pull complete
e841a9c40460: Pull complete
2e3563530feb: Pull complete
3d5b7c7a83e8: Pull complete
30277ddee602: Pull complete
723908bb716e: Pull complete
0ecb4d611d3e: Pull complete
875b3e9febfa: Pull complete
c2b0c2648d5b: Pull complete
280e00a4430c: Pull complete
1aec9ce8436e: Pull complete
b7e5fd5ee142: Pull complete
202dc37f4a5c: Pull complete
c58a3066c1a1: Pull complete
a012ac6da191: Pull complete
03b6d818ad17: Pull complete
87a4df0b3431: Pull complete
3d5a828a6eaf: Pull complete
490489f002ed: Pull complete
f12d894d0841: Pull complete
f46d4a11a473: Pull complete
01d2774ef7d2: Pull complete
fd51a775a227: Pull complete
Digest: sha256:61815ecc152ffff863548caa0009612493d74d60f751244d73e927ab5e0060bd
Status: Downloaded newer image for ibmcom/microclimate-portal-amd64:1812
Creating microclimate-theia
Creating microclimate-file-watcher
Creating microclimate-loadrunner
WARNING: Connection pool is full, discarding connection: localhost
Creating microclimate-portal
Microclimate has been started at http://localhost:9090
No display detected. The command 'mcdev start -o' is not available.
nykym@mydocker:~$
コンテナの起動状況を見てみる。
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e02d958387e5 ibmcom/microclimate-portal-amd64:1812 "npm start" 3 minutes ago Up 3 minutes 127.0.0.1:9090->9090/tcp microclimate-portal
42afc03ada51 ibmcom/microclimate-theia-amd64:1812 "./start.sh" 3 minutes ago Up 3 minutes 127.0.0.1:4191->4191/tcp microclimate-theia
cf326e070697 ibmcom/microclimate-loadrunner-amd64:1812 "npm start" 3 minutes ago Up 3 minutes 127.0.0.1:9092->9092/tcp microclimate-loadrunner
0c1dc1c8ded3 ibmcom/microclimate-file-watcher-amd64:1812 "/scripts/root-watch…" 3 minutes ago Up 3 minutes 127.0.0.1:9091->9091/tcp microclimate-file-watcher
$
Ubuntu Desktopをインストールして、もう一度、始動してみる。
$ mcdev start -o
Starting Microclimate
Creating network "microclimate_network" with the default driver
Creating microclimate-file-watcher
Creating microclimate-loadrunner
Creating microclimate-theia
Creating microclimate-portal
Microclimate has been started at http://localhost:9090
Waiting for Microclimate to start
Waiting for Microclimate to start
Waiting for Microclimate to start
Waiting for Microclimate to start
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
75402316dea7 ibmcom/microclimate-portal-amd64:1812 "npm start" 2 minutes ago Up About a minute 127.0.0.1:9090->9090/tcp microclimate-portal
abe341e9c8d0 ibmcom/microclimate-loadrunner-amd64:1812 "npm start" 2 minutes ago Up 2 minutes 127.0.0.1:9092->9092/tcp microclimate-loadrunner
f820b906e2c3 ibmcom/microclimate-file-watcher-amd64:1812 "/scripts/root-watch…" 2 minutes ago Up 2 minutes 127.0.0.1:9091->9091/tcp microclimate-file-watcher
$
ライセンスに同意する
-oオプションを指定しているため、ブラウザーが自動で立ち上がりmicroclimateのポータル画面が開く。初回のアクセス時にはライセンスの同意画面が表示される。利用規約を確認の上、同意する。
ライセンスに同意すると、製品の利用状況を分析するための情報収集について確認を求められる。任意のオプションを指定し(今回はNo)[Done]をクリック。
新規プロジェクト作成、もしくは、プロジェクトのインポートを行うメニューが表示される。
動作確認
プロジェクトの作成
(補足)microclimateのドキュメントとしては以下がある。
https://microclimate-dev2ops.github.io/creatingaproject#doc
先ほどの画面で[New project]を選択すると、作成するプロジェクトで利用する開発言語の選択画面が表示される。(4月時点よりもサポート対象が増えている。)
今回はNode.jsを選択。
画面をスクロールし、プロジェクト名を入力し、[Next]をクリック。
プロジェクトで利用したいServiceを選択する画面が表示される。まずは特に指定せずに[Create]でプロジェクトの作成処理を進める。
作成したプロジェクトの確認
pipelineは作成した直後では未構成。手動で構成する必要がある。
下記のWorkaroundを参考に再起動すると表示されるようになった。
Edit code view does not show
https://microclimate-dev2ops.github.io/troubleshooting#editing-your-project
以上。