some more relative url roots in editor_edit, removed javascript uglifying for staging, added debug message for docker websocket connection url.
added doku for setting up docker daemon for codeocean
This commit is contained in:
@ -1,5 +1,6 @@
|
|||||||
$(function() {
|
$(function() {
|
||||||
var ACE_FILES_PATH = '/assets/ace/';
|
// ruby part adds the relative_url_root, if it is set.
|
||||||
|
var ACE_FILES_PATH = '<%= (defined? config.relative_url_root) && config.relative_url_root != nil && config.relative_url_root != "" ? config.relative_url_root : "" %>' + '/assets/ace/';
|
||||||
var THEME = 'ace/theme/textmate';
|
var THEME = 'ace/theme/textmate';
|
||||||
|
|
||||||
var configureEditors = function() {
|
var configureEditors = function() {
|
9
codeocean-dockerconfig.md
Normal file
9
codeocean-dockerconfig.md
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
In order to make containers accessible for codeocean, they need to be reachable via tcp.
|
||||||
|
For this, the docker daemon has to be started with the following options:
|
||||||
|
|
||||||
|
DOCKER_OPTS='-H tcp://127.0.0.1:4243 -H unix:///var/run/docker.sock --iptables=false'
|
||||||
|
|
||||||
|
This binds the daemon to the specified socket (for access via the command line on the machine) as well as the specified tcp url.
|
||||||
|
Either pass these options to the starting call, or specify them in the docker config file.
|
||||||
|
|
||||||
|
In Ubuntu, this file is located under: /ect/default/docker
|
@ -23,7 +23,7 @@ Rails.application.configure do
|
|||||||
config.serve_static_assets = false
|
config.serve_static_assets = false
|
||||||
|
|
||||||
# Compress JavaScripts and CSS.
|
# Compress JavaScripts and CSS.
|
||||||
config.assets.js_compressor = :uglifier
|
# config.assets.js_compressor = :uglifier
|
||||||
# config.assets.css_compressor = :sass
|
# config.assets.css_compressor = :sass
|
||||||
|
|
||||||
# Do not fallback to assets pipeline if a precompiled asset is missed.
|
# Do not fallback to assets pipeline if a precompiled asset is missed.
|
||||||
|
@ -72,7 +72,10 @@ class DockerClient
|
|||||||
# Headers are required by Docker
|
# Headers are required by Docker
|
||||||
headers = {'Origin' => 'http://localhost'}
|
headers = {'Origin' => 'http://localhost'}
|
||||||
|
|
||||||
socket = Faye::WebSocket::Client.new(DockerClient.config['ws_host'] + '/containers/' + @container.id + '/attach/ws?' + query_params, [], :headers => headers)
|
socket_url = DockerClient.config['ws_host'] + '/containers/' + @container.id + '/attach/ws?' + query_params
|
||||||
|
socket = Faye::WebSocket::Client.new(socket_url, [], :headers => headers)
|
||||||
|
|
||||||
|
Rails.logger.debug "Opening Websocket on URL " + socket_url
|
||||||
|
|
||||||
socket.on :error do |event|
|
socket.on :error do |event|
|
||||||
Rails.logger.info "Websocket error: " + event.message
|
Rails.logger.info "Websocket error: " + event.message
|
||||||
|
Reference in New Issue
Block a user