play-with-docker / play-with-docker Goto Github PK
View Code? Open in Web Editor NEWYou know it, you use it, now it's time to improve it. PWD!.
Home Page: http://play-with-docker.com
License: MIT License
You know it, you use it, now it's time to improve it. PWD!.
Home Page: http://play-with-docker.com
License: MIT License
Hello,
Is there a way to limit the CPU allocated to pwd dind instances ?
thanks
But whenever I type ssh root@IP_of_other_instance
, I get the following error.
bash: ssh: command not found
Also apt-get dosen't work.
Is there any possibility of giving the option for saving the state of instance when the timer runs out. And give an extra option to the user to restart the timer along with the previously active instances and work.
Or maybe give an option for extending the timer and session when 10 or so minutes are left before timer runs down.
Consider the below scenario:
Just a thought.
When I run
docker run -d -p 80:80 -p 443:443 nginx
Then ports 80 and 443 are opened.
These exposed ports are also displayed in the UI next to the IP.
There nearly each time the script checks the exposedd ports the order in which they are displayed changes.
Wouldn't it be nicer if these portlists are stable, probably also sorted?
Maybe by port number and/or by time the container with the exposed port has been started.
The current flickering just indicates a change, but in fact nothing changed.
We can store all session information on disk so whenever we restart the API, we can still have all the sessions.
We need to check if there is something we can do to not loose our terminals.
if you exit the shell by either exit
or ctrl + d the exec session will end and all other terminal will remain unresponsive. It'd be nice to warn the user about this action and automatically delete terminals if action is intentional.
I think the way we implemented services is a bit racy.
If 2 clients are deleting the same instance at the same time, etc, it could crash or lead to weird results.
Since this is not traffic intensive, we could always lock on every service call, to make sure everything that happens in the session in synchronized and safe.
This just gives a log of the Docker daemon - using the franela image does work.
If within an instance you write curl www.google.com
you'll see that the javascript console shows: WebSocket connection to 'ws://play-with-docker.com/sessions/952dc23e-c830-40e2-ba0d-35ec548d0127/instances/goofy_keller/attach' failed: Could not decode a text frame as UTF-8.
and terminal stops working
I tried running ngrok but it crashed the screen and gave an error about $HOME.. this would be really cool for connecting to the live service from your PC.
๐ on this project.. very cool proof of concept ๐ฏ %
Just an idea - maybe limit the amount of processes?
/ # ulimit -p
524288
Could maybe do make a mess if someone fork bomb'd 5x524288 processes?
I started a new instance. Then ran 'docker swarm init'. The command worked but I could not highlight the text then right-click to copy. Nor could I use ^c.
Is there another keyboard combo I should be using?
Current terminal size is hardcoded to a default size of 80 x 24. It'd be nice to automatically handle screen resize.
I believe this should be implemented after #10 to prevent any possible re-work.
So that people know how long they still have in their session!
# apk --update add nano
# nano
Type in some text then do control + w control + x ... it doesn't work - just hangs. I think mandating vi
will be an issue for the groups I'd be working with.
Is this to do with the remapping of disconnect keys?
When sleeping and resuming the machine, the client-side timer will lose sync with the server. As stats are already being sent once every a couple of seconds, maybe we can take the opportunity to sync the timer as well.
@xetorthio thoughts?
Objective:
If I create a swarm (one or many) it'd be amazing if the app shows the swarm ID as well as each node role in the swarm (managers (leaders and followers) and workers).
This one is a bit tricky the way the app currently works because there's no centralized database to query that info from.
Depends on #8
Currently we have a button to "delete" an instance.
We should probably add a button to close the entire playground session. We should delete all instances and the session immediately.
This is not an issue, but more of an possible improvement. I saw that the on-line variant was using a newer version of dind, with Docker 1.13.0-rc3, while the Dockerfile in this github was based on 1.13.0-rc2. THis version is also the version on the Docker hub.
Is it possible to keep the code on github, the image on Docker hub and the on-line variant on play-with-docker.com in sync? The code is already there, I think as it is running on play-with-docker.com. Maybe on a seperate (develop/unstable) branch?
It'd be amazing to have something like golang (https://tour.golang.org/welcome/1) using play-with-docker.
We definitely need to structure in a way that's easy for collaborators to add new sections and content.
This way we prevent possible bots from exploiting the site.
If you point your docker cli using DOCKER_HOST to a pwd daemon and try to run a non detached container, the CLI will hang and the container will be left in "Created" state
Check play-with-docker/docker-machine-driver-pwd#1 for more info
The idea to horizontally scale nodes (docker daemons and webapp). In order to do this we need a centralized DB ( maybe redis?) where session information and node state is stored and shared across nodes.
There are several //TODO's in the code to improve this.
Usually, I connected Portainer to PWD either when starting Portainer via the CLI with the -H
flag or via the UI by defining a new endpoint.
I used to manage the PWD endpoints using the following url pattern ip10_0_XX_XX-2375.play-with-docker.com:80
.
Example:
$ docker run -d -p 9000:9000 portainer/portainer -H tcp://ip10_0_XX_XX-2375.play-with-docker.com:80
Yesterday, when I tried it again I was not able to connect to PWD either from Portainer or via the CLI using this URL pattern. After a short discussion on twitter with @marcosnils (https://twitter.com/marcosnils/status/831108149860036608), he told me to update the URL pattern to ip10_0_XX_XX.play-with-docker.com
.
Now, this is working fine when I use the Docker CLI with the -H
flag but it's not working anymore with Portainer (either using the -H
flag or when defining the endpoint from the UI).
Portainer tries to proxy the request to the PWD host/cluster and gets a 502 Bad Gateway issue.
The idea is to write a simple script that:
We will run this script every few minutes on every PWD server. If it works, nothing happens. If it doesn't work, we will send a message to a slack channel.
The play-with-docker containers will override the value with the container's URL. If the project inside the container returns "*", it will fail in Chrome and Firefox, because sending the header two times with different values is not allowed as per specification.
Example error in Chrome:
XMLHttpRequest cannot load http://pwd10_0_9_3-8080.play-with-docker.com:4848/api/project/index. The 'Access-Control-Allow-Origin' header contains multiple values 'http://pwd10_0_9_3-8080.play-with-docker.com, *', but only one is allowed. Origin 'http://pwd10_0_9_3-8080.play-with-docker.com' is therefore not allowed access.
The header is added by play-with-docker and not overwritten which means there will be two times the Access-Control-Allow-Origin
header transmitted over the network. You can see that in Chrome via the Network Tab's Header Inspector:
Hello,
I try to use the play-with-docker on ubuntu 16.04 with docker with overlay2.
When building image from Dockerfile.dind, then launching it via PWD, I got this error :
level=error msg="'overlay2' is not supported over overlayfs"
I had similair error with
level=error msg="'overlay2' is not supported over aufs"
Which driver to you uses for you PWD instance ?
Thanks
From behind corporate firewall / http_proxy:
socket.io-1.3.7.js:3 WebSocket connection to 'ws://play-with-docker.com/sessions/1ee25be8-80e2-48b0-9d89-8f7478345f2e/ws/?EIO=3&transport=websocket' failed: Establishing a tunnel via proxy server failed.ws @ socket.io-1.3.7.js:3WS.doOpen @ socket.io-1.3.7.js:2Transport.open @ socket.io-1.3.7.js:1Socket.open @ socket.io-1.3.7.js:1Socket @ socket.io-1.3.7.js:1Socket @ socket.io-1.3.7.js:1Manager.open.Manager.connect @ socket.io-1.3.7.js:1(anonymous function) @ socket.io-1.3.7.js:1
wss:// does appear to work on KataCoder (Ben Hall) because it uses 443 / CONNECT.
I'm trying to run PWD locally on my Mac in D4M beta31 (Docker 1.13.0-rc2).
I get to the main webpage and accept the captcha and will be redirected to a blank page and getting the following errors on the console:
2016/12/01 05:53:56 NewSession id=[171c7cec-349c-47f7-95fc-a63e3b090cbf]
2016/12/01 05:53:56 Starting session err [Error response from daemon: datastore for scope "global" is not initialized]
2016/12/01 05:53:56 ERROR NETWORKING
2016/12/01 05:53:56 Error response from daemon: datastore for scope "global" is not initialized
[negroni] Completed 0 in 550.306066ms
Would be nice to get some help or at least some hints where to dig deeper to analyse the problem. Running PWD in D4M could be pretty easy to set up and demo w/o the need to install and maintain additional hypervisors. at all.
This is useful when new clients connect to a session, they will get this buffer and can see the current state of the terminal.
In order to make this thing scale we need to redirect to <host>.play-with-docker.com
when creating the session. This was once the host is picked by the load balancer, any following request will go directly to the host that was chosen for the session.
Discussion started in #97 and moved here.
According to @jpetazzo suggestions, 512MB should be enough for the default workshop expectations.
Run this...
dd if=/dev/zero of=filename bs=$((1024*1024)) count=$((10*1024))
And the whole service will grind to a halt and stop functioning.
Perhaps need to add / enforce a disk size quota on containers.
Is there something else that needs to be configured or setup for service discovery/proxying?
From the README:
If you need to access your services from outside, use the following URL pattern http://ip<underscore_ip>-<port>.play-with-docker.com (i.e: http://ip10_2_135_3-80.play-with-docker.com/).
However, when running locally using make
, exposed services redirect to URLs such as:
http://ip10_0_0_3-32768.192.168.99.103:3000/
Which doesn't work. What else needs to be set and/or run for this to work?
And if we know in the future who they are (because they are identified somehow) then we could show it nicer and maybe even say who is typing (when someone is typing)
Is http://play-with-docker.com/ broken? When I click on 'ADD NEW INSTANCE' it doesn't seem to do anything. It was working yesterday.
I think this would help people debug a long session better and share with others.
Now that sessions are persisted into disk #32 it'd be nice to tell the user when the connection has been lost. I believe it should be quite simple to do with socket.io
I did a go get
and go build
with go 1.7.1 and Docker 1.12.2-rc1. This is what happened when I hit "localhost:3000/"
Commenting out the Driver portion let me work around the issue but used bridge for the driver.
[negroni] Started GET /
2016/10/09 19:06:17 NewSession id=[dc341e92-970c-44ef-aa18-0b80d60e4ed9]
2016/10/09 19:06:17 Starting session err [Error response from daemon: driver name: if driver is specified name is required]
2016/10/09 19:06:17 Error response from daemon: driver name: if driver is specified name is required
[negroni] Completed 0 in 8.6795ms
We could publish metrics so prometheus
can collect them and keep track of things like:
We can eventually add more important metrics :)
If you close your tab accidentally and you didn't save your session URL you're done. Should we add a sessionID cookie?
This way when sharing a link the receiver page will open on the same instance that the sender shared.
"Add instance" and "Delete" should have a spinner or something that indicates that the action started and ended. Sometimes "Add instance" fails because of a 1.13rc networking bug and the session needs to be recreated.
We need a dockerfile that builds this app ๐
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.