hotg-ai / rune

Rune provides containers to encapsulate and deploy edgeML pipelines and applications
Apache License 2.0
134 stars 15 forks source link

Generate new code for Runes and update runefile-parser #10

Closed kthakore closed 3 years ago

kthakore commented 3 years ago

Checklist:

Mi1ind commented 3 years ago

Commented on lib.rs generation in rune from parser.rs

Mi1ind commented 3 years ago

Function to override files instead of appending to them. Has been applied to lib.rs.

Mi1ind commented 3 years ago

In Runefile add 2 capabilities and should see their variables:

        CAPABILITY<_,I32> RAND randasas --n 1 
  1. Check that RAND is part of runic_types::CAPABILITY ENUM if None from runic_types::CAPABILITY::from_str("asdasd") => log::fatal!("INVALID....")
  2. Check that randasas is a variable name that is not already used in capabilities before
  3. For each variable --n 1 Write out the u32.
  4. MODEL parameters need to be put in a hasmap
Mi1ind commented 3 years ago

Updated Cargo.toml in rune:

Boilerplate has the following dependencies listed:

[dependencies]
no-std-compat = "0.4.1"
wee_alloc = "0.4.5"
runic-types = { path = "../../runic-types" }

the runic-types dependency is not being called with the above path. It outputs the following error (even though i have runic-types repo in the correct location):

[2021-02-10T03:37:20Z ERROR rune::build] Couldn't compile Rune 'failed to get `runic-types` as a dependency of package `rune v0.1.0 (/Users/milind/.rune/runes/2a9beef0-4c7e-42b5-98bb-c50f05530235)`

    Caused by:
        0: failed to load source for dependency `runic-types`
        1: Unable to update /Users/milind/.rune/runic-types
        2: failed to read `/Users/milind/.rune/runic-types/Cargo.toml`
        3: No such file or directory (os error 2)'

Current Work around:

runic-types = { git = "ssh://git@github.com/hotg-ai/runic-types"  }
Mi1ind commented 3 years ago

Things to add to documentation

Mi1ind commented 3 years ago

Still having issues with lib.rs in the rune:

error[E0432]: unresolved imports `runic_types::CAPABILITY`, `runic_types::PARAM_TYPE`, `runic_types::OUTPUT`
  --> src/lib.rs:14:19
   |
14 | use runic_types::{CAPABILITY, PARAM_TYPE, OUTPUT};
   |                   ^^^^^^^^^^  ^^^^^^^^^^  ^^^^^^ no `OUTPUT` in the root
   |                   |           |
   |                   |           no `PARAM_TYPE` in the root
   |                   no `CAPABILITY` in the root

error[E0432]: unresolved import `runic_transform`
  --> src/lib.rs:15:5
   |
15 | use runic_transform::{Transform, Transformable};
   |     ^^^^^^^^^^^^^^^ use of undeclared crate or module `runic_transform`

error: cannot find macro `vec` in this scope
 --> src/sine_model.rs:2:12
  |
2 |     return vec![
  |            ^^^
  |
  = note: consider importing this macro:
          alloc::vec