...
Updates to OS
Download and Build
Launch New Instance Running Voila and Nginx [OUTDATED]
Instructions from https://docs.google.com/document/d/1vqK-qAxBGt_I9j6VG1SSLtPhQp89PzV4Y32yuWLWbUg/edit
Voila documentation: https://voila.readthedocs.io/en/stable/deploy.html#running-voila-on-a-private-server
WARNING: These instructions are very old and some steps might be outdated or simply not correct for the current web apps.
Start a new EC2 instance using the console:
Troubleshooting
How to run the web apps on a locally
How to print to output from ipywidgets
import ipywidgets as widgets
out = widgets.Output(layout={'border': '1px solid black'})
display(out)
from jedi_data_viewer_experiments import JediDataViewerExperiments
jedi_data_viewer_experiments = JediDataViewerExperiments(out)
with self._out: print("")
Web page fails to load
Issue: the web pages will fail to load/ timeout
Explanation: Each time the website is hit a new python kernel is opened and will stay open forever. Therefore, when the instance memory is full of these python kernels the page will go down.
Solution: Reboot the EC2 Instance (see procedure above)
Launch New Instance Running Voila and Nginx [OUTDATED]
Instructions from https://docs.google.com/document/d/1vqK-qAxBGt_I9j6VG1SSLtPhQp89PzV4Y32yuWLWbUg/edit
Voila documentation: https://voila.readthedocs.io/en/stable/deploy.html#running-voila-on-a-private-server
WARNING: These instructions are very old and some steps might be outdated or simply not correct for the current web apps.
Start a new EC2 instance using the console:
- From https://console.aws.amazon.com/ec2/v2/home?region=us-east-1, click on the blue “Launch Instance” button
- Scroll down to Ubuntu Server 20.04 LTS (HVM), SSD Volume Type and click the blue “Select” button Note: The user name is ubuntu, unlike other EC2 instance, where the user name is ec2-user
- Select t2.large, and click
- From https://console.aws.amazon.com/ec2/v2/home?region=us-east-1, click on the blue “Launch Instance” button
- Scroll down to Ubuntu Server 20.04 LTS (HVM), SSD Volume Type and click the blue “Select” button Note: The user name is ubuntu, unlike other EC2 instance, where the user name is ec2-user
- Select t2.large, and click “Next: Configure Instance Details”
- Keep the default options and click “Next: Add Storage” Note: An IAM role will need to be added to the instance in order to access private buckets. For Phase 0, the bucket that contains the pre-generated plots, jtd.jcsda, is public.
- Update the size to 50GB, and click “Next: Add Tags”. Note: It is good practice to add tags.
- Click “Next: Configure Security Groups”.
- Change the radio button to “Select an existing security group”, and select sg-023d069fd080b4c15, or “dashboard”, which allows global HTTP and HTTPS access, and SSH access from NCAR IP addresses.
- Click launch and a key pair popup will appear. Choose “Create a new key pair” unless you want to use an old one of yours.
- Find your new instance in the console and edit the name field.
...
Create /usr/lib/systemd/system/voila.service with the contents:
Code Block [Unit] Description=Voila [Service] Type=simple PIDFile=/run/voila.pid ExecStart=voila --no-browser --show_traceback=False jtd/voila/app.ipynb User=ubuntu WorkingDirectory=/home/ubuntu/ Restart=always RestartSec=10 [Install] WantedBy=multi-user.target
Enable and start the voila.service:
Code Block sudo systemctl enable voila.service sudo systemctl start voila.service
Restart nginx
Code Block sudo systemctl restart nginx.service
Enable access to https:
Code Block sudo snap install core; sudo snap refresh core sudo snap install --classic certbot sudo ln -s /snap/bin/certbot /usr/bin/certbot sudo certbot --nginx
- Check access on https://{website_name}.jcsda.org, it should be up and running
Troubleshooting
How to run the web apps on a locally
How to print to output from ipywidgets
import ipywidgets as widgets
out = widgets.Output(layout={'border': '1px solid black'})
display(out)
from jedi_data_viewer_experiments import JediDataViewerExperiments
jedi_data_viewer_experiments = JediDataViewerExperiments(out)
with self._out: print("")
Web page fails to load
Issue: the web pages will fail to load/ timeout
Explanation: Each time the website is hit a new python kernel is opened and will stay open forever. Therefore, when the instance memory is full of these python kernels the page will go down.
...