Coder Social home page Coder Social logo

control-center / serviced Goto Github PK

View Code? Open in Web Editor NEW
126.0 41.0 26.0 146.2 MB

Serviced is a PaaS runtime. It allows users to create, manage and scale services in a uniform way.

License: Apache License 2.0

Shell 1.02% Ruby 1.92% HTML 2.17% Go 74.91% Makefile 0.53% Python 5.32% JavaScript 11.96% C 0.11% CSS 0.67% Java 0.03% Gherkin 1.17% Groovy 0.05% Dockerfile 0.15%

serviced's Introduction

serviced

Serviced is a PaaS runtime. It allows users to create, manage and scale services in a uniform way.

Installation

Serviced can run on a single host or across multiple hosts. First, serviced depends on docker. The minimal version of docker should be 19.03.11 for running serviced 1.8.x. The minimum supported versions of Linux distributions are Ubuntu is 18.04 and CentOS 7.6.

  1. Follow the instruction at http://www.docker.io/ , to install it on every host that serviced will run on. Ensure docker is running.

  2. Install a generated package

        sudo apt-key adv --keyserver keys.gnupg.net --recv-keys AA5A1AD7
        sudo sh -c 'echo "deb [ arch=amd64 ] http://get.zenoss.io/apt/ubuntu trusty universe" > /etc/apt/sources.list.d/zenoss.list'
        sudo apt-get update
        sudo apt-get install -y serviced

    Or follow the steps below in the dev section to a source build.

  3. Elasticsearch 7.x uses a mmapfs directory by default to store its indices. The default operating system limits on mmap counts is likely to be too low, which may result in out of memory exceptions. On Linux, the limits should be increased by running the following command as root:

    sysctl -w vm.max_map_count=262144

    To set this value permanently, update the vm.max_map_count setting in /etc/sysctl.conf. To verify after rebooting, run sysctl vm.max_map_count.

  4. Start the service. On ubuntu,

    start serviced

    There will be some delay the first time serviced is started before it is ready for user requests. You can track the output of serviced at /var/log/upstart/serviced.log.

  5. Browse the UI at https://localhost

Usage

Serviced is a platform for running services. Serviced is composed of a master serviced process and agent processes running on each host. Each host must be registered with the master process. To register an agent process:

serviced host add HOST:PORT RESOURCE_POOL

Dev Environment

Serviced is written in Go. To install Go, download go v1.14.4 from http://golang.org. Untar the distribution to /usr/local/go. If you use a different location for go, you must set GOROOT. See the http://www.golang.org for more information. Ensure that $GOROOT/bin is in you path. There's an easier way to install in Ubuntu

sudo snap install --classic --channel=1.14/stable go

Add your development user to the "docker" group.

sudo usermod -G docker -a $USER

Ubuntu 18.04 is the typical development environment. There are additional dependencies your install will need.

sudo apt-get install git mercurial libpam0g-dev make

With $GOROOT set and $GOROOT/bin in your $PATH, create a development workspace.

export GOPATH=~/mygo
export PATH="$PATH:$GOPATH/bin"
mkdir -p $GOPATH/{bin,pkg,src}
mkdir -p $GOPATH/src/github.com/control-center
cd $GOPATH/src/github.com/control-center
git clone [email protected]:control-center/serviced
    # alternatively: git clone https://github.com/control-center/serviced
cd serviced
make

After this, a binary should exist at $GOPATH/bin/serviced & $GOPATH/src/github.com/control-center/serviced/serviced. You can run the server with

sudo serviced -master

serviced's People

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  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

serviced's Issues

Websocket Shell: Share a single session among multiple users

Summary

Allow each shell session to be identified by a SessionID, so that multiple users can monitor a running session.

Acceptance Criteria

  • There will be only one host connection who can send messages to the session
  • By default, the host is established by connection that creates the session, or the only participant monitoring the session
  • The host can yield control, allowing any of the participants to become the host
  • If there are no participants & the session is idle for a period of time, remove the session.
  • Buffer the last N bytes of the running session and send the buffer to any new participants that join the session
  • Should be able to get a list of all active sessions
  • As a host, should be able to manually close a session

README's install instructions fail on Ubuntu 14.04 server

I've now tried this using Go 1.3.3 and Go 1.2.2 and get the same result:

root@zenoss:~# mkdir $GOPATH/{bin,pkg,src} -p
root@zenoss:~# mkdir $GOPATH/src/github.com/zenoss -p
root@zenoss:~# cd $GOPATH/src/github.com/zenoss 
root@zenoss:~/mygo/src/github.com/zenoss# git clone https://github.com/control-center/serviced.git
Cloning into 'serviced'...
remote: Counting objects: 32659, done.
remote: Compressing objects: 100% (98/98), done.
remote: Total 32659 (delta 41), reused 0 (delta 0)
Receiving objects: 100% (32659/32659), 22.25 MiB | 586.00 KiB/s, done.
Resolving deltas: 100% (21352/21352), done.
Checking connectivity... done.
root@zenoss:~/mygo/src/github.com/zenoss# cd serviced
root@zenoss:~/mygo/src/github.com/zenoss/serviced# make
go get github.com/tools/godep
go install github.com/tools/godep
/root/mygo/bin/godep restore

touch .Godeps_restored
cd isvcs && make
make[1]: Entering directory `/root/mygo/src/github.com/zenoss/serviced/isvcs'
cp resources/logstash/logstash.conf.in resources/logstash/logstash.conf
make[1]: Leaving directory `/root/mygo/src/github.com/zenoss/serviced/isvcs'
cd web && make build_js
make[1]: Entering directory `/root/mygo/src/github.com/zenoss/serviced/web'
cat static/js/main.js static/js/controllers/BackupRestoreControl.js static/js/controllers/CeleryLogicControl.js static/js/controllers/DeployedAppsControl.js static/js/controllers/DeployWizard.js static/js/controllers/DevControl.js static/js/controllers/HostDetailsControl.js static/js/controllers/HostsControl.js static/js/controllers/HostsMapControl.js static/js/controllers/IsvcsControl.js static/js/controllers/LanguageControl.js static/js/controllers/LogControl.js static/js/controllers/LoginControl.js static/js/controllers/NavbarControl.js static/js/controllers/PoolsControl.js static/js/controllers/PoolsDetailsControl.js static/js/controllers/ServicesMapControl.js static/js/controllers/SubServiceControl.js > static/js/controlplane.js || rm -rf static/js/controlplane.js
makefile:46: WARNING: This is a scurrilous lie. We are not minifying anything.
cp static/js/controlplane.js static/js/controlplane.min.js
make[1]: Leaving directory `/root/mygo/src/github.com/zenoss/serviced/web'
go build -ldflags "-X main.Version 0.8.0 -X main.Giturl '' -X main.Gitcommit b5e106f -X main.Gitbranch develop -X main.Date 'Sat Oct  4 14:02:31 UTC 2014' -X main.Buildtag 0"
main.go:19:2: cannot find package "github.com/control-center/serviced/cli/api" in any of:
    /usr/local/go/src/pkg/github.com/control-center/serviced/cli/api (from $GOROOT)
    /root/mygo/src/github.com/control-center/serviced/cli/api (from $GOPATH)
main.go:20:2: cannot find package "github.com/control-center/serviced/cli/cmd" in any of:
    /usr/local/go/src/pkg/github.com/control-center/serviced/cli/cmd (from $GOROOT)
    /root/mygo/src/github.com/control-center/serviced/cli/cmd (from $GOPATH)
main.go:21:2: cannot find package "github.com/control-center/serviced/servicedversion" in any of:
    /usr/local/go/src/pkg/github.com/control-center/serviced/servicedversion (from $GOROOT)
    /root/mygo/src/github.com/control-center/serviced/servicedversion (from $GOPATH)
make: *** [serviced] Error 1
root@zenoss:~/mygo/src/github.com/zenoss/serviced# 

Install instructions fail due docker version mismatch

http://controlcenter.io/gettingstarted.html

root@eb430a03e479:/# sudo apt-get install serviced
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 serviced : Depends: docker-engine (= 1.8.2-0~trusty) but 1.12.3-0~trusty is to be installed
E: Unable to correct problems, you have held broken packages.
root@eb430a03e479:/#

apparently the docker install instructions install latest docker version, but you require specific docker version

# wget -O - http://get.docker.io | sudo su

Documentation

I hope this isn't superfluous, but I'm not sure where else I'd put a statement/question. I ran into some issues following the install directions with zenoss 5.1. Admittedly I had made a mistake and started down a bit of a rabbit hole, but in the process I compiled this platform from source and it was a bit of a mess. I went with the development branch which may have caused issues on it's own, but even master calls for things like go 1.4 while the installer calls for go 1.6. There's a link to a non functioning jenkins build or something of the sort. Even that aside, part of the build process requires ruby, node, and a slew of other dependencies that are not listed. I found myself modifying make files for environment variables, to fix fpm issues, gulp files, go files and other things I'm sure. I'm a bit fresh to git, and each project is different I'm sure. But the question is, if I write up directions for a proper compile, do you guys want that? Then how do I merge that? It's just the readme, but I can't make a branch in your repo right? I just fork that and then figure out how to merge that back in with a pull request?

Support for Advanced Filesystems

Serviced uses thin pools with fragile FS' atop them (XFS and EXT4), while performing a bunch of block operations beneath those FS' with occasional mishaps occurring as a result. Moreover, operators collecting reasonable amounts of production data will want to preserve, compress, deduplicate, and back it up in a consistent manner - all of which can be done with ZFS and (AFAIK) BTRFS/HAMMER/etc.
We build serviced for Arch Linux internally (well, CI does it for us), and our little Arch fork is ZFS-native (built into the kernel), with root mounts and most workloads on it (unless we need XFS/F2FS/etc for specific things). Using ZFS for docker storage has pretty much fixed our corruption issues with serviced, as well as having it back the media underneath the thin pool since its operations are transactional/atomic.
However, the requirement for thin pools with more VFS atop them becomes redundant and reduces the efficacy of the underlying advanced storage (ZFS' default recordsize is 128K, and these days dnodes are dynamically sized). If we truly need block storage, its baked right in, but what's really needed for serviced's "volume" semantic is the ability to control datasets (also handy to be able to leverage the NFS integration for "DFS").
This would also benefit the commercial deployments out there as the infrastructure improvement yields much more efficient storage (ZSTD, of varying depths is available), improves performance (ARC is much smarter than Linux' pagecache and fewer bytes are accessed when compressed), and most importantly provides guarantees for the integrity of data on-disk which are not possible with the current approach (EXT4 and XFS do not perform cryptographically checksummed and immediately validated writes, before returning a successful commit to the caller). Concurrently, ZFS has inline crypto and allowing serviced to manage that would deliver additional security boundaries to customers and community users with zero effort to actually implement any of that (the FS' do the work, the interface to them appears to be missing). While ZFS may not be GPL, it is battle-hardened and well-proven. If BTRFS no longer stands for "bit rot filesystem," then it might be worth a shot too.

Go get failed due to incorrect dependency name: Sirupsen

go get github.com/control-center/serviced/dfs/nfs
go: finding github.com/control-center/serviced latest
go: finding github.com/zenoss/glog latest
go: finding github.com/zenoss/logri latest
go: github.com/control-center/serviced/dfs/nfs imports
github.com/control-center/serviced/logging imports
github.com/Sirupsen/logrus: github.com/Sirupsen/[email protected]: parsing go.mod:
module declares its path as: github.com/sirupsen/logrus
but was required as: github.com/Sirupsen/logrus

need to change sirupsen to be Sirupsen sirupsen/logrus#1041

docker 1.6

When installing serviced it attempts to uninstall docker 1.6.3 and replace it with 1.5.0. Is 1.5 a hard dependency, or can the pkg be changed to allow 1.5+?

How can I install a new SSL certificate

Specifying SERVICED_KEY_FILE and SERVICED_CERT_FILE in /etc/default/serviced does not result in the new certificate in being offered by Control Center on login. Is this the way to change the certificate?

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.