Commit Graph

3941 Commits (0a9c664d17cba2139fcf93274536ea1ab1272cb4)

Author SHA1 Message Date
connor rigby 0a9c664d17
Update farmbot-arduino-firmware submodule to be built in
farmbot_firmware app
2019-09-13 16:03:17 -07:00
connor rigby 58e382268a
Remove firmware submodule 2019-09-13 16:03:17 -07:00
connor rigby 59c17cab4e
Update deps 2019-09-13 16:03:17 -07:00
Connor Rigby 4b4de1c2c4
quiet down tty detector 2019-09-13 16:03:17 -07:00
Connor Rigby b3d4930dee
Update tzdata 2019-09-13 16:03:17 -07:00
Rick Carlino 8aeac940f6
Test case: Missing paramters and falling back to defaults- FE=>Regimen=>Sequence 2019-09-13 16:03:17 -07:00
Rick Carlino fd2ab792dd
Test case: Sequence using default value when regimen does not provide value 2019-09-13 16:03:17 -07:00
Rick Carlino b4c05d13e0
Test case: passing default value in a sequence 2019-09-13 16:03:17 -07:00
connor rigby eaa4839405
Pass variables from FarmEvent -> Regimen -> Sequence 2019-09-13 16:03:17 -07:00
Rick Carlino 016ea36f34
🎉 FarmEvent variables ✔️ 2019-09-13 16:03:17 -07:00
Rick Carlino 399ddf50c8
PersistentRegimen => RegimenInstance 2019-09-13 16:03:17 -07:00
Rick Carlino 295cb45d49
Transport => Channel 2019-09-13 16:03:17 -07:00
Rick Carlino 62173829e9
AutoSyncTransport => AutoSyncChannel 2019-09-13 16:03:17 -07:00
Rick Carlino bca13f600b
LogTransport => LogChannel 2019-09-13 16:03:17 -07:00
connor rigby d842c3a123
🎉 Implement Variables in Regimen 2019-09-13 16:03:17 -07:00
Rick Carlino 18731e295d
Add `body` attribute to Regimen asset 2019-09-13 16:03:17 -07:00
Connor Rigby e80780aeb8
Remove EnigmaWorker in favor of db context hooks
* Add firmware_hardware setter on bot_state
* move firmware side effects to farmbot_core
* move firmware estop timer to farmbot_core
* change enigmas to be soft delete
2019-09-13 16:03:17 -07:00
Rick Carlino 673d8a834c
Add docs to modules that were missing them 2019-09-13 16:03:17 -07:00
Connor Rigby 0a55aa4cc3
Fix host only race condition causing token to delete itself 2019-09-13 16:03:17 -07:00
Connor Rigby 13ae06cf17
Backport elixir 1.8 + elixir_make 0.5 hacks from `staging` 2019-09-13 16:03:17 -07:00
connor rigby 16c9f8d62f
Fix test env config.exs 2019-09-13 16:03:17 -07:00
Connor Rigby d4245cf2df
Fix/update dirty worker 2019-09-13 16:03:17 -07:00
Connor Rigby b7f4ebba57
Fixes for bootstrapping firmware.
* TTYDetector no longer causes side effects
* add new RPC for `flash_firmware` that takes a `package` arg
2019-09-13 16:03:17 -07:00
Rick Carlino aa9ad9523a
Update EnigmaWorker to not die causing supervisor restarts.
* Tests for enigma cleanup
2019-09-13 16:03:17 -07:00
Rick Carlino 0b5df60f67
Implement and test Enigmas for firmware_missing
* Test for create_or_update_enigma!() and clear_enigma()
2019-09-13 16:03:17 -07:00
Connor Rigby 2df816873f
Implement closing/reopening of Transports in farmbot_firmware 2019-09-13 16:03:16 -07:00
Rick Carlino 17d24bdc0e
Begin impl of firmware flasher RPC, add `clear_enigma` helper 2019-09-13 16:03:16 -07:00
Rick Carlino 3bc84a3d3e
Add `flash_firmware` to Celery compiler. 2019-09-13 16:03:16 -07:00
Connor Rigby d2c5a1a72b
Add enigma_worker config to farmbot_ext and frambot_os 2019-09-13 16:03:16 -07:00
Connor Rigby ee7c20c7fa
Expand enigma_worker_test to include lifecycle events 2019-09-13 16:03:16 -07:00
Rick Carlino cfa86293a4
Refactor fbos_config_worker_test to be less prone to races 2019-09-13 16:03:16 -07:00
Rick Carlino af7b9e3359
Add seeds, Add FarmbotFirmware back to core 2019-09-13 16:03:16 -07:00
Connor Rigby 981dee6fef
Update enigma schema to match other asset schema
This is because we need to hook the Enigma AssetWorker up to the
existing AssetWorker system. It expects some keys to exist including
`updated_at` and `created_at`
2019-09-13 16:03:16 -07:00
Connor Rigby b9ff313750
Fix and expand enigma state tracking tests 2019-09-13 16:03:16 -07:00
Rick Carlino b15a9a0129
Tests for BotState and BotStateNG WRT Enigma resources. 2019-09-13 16:03:16 -07:00
Rick Carlino acf4de0671
Add enigmas table / private asset 2019-09-13 16:03:16 -07:00
Connor Rigby b25f8526bc
Small doc update to bot_state_ng 2019-09-13 16:03:16 -07:00
Connor Rigby 092985cfc2
Rename `farmware_manifest_version` 2019-09-13 16:03:16 -07:00
connor rigby 2124c19fcd
Change how FarmwareManifests are built 2019-09-13 16:03:16 -07:00
Connor Rigby 1e7ae7a744
Finish implementing Farmware.
Farmware runtime seems to be working really well. The only
problem is currently the way Farmware is stored on the bot state
can not be properly serialized to the new method. This will require
a breaking change
2019-09-13 16:03:16 -07:00
connor rigby b204ce3b9e
Add some work for Farmware 2019-09-13 16:03:16 -07:00
connor rigby 218b33785d
Fix more namespaces 2019-09-13 16:03:16 -07:00
Connor Rigby 95bd827518
Rename FarmbotOS namespace 2019-09-13 16:03:16 -07:00
Connor Rigby 08cec79db6
Rename FarmbotExt Namespace 2019-09-13 16:03:16 -07:00
Connor Rigby f1dd9009ea
Rename FarmbotCore Namespace 2019-09-13 16:03:16 -07:00
Connor Rigby 22ceb7a01a
Rename FarmbotFirmware Namespace 2019-09-13 16:03:16 -07:00
Connor Rigby ef3225878d
Change FarmbotCeleryScript Namespace 2019-09-13 16:03:16 -07:00
Connor Rigby 21bb1a6f25
Misc cleanup and bug fixes.
* Fixes botstate changes being dispatched as nested lists
* Fixes jwt failing to decode `nil`. Doesn't fix token actually being`nil` though.
* Adds a syscall for read_pin
* Add/fix calibrate syscall
* tweak tty detector. This is still broken i think
2019-09-13 16:03:16 -07:00
Connor Rigby 4114e26804
Implement new CeleryScript Runtime environment.
This is obviously a rather large change warranting an essay describing
it.

A Brief overview
Basically the old implementation had quite a few down sides preventing
it from really working as intended, especially with the addition of the
variables feature. Here is the shortlist of things that needed
addressing:

* No scoping between sequences.
What this essentially means is that a sequence that executes another
sequence is unable to add data to the calle. This is important for using
Variables.

* Error recovery
certain nodes have a high likelyhood of failing such as anything that
interfaces the firmware. Much focus was spent ensuring that errors would
be recoverable when desired.

* Complexity of control flow asts versus action asts.
Nodes such as `if` will always work in the same way regardless of the
state of the rest of the system meaning there is no reason for it to
have a special implementation per environment. on the other hand
`move_absolute` is bound to a specific part of the system. Seperating
these concerns allows for better testing of each piece independently.

A More In Depth overview
The core of this change resolves around 1 really big change resulting in
many more small changes. This change is the CeleryScript `compiler`. The
TLDR of this system is that now CeleryScript ASTs are deterministicly
compiled to Elixir's AST and executed. Doing this has some big benifits
as described below.

1) CeleryScript "runtime" environment is now much simpiler in favor of a somewhat
complex "compile time" environment. Basically instead of EVERY single
CeleryScript AST having a custom runtime implementation, only a subset
of ASTs that require external services such as the Firmware, Database,
HTTP, etc require having a runtime implementation. This subset of ASTs
are called `SysCalls`. Also the runtime implementations are compiled to
a single function call that can be implemented instead of needing to
have a contextual environment and making decisions at runtime to
evaluate variables and the like.

2) Static analysis is now possible. This means an incorrectly crafted
sequence can be validated at compile time rather than getting half way
through a sequence before finding the error.

3) Having the "external services" separated leads to better plugability.
There is now a behaviour to be implemented for the subset of syscalls
that are system specific.
2019-09-13 16:03:15 -07:00
Connor Rigby 519791e99e
Implement helpful macros for building node implementation 2019-09-13 16:03:15 -07:00