GithubHelp home page GithubHelp logo

canaan-creative / avalon-management-system Goto Github PK

View Code? Open in Web Editor NEW
13.0 14.0 19.0 1.39 MB

License: GNU General Public License v3.0

Python 58.67% CSS 1.63% JavaScript 23.69% HTML 14.75% Shell 1.27%

avalon-management-system's Introduction

AMS - Avalon Management System

A toolset to manage BTC Farm

Installation

Requirements

As root

$ sudo apt-get install apache2 mysql-server mysql-client \
  libapache2-mod-wsgi-py3 python3 python3-pip redis-server
$ sudo -H pip3 install Flask setuptools python-jose redis
$ sudo -H pip3 install --egg mysql-connector-python-rf
MySQL Setup
  • init mysql ( NOTE: if this is NOT the first time you install mysql in current OS, SKIP this step ):

    $ sudo mysql_secure_installation
    
  • Login with root:

    $ mysql -u root -p
    
  • Add new user ams and new database ams:

    > CREATE database ams;
    > GRANT ALL PRIVILEGES ON ams.* TO ams@localhost IDENTIFIED BY "PASSWD";
    > GRANT FILE ON *.* TO ams@localhost;
    > FLUSH PRIVILEGES;
    

    Note: replace PASSWD with the real password. It will be used in /etc/ams.conf

Install from tar.gz
  • Download the tar.gz files of ams-server and ams-client from releases.

  • Install server:

    $ tar xzpvf ams-server-VERSION.tar.gz
    $ cd ams-server-VERSION
    $ sudo python3 setup.py install
    
  • Install client:

    $ tar zxpvf ams-client-VERSION.tar.gz
    $ sudo mkdir /var/www/html/ams
    $ sudo cp -r ams-client/* /var/www/html/ams/
    

    Note: replace VERSION with the real version number.

Configuration
  • Modify AMS config file /etc/ams.conf. At least fill correct DataBase password.

  • Clone code to local

    $ git clone https://github.com/Canaan-Creative/Avalon-Management-System.git ams-git
    
  • Copy Apache2 config file:

    $ sudo cp ams-git/simple-cdd/extras/root/etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/000-default.conf
    $ sudo a2enmod wsgi headers
    $ sudo service apache2 restart
    
  • Load crontab file:

    $ crontab ams-git/config/cron.tab
    
  • Initialize database and add ui user:

    $ amscli init
    $ amscli adduser USERNAME PASSWORD
    

    NOTE: this USERNAME & PASSWORD are used to login web site

  • Add Avalon miners

    • login to http://127.0.0.1/ams with above USERNME & PASSWORD
    • go to "setting" page
    • add miners with ip address, port (4028 usually), modules (number of Avalon miners under this ip)
    • click "Save" button

Build (for Developer)

  • server:

    cd server
    python3 setup.py sdist
    
  • client:

    Requirement:

    sudo apt-get install npm
    sudo ln -s /usr/bin/nodejs /usr/bin/node
    sudo npm install -g grunt-cli jshint
    
    

    Build:

    cd client
    npm install
    grunt prereq
    grunt build
    

Structure

```
Database: /usr/local/lib/python3.5/dist-packages/ams/
Config file: /etc/ams.conf
Tools: /usr/local/bin/amscli
Frontend: /var/www/html/ams
```

Known Issues

####Apache Error: 'assert tlock is not None'

  • Reason:

    mod_wsgi version is too low (<= 3.4).

  • Solution:

    As root

    pip3 install mod_wsgi
    rm /usr/lib/apache2/modules/mod_wsgi.so
    ln -s /usr/local/lib/python3.4/dist-packages/mod_wsgi/server/mod_wsgi-py34.cpython-34m.so /usr/lib/apache2/modules/mod_wsgi.so
    service apache2 restart
    

    NOTE: the version number in python3.4 and mod_wsgi-py34.cpython-34m.so may vary.

####MySQL5.7: Create table failed with invalid date

avalon-management-system's People

Contributors

archangdcc avatar binsgit avatar cai-canaan avatar jianxiongz avatar qinfengling avatar

Stargazers

 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

avalon-management-system's Issues

Improve location of config files

In you instructions you place a config file directly in /etc/ which you shouldn't do. Create a dedicated directory for your configuration files, say something like /etc/canaan/.

A bit further down, you give the following direction:
sudo cp ams-git/config/000-default.conf /etc/apache2/sites-available/000-default.conf

Not only is config/000-default.conf NOT available in the master branch (it is in the source code download), but 'blindly' overwriting the default configuration file which is already present, is not the way to do it.
Create your own config file with a unique name and copy that to sites-available and then enable it with a2ensite would be major improvement.

Is development ongoing?

Hey guys,

I am looking for software to manage a farm of several thousand Canaan machines. It seems that this project hasn't had any commits for a while, though.

Is this still in active development, or should I look elsewhere for farm management?

Not getting any details when I go to AMS > Details > MODULES

Hi, I am new to AMS.

Can you please tell me why there isn't any information showing on this tab?

Also, OVERVIEW tab does not work as well. It stays blank!

Also, most of the amscli commands return an error?

is there any online guide or manual for AMS that I can go through ?

Thanks

Broken simple-cdd/build script

The script stopped at here for 30+ mins. Running on a Debian jessie server outside GFW.

I've done what the README.md said before running this. Maybe a detailed instruction document is needed.

root@localhost:~/Devel/Avalon-Management-System/simple-cdd# ./build
~/Devel/Avalon-Management-System/server ~/Devel/Avalon-Management-System/simple-cdd
running sdist
running egg_info
writing ams_server.egg-info/PKG-INFO
writing dependency_links to ams_server.egg-info/dependency_links.txt
writing top-level names to ams_server.egg-info/top_level.txt
reading manifest file 'ams_server.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'ams_server.egg-info/SOURCES.txt'
warning: sdist: standard file not found: should have one of README, README.rst, README.txt

running check
warning: check: missing required meta-data: url

warning: check: missing meta-data: either (author and author_email) or (maintainer and maintainer_email) must be supplied

creating ams-server-3.0.0-dev6
creating ams-server-3.0.0-dev6/ams
creating ams-server-3.0.0-dev6/ams_server.egg-info
making hard links in ams-server-3.0.0-dev6...
hard linking MANIFEST.in -> ams-server-3.0.0-dev6
hard linking README.md -> ams-server-3.0.0-dev6
hard linking ams.conf.example -> ams-server-3.0.0-dev6
hard linking ams.wsgi -> ams-server-3.0.0-dev6
hard linking amscli -> ams-server-3.0.0-dev6
hard linking setup.py -> ams-server-3.0.0-dev6
hard linking ams/__init__.py -> ams-server-3.0.0-dev6/ams
hard linking ams/api.py -> ams-server-3.0.0-dev6/ams
hard linking ams/avalon4.py -> ams-server-3.0.0-dev6/ams
hard linking ams/avalon6.py -> ams-server-3.0.0-dev6/ams
hard linking ams/avalon7.py -> ams-server-3.0.0-dev6/ams
hard linking ams/config.py -> ams-server-3.0.0-dev6/ams
hard linking ams/farm.py -> ams-server-3.0.0-dev6/ams
hard linking ams/log.py -> ams-server-3.0.0-dev6/ams
hard linking ams/luci.py -> ams-server-3.0.0-dev6/ams
hard linking ams/miner.py -> ams-server-3.0.0-dev6/ams
hard linking ams/plot.py -> ams-server-3.0.0-dev6/ams
hard linking ams/pool.py -> ams-server-3.0.0-dev6/ams
hard linking ams/report.py -> ams-server-3.0.0-dev6/ams
hard linking ams/rtac.py -> ams-server-3.0.0-dev6/ams
hard linking ams/sql.py -> ams-server-3.0.0-dev6/ams
hard linking ams_server.egg-info/PKG-INFO -> ams-server-3.0.0-dev6/ams_server.egg-info
hard linking ams_server.egg-info/SOURCES.txt -> ams-server-3.0.0-dev6/ams_server.egg-info
hard linking ams_server.egg-info/dependency_links.txt -> ams-server-3.0.0-dev6/ams_server.egg-info
hard linking ams_server.egg-info/not-zip-safe -> ams-server-3.0.0-dev6/ams_server.egg-info
hard linking ams_server.egg-info/top_level.txt -> ams-server-3.0.0-dev6/ams_server.egg-info
Writing ams-server-3.0.0-dev6/setup.cfg
creating dist
Creating tar archive
removing 'ams-server-3.0.0-dev6' (and everything under it)
~/Devel/Avalon-Management-System/simple-cdd
~/Devel/Avalon-Management-System/client ~/Devel/Avalon-Management-System/simple-cdd
grunt-cli: The grunt command line interface (v1.2.0)

Fatal error: Unable to find local grunt.

If you're seeing this message, grunt hasn't been installed locally to
your project. For more information about installing and configuring grunt,
please see the Getting Started guide:

http://gruntjs.com/getting-started



npm WARN package.json [email protected] No repository field.
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: wrench.js is deprecated! You should check out fs-extra (https://github.com/jprichardson/node-fs-extra) for any operations you were using wrench for. Thanks for all the usage over the years.
npm WARN deprecated [email protected]: Jade has been renamed to pug, please install the latest version of pug instead of jade

Minor installation issues

  1. The mysql:
GRANT ALL PRIVILEGES ON ams.* TO ams@'%' IDENTIFIED BY "PASSWD";
GRANT FILE ON *.* TO ams@localhost;

Sets the password for ams@%, which mysql thinks is a different user than ams@localhost. This is noticed when doing the later amscli init command where 'ams' is unable to connect to the DB.

Issuing the command: SET PASSWROD FOR 'ams'@'localhost' = PASSWORD("YOUR PASSWORD"); resolved that issue.

  1. Current versions of Apache do not allow "Order" and "Allow" statements anymore. Replacing those with "Require all granted" resolves the issue.

Login button / sql tables

When I click the login button nothing happens, I have everything installed, and verified the sql db is setup. Not seeing the tables being installed into db tho

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.