Skip to content

Commit b3f7210

Browse files
authored
Merge pull request #34 from RCOSDP/release-v3.0
v3.0のリリース
2 parents 0b4ca1e + 1e3b8e5 commit b3f7210

587 files changed

Lines changed: 8624 additions & 23773 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ moodle.sql
77
caliper_log/data/*
88
open_lrw/data/*
99
xapi_stmt_gen/log/*
10-
elcampus_la/xapi_stmt_gen/log/*
11-
superset_db/data/*
10+
learning_analytics_db/data/*
11+
superset-db/data/*
1212
metabase/*
13-
**/.DS_Store
13+
**/.DS_Store

README.adoc

Lines changed: 74 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
:lang: ja
33
:source-highlighter: rouge
44
:author: 国立情報学研究所
5-
:revdate: 2020年10月12日
6-
:revnumber: 2.0.0版
5+
:revdate: 2022年1月20日
6+
:revnumber: 3.0.0版
77
:doctype: book
88
:version-label:
99
:chapter-label:
@@ -39,7 +39,6 @@ $ git clone https://github.com/RCOSDP/LAaaS-docker.git
3939
* `moodle-docker` の設定で `MOODLE_DOCKER_DBUSER` および `POSTGRES_USER` を `moodleuser` に変更( `moodle-docker/base.yml` )
4040
* Moodleの設定でMoodleデータベースのテーブル名に付与する接頭辞を `mdl_` に変更( `moodle-docker/moodle/config.php` )
4141
* Moodleのコンテナ群を起動
42-
* xAPIステートメント変換スクリプトでイベントの処理状況を管理するためのテーブル( `xapi_records_processed` )を作成
4342

4443
----
4544
$ cd LAaaS-docker
@@ -69,18 +68,19 @@ image::moodle.png[align=center]
6968
次のコンテナを起動する。
7069

7170
|===
72-
|項目 |名称 |コンテナ名
73-
.5+|学習活動のデータストア|Learning Locker(Web) |learninglocker
74-
.2+|Learning Locker(DB) |learninglocker_mongo
75-
|learninglocker_redis
76-
|OpenLRW(Web) |openlrw_web
77-
|OpenLRW(DB) |openlrw_mongo
78-
.3+|ステートメント変換 |xAPIステートメント変換 |xapi_stmt_gen
79-
|Caliperステートメント変換 |caliper_stmt_gen
80-
|Caliperステートメント変換(db) |caliper_log_db
81-
.4+|分析システム |Superset(Web) |superset
82-
|Superset(DB) |superset_db
83-
|JupyterHub(Web/DB) |jupyterhub
71+
|項目 |名称 |コンテナ名
72+
.5+|学習活動のデータストア|Learning Locker(Web) |learninglocker
73+
.2+|Learning Locker(DB) |learninglocker_mongo
74+
|learninglocker_redis
75+
|OpenLRW(Web) |openlrw_web
76+
|OpenLRW(DB) |openlrw_mongo
77+
.4+|ステートメント変換 |xAPIステートメント変換 |xapi_stmt_gen
78+
|Caliperステートメント変換 |caliper_stmt_gen
79+
|Caliperステートメント変換(db) |caliper_log_db
80+
|Learning Analytics DB |learning_analytics_db
81+
.3+|分析システム |Superset(Web) |superset
82+
|Superset(DB) |superset-db
83+
|JupyterHub(Web/DB) |jupyterhub
8484
|===
8585

8686
----
@@ -137,50 +137,36 @@ image::learninglocker/add-new-lrs.png[align=center]
137137
[[learninglocker_client_settings]]
138138
==== クライアント情報の設定
139139
サイドメニューの `Settings>Clients` から `New xAPI store client` を選択する。
140-
`Overall Scopes` の `All` にチェックを入れ、LRSとして事前に作成したLRSを指定する
140+
`Overall Scopes` の `API All` にチェックを入れ、 `LRS (optional)` に上記で作成したLRSを指定する
141141

142142
image::learninglocker/new-xapi-store-client.png[align=center]
143143

144144
<<<
145145
=== xAPIステートメント変換スクリプトの設定
146-
`xapi_stmt_gen` コンテナに接続する。
147-
148-
----
149-
$ docker exec -it xapi_stmt_gen bash
150-
----
151-
152146
スクリプトの設定ファイルを編集する。
153147

154-
./usr/local/src/xapi_stmt_gen/config/app.js
148+
.xapi_stmt_gen/xapi_stmt_gen/config/app.js
155149
[source, javascript]
156150
----
157151
const config = {
158152
159153
LRS:{
160-
url:'http://<learning-locker-container-ip-address>:8081/data/xAPI/', // <1>
154+
...
161155
clients:{
162156
// LRS client
163157
'default':{
164-
user:'<xapi-store-client-key>', // <2>
165-
pass:'<xapi-store-client-secret>' // <2>
158+
user:'<xapi-store-client-key>', // <1>
159+
pass:'<xapi-store-client-secret>' // <1>
166160
},
167161
168162
----
169-
<1> `LRS.url` はLearning Lockerのクライアント情報として表示される `xAPI Endpoint` とは異なる
170-
<2> <<learninglocker_client_settings>>で確認したLRSのクライアント情報を設定
163+
<1> <<learninglocker_client_settings>>で確認したLRSのクライアント情報を設定
171164

172-
なお、 `<learning-locker-container-ip-address>` は以下の方法で確認することができる
165+
設定ファイルの変更を `xapi_stmt_gen` コンテナに反映する
173166

174167
----
175-
$ docker inspect learninglocker
176-
...
177-
"NetworkSettings": {
178-
...
179-
"Networks": {
180-
"moodle-docker_default": {
181-
...
182-
"IPAddress": "xxx.xxx.xxx.xxx",
183-
...
168+
$ docker-compose build xapi_stmt_gen
169+
$ docker-compose up -d xapi_stmt_gen
184170
----
185171

186172
<<<
@@ -198,13 +184,13 @@ image::learninglocker/source.png[align=center]
198184
なお、Moodleログの処理済み件数を算出する場合は以下のコマンドを実行する。
199185

200186
----
201-
$ docker exec -it moodle-docker_db_1 psql -U moodleuser moodle -c "SELECT count(*) FROM xapi_records_processed;"
187+
$ docker exec -it learning_analytics_db psql -U learning_analytics learning_analytics -c "SELECT count(*) FROM xapi_records_processed;"
202188
----
203189

204190
また、スクリプトのバージョンアップ等に伴い処理済みのMoodleログを再度処理したい場合は、以下のコマンドで変換処理の実行履歴を削除する。
205191

206192
----
207-
$ docker exec -it moodle-docker_db_1 psql -U moodleuser moodle -c "DELETE FROM xapi_records_processed;"
193+
$ docker exec -it learning_analytics_db psql -U learning_analytics learning_analytics -c "DELETE FROM xapi_records_processed;"
208194
----
209195

210196
<<<
@@ -328,6 +314,13 @@ $ docker-compose exec openlrw_mongo bash
328314

329315
<<<
330316
=== Supersetの設定
317+
==== データベースの初期設定
318+
以下のコマンドを実行し、データベースの初期設定を行う。
319+
320+
----
321+
$ docker-compose exec superset /init.sh
322+
----
323+
331324
==== ログイン
332325
Superset( http://localhost:8088 )にアクセスし、Adminユーザでログインする(Username: `admin` 、Password: `admin` )。
333326

@@ -353,7 +346,7 @@ image::superset/xapi/list-databases.png[align=center]
353346
[%noheader, cols="1,3"]
354347
|===
355348
|Databases |learninglocker
356-
|SQLAlchemy URI |postgresql://postgres@superset_db:5432/learninglocker
349+
|SQLAlchemy URI |postgresql://postgres@superset-db:5432/learninglocker
357350
|Expose in SQL Lab|チェック
358351
|===
359352

@@ -395,6 +388,17 @@ image::superset/xapi/added-xapi-statements.png[align=center]
395388
<<<
396389
`xapi_statements` テーブルを選択し、Learning Lockerに登録済みのステートメント件数が取得できることを確認する。
397390

391+
.xAPIステートメントの件数をカウントする例
392+
[cols="30%,30%,40%"]
393+
|===
394+
|大項目 |小項目 |設定値
395+
|Datasource & Chart Type |Visualization Type |`Table View`
396+
.3+|Time |Time Column |`stored`
397+
|Since |`∞` (指定なし)
398+
|Until |`∞` (指定なし)
399+
|GROUP BY |Metric |`COUNT(*)`
400+
|===
401+
398402
image::superset/xapi/count-xapi-statements.png[align=center]
399403

400404
<<<
@@ -412,7 +416,7 @@ image::superset/caliper/list-databases.png[align=center]
412416
[%noheader, cols="1,3"]
413417
|===
414418
|Database |openlrw
415-
|SQLAlchemy URI |postgresql://postgres@superset_db:5432/openlrw
419+
|SQLAlchemy URI |postgresql://postgres@superset-db:5432/openlrw
416420
|Expose in SQL Lab|チェック
417421
|===
418422

@@ -454,6 +458,17 @@ image::superset/caliper/added-caliper-statements.png[align=center]
454458
<<<
455459
`caliper_statements` テーブルを選択し、OpenLRWに登録済みのステートメント件数が取得できることを確認する。
456460

461+
.Caliperステートメントの件数をカウントする例
462+
[cols="30%,30%,40%"]
463+
|===
464+
|大項目 |小項目 |設定値
465+
|Datasource & Chart Type |Visualization Type |`Table View`
466+
.3+|Time |Time Column |`event.eventTime`
467+
|Since |`∞` (指定なし)
468+
|Until |`∞` (指定なし)
469+
|GROUP BY |Metric |`COUNT(*)`
470+
|===
471+
457472
image::superset/caliper/count-caliper-statements.png[align=center]
458473

459474
<<<
@@ -505,10 +520,10 @@ JupyterHubにログインし、ノートブック「link:jupyterhub/notebooks/im
505520
image::jupyterhub/import-analysis-result-to-superset.png[align=center]
506521

507522
<<<
508-
`superset_db` コンテナ上に登録された分析結果は以下のコマンドで参照することができる。
523+
`superset-db` コンテナ上に登録された分析結果は以下のコマンドで参照することができる。
509524

510525
----
511-
$ docker exec -it superset_db psql jupyter -c "SELECT * FROM <tablename>;"
526+
$ docker exec -it superset-db psql jupyter -c "SELECT * FROM <tablename>;"
512527
513528
index | object.definition.description.en |object.id | timestamp
514529
--------+--------------------------------------------+------------------------------+---------------------------
@@ -523,7 +538,7 @@ Superset上で上記テーブルが格納されたjupyterデータベースを
523538
[%noheader, cols="1,3"]
524539
|===
525540
|Database |jupyter
526-
|SQLAlchemy URI |postgresql://postgres@superset_db:5432/jupyter
541+
|SQLAlchemy URI |postgresql://postgres@superset-db:5432/jupyter
527542
|Expose in SQL Lab|チェック
528543
|===
529544

@@ -541,11 +556,23 @@ image::superset/jupyter/add-jupyter-analysis-result.png[align=center]
541556

542557
image::superset/jupyter/added-jupyter-analysis-result.png[align=center]
543558

544-
グループ列、フィルター列、時刻列の指定などはテーブルの設定から必要に応じて行うこと
559+
グループ列、フィルター列、時刻列の指定などはテーブルの設定(テーブル名左横の `Edit record` から `List Columns` タブを選択)から必要に応じて行うこと
545560

546561
image::superset/jupyter/edit-jupyter-analysis-result.png[align=center]
547562

548563
<<<
549564
JupyterHubで加工したステートメントが可視化できることを確認すること。
550565

551-
image::superset/jupyter/visualize-jupyter-analysis-result.png[align=center]
566+
.ノートブックの実行結果を可視化する例
567+
[cols="30%,30%,40%"]
568+
|===
569+
|大項目 |小項目 |設定値
570+
|Datasource & Chart Type |Visualization Type |`Distribution - Bar Chart`
571+
.3+|Time |Time Column |`timestamp`
572+
|Since |`∞` (指定なし)
573+
|Until |`∞` (指定なし)
574+
.2+|Query |Metric |`COUNT(*)`
575+
|Series |`object.id`
576+
|===
577+
578+
image::superset/jupyter/visualize-jupyter-analysis-result.png[align=center, scaledwidth=90%]

bin/moodle_install

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,3 @@ sed -i.org -e "s/MOODLE_DOCKER_DBUSER: moodle/MOODLE_DOCKER_DBUSER: moodleuser/"
1313
sed -i.org -e "s/$CFG->prefix = 'm_';/$CFG->prefix = 'mdl_';/" moodle/config.php
1414

1515
$BIN_DIR/moodle_start
16-
17-
docker cp $REPO_DIR/xapi_stmt_gen/create_xapi_records_processed.sql moodle-docker_db_1:/
18-
docker exec -it moodle-docker_db_1 psql -f create_xapi_records_processed.sql -U moodleuser moodle

bin/moodle_start

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@ REPO_DIR=$(dirname $BIN_DIR)
66

77
export MOODLE_DOCKER_WWWROOT=$REPO_DIR/moodle-docker/moodle
88
export MOODLE_DOCKER_DB=pgsql
9+
export MOODLE_DOCKER_PHP_VERSION=7.2
910
$REPO_DIR/moodle-docker/bin/moodle-docker-compose up -d
1011
$REPO_DIR/moodle-docker/bin/moodle-docker-wait-for-db

caliper/.env

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@ DB_LOG_DATABASE=caliper_log
1111
DB_LOG_USERNAME=caliper_cli
1212
DB_LOG_PASSWORD=caliper
1313

14+
DB_EPPN=false
15+
DB_EPPN_HOST=<eppn_host_name>
16+
DB_EPPN_DATABASE=<eppn_db_name>
17+
DB_EPPN_USERNAME=<eppn_username>
18+
DB_EPPN_PASSWORD=<eppn_password>
19+
1420
APP_NAME=moodle
21+
APP_URL='http://localhost:8000'
1522

1623
OPENLRW_HOST='openlrw:9966/key/caliper'

caliper/.env.testing

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,14 @@ DB_USERNAME=caliper_test
66
DB_PASSWORD=''
77

88
APP_NAME='RCOS LRS'
9+
APP_URL='https://test.example.com'
910

1011
DB_LOG_DATABASE=caliper_log_test
1112
DB_LOG_USERNAME=caliper_log_test
1213
DB_LOG_PORT=5432
1314

15+
DB_EPPN_DATABASE=eppn_test
16+
DB_EPPN_USERNAME=eppnuser_test
17+
DB_EPPN_PORT=5432
18+
1419
OPENLRW_HOST='localhost:9966/key/caliper'

caliper/Dockerfile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
FROM composer:1.9 AS builder
2+
3+
LABEL version="2.2.0"
4+
25
WORKDIR /stage
36
COPY . .
47
RUN composer install --no-dev && \
58
composer build
9+
WORKDIR tenantcreator
10+
RUN composer install --no-dev
611

712
FROM php:7.3-alpine AS runtime
813
WORKDIR /app
@@ -14,7 +19,7 @@ RUN apk update &&\
1419
pgsql pdo_pgsql\
1520
mbstring &&\
1621
docker-php-ext-enable pdo pdo_pgsql pdo_mysql
17-
COPY --from=builder /stage/builds/caliper-cli /app
22+
COPY --from=builder /stage /app
1823

1924
ENTRYPOINT [ "/app/caliper-cli" ]
20-
CMD ["generate"]
25+
CMD ["generate"]

0 commit comments

Comments
 (0)