Contents

Canvas LMS - Quick Start

I setup Canvas LMS following Canvas LMS Quick Start Guide atgithub page.

1. Prerequisite

  • SSH login to ubuntu
  • setup Docker
  • ruby - ruby 2.6. see dependency installation
  • python - python3 worked in my case. python2 did not.
  • dory (optional)

1.1. SSH login to ubuntu

1.2. Setup Docker and Docker compose

1.3. Ruby > 2.6

Install ruby virtual environment (rbenv) if necessary.

1
2
$ sudo apt udpate
$ sudo apt install rbenv

However, this rbenv does not support ruby 2.6 checking by rbenv install --list. So I needed to download it by github.

1
$ git clone https://github.com/rbenv/rbenv.git ~/.rbenv

Then setup path to .bashrc

1
2
3
4
$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
$ echo 'eval "$(rbenv init -)"' >> ~/.bashrc

$ source ~/.bashrc

Activate rbenv and install ruby 2.6 (requirement for Canvas-LMS)

1
2
3
4
5
6
7
8
9
$ rbenv --version
rbenv 1.0.0

$ rbenv install 2.6.6 # install ruby 2.6.6 over rbenv

$ rbenv global 2.6.6

$ ruby --version
ruby 2.6.6p146 (2020-03-31 revision 67876) [x86_64-linux]

Sometime, rbenv rehash works for switching ruby version.

1.4. Python 3

Python versions on Ubuntu

1
2
3
4
5
$ python -V
2.7.17

$ python3 -V 
3.6.9

Create python virtual environment

1
python3 -m venv ~/env1

Activate virtual environment for python 3.6

1
2
3
4
$ source ~/env1/bin/activate

(env1) $ python --version
Python 3.6.9

1.5. Dory (optional)

Install dory


2. Run docker setup script

1
(env1) $ ./script/docker_dev_setup.sh 

2.1. Error: Failed by DNS configuration (2021.5.11)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
(env1) $ ./script/docker_dev_setup.sh 

  ________  ________  ________   ___      ___ ________  ________
|\   ____\|\   __  \|\   ___  \|\  \    /  /|\   __  \|\   ____\
\ \  \___|\ \  \|\  \ \  \\ \  \ \  \  /  / | \  \|\  \ \  \___|_
 \ \  \    \ \   __  \ \  \\ \  \ \  \/  / / \ \   __  \ \_____  \
  \ \  \____\ \  \ \  \ \  \\ \  \ \    / /   \ \  \ \  \|____|\  \
   \ \_______\ \__\ \__\ \__\\ \__\ \__/ /     \ \__\ \__\____\_\  \
    \|_______|\|__|\|__|\|__| \|__|\|__|/       \|__|\|__|\_________\
                                                         \|_________|

Welcome! This script will guide you through the process of setting up a
Canvas development environment with docker and dinghy/dory.

When you git pull new changes, you can run ./scripts/docker_dev_update.sh
to bring everything up to date.
  Log file is /home/xxxx/repo/canvas/log/docker_dev_setup.log

> It looks like you're using Linux. Let's set that up.

> Checking Dependencies...

> Starting dory...

> Looks like dory is already running. Moving on...

> Now we can set up Canvas!

> Copying Canvas docker configuration...
OK to run 'cp docker-compose/config/*.yml config/'? [y/n] y

> Setup override yaml and .env...

> docker-compose.override.yml exists, skipping copy of default configuration
.env file exists, would you like to reset it to default? [y/n] y

> Setting up default .env configuration

> Building docker images...    /
[FAIL]

  /o\ Something went wrong. Check /home/xxxx/repo/canvas/log/docker_dev_setup.log for details.
Warning
Error : http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

/home/xxx/repo/canvas/log/docker_dev_setup.log

1
2
3
4
5
...
Step 1/2 : FROM busybox:latest
Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
Service 'githook_installer' failed to build : Build failed

Some references says et/http: request canceled while waiting for connection is caused by DNS error.

So, I tried to recover it by setting up resolvconf.

Ref. DOCKER COMMUNITY FORUMS - 73064/16

Install resolvconf.

1
$ sudo apt install resolvconf

Then make edits to /etc/resolvconf/resolv.conf.d/head to configure google name servers.

1
2
nameserver 8.8.8.8
nameserver 8.8.4.4

Then restart the resolvconf service.

1
$ sudo service resolvconf restart

2.2. Error: Failed by http connection timeout (2021.5.11)

However, I could not fix the error only by DNS configuration.

1
(env1) $ ./script/docker_dev_setup.sh 

/home/xxx/repo/canvas/log/docker_dev_setup.log

1
2
3
...
Step 2/7 : FROM postgis/postgis:$POSTGRES-2.5
Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

By some of suggestion at Forum discussion, I tried not to use SSH over Wifi, but local Ubuntu over Ethernet.

  • Disconnect SSH and directly login to Ubuntu server machine
  • Connect Ethernet cable to Ubuntu
  • Disconnect Wifi on Ubutu

Then, run ./script/docker_dev_setup.sh locally (not over SSH) and it works! 😄


2.3. Success

Summary:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
$ source ~/.bashrc
$ cd repo/canvas
$ rbenv global 2.6.6
$ source ~/env1/bin/activate

(env1) $ ./script/docker_dev_setup.sh 
...
> Copying Canvas docker configuration...
OK to run 'cp docker-compose/config/*.yml config/'? [y/n] y
...
> docker-compose.override.yml exists, skipping copy of default configuration
.env file exists, would you like to reset it to default? [y/n] y
...
> Setting up default .env configuration
> Building docker images...    [DONE]
...
OK to run 'rm -f Gemfile.lock'? [y/n] y
...
> About to run "bundle exec rake db:drop"
type NUKE in all caps:  NUKE

What email address will the site administrator account use? > xxxx@example.com
Please confirm > xxxx@example.com
What password will the site administrator use? > **********
Please confirm > **********
What do you want users to see as the account name? This should probably be the name of your organization. > exampleorg

To help our developers better serve you, Instructure would like to collect some usage data about your Canvas installation. You can change this setting at any time.:
1. Opt in
2. Only send anonymized data
3. Opt out completely
> 3

  ...
  \o/ Success!

(env1) 

Full output:

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
(env1) $ ./script/docker_dev_setup.sh 

  ________  ________  ________   ___      ___ ________  ________
|\   ____\|\   __  \|\   ___  \|\  \    /  /|\   __  \|\   ____\
\ \  \___|\ \  \|\  \ \  \\ \  \ \  \  /  / | \  \|\  \ \  \___|_
 \ \  \    \ \   __  \ \  \\ \  \ \  \/  / / \ \   __  \ \_____  \
  \ \  \____\ \  \ \  \ \  \\ \  \ \    / /   \ \  \ \  \|____|\  \
   \ \_______\ \__\ \__\ \__\\ \__\ \__/ /     \ \__\ \__\____\_\  \
    \|_______|\|__|\|__|\|__| \|__|\|__|/       \|__|\|__|\_________\
                                                         \|_________|

Welcome! This script will guide you through the process of setting up a
Canvas development environment with docker and dinghy/dory.

When you git pull new changes, you can run ./scripts/docker_dev_update.sh
to bring everything up to date.
  Log file is /home/xxxx/repo/canvas/log/docker_dev_setup.log

> It looks like you're using Linux. Let's set that up.

> Checking Dependencies...

> Starting dory...

> Looks like dory is already running. Moving on...

> Now we can set up Canvas!

> Copying Canvas docker configuration...
OK to run 'cp docker-compose/config/*.yml config/'? [y/n] y

> Setup override yaml and .env...

> docker-compose.override.yml exists, skipping copy of default configuration
.env file exists, would you like to reset it to default? [y/n] y

> Setting up default .env configuration

> Building docker images...    [DONE]

> For historical reasons, the Canvas Gemfile.lock is not tracked by git. We may
need to remove it before we can install gems, to prevent conflicting dependency
errors.
OK to run 'rm -f Gemfile.lock'? [y/n] y

> Starting docker containers...

> Building assets...

> > Bundle install...  [DONE]

> > Yarn install....   [DONE]

> > Compile assets.... [DONE]

> Checking for existing db...  [DONE]

> An existing database was found.

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
This script will destroy ALL EXISTING DATA if it continues
If you want to migrate the existing database, use docker_dev_update
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

> About to run "bundle exec rake db:drop"
type NUKE in all caps:  NUKE

> Deleting db.....     [DONE]

> Creating new database....    [DONE]

> Migrating (Development env)....      [DONE]

> Migrating (Test env)....     [DONE]
/home/docker/.gem/gems/soap4r-ruby1.9-2.0.5/lib/soap/mapping/encodedregistry.rb:150: warning: constant ::Fixnum is deprecated
/home/docker/.gem/gems/soap4r-ruby1.9-2.0.5/lib/soap/mapping/encodedregistry.rb:216: warning: constant ::Fixnum is deprecated
default: development
default: development
/usr/src/app/app/models/pseudonym.rb:38: warning: already initialized constant Pseudonym::MAX_UNIQUE_ID_LENGTH
/usr/src/app/app/models/pseudonym.rb:38: warning: previous definition of MAX_UNIQUE_ID_LENGTH was here
/usr/src/app/app/models/pseudonym.rb:40: warning: already initialized constant Pseudonym::CAS_TICKET_TTL
/usr/src/app/app/models/pseudonym.rb:40: warning: previous definition of CAS_TICKET_TTL was here
What email address will the site administrator account use? > xxxx@example.com
Please confirm > xxxx@example.com
What password will the site administrator use? > **********
Please confirm > **********
What do you want users to see as the account name? This should probably be the name of your organization. > exampleorg
To help our developers better serve you, Instructure would like to collect some usage data about your Canvas installation. You can change this setting at any time.:
1. Opt in
2. Only send anonymized data
3. Opt out completely
> 3
You have opted out.
You can change this feature at any time by running the rake task 'rake db:configure_statistics_collection'
......................................................................................
Notifications Loaded
No notification files found for Assignment Publishing Reminder
No notification files found for Assignment Grading Reminder
No notification files found for Assignment Due Date Reminder
No notification files found for Rubric Assessment Invitation
No notification files found for Migration Export Ready
No notification files found for Migration Import Finished
No notification files found for Migration Import Failed

Initial data loaded

> You're good to go! Next steps:

  I have added your user to the docker group so you can run docker commands
  without sudo. Note that this has security implications:

  https://docs.docker.com/engine/installation/linux/linux-postinstall/

  You may need to logout and login again for this to take effect.

  Running Canvas:

    docker-compose up -d
    open http://canvas.docker

  Running the tests:

    docker-compose run --rm web bundle exec rspec

   Running Selenium tests:

    add docker-compose/selenium.override.yml in the .env file
      echo ':docker-compose/selenium.override.yml' >> .env

    build the selenium container
      docker-compose build selenium-chrome

    run selenium
      docker-compose run --rm web bundle exec rspec spec/selenium

    Virtual network remote desktop sharing to selenium container
      for Firefox:
        $ open vnc://secret:secret@seleniumff.docker
      for chrome:
        $ open vnc://secret:secret@seleniumch.docker:5901

  I'm stuck. Where can I go for help?

    FAQ:           https://github.com/instructure/canvas-lms/wiki/FAQ
    Dev & Friends: http://instructure.github.io/
    Canvas Guides: https://guides.instructure.com/
    Vimeo channel: https://vimeo.com/canvaslms
    API docs:      https://canvas.instructure.com/doc/api/index.html
    Mailing list:  http://groups.google.com/group/canvas-lms-users
    IRC:           http://webchat.freenode.net/?channels=canvas-lms

    Please do not open a GitHub issue until you have tried asking for help on
    the mailing list or IRC - GitHub issues are for verified bugs only.
    Thanks and good luck!
  

  \o/ Success!

3. Post installation

docker linux post installation procedure - just enable non root user to run docker at this point.

For running docker image,

1
$ docker-compose up -d

4. Confirmation

I could access to Canvas login screen by IP address based connection - http://192.xxx.xxx.xxx on my local network.

../../../images/canvaslms/canvas-login.jpg

Then login to canvas by user account(email) and password that I configured during the installation process. It looks they limit feature for Quick start installation version.

../../../images/canvaslms/canvas-dashboard.jpg

I could not connect to http://canvas.docker. It looks DNS related configuration is wrong in dory.

1
2
3
4
(env1) xxxx@ubuntu01:~/repo/canvas$ dory status
[*] Nginx proxy:  Running as docker container dory_dinghy_http_proxy
[*] Dnsmasq:  Running as docker container dory_dnsmasq
[*] Resolv is not configured

References