-
Notifications
You must be signed in to change notification settings - Fork 0
Prerequisites
The following are prerequisites required for deployment the containerized server online. They are not required for offline deployment or for testing the server functionality.
ℹ️ Your institution may offer access to some of the particular resources below through their IT department. Alternatively, they may have their own partners or tools to assist you with setting up a server. Contact your IT department for further information.
This server utilizes Docker for containerization and will require a Docker-compatible host platform for deployment. Google Cloud Platform (GCP), Amazon Web Services (AWS), and Microsoft Azure are the three biggest cloud computing providers. Each provider has capability to deploy and manage Docker containers. There are two primary strategies that can be taken to deploy Docker containers using these providers:
- Deployment via a Docker resource pre-configured by the cloud computing provider (simpler deployment, recommended).
- Deployment via a customized virtual machine (greater potential for customization, effective if you know what you are doing).
Depending on the cloud computing provider selected, each provider has their own set of resources that could be used to deploy the containers. Under the hood, Docker Compose is used to manage multiple containers at once (one to run the R server, and another to run a proxy in front of the server).
- Azure: Tutorial: Deploy a multi-container group using Docker Compose
- AWS: Deploying Docker containers on ECS
- GCP: Running containers on instances (Limited ability to run multiple containers on one computing instance, not a recommended cloud provider.)
To enable consistent access to the Docker resource, a static IP address should be assigned to the resource. Most cloud computing providers will automatically configure a static IP address, and others will make it available as another resource that can simply be assigned to the Docker resource.
In order to enable secure communication features between the participant's browser and the Docker resource, a domain name is required. A domain name is the address through which the browser can locate a particular resource. Directly accessing a resource via a static IP address is not secure. A domain provides a layer of secure abstraction on top of the IP address, allowing the HTTPS protocol to be used when communicating.
Modern browsers restrict Cross-Origin Resource Sharing (CORS), a form of inter-resource access control. In the situation of a participant's task communicating with the R server, the participant's browser will expect the Docker resource to be accessed via the HTTPS protocol. If no domain name has been allocated to the Docker resource, the participant's browser will only be able to reach the Docker resource using its IP address and the HTTP protocol. The participant's browser will block the attempt to access the Docker resource under the CORS functionality. The solution to this dilemma is to assign a domain name to the Docker resource and enable the HTTPS protocol for communication between the task and the server.
Domains can be obtained from multiple locations:
- A domain name registrar such as GoDaddy, Namecheap, or Google Domains; or
- Your institution may allow you to provision your own sub-domain on top of their *.edu domain (e.g. *.wustl.edu).
A SSL certificate is required to enable the HTTPS protocol. These can be included with a domain name and configured either automatically or manually within the Docker resource. The domain must be configured to point to the static IP address assigned to the Docker resource (see Static IP address).
ℹ️ Some software tools are recommended as they make setup and configuration smoother.
- GitHub: It is highly recommended that you continue to use an online version control system (such as GitHub) to manage your files and changes to the server source code. This template repository can be used to setup a repository for your own implementation. Additionally, usage of a platform such as GitHub will allow easier deployment of the source code to the virtual machine once the server has been configured.
- Postman: A tool that allows HTTP requests to be constructed and sent to remote resources. This is useful for testing server functionality and to ensure it will respond to online cognitive task interactions once deployed. Postman can be used to test the solution offline and online by simulating requests from the cognitive task to the server.
Feedback? Questions? Please reach out or create an issue under this repository.
Lab Website: Brain Development and Disorders Lab
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
