Свеча dragonfly doji: что это такое?
Installation
Quick Installation:
If you have done this kind of thing before, you should be able to install
Dragonfly via .
$ sudo apt-get install python-dev python3-dev gfortran # On Ubuntu/Debian $ pip install numpy $ pip install dragonfly-opt -v
Testing the Installation:
You can import Dragonfly in python to test if it was installed properly.
If you have installed via source, make sure that you move to a different directory
to avoid naming conflicts.
$ python >>> from dragonfly import minimise_function >>> # The first argument below is the function, the second is the domain, and the third is the budget. >>> min_val, min_pt, history = minimise_function(lambda x: x ** 4 - x**2 + 0.1 * x, ], 10); ... >>> min_val, min_pt (-0.32122746026750953, array())
Due to stochasticity in the algorithms, the above values for , may be
different. If you run it for longer (e.g.
),
you should get more consistent values for the minimum.
Features
In details, Dragonfly has the following features:
- P2P based file distribution: Using P2P technology for file transmission, which can make full use of the bandwidth resources of each peer to improve download efficiency, saves a lot of cross-IDC bandwidth, especially costly cross-board bandwidth
- Non-invasive support for all kinds of container technologies: Dragonfly can seamlessly support various containers for distributing images.
- Host level speed limit: Many downloading tools(wget/curl) only have rate limit for the current download task, but dragonfly also provides rate limit for the entire host.
- Passive CDN: The CDN mechanism can avoid repetitive remote downloads.
- Strong consistency: Dragonfly can guarantee that all downloaded files must be consistent even if users do not provide any check code(MD5).
- Disk protection and high efficient IO: Precheck Disk space, delay synchronization, write file-block in the best order, split net-read / disk-write, and so on.
- High performance: Cluster Manager is completely closed-loop, which means, it does not rely on any DB or distributed cache, processing requests with extremely high performance.
- Exception auto isolation: Dragonfly will automatically isolate exception nodes(peer or Cluster Manager) to improve download stability.
- No pressure on file source: Generally, as long as a few Cluster Managers download file from the source.
- Support standard http header: Support http header, Submit authentication information through http header.
- Effective concurrency control of Registry Auth: Reduce the pressure of the Registry Auth Service.
- Simple and easy to use: Very few configurations are needed.
Quick Start
Command line:
Below is an example usage in the command line.
$ cd examples $ dragonfly-script.py --config synthetic/branin/config.json --options options_files/options_example.txt
In Python code:
The main APIs for Dragonfly are defined in
.
For their definitions and arguments, see
and
.
You can import the main API in python code via,
from dragonfly import minimise_function, maximise_function func = lambda x: x ** 4 - x**2 + 0.1 * x domain = ] max_capital = 100 min_val, min_pt, history = minimise_function(func, domain, max_capital) print(min_val, min_pt) max_val, max_pt, history = maximise_function(lambda x: -func(x), domain, max_capital) print(max_val, max_pt)
Here, is the function to be maximised,
is the domain over which is to be optimised,
and is the capital available for optimisation.
The domain can be specified via a JSON file or in code.
See
here,
here,
here,
here,
here,
here,
here,
here,
here,
here,
and
here
for more detailed examples.
In Ask-Tell Mode:
Ask-tell mode provides you more control over your experiments where you can supply past results
to our API in order to obtain a recommendation.
See the following example for more details.
Acknowledgements
Research and development of the methods in this package were funded by
DOE grant DESC0011114, NSF grant IIS1563887, the DARPA D3M program, and AFRL.
License
This software is released under the MIT license. For more details, please refer
LICENSE.txt.
«Copyright 2018-2019 Kirthevasan Kandasamy»
Comparison
For Dragonfly, no matter how many clients start the file downloading, the average downloading time is almost stable without increasement (12s in experiment, which means it only takes 12s in total for all client to finish downloading file/image).
And for wget, the downloading time keeps increasing when you have more clients. As the number of wget clients reaches 1200 (in following experiment), the file source will crash, then it can not serve any client.
The following table shows the testing environment and the graph shows the comparison result.
Test Environment | Statistics |
---|---|
Dragonfly server | 2 * (24core 64GB 2000Mb/s) |
File Source server | 2 * (24core 64GB 2000Mb/s) |
Client | 4core 8GB 200Mb/s |
Target file size | 200MB |
Introduction
Dragonfly is an open source intelligent P2P based image and file distribution system. Its goal is to tackle all distribution problems in cloud native scenarios. Currently Dragonfly focuses on being:
- Simple: well-defined user-facing API (HTTP), non-invasive to all container engines;
- Efficient: CDN support, P2P based file distribution to save enterprise bandwidth;
- Intelligent: host level speed limit, intelligent flow control due to host detection;
- Secure: block transmission encryption, HTTPS connection support.
Dragonfly has finished refactoring in Golang. Now versions > 0.4.0 are totally in Golang, while those < 0.4.0 are in Java. We encourage adopters to try Golang version first, since Java versions will be out of support in the next few releases.