Skip to content

A repository to pull up the needed infrastructure for the entrainment Oculus game.

License

Notifications You must be signed in to change notification settings

RC-7/entrainmentInfrastructure

Repository files navigation

entrainmentInfrastructure

aws bash docker go linux matlab pandas python qt scikit_learn seaborn tensorflow unity unity

Description

This repository consists of several aspects of code needed to run an entrainment experiment using AWS and an Oculus Quest 2.

The repository is divided into different directories:

  • lambda_functions: Lambda functions deployed to AWS that allow the experiment to be run. Deployment is handled by Terraform and Docker.
  • data: Encloses Data analysis and meta analysis methods used to clean and analyse data recorded using a power and connectivity analysis. participant_info.py files are required to specify participant information of recorded data.
    • Further, it holds data recorded using the custom suite developed. This is not on the repository.
    • Holds code to plot figures from meta analysis methods run on data.
    • Holds results of data analysis once run on recorded data.
  • testing_interface: Holds code used for testing interface of experiment. This encompasses code to record data from a Gtec HIAmp using the API, Machine Learning code to use Q learning that learns an optimal policy to control the entrainment stimulus and all other aspects required to run the experiment which includes GUI and other interfaces used to run the experiment.
  • runners: Code to wrap docker and terraform commands assisting in running and deploying the experiment.
  • tst: Code used to test various aspects of the system including the AWS infrastructure.
  • Dockerfile: Docker file for experiment

Using the Runner

Runner's allow easier actions for terraform and docker. From the runner's directory run:

Description Command
To deploy terraform changes (will create a docker image if needed) python runner.py --f tf --a apply
To pull down infrastructure python runner.py --f tf --a destroy
Further terraform based commands are possible: validate, fmt, apply, plan, state, destroy, init using the following python runner.py --f tf --a command
Create the Docker image. Images can be experiment_setup_only (setting up the experiment Terraform) or , experiment_complete (running the experiment) python runner.py --f docker --a build -t targeted image
Delete a Docker image python runner.py --f docker --a delete -t targeted image

General workflows:

  • tst directory has an eeg_device_testing.py file that is useful to record data from the gtec device without using a GUI.
  • Infrusture has been designed to work with the correpsonding game developed in Unity for the Oculus Quest 2. The code for this should be in the same directory as this project and can be found at OculusEntrainment.
  • data_analysis_runner.py is the first point of entry for analysis and running analysis workflows. meta_analysis_runner.py runs a meta analysis on power and connecitivity analysis applied in the data analysis runner.

Note: Auth lambda emails participants who have been authenticated to identify themselves. The Email password will be stored in AWS Secrets Manager. This step needs to be completed via the console. Currently, it is an env variable that needs to be manually set for the Lambda. This has been done for the privacy of AWS Secrets Manager.

TODO:

  • Rework the participant_info system to hold information around participant data recorded.
  • Improve explanation of different aspects of the code base.
  • Clean code.
  • Update pythonPackages.txt file.
  • Commit finished GUI from local files.

About

A repository to pull up the needed infrastructure for the entrainment Oculus game.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published