Setting up the Canvas-LMS dev environment with docker

3,229 views
Skip to first unread message

Verun Rahimtoola

unread,
Jun 18, 2018, 10:52:05 PM6/18/18
to Canvas LMS Users
Hi,

I tried posting this question on the freenode IRC channel, but so far no one's responded.

I'm working on a macbook and trying to get a dev environment set up for Canvas LMS. I've been following the quick-start here: https://github.com/instructure/canvas-lms/wiki/Quick-Start

I've used the docker_dev_script.sh script to set up the docker container, but what are the next steps, if any? The guide isn't clear on whether additional steps need to be taken (such as creating any DB tables etc).

I'm trying to set up minimal data in the DB and then play with the Analytics REST API to build a dashboard and maybe some ML models.

Thanks!

Verun

Bryan Petty

unread,
Jun 19, 2018, 11:12:13 PM6/19/18
to canvas-l...@googlegroups.com
On Mon, Jun 18, 2018 at 8:52 PM, Verun Rahimtoola <verun...@gmail.com> wrote:
> I tried posting this question on the freenode IRC channel, but so far no
> one's responded.

I spotted your question, and was going to answer, but you quit too quickly. ;)

> I'm working on a macbook and trying to get a dev environment set up for
> Canvas LMS. I've been following the quick-start here:
> https://github.com/instructure/canvas-lms/wiki/Quick-Start
>
> I've used the docker_dev_script.sh script to set up the docker container,
> but what are the next steps, if any? The guide isn't clear on whether
> additional steps need to be taken (such as creating any DB tables etc).

There's more thorough documentation you likely missed under:
https://github.com/instructure/canvas-lms/tree/master/doc/docker

Especially: https://github.com/instructure/canvas-lms/blob/master/doc/docker/developing_with_docker.md

--
Regards,
Bryan Petty

Verun Rahimtoola

unread,
Jun 19, 2018, 11:30:39 PM6/19/18
to canvas-l...@googlegroups.com
Thanks Bryan! Yeah, I totally missed those links somehow. I'll dig in
and see if I can get things up and running.

Cheers!

V
> --
>
> ---
> You received this message because you are subscribed to the Google Groups "Canvas LMS Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to canvas-lms-use...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Verun Rahimtoola

unread,
Jun 20, 2018, 1:09:03 AM6/20/18
to canvas-l...@googlegroups.com
Hey, so that definitely helped - but when I go to http://canvas.docker
on my local machine, I get a message saying "Welcome to the Dinghy
HTTP Proxy" and below it, it says "If you expected to see your
application at this URL, it may not be running, or it may be
improperly configured.". So I'm guessing something isn't right. I
ssh'ed into the docker instance and did a `ps aux` looking for any
canvas process but didn't find anything.

Where can I locate the logs?

FYI, when I run `dinghy status` in ~/canvas on my machine, the output
is the following:

VM: running
NFS: running
FSEV: running
DNS: running
PROXY: running

Your environment variables are already set correctly.

----------

Any ideas?

Thanks,

Verun

Graham Ballantyne

unread,
Jun 20, 2018, 2:30:39 AM6/20/18
to canvas-l...@googlegroups.com
If you ran `docker-compose up`, then your logs should be streaming to STDOUT (unless you ran it with the -d flag, then it backgrounded; run docker-compose logs -f to tail the output).

What does `docker-compose ps` output?

– 
Graham Ballantyne 
Senior Software Engineer | IT Services 
Simon Fraser University | Strand Hall 1001 
8888 University Dr., Burnaby, B.C. V5A 1S6 
604-837-6698  | gra...@sfu.ca

Verun Rahimtoola

unread,
Jun 20, 2018, 3:23:49 PM6/20/18
to canvas-l...@googlegroups.com
Hi,

So I cleaned out what I had and started back up from scratch, I am now
seeing this error when I invoke the ./script/docker_dev_setup.sh:

===========================
...
Happy[handlebars-ember]: All set; signaling webpack to proceed.

FATAL ERROR: NewSpace::Rebalance Allocation failed - process out of memory

1:

<--- Last few GCs --->


[381:0x3d36740] 151578 ms: Scavenge 1548.8 (1681.8) -> 1541.2
(1685.8) MB, 20.2 / 0.0 ms allocation failure

[381:0x3d36740] 151620 ms: Scavenge 1553.6 (1685.8) -> 1545.3
(1689.3) MB, 18.9 / 0.0 ms allocation failure

[381:0x3d36740] 151670 ms: Scavenge 1557.5 (1689.3) -> 1549.5
(1693.8) MB, 26.9 / 0.0 ms allocation failure

[381:0x3d36740] 151755 ms: Scavenge 1561.6 (1693.8) -> 1554.0
(1697.3) MB, 51.5 / 0.6 ms allocation failure



<--- JS stacktrace --->

Cannot get stack trace in GC.

node::Abort() [node]

2: 0x8c21ec [node]

3: v8::Utils::ReportOOMFailure(char const*, bool) [node]

4: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [node]

5: 0xa2f61b [node]

6: v8::internal::MarkCompactCollector::Evacuate() [node]

7: v8::internal::MarkCompactCollector::CollectGarbage() [node]

8: v8::internal::Heap::MarkCompact() [node]

9: v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector,
v8::GCCallbackFlags) [node]

10: v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace,
v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]

11: v8::internal::Factory::NewFillerObject(int, bool,
v8::internal::AllocationSpace) [node]

12: v8::internal::Runtime_AllocateInTargetSpace(int,
v8::internal::Object**, v8::internal::Isolate*) [node]

13: 0xd7072c842fd

Aborted

error Command failed with exit code 134.

info Visit https://yarnpkg.com/en/docs/cli/run for documentation about
this command.

rake aborted!

Parallel::UndumpableException: RuntimeError: Error running
js:webpack_production:

ABORTING

/usr/src/app/lib/tasks/js.rake:50:in `block (2 levels) in <top (required)>'

/usr/src/app/lib/tasks/canvas.rake:76:in `block (5 levels) in <top (required)>'

/usr/src/app/lib/tasks/canvas.rake:7:in `log_time'

/usr/src/app/lib/tasks/canvas.rake:76:in `block (4 levels) in <top (required)>'

/home/docker/.gem/ruby/2.4.0/gems/parallel-1.12.1/lib/parallel.rb:486:in
`call_with_index'

/home/docker/.gem/ruby/2.4.0/gems/parallel-1.12.1/lib/parallel.rb:342:in
`block (2 levels) in work_in_threads'

/home/docker/.gem/ruby/2.4.0/gems/parallel-1.12.1/lib/parallel.rb:495:in
`with_instrumentation'

/home/docker/.gem/ruby/2.4.0/gems/parallel-1.12.1/lib/parallel.rb:341:in
`block in work_in_threads'

/home/docker/.gem/ruby/2.4.0/gems/parallel-1.12.1/lib/parallel.rb:206:in
`block (2 levels) in in_threads'

Tasks: TOP => canvas:compile_assets

(See full trace by running task with --trace)

ERROR: Service 'web' failed to build: The command '/bin/sh -c
COMPILE_ASSETS_NPM_INSTALL=0 bundle exec rake canvas:compile_assets'
returned a non-zero code: 1

=================

How do I give it more heap space?

Thanks!

Verun Rahimtoola

unread,
Jun 24, 2018, 9:04:08 PM6/24/18
to Canvas LMS Users
So I got past the heap space error, but now I keep seeing this:

==============================================================================================================================

Status: Downloaded newer image for redis:alpine
Creating canvas_postgres_1 ... done
Creating canvas_redis_1    ... done
ERROR: An HTTP request took too long to complete. Retry with --verbose to obtain debug information.
If you encounter this issue regularly because of slow network conditions, consider setting COMPOSE_HTTP_TIMEOUT to a higher value (current value: 60).

> The 'docker' user is not allowed to write to Gemfile.lock. We need write
permissions so we can install gems.
Starting canvas_postgres_1 ... done
Starting canvas_redis_1    ... done
ERROR: Cannot create container for service web: b'Conflict. The container name "/canvas_web_run_1" is already in use by container "629326f89bcc1ceb9488199ff80132c279af3a12a7c29a7c02162e38902ae41c". You have to remove (or rename) that container to be able to reuse that name.'

==============================================================================================================================

Strangely, running "docker ps -a" on my machine doesn't reveal any container with the name "canvas_web_run_1". I've deleted the entire "canvas" repo on my machine and run the ./scripts/docker_dev_setup.sh script multiple times already, with the same issue coming up every time.

Help?
Reply all
Reply to author
Forward
0 new messages