This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
jaredallard's profile picture

[virtualization] ccDocker

Started by jaredallard, 25 May 2015 - 05:33 AM
jaredallard #1
Posted 25 May 2015 - 07:33 AM

A virtualization platform for developers


~



Introduction

Ever heard of docker? No? https://docker.io. TL;DR it's a container platform for virtualizing programs and operating systems (specifically linux hosts currently). It's unique as it's not a complete virtualization platform, it interlaces directly into the Linux kernel which makes it have little to no performance impacts.




So… What is this?

So, all that good stuff you just heard, well ccDocker does almost all of it. ccDocker was more-or-less an experiment to see if it could be done, well, one thing led to another and it seems it can be done. Currently CraftOS can be emulated perfectly ontop of it, and it has no performance loss (that can be seen). Plus, it has all the goodness of the container system of Docker. As they say;


" Build, Ship and Run

Any App, Anywhere "




That sounds all well and good, but how does it work?


It's quite simple, actually. All you do is make a CCDockerfile. They consist of simple commands, such as
  • NAME - set the container name
  • VERSION - set the container version
  • MAINTAINER - set the container maintainer
  • ADD - add files from <path> to <container path>
  • ENV - set a custom value to be inserted on run
  • ENTRYPOINT - script to run on init (be careful about respecting yeilds!)
I stillll don't get it.






Wow, how do I get it?


Simple! A lot of work has been put into making it a simple dependency-less program:



pastebin get 41ardsnF ccdocker




Download &amp; License





Contributing

Feel free to submit a pull request, and/or ask me to join the development team! This is a completely open-governed application so anyone can submit feedback and/or code! Anyone is welcome, so boot up a text editor and start converting some caffiene into code!
Edited on 27 May 2015 - 07:34 AM
Creator #2
Posted 25 May 2015 - 08:33 AM
Can I be part of the dev team?

Already working on the first pull request
jaredallard #3
Posted 25 May 2015 - 04:08 PM
Can I be part of the dev team?

Already working on the first pull request

Write some PRs and then we can talk :)/>
Creator #4
Posted 25 May 2015 - 04:50 PM
Ok
jaredallard #5
Posted 26 May 2015 - 05:58 AM
The latest update, just pushed, enables the ability to fetch images and sets the basis with a Node.JS powered API! Starting now you can also do everything through the ccdocker script. Check out the git for more information, coming soon is a packaged version as well as a pastebin installer.

If you do download the latest version, simply follow the setup instructions then try running


ccdocker run rainbowdashdc/craftos:1.7

This will fetch the craftos image from the repository then move it to /var/ccdocker/<maintainer>/<name>/<version>!

The newest version, from a developer standpoint, also brings changes in how CCDockerfiles work. MAINTAINER must now be a non-spaced name, and be your username. Otherwise the repository will refuse to accept it.


Lastly, in order to push images to the repository you must now register on the repository. This will enable you to transparently use it and generate API Tokens. This can be done like so:



ccdocker register


Happy shipping! ;)/>
Lupus590 #6
Posted 26 May 2015 - 09:38 AM
I'm wondering whether CCDocker will be overkill for what we need, I want to use it in Hive (the turtles are going to use sandboxes).
My question is, will this work as the turtles sandbox without having lots of unused code, or are we going to be better off making our own sandbox?
jaredallard #7
Posted 26 May 2015 - 03:12 PM
I'm wondering whether CCDocker will be overkill for what we need, I want to use it in Hive (the turtles are going to use sandboxes).
My question is, will this work as the turtles sandbox without having lots of unused code, or are we going to be better off making our own sandbox?

Actually, this is a usecase that it'd work great in. However, what do you mean by unused code? Do you want to trim it? Do you have size restrictions, etc, etc? If you want more direct communication, feel free to email me at [email="jaredallard@outlook.com"]jaredallard@outlook.com[/email].


Thanks for expressing your interest! :)/>
Edited on 26 May 2015 - 01:13 PM
jaredallard #8
Posted 27 May 2015 - 09:35 AM
ccDocker, while no code improvements were pushed, now uses Howl (Thanks @SquidDev!) to build into a single minified file. Check the original post for details on how to obtain it via pastebin.
Lupus590 #9
Posted 27 May 2015 - 11:48 AM
I'm wondering whether CCDocker will be overkill for what we need, I want to use it in Hive (the turtles are going to use sandboxes).
My question is, will this work as the turtles sandbox without having lots of unused code, or are we going to be better off making our own sandbox?

Actually, this is a usecase that it'd work great in. However, what do you mean by unused code? Do you want to trim it? Do you have size restrictions, etc, etc? If you want more direct communication, feel free to email me at jaredallard@outlook.com.


Thanks for expressing your interest! :)/>

Got a present for you: https://github.com/l...c10a1e07cb7a64d
Having read it properly (a common mistake of mine is not reading properly), and CCDocker sound like it will be perfect.
Edited on 27 May 2015 - 09:49 AM
jaredallard #10
Posted 31 May 2015 - 04:31 AM
Apologies if you tried this in the past 3-4 days you probably couldn't communicate with the API. Unfortunatly, Comcast had changed my IP, and it had to be changed. However, now it has been fixed and will not happen again as I have a static IP machine setup and everything!


Happy shipping!
wilcomega #11
Posted 09 June 2015 - 12:30 PM
from what i could find from the website of this program and your tiny explanation,
my interpetation is that this is version control for minecraft, where you can update your programs on a server
and people can download every revision,

if i am wrong please explain it as if i had never heard of version control :P/>
it looks cool tho
jaredallard #12
Posted 09 June 2015 - 03:26 PM
from what i could find from the website of this program and your tiny explanation,
my interpetation is that this is version control for minecraft, where you can update your programs on a server
and people can download every revision,

if i am wrong please explain it as if i had never heard of version control :P/>
it looks cool tho

Apologies, it's been hard explaining the concept personally (I've had to do it over four times in person!)

Essentially it allows shipping containers of your software. Say your program depends on OneOS or someother OS and you want to base it off of it. You'd make a CCDockerfile like


# Note, there is no oneos image yet, or pulling images but this is on git right now (semi)
PULL oneos:1.<whatever>
ADD <my stuff>
ENTRYPOINT (or is it ENTRY?) <my/script/to/run>

Then, you would build your image. It would pull that image and then merge them both. Afterwards you can push your image to the repository. This would allow people to pull it. Upon pulling your image, it will also pull it's dependency image, oneos.

Hope this helped! :)/>

Feel free to ask more questions!
Creator #13
Posted 09 June 2015 - 03:52 PM
What is the advantage ove just running OneOS?
jaredallard #14
Posted 09 June 2015 - 04:00 PM
What is the advantage ove just running OneOS?

1. Not sandboxed.
2. Chain-loading an OS ontop of another OS for one program would be exhausting and hard to setup
3. You cannot deploy the same environment to multiple machines as fast.
Creator #15
Posted 09 June 2015 - 04:08 PM
I don't understand what you mean by not sandboxed. OneOS is sandboxed.
jaredallard #16
Posted 09 June 2015 - 04:12 PM
I don't understand what you mean by not sandboxed. OneOS is sandboxed.

as in the entirety of the FS and etc is all sandboxed into a single environment. Think of a virtual machine.
Creator #17
Posted 09 June 2015 - 05:20 PM
Oh, I see. Like a VM.
wilcomega #18
Posted 09 June 2015 - 05:27 PM
that looks pretty cool, usually i just put a little pastebin part at the top to download any dependencies, or if http is disabled, show instructions, but this is very cool indeed
jaredallard #19
Posted 02 July 2015 - 06:21 PM
Breaking changes will be coming soon, a new filesystem format is being intergrated.

EDIT

Also, a presentation &amp; slideshow on what ccDocker is (presenting the concept later today to an audience) will be uploaded! :)/>
Edited on 02 July 2015 - 04:22 PM
jaredallard #20
Posted 13 February 2016 - 06:49 AM
Announcing the End of Life of the ccdocker repository.

I don't really program with CC anymore, find myself dedicating more time to real world projects, and frankly I host a server that I pay for monthly that isn't used! The actual "proof of concept" of ccdocker is still on Github and is still a crowned achievement of mine, It had a good run!