November 16, 2021

Open Response Assessment (ORA) Using MinIO as Storage in Open edX

Activities, Android Developer, Ansible, Apache2, Atlassian, Ayo Belajar Linux, Bestpath Network, BLC Telkom Klaten, BSD, Caddy Server, Case Study, Cisco, Cisco Indonesia, Cloud Computing, Cockpit, Custom Weapons, Docker, E-Learning, Engenius, Error, FreeBSD, FreeBSD Indonesia, Komunitas Pengguna Linux Indonesia, KPLI Bulukumba, KPLI Klaten, Lets Encrypt, Linux, MacOS, Microsoft Azure, Microsoft SQL Server, MikroTik, MikroTik Indonesia, MySQL, Nginx, Open edX, OpenSID, Others, PHP, phpMyAdmin, PostgreSQL, Proxmox, Python, Redash, Sendy, SSH, Stories, Subnetting, TP-Link, Ubiquiti, Unix, Virtualization, Windows, X-Mosque, Faizar Septiawan, Icar, siBunglonGanteng, Orang Ganteng, siBunglonLabs, Programmer, SysAdmin, Site Reliability Engineer, Developer, Palugada, Makassar, Ganteng, Gila, Cyclist, Panglima, Setan, Panglima Setan, sibunglon, Ganteng

Usually, someone use Amazon S3 as storage for Open edX course content and services (eg, storage for grades, video transcript, etc.). But this article just share how to set MinIO as storage for ORA instead use Amazon S3. Do the following steps.

  1. Setup AWS auth (/edx/app/edxapp/lms.auth.json or /edx/etc/lms.yml).

    Find the following snippet codes on the configuration file.

    ...
    AWS_ACCESS_KEY_ID: null
    AWS_S3_CUSTOM_DOMAIN: SET-ME-PLEASE (ex. bucket-name.s3.amazonaws.com)
    AWS_SECRET_ACCESS_KEY: null
    AWS_STORAGE_BUCKET_NAME: SET-ME-PLEASE (ex. bucket-name)
    FILE_UPLOAD_STORAGE_BUCKET_NAME: SET-ME-PLEASE (ex. bucket-name)
    ...
    

    Change the value, set with your MinIO credentials. See sample conf on my env.

    ...
    AWS_ACCESS_KEY_ID: 'AKIATICAB5RS6HFGB7OR'
    AWS_S3_CUSTOM_DOMAIN: minio-dev.sibunglon.com:9090/devx
    AWS_SECRET_ACCESS_KEY: 'F2ZW5I+sGOZeBVFRMJQkNIPmovF97OfWmU6xj63x'
    AWS_STORAGE_BUCKET_NAME: devx
    FILE_UPLOAD_STORAGE_BUCKET_NAME: devx
    ...
    
  2. Update backend of file upload ORA s3.

    For ironwood version or older : /edx/app/edxapp/venvs/edxapp/lib/python2.7/site-packages/openassessment/fileupload/backends/s3.py

    For juniper version or newer : /edx/app/edxapp/venvs/edxapp/lib/python3.5/site-packages/openassessment/fileupload/backends/s3.py

    Find the following snippet codes on the configuration file.

    ...
        return boto.connect_s3(
            aws_access_key_id=aws_access_key_id,
            aws_secret_access_key=aws_secret_access_key
        )
    ...
    

    Update it looks like the configuration below.

    ...
        return boto.connect_s3(
            aws_access_key_id=aws_access_key_id,
            aws_secret_access_key=aws_secret_access_key,
    				host='minio-dev.sibunglon.com',
    				port=9090,
    				is_secure=False, # set to True if your run MinIO with SSL
    				calling_format=boto.s3.connection.OrdinaryCallingFormat()
        )
    ...
    
  3. Restart LMS service and tried to upload file on ORA component.