Version: | 1.2.1 |
---|---|
Release: | 1.2.1 |
Date: | Oct 02, 2018 |
The Hackerfleet is a research & development venture founded by some friends who decided to revolutionize the maritime technology sector.
We develop opensource hardware and software for unmanned and manned vessels on all waters, we do this publicly and transparent, our repositorys are open for you.
One of our primary goals is to establish a better communication network between compatible hardware, for automatic data exchange between ships.
We want to aggregate all the information that is currently thrown away on shipbridges all over the world and make the best free map of the ocean.
This vast ressource of currently nearly unused data will also help scientists understand our oceans better.
And now, we’re here!
You can check all this out on the intertubes. Youtube, CNN, etc. Just search for ‘Hackerfleet’ - hmm.. succinct name, eh?
Meet us at c-base, the spacestation below Berlin Mitte!
Note
Please be patient when using IRC, responses might take a few hours!
The Hackerfleet Operating System (Short HFOS) is being developed specifically to target a handful of properties and challenges, that are unique to the projected use of the system:
To master all these challenges, a rather radical approach was chosen after evaluation of most of the currently available frameworks and libraries.
The system consists of two parts: 1. A backend written in Python. It handles communications, data handling and other general services provided by independent modules. 2. To communicate with users, a HTML5 based Frontend is deployed to most modern web browser capable clients.
The cloud/server-less mesh operation enables local independence and adaptability regarding network environments.
It also eliminates the need to write platform specific applications (e.g. native Android or other mobile platform applications)
At first glance, HFOS looks like just another web application platform.
In contrast to most available systems though, HFOS works using a component based frontend and backend architecture.
This enables every installation to install, activate and use only the modules relevant for the local group of users.
Also, communication between clients and the backend has been streamlined and minimized by relying on Websockets.
The script currently only supports Debian based systems.
Note
Feel free to contribute installation steps for other distros - that is mostly adapting the package manager and package names
To use the install script, get the source code (see Getting the source) if you don’t have it already, then invoke the script with root permissions:
$ sudo ./install
If you run into trouble or get any unexpected errors, try the complex installation procedure.
We’re providing a Docker image for installation.
The command to get the current testing release is:
$ docker run -i -t hackerfleet/hfos hfos_launcher.py
HFOS’ backend has a few dependencies:
Note
We’re phasing out Python 2.7 support.
A few more dependencies like nginx, and some python packages provided per distribution are recommended, but not strictly necessary.
The HFOS Python package additionally installs a few pure Python libraries:
- Circuits
- Click and a few supporting packages
- PyMongo
- PyOpenSSL
- PyStache
- JSONSchema
- DPath
- DeepDiff
Supported Platforms: | |
---|---|
Linux | |
Supported Python Versions: | |
(2.7), 3.3, 3.4, 3.5, 3.6 |
By design, there is currently no stable release planned.
The latest stable releases (if there should ever be one) could be downloaded from the Releases page (specifically the Tags tab).
We use Git for source control and code sharing.
The latest development branch can be cloned using the following command:
$ git clone https://github.com/hackerfleet/hfos.git
For further instructions on how to use Git, please refer to the Git Website.
First of all: The manual installation procedure is rather complex right now.
We’ve simplified the process by supplying an install script, but if you encounter any trouble/problems, checkout these detailed installation steps.
If you still can’t get it to install, contact us via irc or email and we’ll happily try to help you get your installation running.
This is very important for us, since the system has not yet been deployed very often and we’re not yet aware of all of the pitfalls and traps on that route.
We encourage you to use Python >= 3.5 for HFOS, but the system is built (and checked against) 2.7, too.
Warning: HFOS is not compatible with Python 3.2!
These instructions are for Debian or Ubuntu based systems. Installation on other distributions is possible.
Before doing anything with HFOS, be sure you have all the dependencies installed via your distribution’s package manager.
For Debian Unstable use this:
$ sudo apt-get install nginx mongodb python3.5 python3-pip python3-grib \
python3-bson python3-pymongo python3-serial
If you want (and can, depending on your platform/distribution), install the mongo and bson extensions for speedups:
$ sudo apt-get install python3-pymongo-ext python3-bson-ext
The system will need to get a bunch of more dependencies via npm to set up the frontend, so install npm and if necessary the nodejs-legacy-symlink package:
$ sudo apt-get install npm nodejs
$ sudo npm install npm@4.2.0 -g
If you want to install the full development dependencies to write documentation as well, you need to install the enchant package:
$ sudo apt-get install enchant
In case you want to use raster (or in future: vector) charts in HFOS’ map module, you’ll need to install libgdal and its binaries:
$ sudo apt-get install gdal-bin python-gdal
Note, that it is necessary to install python-gdal 2.7 - not the python3 variant, as the scripts are not included in that.
To initially obtain the development source code if you don’t have it already, use git thus:
$ mkdir ~/src
$ cd ~/src
$ git clone https://github.com/hackerfleet/hfos
$ cd hfos
$ git submodule init
$ git submodule update
$ git pull
$ cd frontend
$ git pull
The manage tool usually can install everything you need. It starts by adding a new system user for HFOS and generating a (currently only self signed) certificate.
The process also involves installing the supplied modules, getting the frontend dependencies, building and installing the documentation, etc.
It also creates two folders in /var (lib/hfos and cache/hfos) for hfos’ tile- cache and other stuff as well as install basic default provisions into the database.
Finally, it installs and activates a systemd and nginx service script to launch HFOS on bootup and make it available to users.
$ virtualenv -p /usr/bin/python3.5 --system-site-packages venv
$ source venv/bin/activate
$ pip install -Ur requirements.txt
$ python setup.py develop
$ sudo venv/bin/python hfos_manage.py install all
If you want to develop (documentation) as well, you’ll need to use the requirements-dev.txt instead of the normal one.
If you want to manually start HFOS, invoke the launcher thus:
$ sudo ./venv/bin/python hfos_launcher.py
Running the launcher as root to be able to open ports below 1024 should be safe, as it drops its root privileges, unless you specify –insecure, which is strongly discouraged and only meant for development purposes. The default is to use port 8055 and relay that with the supplied nginx site definition
The documentation is available online on ReadTheDocs.org. If you wish to build and install the included documentation for offline use, run these commands:
$ sudo ./venv/bin/python hfos_manage.py install docs
This installs all necessary documentation tools and copies the files to the expected HFOS web data folder.
You can also build the PDF file (and various other formats) by using the Makefile inside the docs directory.
$ cd docs
$ make pdf
Just running make without arguments gives you a list of the other available documentation formats.
If you have downloaded a source archive, this applies to you.
$ python setup.py install
For other installation options see:
$ python setup.py --help install
If you have cloned the source code repository, this applies to you.
If you have cloned the development repository, it is recommended that you use setuptools and use the following command:
$ python setup.py develop
This will allow you to regularly update your copy of the hfos development repository by simply performing the following in the hfos working directory:
$ git pull -u
$ cd frontend
$ git pull -u
Note
You do not need to reinstall if you have installed with setuptools via the hfos repository and used setuptools to install in “develop” mode.
These instructions are WiP. The easiest way to get HFOS on Win7 or newer is to install and user Docker or a virtual machine
To install on Windows, you’ll need to install these packages first:
- Python 3.5 https://www.python.org/downloads/windows/
- MongoDB https://www.mongodb.org/downloads#production
- pymongo
- numpy
HFOS contains a few CLI scripts:
Bootstrap basics, assemble graph and hand over control to the Core component
hfos_launcher [OPTIONS]
Options
-p
,
--port
<port>
¶Define port for server
--host
<host>
¶Define hostname for server
-c
,
--cert
,
--certificate
<cert>
¶Certificate file path
--dbhost
<dbhost>
¶Define hostname for database server
--dbname
<dbname>
¶Define name of database (default: hfos)
--profile
¶Enable profiler
--opengui
¶Launch webbrowser for GUI inspection after startup
--drawgraph
¶Draw a snapshot of the component graph after construction
-q
,
--quiet
¶Suppress console output
--log
<log>
¶Define console log level (0-100)
--logfileverbosity
<logfileverbosity>
¶Define file log level (0-100)
--logfilepath
<logfilepath>
¶Logfile path
--dolog
¶Write to logfile
--livelog
¶Log to in memory structure as well
--debug
¶Run circuits debugger
--dev
¶Run development server
--instance
<instance>
¶Define name of instance
--insecure
¶Keep privileges - INSECURE
--norun
¶Only assemble system, do not run
-b
,
--blacklist
<blacklist>
¶Blacklist a component
Todo
Simplify the installation documents by stringing them together, so the other setup documents are more visible
Todo
Add setup section
Todo
Add crew setup
Todo
Add vessel setup
Todo
Add generic preferences setup
Glad to see you’re interested in helping out the project!
Generally, you can ping riot if you want to help out and don’t exactly know where to start.
Here, we list a few possible opportunities where you can help us and become part of the driving community:
People need to be more aware of this project as it may be of great value to them. If you’re interested in spreading the word and getting people involved, you’re very welcome to do so. Again, please ping riot to get crucial info on how to do so.
There are various degrees to which you can test the project:
- Check the installation processes if they actually work on your platform and everything installs smoothly
- Test-drive your installation or the demo instance (Currently offline for maintenance)
- Build and extend parts of the automatic testing infrastructure
- Optimize and extend the continuous integration infrastructure
We’d value your input on some very important user experience questions:
- Is the current design logical and does it allow for a smooth user experience?
- Check the supplied modules and the framework itself for consistency and good UX practices
- Develop further use cases and user stories to spark new modules
A lot of documentation is still missing. If you’re interested in writing documentation, you should be familiar with the two core tools we use for generating our documentation:
We still need a lot of module, core framework and source code documentation, so there’s ample opportunities in this field.
Most of (if not all) parts of the project can be translated and are waiting for your help. You can use Transifex to translate all the strings we have or work with your favourite PO Editor. Have a look at Translating HFOS for more details.
This is the rather dry material for new software developers:
Here’s how we do things in HFOS…
Note
If you are familiar with IRC
and use your own IRC Client then connect to the FreeNode Network and /join #hackerfleet
.
We use the following coding standard:
We also lint our codebase with the following tools:
Please ensure your Development IDE or Editor has the above linters and checkers in place and enabled.
Alternatively you can use the following command line tool:
We use the following tools to develop HFOS and share code:
We strongly suggest familiarizing with all of them, to make sure you understand our CI.
Big thanks to all of these magnificent and free-for-opensource services!
Here’s how you can contribute to HFOS
We welcome all bug reports. We do however prefer bug reports in a clear and concise form with repeatable steps. One of the best ways you can report a bug to us is by writing a unit test (//similar to the ones in our tests//) so that we can verify the bug, fix it and commit the fix along with the test.
To submit a bug report, please Create an Issue
We’re not perfect, and we’re still writing more tests to ensure quality code. If you’d like to help, please Fork HFOS, write more tests that cover more of our code base and submit a Pull Request. Many Thanks!
If you’d like to see a new feature added to HFOS, then we’d like to hear about it~ We would like to see some discussion around any new features as well as valid use-cases. To start the discussions off, please either:
Chat with us on #hackerfleet on the FreeNode IRC Network
or
This is the recommended way to setup a development enviornment for developing the backend and frontend of HFOS .
Note
This document assumes you already have a working Python environment with a minimum Python version of 2.7 as well as mongodb and pip already installed.
It is highly recommended that you install and use virtualenv for all your Python development and production deployments (not just HFOS).
It is also convenient to install and use the accompanying shell scripts and tools virtualenvwrapper which adds a nice set of workflows and functions useful for both development and deployments.
$ pip install -U virtualenvwrapper
$ source $(which virtualenvwrapper.sh)
Note
You should put source $(which virtualenvwrapper.sh)
in either
your $HOME/.bashrc
or $HOME/.profile
depending on how you
login and interact with your terminals.
In addition to the above recommendations you must also have a Git client installed and ready to use as well as your Editor/IDE of choice ready to use.
And you’re done!
Example:
$ git clone git@github.com:yourgithubaccount/hfos.git
$ cd hfos
$ mkvirtualenv hfos
$ pip install -r requirements-dev.txt
$ python setup.py develop
We document all our internal development processes here so you know exactly how we work and what to expect. If you find any issues or problems, please let us know!
We employ the use of the SCRUM Agile Process and use our Issue Tracker to track features, bugs, chores and releases. If you wish to contribute to HFOS, please familiarize yourself with SCRUM and GitHub’s Issue Tracker.
New Bug Reports are submitted via: https://github.com/hackerfleet/hfos/issues
Confirmation and Discussion of all New Bug Reports.
Once confirmed, a new Bug is raised in our Issue Tracker
An appropriate milestone will be set (depending on current milestone’s schedule and resources)
A unit test developed that demonstrates the bug’s failure.
A fix developed that passes the unit test and breaks no others.
A New Pull Request created with the fix.
This should contain: - A new or modified unit test. - A patch that fixes the bug ensuring all unit tests pass. - The Change Log updated. - Appropriate documentation updated.
The Pull Request is reviewed and approved by at least two other developers.
New Feature Requests are submitted via: https://github.com/hackerfleet/hfos/issues
Confirmation and Discussion of all New Feature Requests.
Once confirmed, a new Feature is raised in our Issue Tracker
An appropriate milestone will be set (depending on current milestone’s schedule and resources)
A unit test developed that demonstrates the new feature.
The new feature developed that passes the unit test and breaks no others.
A New Pull Request created with the fix.
This must contains: - A new or modified unit test. - A patch that implements the new feature ensuring all unit tests pass. - The Change Log updated. - Appropriate documentation updated.
The Pull Request is reviewed and approved by at least two other developers.
Submit a New Issue
Write your code.
Use flake8 to ensure code quality.
Run the tests:
$ tox
Ensure any new or modified code does not break existing unit tests.
Update any relevant doc strings or documentation.
Update the Change Log appropriately.
Submit a New Pull Request.
To run the tests you will need the following installed:
All of these can be installed via pip install -r requirements-dev.txt
.
Please also ensure - if you can - that you you have all supported versions of Python that HFOS supports installed in your local environment.
To run the tests:
$ tox
We aim for the following development standards:
Code Complexity shall not exceed 10
Note
This includes the 79 character limit!
Note
Arguments, Keyword Arguments, Return and Exceptions must be documented with the appropriate Sphinx Python Domain.
We manage our roadmap via milestones on our github issuetracker.
The following users and developers have contributed to HFOS:
HFOS proudly uses the circuits framework. circuits was originally designed, written and primarily maintained by James Mills (http://prologic.shortcircuit.net.au/).
Anyone not listed here, ping us. We appreciate any and all contributions to HFOS and other Hackerfleet components.
Todo
Remove/Merge original list and asset docs to this document
Got more questions?
Note
Please be patient when using IRC, responses might take a few hours!
- Clean up docstrings
- Shorten Index
- Split up Index?
- Shorten Index title lengths
- Import nautical glossary
- Multilang
Todo
Remove/Merge original list and asset docs to this document
(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/hfos/checkouts/latest/docs/source/contributors.rst, line 32.)
Todo
Simplify the installation documents by stringing them together, so the other setup documents are more visible
(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/hfos/checkouts/latest/docs/source/start/index.rst, line 13.)
Todo
Add setup section
(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/hfos/checkouts/latest/docs/source/start/index.rst, line 14.)
Todo
Add crew setup
(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/hfos/checkouts/latest/docs/source/start/index.rst, line 15.)
Todo
Add vessel setup
(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/hfos/checkouts/latest/docs/source/start/index.rst, line 16.)
Todo
Add generic preferences setup
(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/hfos/checkouts/latest/docs/source/start/index.rst, line 17.)
Todo
Link backend deps
(The original entry is located in /home/docs/checkouts/readthedocs.org/user_builds/hfos/checkouts/latest/docs/source/start/requirements.rst, line 49.)
A collaborative and modular infrastructure for your data.
There is more than one way of installing HFOS, see the quickstart instructions for those.
The simplest way is to use the supplied installation script:
sudo ./install
The installation produces a lot of output which is automatically piped into ‘output.log’. It installs all dependencies then sets up a user account and the system’s services. This assumes, that you’re not running another web server on port 443 and that your firewall is configured to allow communications on that port. HFOS modules may require additional open ports, to find out about that, read their readme files.
If you run into trouble or get any unexpected errors, contact us or try the complex installation procedure.
The system is modular, so you can install what you need and leave other things.
A lot of the included modules are still Work in Progress, so help out, if you’re interested in a powerful - cloud independent - collaboration tool suite.
These are ‘official’ Hackerfleet developed modules. If you’d like to contribute your own, ping riot@c-base.org, to get it added to the list.
Name | Description |
---|---|
sails | Web UI, compatible with all modern browsers |
automat | Automation for non programmers |
alert | User alerting and notification system |
calc | Integrated EtherCalc |
camera | Camera support |
chat | Integrated chat |
comms | Communication package |
countables | Count arbitrary things |
dash | Dashboard information system |
enrol | Enrollment (new user) management |
equipment | Equipment management |
filemanager | File management |
garden | Garden automation tools |
ldap | LDAP user authorization |
library | Library management |
mesh | Mesh networking |
nodestate | Node wide status system |
polls | Tool for lightweight internet voting |
project | Project management tools |
protocols | Miscellaneous communication protocols |
robot | RC remote control unit |
shareables | Shared resource blocking tool |
switchboard | Virtual switchboard |
wiki | Etherpad + Wiki = awesomeness |
Many of these are not yet fully usable, so please help out and perhaps take ownership of one (or more) of them!
Please research any bugs you find via our Github issue tracker for HFOS and report them, if they’re still unknown.
If you want to discuss distributed, opensource (or maritime) technology in general incl. where we’re heading, head over to our Github discussion forum …which is cleverly disguised as a Github issue tracker.
You can also find us here:
Note
Please be patient when using IRC, responses might take a few hours!
Copyright (C) 2011-2018 riot <riot@c-base.org> and others.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
– :boat: :+1: