-
Notifications
You must be signed in to change notification settings - Fork 0
First draft #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
First draft #1
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…on the remote machine
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR lay the ground structure of this package. It doesn't simulate every part of the operating system, so far it covers the clock, HTTP requests and processes. The rest will be done in other PRs to keep each as small as possible.
It started as just a way to configure an
OperatingSystemobject but it quickly became messy when dealing with representing multiple remote machines. For example contacting a same machine over HTTP and then SSH was hard to represent as it requires to have the same persistent OS object (to share the same state).That's why the current design models these concepts:
MachineClusterto represent a collection ofMachines that can talk to each otherThese public structures are immutable to ease configuring them. Then they are booted, meaning it creates mutable copies of these objects. Once booted they are connected over a
Networkobject to allow to route HTTP requests and SSH connections.The
Networkalso starts aNTPServerthat allows to centralise the time between machines. When connections are made over this network it can inject latencies by fast forwarding theNTPServerinternal clock.A
Machineclock is bound to theNTPServerone but when accessing the clock time it can drift from the central clock (either by speeding up or slowing down). This drift is reseted when the machine makes any call over the network in order to simulate a real machine synchronising over an NTP server.When a
Machineprocess tries to halt itself, instead of really waiting for the specified period it jumps the central clock by this period.The latencies and drifts are represented as ring buffers instead of continuous sequence of random values to allow to decouple BlackBox from this package. Also this helps keep this simulation deterministic. But the way it's represented allows to still introduce such behaviour later on without a BC break.
The overall time can also be sped up (meaning the app is slower than actual behaviour) to simulate degraded performance in a cluster. For now it's specified as a factor between
2and10, this range is arbitrary and may change in the future.The cluster can also be specified any start point in time to allow to test in the past or future. Each machine OS is configurable meaning each machine can be specified to operate on a different timezone. This allows to test any deployment topology.
Each
Machinecan be injected a HTTP or CLI app, this corresponds to the 2 cases covered byinnmind/framework.Note
The remaining
todos are either decisions that can be made later on (needs more feedback before making a decision) or requires to use other packages that rely oninnmind/foundation. This last point will wait for the next major version ofinnmind/foundationbefore implementing them.