Git Product home page Git Product logo

subo's People

Contributors

arbourd avatar bishal7679 avatar calebschoepp avatar callahad avatar cohix avatar danielledeleo avatar denopink avatar fanahova avatar flaki avatar javorszky avatar jaydjayg avatar lauralangdon avatar macklinengineering avatar ospencer avatar renovate[bot] avatar rnpridgeon avatar samderlust avatar sylfrena avatar xtuc avatar yashikajotwani12 avatar zhangwinning avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

subo's Issues

Split build pipeline into isolated module

The 'build pipeline', such as the BuildContext, the template system, and the native/Docker toolchains should be refactored into an isolated module with a well-defined API so that it can be used in other non-CLI contexts.

Add `wasm` language builder

This builder would just check that the wasm file exists, and if so, the build is done.

This would allow languages that subo doesn't support to specify language: wasm and have an external build system.

TinyGo Builder

Once Reactr supports TinyGo, Subo should gain the ability to build a Runnable written in Go.

create handler command

Would love to be able to run subo create handler /foo and have it added to the directive.

Some potential flags: --method, --stream, --steps

sudo build fails and exits with 0

I noticed that when I run subo build . --bundle and it fails to compile, it exits with 0.

More information:

...
error: build failed
๐Ÿšซ failed to doBuild for helloworld: failed to RunInDir: failed to Run command: exit status 101
โœ… DONE: helloworld was built -> /home/sven/.../important-api/helloworld/helloworld.wasm
โœ… DONE: bundle was created -> runnables.wasm.zip

$ echo $?
0

failed to Run subo dev

I just followed https://atmo.suborbital.dev/getstarted and created an empty project.

When running subo dev I see the following:

docker: Error response from daemon: OCI runtime create failed: container_linux.go:345: starting container process caused "chdir to cwd (\"/home/atmo\") set in config.json failed: permission denied": unknown.
time="2021-03-07T13:57:15Z" level=error msg="error waiting for container: context canceled"
Error: ๐Ÿšซ failed to run dev server: failed to Run command: exit status 126
Usage:
  subo dev [flags]

Flags:
  -h, --help          help for dev
      --port string   set the port that Atmo serves on (default "8080")

In the container configuration:

        "Mounts": [
            {
                "Type": "bind",
                "Source": "/home/sven/.../important-api",
                "Destination": "/home/atmo",
                "Mode": "",
                "RW": true,
                "Propagation": "rprivate"
            }
        ],

and my current directory:

total 8.0K
-rwxrwxr-x 1 sven sven  384 Mar  7 13:55 Directive.yaml
drwxr-xr-x 3 sven sven 4.0K Mar  7 13:55 helloworld

Can't kill atmo container with CTRL + C

Steps to reproduce:

# Build a project
subo create project test

# Build the project docker image
subo build --docker

# Run the image
docker run com.surborbital.test:v0.0.1

# Try and fail to exit the container with CTRL + C
^C

Currently the Dockerfile is using the shell form for the ENTRYPOINT instead of the exec form (docs). This means the SIGINT get's picked up by the shell running Atmo and not by Atmo itself (more on this). If we switch to using the exec form then this issue will be resolved.

Happy to write up a PR for this.

`error: could not find wasm-opt`when building TinyGo runnable

Hello, I get an error when using the TinyGo template

Status: Downloaded newer image for suborbital/builder-tinygo:v0.2.0
โฉ START: building runnable: hi (tinygo)
go: downloading github.com/suborbital/reactr v0.13.0
error: could not find wasm-opt, set the WASMOPT environment variable to override
Error: failed to BuildWithToolchain: ๐Ÿšซ failed to build hi: failed to RunInDir: failed to Run command: exit status 1

...

Error: failed to BuildWithToolchain: failed to dockerBuildForDirectory: failed to Run docker command: failed to Run command: exit status 255

All is ok with Rust, Swift, and Grain templates

Make integration

Developers should be able to configure subo to execute Make targets as part of a build. This would allow for things like building static sites before creating a bundle.

For example, if I run subo build . --make app, I'd want subo to run make app before starting the actual build.

Subo CLI Segfaults and Panics During Bundle

It is an amazing work you folks are doing here. I encountered an issue while following the walkthrough here.

When I got to subo build helloworld --docker, the following error shows up:

...
โœ… DONE: helloworld was built -> /Users/.../Desktop/projects/important-api/helloworld/helloworld.wasm
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x13b1670]

goroutine 1 [running]:
github.com/suborbital/subo/subo/command.BuildCmd.func1(0xc000130780, 0xc0000ec4e0, 0x1, 0x2, 0x0, 0x0)
	/private/tmp/subo-20210905-4022-iy0t5p/subo-0.0.22/subo/command/build.go:81 +0x310
github.com/spf13/cobra.(*Command).execute(0xc000130780, 0xc0000ec4c0, 0x2, 0x2, 0xc000130780, 0xc0000ec4c0)
	/private/tmp/subo-20210905-4022-iy0t5p/subo-0.0.22/vendor/github.com/spf13/cobra/command.go:852 +0x472
github.com/spf13/cobra.(*Command).ExecuteC(0xc0000c0f00, 0x0, 0xffffffff, 0xc000096058)
	/private/tmp/subo-20210905-4022-iy0t5p/subo-0.0.22/vendor/github.com/spf13/cobra/command.go:960 +0x375
github.com/spf13/cobra.(*Command).Execute(...)
	/private/tmp/subo-20210905-4022-iy0t5p/subo-0.0.22/vendor/github.com/spf13/cobra/command.go:897
main.main()
	/private/tmp/subo-20210905-4022-iy0t5p/subo-0.0.22/subo/main.go:10 +0x2a

No runnables.wasm.zip generated.

Subo CLI v0.0.22 (Installed via brew)
macOS Catalina v10.15.6

Atmo live reload

I have a feature request for live reloading when using subo dev.

I'm coming from a "similar in function but different in scope" dev environment called architect and one of the best features I've been able to take advantage of in development is the ability to reload function (or in our case runnable) code without restarting the web server or manually triggering the build process. This includes editing the arc equivalent of Directive.yaml.

It's unclear to me if atmo would ever support websockets (arc does because it's emulating aws's api gateway which has that feature), but being able to modify message handlers on a connected web socket is an amazing development experience.

clean command

There should be a subo clean command that removes all of the target/.build folders for Runnables and deletes the .wasm files.

C++ Builder

Fairly straightforward, should be able to build C++ into Runnables!

Add Dockerfile in new projects

subo create project should include a Dockerfile that can be used to build an image which includes the project's bundle. Down the line, it would enable something like subo publish which would build that image and push it to a repo.

[dev] command to build and test docs snippets

Would be great to have some Go files in a directory, and be able to add template markers in documentation markdown such that running subo docs build would build and run all of the Go code to ensure it's still correct, then insert the appropriate snippets into the documentation.

There should also be a subo docs test command wherein it tests the snippets but doesn't re-generate the docs, to be run in CI.

clarify subo `create runnable` Mkdir error

Replication steps:

mkdir foobar && subo create runnable foobar --lang rust                             

Output:

โฉ START: creating runnable foobar
Error: ๐Ÿšซ failed to Mkdir: failed to Mkdir: mkdir /Users/odc/Documents/GitHub/foobar: file exists

I think the error message is clear for most, but for new users it may be unclear what the problem is.

We already have a nice check if runnables already exist, do we want one to check if the output dir already exist? Maybe something like the following:

โฉ START: creating runnable foobar
Error: ๐Ÿšซ runnable output dir already exists: failed to Mkdir: mkdir /Users/odc/Documents/GitHub/foobar: file exists

bctx.RunnableExists would catch this if the dir already exist and it's being used for runnables. But it doesn't cover the case when a user reuses an existing dir.

It's a simple patch if we like it.

Use Directive when creating bundle

When creating a bundle, a Directive should be generated using the metadata from each Runnable's DotHive, and the Directive file should be included in the bundle

Add --native flag to build command

Subo should be able to run native commands to run builds in various languages instead of using Docker.

Once this is implemented, the builder Docker images should be updated to use subo internally so that a Docker and non-Docker build is identical.

Run compilers in release mode

Rust for example provides a --release mode, and we should run that by default, with a --debug Subo flag for when that's not desired.

Ability to create new project from template

subo currently has subo create to create a new Runnable.

That should be updated to be subo create runnable, and then subo create project should be added to bootstrap a new project.

It should have a Directive, an empty Runnables directory, and perhaps a static and templates directory if those features get built.

Ability to push bundles to OCI registries

Adding a subo push and/or subo pull which packages the bundle as an OCI image and then pushes it to an image registry would be very useful.

Atmo could also be directed to use an image from a registry.

We can take inspiration from wasm-to-oci, though it will be different as we're pushing a bundle, not a single Wasm module.

Add shell completions for subo CLI

spf13/cobra has built in support to automatically generate shell completion scripts for zsh, bash, and fish. CI would then be able to generate each script and package them for use in package managers (homebrew, etc.).

Have subo create commands add .gitignore files

I think it would be beneficial for the subo create commands to also scaffold out a .gitignore file. I felt like this was an issue because when I ran subo create project my Rust target directory was being tracked.

These .gitignore files could be added at the project level, the runnable level, or both. Some things that might be nice to exclude would include:

  • target directories
  • The equivalent for Swift (not familiar with the language)
  • Maybe runnables.wasm.zip. I'm not sure if tracking this artifact of the build process is idiomatic or not. Regardless, it's inclusion or absence in the .gitignore would be a good guide to new developers like me on whether it is idiomatic to track or not.

typing `subo` doesn't seem to do anything

I get a hint from the source that maybe the default used to be --version but a fresh install today has zero output with a successful error code. --help would be rad.

"failed to get CurrentBuildContext" when running "subo create project" in user home folder

To reproduce:

  • Install subo
  • cd ~
  • subo create project name

Returns:

Error: ๐Ÿšซ failed to get CurrentBuildContext: failed to getRunnableDirs: failed to list files in .Trash: open /Users/fana/.Trash: operation not permitted

Expected result:
Project is created successfully

Hardware specs:

  • 2.8 GHz Quad-Core Intel Core i7
  • 16 GB 2133 MHz LPDDR3
  • Docker Desktop 3.5.1

CLI experience improvements

Remove the copy/paste step for getting an environment token by feeding it seamlessly through to the next command with a temporary file.

Initialize Git repo when creating project

subo create project command should initialize a new git repo for that project.

Essentially, using util.Run to execute git init after the new project has been created.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.