I am trying to get the columns from the custom_reg_form_extrainfo (this table I have it in my database thanks to the plugin custom_reg_form_plugin==0.1.0) throw another plugin called cairn but every time I try I get this error.
Cairn is not connecting directly to the MySQL database of your Open edX instance. Instead, the data from MySQL is pulled into a Clickhouse database and the data visualisation tool (superset) is connected to that database.
To get access to the additional table you have two options:
Creat a live view inside clickhouse (migration of data from MySQL to clickhouse), see “Adding data to your data lake”.
Connect superset to your MySQL instance. This method is not recommended, as your instance grows this can cause performance issues if your Open edX services and cairn are competing for resources to use the same database.
We created the migrations inside the migrations.d folder indicated above.
We installed it with pip install -e ourpluginname and then enabled it with tutor plugins enabled ourpluginname. Finally, after performing tutor local quickstart the migrations did not run.
We have not tried the second option because we want the plugin running so in the future we can create new migrations easily.
We updated Cairn to the 12.0.12 version, but upon activating our plugin and running a quickstart, we receive a message from the cairn-clickhouse that our migration cannot be copied to the cairn-clickhouse volume as it is read only.
This is the error: Error response from daemon: OCI runtime create failed: container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: rootfs_linux.go:76: mounting "/root/.local/share/tutor/env/plugins/our_plugin_name/apps/migrations.d/0001_custom_form_extra_info.sql" to rootfs at "/etc/clickhouse-server/migrations.d/0001_custom_form_extra_info.sql" caused: open /var/lib/docker/overlay2/a532c9a7ebf2ea64b1f65d60eee9e6cb86c24fba234b95db5cf1b4d31ddf3b9a/merged/etc/clickhouse-server/migrations.d/0001_custom_form_extra_info.sql: read-only file system: unknown
If we try to manually add the file to the clickhouse container, we receive the following error: Error response from daemon: mounted volume is marked read-only
Just to clarify, we have created the plugin as specified on the cairn documentation section “Adding data to your data lake”. After checking the docker-compose.yml file, we found out that the volume is in fact read only: ../plugins/cairn/apps/clickhouse/migrations.d/:/etc/clickhouse-server/migrations.d/:ro. In the docker-compose.jobs.yml we find this line: ../plugins/our_plugin_name/apps/migrations.d/0001_custom_form_extra_info.sql:/etc/clickhouse-server/migrations.d/0001_custom_form_extra_info.sql:ro.
Thanks for your feedback @Andress. This is probably a bug due to the way we bind-mount custom migrations inside the containers. Can you please manually modify the file in $(tutor config printroot)/env/local/docker-compose.jobs.yml such that the following line: