Newer
Older
pepper / README.md
@ikko ikko on 7 Jun 2021 6 KB Update README.md
### ROSでペッパーを動かすためのDockerイメージ

PepperのIPは、192.168.100.3で同じネットワーク内にこのDockerファイルを動かすサーバがある設定を仮定。
tiryoh/ros-desktop-vncをベースとしたDockerイメージを採用しています。
このイメージは、novncを採用しているため、ブラウザ経由と、ssh経由の両方からアクセス可能。
### Build 
```bash
> ./buildPEPPER.sh
```
最初のビルトで実行する場合、マシンスペックによるが、起動に時間がかかる。
これは、Dockerファイルは、マルチレイヤーでイメージが構成されているためである。
シングルレイヤーにするため、一度実行し、メモリに展開した状態で、再度キャプチャーし
シングルレイヤーのイメージを作る。
### Run Build Image
```bash
~/pepper$ ./runPEPPER.sh
* enable custom user: ubuntu
useradd: user 'ubuntu' already exists
  set default password to "ubuntu"
Please execute -> sudo apt install ros-kinetic-peper-meshes
2021-03-27 14:34:06,554 CRIT Supervisor running as root (no user in config file)
2021-03-27 14:34:06,554 WARN Included extra file "/etc/supervisor/conf.d/supervisord.conf" during parsing
2021-03-27 14:34:06,560 INFO RPC interface 'supervisor' initialized
2021-03-27 14:34:06,560 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2021-03-27 14:34:06,560 INFO supervisord started with pid 18
2021-03-27 14:34:07,563 INFO spawned: 'nginx' with pid 21
2021-03-27 14:34:07,564 INFO spawned: 'web' with pid 22
2021-03-27 14:34:07,565 INFO spawned: 'novnc' with pid 23
2021-03-27 14:34:07,567 INFO spawned: 'wm' with pid 24
2021-03-27 14:34:07,567 INFO spawned: 'pcmanfm' with pid 25
2021-03-27 14:34:07,568 INFO spawned: 'lxpanel' with pid 27
2021-03-27 14:34:07,569 INFO spawned: 'xvfb' with pid 28
2021-03-27 14:34:07,570 INFO spawned: 'x11vnc' with pid 30
2021-03-27 14:34:07,574 INFO exited: wm (exit status 1; not expected)
2021-03-27 14:34:07,648 INFO  Listening on http://localhost:6079 (run.py:87)
2021-03-27 14:34:08,566 INFO success: nginx entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-03-27 14:34:08,566 INFO success: web entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-03-27 14:34:08,566 INFO success: novnc entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-03-27 14:34:08,576 INFO spawned: 'wm' with pid 87
2021-03-27 14:34:08,576 INFO success: pcmanfm entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-03-27 14:34:08,576 INFO success: lxpanel entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-03-27 14:34:08,576 INFO success: xvfb entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-03-27 14:34:08,576 INFO success: x11vnc entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2021-03-27 14:34:10,570 INFO success: wm entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
127.0.0.1 - - [2021-03-27 14:34:17] "GET /api/health HTTP/1.0" 200 141 0.091562
127.0.0.1 - - [2021-03-27 14:34:47] "GET /api/health HTTP/1.0" 200 141 0.091615
```
### Export Image and Capture Rebuild Image
マルチレイヤ―イメージをメモリ展開し、コンテナがスタンバイ状態("GET /api/health HTTP/1.0" が表示される状態)になってから、
別ターミナルを開いてコンテナIDを調べる。コンテナIDを元に、docker イメージをキャプチャーし、シングルレイヤー化
(起動の高速化とイメージサイズの圧縮に効果あり)したイメージpepper-lite.tazを作る。
```
~/pepper$ ./exportPEPPER.sh
Open a new terminal and run . /runPEPPER.sh and wait until you see GET /api/health HTTP/1.0. Press enter key.
-------------------------
Current running docker ontainer id is
-------------------------
28a1487ec5d2
-------------------------
Make sure that only one container ID is running and after that press enter key to capture single layered container image to pepper-lite.taz.
~/pepper$
```
### Import Captured Image and Run
高速化した、イメージpepper-lite.tazをインポートし、実行する。
```bash
~/pepper$ ./importPEPPERLITE.sh
~/pepper$ ./runPEPPERLITE.sh
```
### Open
ブラウザ経由
```bash
http://docker_ip:6080
http://localhost:6080
```
### Ssh password is ubuntu
SSH経由
```bash
$ ssh ubuntu@docker_ip -p 2222
```

# Manegement

本レポジトリでは、GitHub flowに従います.
clone, push, pull, mergeの流れを説明しておきます。

## Clone
本レポジトリは、/home/kbknにcloneしてください。

```bash
cd /home/kbkn
git clone https://www.ikko-lab.k.hosei.ac.jp/gitbucket/git/ikko/pepper.git
```

## Branchを作成
masterブランチ直下に作業内容がわかるような、任意の名前のブランチを作成してください。
尚、以下の<hogehoge>には、任意のブランチ名が入ります。

```bash
git checkout maser
git checkout -b <hogehoge>
```
## Cording
```bash
git add .
git commit -m "fix bug"
```

開発してください。

## Push
自分で作成したブランチにPushしてください。

```bash
git push origin <hogehoge>
```
## Pull Request

https://www.ikko-lab.k.hosei.ac.jp/gitbucket/

Gitbucket上で、Pull Requestを作成してください。

Pull Requestの結果、

許可されたら(リーダが、masterブランチへmergeします。)
もし、開発が終了していなければ、再び手順3. へ。
開発が終了していれば、ブランチを削除してください。

```bash
git checkout master
git branch -d <hogehoge>
git push --delete origin <hogehoge>
```

許可されなかったら(GitHub上のPullRequestに、いちゃもんメッセージが付けられます。)
手順3. へ。頑張ってください。

Pull
手順5. が終わっている方のみ、Pullしてください。

```bash
git pull origin master
```
以上が、GitHub-flowの手順です。参考リンクにわかりやすいフローチャートがあります。ぜひ見てください。