Turing complete scripting language for Aurae.

Overview

AuraeScript

AuraeScript is a turing complete language for platform teams built on Rhai and is similar to TypeScript and Rust.

let connect = true;

if connect {
    let aurae = connect();
    aurae.info().json();
}

AuraeScript is a lightweight client that wraps the Aurae Standard Library.

AuraeScript is a quick way to access the core Aurae APIs and follows normal UNIX parlance. AuraeScript should feel simple and intuitive for any Go, C, Python, or Rust programmer.

#!/usr/bin/env auraescript

let client = connect(); // Connect and authenticate with mTLS stored in a ~/.aurae/config
client.info().json();   // Print the connection details as JSON


let observe = client.observe() // Initialize the observe subsystem
observe.status().json();      // Print the status of an Aurae system to JSON

Build From Source

⚠️ Early Active Development ⚠️

We suggest building the project from the higher order environment repository.

git clone [email protected]:aurae-runtime/environment.git
cd environment
make submodules pki config all

Alternatively it is possible to build aurascript by itself. Check out this repository and use the Makefile.

make

...or manually using Cargo.

cargo build 
cargo install --path .

Architecture

AuraeScript follows a similar client paradigm to Kubernetes kubectl command. However, unlike Kubernetes this is not a command line tool like kubectl. AuraeScript is a fully supported programing language complete with a systems standard library. The Aurae runtime projects supports many clients, and the easiest client to get started building with is AuraeScript.

Download the static binary directly to your system, and you can begin writing AuraeScript programs directly against a running Aurae server.

Comments
  • refactor: Add build GHA image

    refactor: Add build GHA image

    I took another whack at this using a few different methods. The time to run is still a bit longer than native GHA jobs, but with a self-hosted runner I think it would be pretty similar.

    I'm building the image as the first step in the pipeline, then using that image to run the jobs on downstream. I have introduced cargo-chef to package the dependencies, without needing to compile the code itself.

    Using minideb we launch a container that has the rust requirements (but without extras like cargo-chef). This runs the actual make steps, and uses native GHA caching for the rust modules.

    I would be happy to setup and own a self-hosted runner and docker registry. I'm happy to chat about that in discord too (kuxaku) :)

    Most of the build layers should cache across branches too (using buildkits native GHA cache), so the first time it runs should be the longest.

    Biggest Risks:

    • I got the caching wrong and the pipeline doesn't have correct dependencies someplace along the test/build process
    • The build times are longer, impacting developer feedback times

    Out of scope:

    • I did not apply the docker image to the deploy step yet.

    I kept the original two GHA jobs in the pipeline for reference. If/when this gets merged they can be ran alongside for a bit to ensure its working, or deleted in a second PR.

    Access Granted 
    opened by jesse-peters 11
  • Options for scripting against aurae

    Options for scripting against aurae

    I'd like to propose using bash (with an aurae cli similar to kubectl or buildah) or Deno to script against aurae instead of moving forward with the Rhai implementation. I am not heavily invested in bash or Deno per se, but I am not sure that Rhai's unique properties serve the project better than other more popular approaches to scripting against API's. In short, why is Rhai better than python, javascript, bash, etc? I tried to focus my thinking on who aurae users probably will be and how that theoretical persona would want to interact with the system. In addition, I am working on a system with some of the same goals as aurae currently, and I'm sure that project also biases my opinions about aurae.

    Soooo, from the readme,

    AuraeScript follows a similar client paradigm to Kubernetes kubectl command. However, unlike Kubernetes this is not a command line tool like kubectl. AuraeScript is a fully supported programing language complete with a systems standard library. The Aurae runtime projects supports many clients, and the easiest client to get started building with is AuraeScript.

    Does it make sense that the easiest client to get started building with is a scripting language users probably aren't familiar with? As a sysadmin, I would much rather reach for bash to get started hacking. I think buildah serves as a great model to emulate (tool intro here). buildah replaces dockerfiles the same way auraescript is attempting to replace yaml for infra configuration. It should be simple to spin up an instance of aurae and configure it with a simple bash script or interactively from the terminal. Bash is the most intuitive answer for this. Moving past simplicity, power users can get pretty far with bash, awk, and a well maintained gnu-style cli such as kubectl or buildah before needing to reach for a beefier (and crucially, more complex to integrate and maintain) scripting language such as python, javascript, perl, or lua.

    And speaking of lua, an even simpler question to ask than above is why Rhai instead of lua? I've fiddled with it a bit to mess with my neovim configuration, but I am far from an expert. From my outsider's perspective, lua seems like an active success story for small, embed-able languages.

    If the scripting language is important to provide a platform for the aurae standard library, then Deno becomes a very compelling option. Deno markets itself as a v8 runtime that is secure, hackable, and embed-able.

    • The Deno global object (Deno.spawn, Deno.test, Deno.exit) can be modified to include runtime specific functionality. You can ship aurae users a full featured runtime & compiler to build their aurae scripts with.
    • Javscript & Typescript is a very popular with developers these days, and might help make maintainable infrastructure code understandable to more web developers.
    • Deno takes a lot of design inspiration from Go. In fact the standard library is loosely modeled after the Go stdlib. Using Deno gives us a lot of the upsides of using Go without some of the more prickly downsides (see bottom)

    A Go Problemo

    side note: when building docker we were struggling to provide flexibly replaceable extensions as Go had no support for dynamic loading of libraries. As Docker wanted to ship with "batteries included but changeable", we ended up with those CNI / CSI constructs, where core functionality was pushed to external processes with more or less nice interfaces.

    opened by bpmooch 8
  • Auraescript case-sensitivity issue

    Auraescript case-sensitivity issue

    It seems like differences in casing for the generated code is causing property/field values to be lost.

    JS/TS use camelCase for properties while rust uses snake_case for fields.

    @krisnova confirmed this as an issue on stream. A possible solution is to relax the casing requirements with another macro that tags all the fields with #[serde(alias = "camelCaseFieldName")] as Deno uses serde for serializing/deserializing.

    *I actually have a macro for this, that probably needs a little adapting before I can contribute it. I'm just a little time constrained before the break, so wanted to leave this issue as a note for future me. For now, if anyone is trying stuff out, just use hardtoread field names so the casing will be the same throughout.

    opened by future-highway 7
  • GitHub actions seems to remove CNAME from pages settings and 404s

    GitHub actions seems to remove CNAME from pages settings and 404s

    Upon merging a PR to main (or committing directly to the branch because I am a horrible person) a GitHub action is kicked off to update the static site using GitHub pages. Shortly after the event, the website aurae.io will return a 404.

    Looking in the get GitHub pages settings for the repository the domain name value is unexpectedly missing.

    image

    Setting the value back to aurae.io fixes the 404 and the site is now updated with the most recent changes from the main branch.

    Good First Issue Ops 
    opened by krisnova 7
  • api best practice rename

    api best practice rename

    these are all suggestions from the proto best practices guide.

    tl;dr:

    1. suffix packages with versions
    2. suffix services with "Service"
    3. prefix request/response with service names
    4. include _UNSPECIFIED enum entries for value 0
    Access Granted 
    opened by dmah42 6
  • introduce tracing

    introduce tracing

    thoroughly untested WIP

    this should give us spans around the cells service and logging should be scoped to that but i'm not seeing any obvious output differences so i'm a bit stumped.

    going to read around and see if i can figure out if i'm meant to be seeing anything new.

    opened by dmah42 6
  • Break the build on compile warnings

    Break the build on compile warnings

    Can we please break the build and fail a pull request if code creates a rust warning?

    We are trying to keep a clean set of code for the project, and we would like to leverage the Makefile commands to ensure that no warnings are generated.

    This includes

    • Documentation
    • Linting
    • Unused (dead) code
    • etc
    Good First Issue 
    opened by krisnova 6
  • Introduce namespaces to cells

    Introduce namespaces to cells

    Should we consider isolating an Aurae cell at the namespace level as well? If so what are the sane defaults we should assume for every Aurae cell? Which namespaces should we consider, and what do we do given the various kernels and their support and awareness of each namespace?

    opened by krisnova 5
  • Plumb stdout and stderr through CellService

    Plumb stdout and stderr through CellService

    I believe we will need to develop a logging cache that serves as an in-memory caching layer (Note: in the future it will need to also persist to disk!) for both stdout and stderr streams from an executable within a cell.

    We will need to be able to hook into a stream at any moment and have some basic guarantees about the data and how we retrieve it.

    Auraed Subsystem: Runtime 
    opened by krisnova 4
  • Validation

    Validation

    WARNING: This PR introduces validation and validation_macros crates which are opinionated in their expectations of the conventions we should use but makes scaffolding code easier ONLY IF you have a cooperative IDE.

    Some expectations:

    • incoming messages should be validated ASAP.
    • we should fail fast (return on first validation error)
    • validating the incoming message should return a new type
    • the new type will have the same fields, but the field types can, and often should, be different

    As part of the PR, I have scaffolded validating the allocate endpoint on the CellService. Steps I had to take.

    1. Create a validated struct based on the unvalidated proto message (field_type is needed because the type differs from the unvalidated type):
    #[derive(ValidatingType)]
    pub(crate) struct ValidatedAllocateCellRequest {
        #[field_type(Option<Cell>)]
        cell: ValidatedCell,
    }
    
    1. The macro generated the AllocateCellRequestTypeValidator trait, and an empty AllocateCellRequestValidator struct so I wrote:
    impl AllocateCellRequestTypeValidator for AllocateCellRequestValidator {
        
    }
    
    1. CLion being a cooperative IDE (hopefully VSC will also be), it provided a "quick-fix" action to generate:
    impl AllocateCellRequestTypeValidator for AllocateCellRequestValidator {
        fn validate_cell(
            cell: Option<Cell>,
            field_name: &str,
            parent_name: Option<&str>,
        ) -> Result<ValidatedCell, ValidationError> {
            todo!()
        }
    }
    
    1. Implement the todo
    impl AllocateCellRequestTypeValidator for AllocateCellRequestValidator {
        fn validate_cell(
            cell: Option<Cell>,
            field_name: &str,
            parent_name: Option<&str>,
        ) -> Result<ValidatedCell, ValidationError> {
            let cell = validation::required(cell, field_name, parent_name)?;
    
            ValidatedCell::validate(
                cell,
                Some(&validation::field_name(field_name, parent_name)),
            )
        }
    }
    
    1. We need a ValidatedCell so (leaving out fields to be succinct here):
    #[derive(ValidatedType)]
    struct ValidatedCell {
        name: String,
        cpus: String,
    }
    
    1. Repeat step 2 but with CellTypeValidator and CellValidator, then step 3 and 4.

     Things to note:

    • There are 2 derive macros (ValidatingType, ValidatedType). The only difference is which type has the validate function.
    • You can skip decorating fields with the field_type attribute if the validated type is exactly the same as the unvalidated type, but Rust has a great type system, so making types such as struct CellName(String) can help reduce errors in code and provides a place to write reusable code. Ex:
    struct CellName(String);
    
    impl validation::ValidatedField<String> for CellName {
        fn validate(
            input: Option<String>,
            field_name: &str,
            parent_name: Option<&str>,
        ) -> Result<Self, ValidationError> {
            let input = validation::required_not_empty(
                input,
                field_name,
                parent_name,
            )?;
    
            validation::allow_regex(
                &name,
                &validation::DOMAIN_NAME_LABEL_REGEX,
                field_name,
                parent_name,
            )?;
    
            Ok(CellName(input))
        }
    }
    

    We could then adjust ValidatedCell to:

    #[derive(ValidatedType)]
    struct ValidatedCell {
        #[field_type(String)]
        name: CellName,
        cpus: String,
    }
    

    and implement validation like:

    impl CellTypeValidator for CellValidator {
        fn validate_name(
            name: String,
            field_name: &str,
            parent_name: Option<&str>,
        ) -> Result<CellName, ValidationError> {
            CellName::validate(Some(name), field_name, parent_name)
        }
    
        fn validate_cpus(
            _cpus: String,
            _field_name: &str,
            _parent_name: Option<&str>,
        ) -> Result<String, ValidationError> {
            todo!()
        }
    }
    
    opened by future-highway 4
  • add missing dependencies to build doc

    add missing dependencies to build doc

    Hi! I'm brand new to the project and was running through building from source doc. Found a couple missing system dependencies that a few crates depend on.

    • pkg-config
    • libdbus-1-dev
    • libseccomp-dev

    I'm building on Ubuntu 22.04 jammy with a fresh Rust 1.65 install. Once installing those dependencies via apt, I was able to build both auraed and auraescript without issue.

    I also updated the link to the aurae.io site for the standard library since it was linking to the (now archived?) auraed stdlib README. If that should be reverted and remain linking to the original source, let me know! As far as I read through, the content looked to be the same and I assumed that the doc site will be the authoritative reference for the stdlib going forward.

    Log snippets from Make before adding those deps:

    error: failed to run custom build command for `libdbus-sys v0.2.2`
    ...
      --- stderr
      pkg_config failed: Could not run `"pkg-config" "--libs" "--cflags" "dbus-1" "dbus-1 >= 1.6"`
      The pkg-config command could not be found.
    
    error: failed to run custom build command for `libdbus-sys v0.2.2`
    ...
      --- stderr
      pkg_config failed: `"pkg-config" "--libs" "--cflags" "dbus-1" "dbus-1 >= 1.6"` did not exit successfully: exit status: 1
      error: could not find system library 'dbus-1' required by the 'libdbus-sys' crate
    
      --- stderr
      Package dbus-1 was not found in the pkg-config search path.
      Perhaps you should add the directory containing `dbus-1.pc'
      to the PKG_CONFIG_PATH environment variable
      No package 'dbus-1' found
    
    error: failed to run custom build command for `libseccomp v0.0.2 (https://github.com/containers/youki.git?tag=v0.0.2#0f662dd9)`
    ...
      --- stderr
      `"pkg-config" "--libs" "--cflags" "libseccomp" "libseccomp >= 2.5"` did not exit successfully: exit status: 1
      error: could not find system library 'libseccomp' required by the 'libseccomp' crate
    
    Access Granted 
    opened by coopernetes 4
  • remove generated files from being committed to the repo

    remove generated files from being committed to the repo

    I think this is safe and have confirmed that the files are regenerated on make

    The proto generation wasn't a dependency for making docs but should have been.

    Access Granted 
    opened by dmah42 0
  • RFC: use repeated ints instead of native format in the API

    RFC: use repeated ints instead of native format in the API

    Implementation of #197.

    Created to source comments on whether this is what we want: a more natural proto API that doesn't match the native cgroup API.

    Access Granted 
    opened by dmah42 0
  • Add initial go client

    Add initial go client

    Follow-up to https://github.com/aurae-runtime/aurae/pull/226 so the first 16 commits are duplicated from that branch, unfortunately GitHub won't let me use that PR as the base since it's not under aurae-runtime.

    This PR adds an initial Go client under client-go. It only has code generate by buf, a future PR (probably some time tmrw or tuesday) will have a more fleshed out client.

    The PR boils down to adding this to buf.gen.yaml, and running make proto.

      - plugin: buf.build/protocolbuffers/go:v1.28.1
        out: client-go/pkg/api
        opt: paths=source_relative
      - plugin: buf.build/grpc/go:v1.2.0
        out: client-go/pkg/api
        opt: paths=source_relative
    
    Access Granted 
    opened by RRethy 1
  • Restructure proto files

    Restructure proto files

    Follow-up to https://github.com/aurae-runtime/aurae/pull/224 so the first 6 commits are duplicated from that branch, unfortunately GitHub won't let me use that PR as the base since it's not under aurae-runtime.

    The previous structure was incompatible with the gRPC Go plugin for the buf tool since the generated Go code would get generated into a single directory with each file having a different package. See https://github.com/aurae-runtime/aurae/pull/227 for this structure.

    This restructure also moves the (pod|spawn|instance|cell) services into their own proto file under the runtime package to simply future client code.

    The changes boil down to this:

    api/v0/observe.proto -> api/observe/v0/observe.proto
    api/v0/schedule.proto -> api/schedule/v0/schedule.proto
    api/v0/runtime.proto *deleted*
    api/runtime/cell/v0/cell.proto *created*
    api/runtime/pod/v0/pod.proto *created*
    api/runtime/instance/v0/instance.proto *created*
    api/runtime/spawn/v0/spawn.proto *created*
    
    Access Granted 
    opened by RRethy 1
  • Rename gRPC packages to follow naming best practices

    Rename gRPC packages to follow naming best practices

    See https://developers.google.com/protocol-buffers/docs/style#packages

    The package names weren't unique nor did they have anything based on the project name. The renames were as follows:

    observe.v0 -> aurae.observe.v0
    runtime.v0 -> aurae.runtime.v0
    schedule.v0 -> aurae.schedule.v0
    
    Access Granted 
    opened by RRethy 0
Owner
Aurae Runtime
Distributed Operating System
Aurae Runtime
TI-89-style calculator, maybe turing complete

I will make a fully capable graphing calculator in Rust and you can't stop me. As always, I'm not using libraries or any of that. Everything here is h

Neptunal 4 Jun 2, 2023
A Turing-complete but dead-simple spaced repetition CLI that helps you learn stuff.

Forne — Learn Stuff Forne is a Turing-complete spaced repetition engine to help you learn stuff your way. What does that mean? Well, there are a few p

Sam Brew 9 May 12, 2023
Easy c̵̰͠r̵̛̠ö̴̪s̶̩̒s̵̭̀-t̶̲͝h̶̯̚r̵̺͐e̷̖̽ḁ̴̍d̶̖̔ ȓ̵͙ė̶͎ḟ̴͙e̸̖͛r̶̖͗ë̶̱́ṉ̵̒ĉ̷̥e̷͚̍ s̷̹͌h̷̲̉a̵̭͋r̷̫̊ḭ̵̊n̷̬͂g̵̦̃ f̶̻̊ơ̵̜ṟ̸̈́ R̵̞̋ù̵̺s̷̖̅ţ̸͗!̸̼͋

Rust S̵̓i̸̓n̵̉ I̴n̴f̶e̸r̵n̷a̴l mutability! Howdy, friendly Rust developer! Ever had a value get m̵̯̅ð̶͊v̴̮̾ê̴̼͘d away right under your nose just when

null 294 Dec 23, 2022
Low effort scraping Python's pickle format in Rust. It is to complete pickle parsing as BeautifulSoup was to complete HTML parsing.

repugnant-pickle Because it is, isn't it? This is a Rust crate for dealing with the Python pickle format. It also has support for opening PyTorch file

Kerfuffle 7 Apr 7, 2023
Nyah is a programming language runtime built for high performance and comes with a scripting language.

?? Nyah ( Unfinished ) Nyah is a programming language runtime built for high performance and comes with a scripting language. ??️ Status Nyah is not c

Stacker 3 Mar 6, 2022
`llm-chain` is a powerful rust crate for building chains in large language models allowing you to summarise text and complete complex tasks

llm-chain ?? llm-chain is a collection of Rust crates designed to help you work with Large Language Models (LLMs) more effectively. Our primary focus

Sobel IO 36 Apr 6, 2023
A rusty dynamically typed scripting language

dyon A rusty dynamically typed scripting language Tutorial Dyon-Interactive Dyon Snippets /r/dyon Dyon script files end with .dyon. To run Dyon script

PistonDevelopers 1.5k Dec 27, 2022
Lisp dialect scripting and extension language for Rust programs

Ketos Ketos is a Lisp dialect functional programming language. The primary goal of Ketos is to serve as a scripting and extension language for program

Murarth 721 Dec 12, 2022
Rhai - An embedded scripting language for Rust.

Rhai - Embedded Scripting for Rust Rhai is an embedded scripting language and evaluation engine for Rust that gives a safe and easy way to add scripti

Rhai - Embedded scripting language and engine for Rust 2.4k Dec 29, 2022
Rhai - An embedded scripting language for Rust.

Rhai is an embedded scripting language and evaluation engine for Rust that gives a safe and easy way to add scripting to any application.

Rhai - Embedded scripting language and engine for Rust 2.4k Jan 3, 2023
A scripting language that allows complex key remapping on Linux.

Map2 A scripting language that allows complex key remapping on Linux, written in Rust. All of the functionality related to interacting with graphical

Matt 99 Dec 6, 2022
Simple, extendable and embeddable scripting language.

duckscript duckscript SDK CLI Simple, extendable and embeddable scripting language. Overview Language Goals Installation Homebrew Binary Release Ducks

Sagie Gur-Ari 356 Dec 24, 2022
A shell scripting language

Slash The system level language for getting the job done. Detailed documentation is available on the Slash site Motivation Bash is an awesome shell, b

null 27 Jun 17, 2022
An interactive scripting language where you can read and modify code comments as if they were regular strings

An interactive scripting language where you can read and modify code comments as if they were regular strings. Add and view text-based visualizations and debugging information inside your source code file.

Sumeet Agarwal 13 Apr 28, 2022
Lagoon is a dynamic, weakly-typed and minimal scripting language. 🏞

Lagoon is a dynamic, weakly-typed and minimal scripting language. It draws inspiration from a handful of modern languages including JavaScript, Rust and PHP.

Ryan Chandler 25 Jul 5, 2022
Scripting language focused on processing tabular data.

ogma Welcome to the ogma project! ogma is a scripting language focused on ergonomically and efficiently processing tabular data, with batteries includ

kdr-aus 146 Dec 26, 2022
A small scripting language running on V8.

Rook A small scripting language running on V8. After spending a few hours playing with V8, it seems like the only way to make this work is by transpil

Ryan Chandler 2 Dec 16, 2022
A forth-inspired, bytecode-compiled scripting language for Anachro Powerbus

Anachro Forth (core) Anachro Forth is a forth-inspired, bytecode-compiled scripting language for Anachro Powerbus platform. Use Case The intended use

null 14 May 27, 2022
A small embeddable scripting language

There is currently a tree-walking interpreter called bird in progress, but the plan is to have a bytecode vm in the end language_name is a small embed

nils 15 Dec 10, 2022
A simple programming language made for scripting inspired on rust and javascript.

FnXY Programming Language Quick move: CONTRIBUTING | LICENSE What? FnXY is a simple programming language made for scripting inspired on rust and javas

null 2 Nov 27, 2021