Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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:

  1. From https://console.aws.amazon.com/ec2/v2/home?region=us-east-1, click on the blue “Launch Instance” button
  2. 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
  3. Select t2.large, and click
  4. From https://console.aws.amazon.com/ec2/v2/home?region=us-east-1, click on the blue “Launch Instance” button
  5. 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
  6. Select t2.large, and click “Next: Configure Instance Details”
  7. 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.
  8. Update the size to 50GB, and click “Next: Add Tags”. Note: It is good practice to add tags.
  9. Click “Next: Configure Security Groups”. 
  10. 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.
  11. 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.
  12. Find your new instance in the console and edit the name field.

...

  1. 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

     

  2. Enable and start the voila.service:

    Code Block
    sudo systemctl enable voila.service
    sudo systemctl start voila.service

     

  3. Restart nginx

    Code Block
    sudo systemctl restart nginx.service

     

  4. 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


  5. 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.

...