Coder Social home page Coder Social logo

core0's Introduction

Build Status codecov

Core

Systemd replacement for G8OS

Releases:

Sample setup

The following steps will create a docker container that have core0 as the init process. When running, u can send commands to core0 using the pyclient

First we need to prepare the base docker image to host core0

FROM ubuntu:16.04
RUN apt-get update && \
    apt-get install -y wget && \
    apt-get install -y fuse && \
    apt-get install -y iproute2 && \
    apt-get install -y nftables && \
    apt-get install -y dnsmasq && \
    apt-get install -y redis-server

Make sure that you build both core0 and coreX as following

go get github.com/g8os/core0/core
go get github.com/g8os/core0/corex

The do

cd $GOPATH/src/github.com/g8os/core0
# then start the docker container
docker run --privileged -d \
    --name core0 \
    -v `pwd`/core0/core0:/usr/sbin/core0 \
    -v `pwd`/coreX/coreX:/usr/sbin/coreX \
    -v `pwd`/core0/g8os.dev.toml:/root/core.toml \
    -v `pwd`/core0/conf:/root/conf \
    corebase \
    core0 -c /root/core.toml

Note: You might ask why we do this instead of copying those files directly to the image the point is, now it's very easy for development, each time u rebuild the binary or change the config u can just do docker restart core0 without rebuilding the whole image.

To follow the container logs do

docker logs -f core0

Using the client

Before using the client make sure the ./pyclient is in your PYTHONPATH

import client

cl = client.Client(host='ip of docker container running core0')

#validate that core0 is reachable
print(cl.ping())

#then u can do stuff like
print(
    cl.system('ps -eF').get()
)

print(
    cl.system('ip a').get()
)

#client exposes more tools for disk, bridges, and container mgmt
print(
    cl.disk.list()
)

Features

v0.9:

  • Boot the core0 as init process
  • Manage disks
  • Create containers
    • Full Namespace isolation
    • Host the root filesystem of the containers via ipfs
    • Network stack dedicated
    • ZeroTier Network integration
    • Use flist file format as root metadata
  • Remotly administrate the process
    • via Python client
    • via redis

v0.10:

  • change datastore for fuse filesystem from ipfs to G8OS Store.

Available Commands

Commands Documentation

Schema

Schema Plan

Examples

You can find example usage here

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.