Giter Site home page Giter Site logo

jockdarock / time2code Goto Github PK

View Code? Open in Web Editor NEW
313.0 9.0 36.0 1.8 MB

Portable Scalable web code editor to integrate into your sites and learning experiences

License: MIT License

HTML 87.57% Python 9.76% Shell 1.65% Dockerfile 1.02%
faas faas-platform swarm docker docker-swarm serverless coding ide web-ide python

time2code's Introduction

Time2Code

A portable, scalable web based code editor to integrate into your code learning experiences.

The goal is to make deploying your own web based code editor easier and more fun.

Tech Overview

  • The Code execution backend is built off of the serverless FaaS Framework for scalability and ability to support many languages. Support for k8s is ready through faas-netes and appears to be working well.

  • UI Modelled after the wonderful Play-with-Moby Site and the wonderful work the guys at Play-With-Docker do to make our Docker Learning Experiences Better.

  • Function handling and code execution are being handled by Python processes. Python handles the STDIN of all of the function requests and then passes it to the desired language for interpretation and execution or compilation and execution.

  • Web site is being driven by the Flask Framework

  • Code editor is built from Ace Editor project.

  • Terminal is built from XTermJS.

Up and Running

Docker Swarm

The following snippet will initialize your swarm, Time2Code, FaaS and Time2code functions.

$ docker swarm init --advertise-addr eth0 && \
  git clone https://github.com/JockDaRock/Time2Code && \
  cd Time2Code && \
  bash time2deploy.sh && \
  docker service ls

If you are on your laptop navigate to http://127.0.0.1:5555 and start coding.

Kubernetes - minikube

Note: Revisiting this and revamping kubernetes deployment...

You will need to have minikube installed before you begin.

Type the following snippets will get minikube started and faas-netes loaded into the kube cluster.

$ git clone https://github.com/JockDaRock/Time2Code

$ minikube start or $ minikube start --vm-driver=xhyve

Then run the following bash script to load FaaS and Time2Code...

`$ bash ./minikube.sh'

Once the script is complete it will provide you with the url, like this http://192.168.99.100:31114/, to reach the Time2Code web editor. BEFORE you start using it, you will need to deploy the code execution functions after the FaaS services have started. It might take a minute or two for all of the necessary Kube pods to be Running. Keep checking the pods with kubectl get pods.

To deploy the functions use the following command in your terminal.

$ faas-cli -action deploy -f ./time2code-faas-cli-minikube.yml

Once the kube pods for the code execution are running you can get to coding :)!

Latest News

Time2Code: Functions as Service and Code as a Function

More to come...

Coding Languages Currently Supported

  • Python, Golang, Powershell, NodeJS, ... more coming very soon.

  • Currently working on... I am currently working C# code execution. Most of my tests are running well, but need to iron out some necessary dependencies and other issues.

Repos for language specific code execution handlers

Roadmap and Contributing

Currently in progress:

  • Adding markdown and instruction functionality to accompany code execution. - check and check

  • Add language dependency builder for code execution functions.

  • Kubernetes Support - check and check

Time2Code is written mostly in HTML and Javascript on the FrontEnd, Python and Flask to handle the WebIDE pages, and Python on the backend to handle code language execution on the OpenFaaS framework. This project is MIT licensed - contributions are welcomed whether that means providing feedback, testing existing and new features or hacking on the source. This project is still in early stages so I need people to generally try functionality and provide feedback. I need help building new code execution handlers for different languages or suggestions for languages to add. I also need help reducing the image sizes for the Microsoft languages handlers (Powershell and C#).

time2code's People

Contributors

alexellis avatar bhageena avatar jockdarock avatar soundug avatar vmr1532 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

time2code's Issues

feature question

Thoughts before I add a PR?

I'd like to add the ability to "grade" project challenges. Sample workflow:

  1. Student forks a Flask app from GitHub that is fully tested, but missing the routes/views
  2. Student adds the routes/views to project locally, and then pushes up the changes to his/her repo
  3. Student then submits the GitHub link to his/her repo in the Time2Code webapp
  4. Time2Code then forks down the students project along with the original, upstream project. The "tests" directory is taken from the upstream and added to the student project (this helps to prevent cheating)
  5. Time2Code then spins up the project, runs the tests, and spits back out the results

Would this be a separate project altogether?

it can't not work

it don't work after i do as your tutorial

$ docker service ls
Saved file tree to doc-filelist.js
Copied JS to doc-script.js
Compiled CSS to doc-style.css

open http://127.0.0.1:5555
and then nothing in browser

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.