Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Tung Nguyen
    @tongueroo
    @joesenova Welcome! There’s no off-the-shelf auth gem for Jets yet, as far as I know. Some guys are using basic Cognito https://community.rubyonjets.com/t/cognito-support/175/4 Would be nice if there was an auth gem for that and one that is more traditional. Until then, you got to roll your own 😔 Hopefully, when got time, will take a look if someone else hasn’t already tackled it.
    Unsure why that Console-setup error is happening.
    eniba
    @eniba
    Anyone know what's going on here?
    PS C:\work> jets new demo
    Traceback (most recent call last):
            5: from C:/Ruby25-x64/bin/jets:23:in `<main>'
            4: from C:/Ruby25-x64/bin/jets:23:in `load'
            3: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/jets-1.9.25/exe/jets:4:in `<top (required)>'
            2: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/jets-1.9.25/exe/jets:4:in `each'
            1: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/jets-1.9.25/exe/jets:5:in `block in <top (required)>'
    C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/jets-1.9.25/exe/jets:5:in `trap': unsupported signal SIGQUIT (ArgumentError)
    Tung Nguyen
    @tongueroo
    Jets doesn’t support windows.
    Tung Nguyen
    @tongueroo
    Recommend trying out cloud9 https://aws.amazon.com/cloud9/ There are some nice advantages https://rubyonjets.com/docs/faster-development/ Note, you will have to pay for the ec2 instance when it’s running and for the EBS volume. For typical dev usage, found it’s about $10/mo The cost may vary. By default, the ec2 hibernates within 30m when idled to save costs.
    Tung Nguyen
    @tongueroo
    Noted it to the install guide and faq to help others in the future: https://rubyonjets.com/faq/
    Jeff Levin
    @jalevin
    Hello!
    Super excited to play with Jets. I'm curious- how does it manage database connections?
    I'm looking at potentially integrating a second services for fulltextsearch
    Tung Nguyen
    @tongueroo
    Jets uses ActiveRecord for relational databases.
    Jeff Levin
    @jalevin
    @tongueroo Does it generate a new database connection every time a lambda function runs?
    Tung Nguyen
    @tongueroo
    The ActiveRecord db connection is established within the lambda execution context https://docs.aws.amazon.com/lambda/latest/dg/running-lambda-code.html outside the handler. So it gets reused between subsequent lambda function runs.
    Jeff Levin
    @jalevin
    Very cool!
    Robert Elwell
    @relwell
    Hey there! Anyone know how I would set an environment variable based on the attribute of a custom resource? In particular, I've declared an Elasticsearch Domain and I would like to retrieve its endpoint URL.
    Tung Nguyen
    @tongueroo

    To reference shared resource ARNs, jets usually grab the ARN from the CloudFormation shared stack output when the lambda function runs. Example from docs: https://rubyonjets.com/docs/shared-resources

    topic_arn = Alert.lookup(:delivery_completed) # looks up output from the Alert

    The lookup method is essentially “lazy”. It references the Shared Resource after it’s been created.

    Thinking the current recommendation is to use the lookup method and lookup the ElasticSearch ARN and then domain in the app code.

    If you like it available everywhere as a global ENV var. Maybe try looking it up and setting as an ENV var in an initializer. Haven't tried this yet but in theory it should work.

    It’s kind-of a chicken and egg problem. The lambda env variables are set as part of the jets deploy build process. So the CloudFormation output is not yet available until at least the 2nd deploy, after the shared resource has been created. So think it is probably easier to reason about the code if it's looked up lazily.

    Robert Elwell
    @relwell
    That helps a lot -- thanks!
    Jason Hung
    @jasonjei
    Hi all, just wondering, how would I do vendor/bundle sort of arrangement with Jets? On serverless, I'd use the lambci/lambda:build-ruby2.5 docker image to build my gems with native binaries, but I'm not exactly sure what's the protocol with Jets.
    Robert Elwell
    @relwell
    Hmm, the ElasticsearchService shared resource I created definitely spins up and works, but I can't use ElasticsearchService.lookup(:domain_endpoint) to retrieve the endpoint. I can't even lookup :arn. Do you have any recommendations for debugging this? I've tried running the console in the environment I've deployed to and I just get nil for those values.
    Tung Nguyen
    @tongueroo
    RE: gems with native binaries
    Jets handles this in 2 ways:
    1. Precompiled binary gems from the labmdagems service: https://rubyonjets.com/docs/lambdagems/
    2. Custom Lambda Layers: https://rubyonjets.com/docs/extras/custom-lambda-layers/
    RE: Debugging Elasticsearch
    Unsure. Thinking take a look at the shared CloudFormation stack that contains the Elasticsearch resource. Look at it's Outputs tab and see what output is available there. The lookup method can only look up outputs there. Maybe play with the SNS example one https://rubyonjets.com/docs/shared-resources/ Then maybe you'll be able to see the difference.
    Jeff Levin
    @jalevin
    @tongueroo do you have any examples of a ci/cd pipeline or if I wanted to figure out how to do that with jets where I could get started?

    FYI for those interested. Released jets v2. Made several improvements:

    • Routing Upgrades: nested resources, namespace, scope, singular resource
    • Name routes helpers
    • Forgery protection
    • Generators upgrades: scaffold, controller, model, job, etc
    • Autoload Rake tasks in lib/tasks.

    Here's the routing guide: https://rubyonjets.com/docs/routing/guide/

    Jeff Levin
    @jalevin
    Very cool update! Thanks @tongueroo
    Any eta on auth? I'm trying to finish this sprint, but if I can prove out Auth and CI/CD this would be a very good candidate for my rewrite. I would be happy to start prototyping an auth solution if you have a direction.
    James Harries
    @vaicine
    Hi all, I've started building some functions, and I've included rubocop in my project. As I haven't been using the context argument, rubocop complains I'm not using it. I can't see me ever using the context argument either... has anyone come up with a solution for not using the context argument and having rubocop not complain about it? I can add in an ignore comment, or disable the rule for my function, but it feels a bit messy.
    Tung Nguyen
    @tongueroo

    RE: Auth

    No ETA. Will be traveling more soon, including speaking at the Southeast conference to speak on Jets https://southeastruby.com/ 🎉 There’s also work 😄

    So will be a while. Hopefully someone chips in. Interested to see what you come up with. 👍

    Think eventually these 2 approaches to auth would be good.

    1. Traditional before filter. Maybe something like devise + omniauth. It may have to be it’s own thing.
    2. Cognito: It’s users as a service essentially. Admin and user management would be managed. Need to figure out cognito more fully.

    Making both key-turn would be great. Think both are a decent amount of work.

    RE: rubocop context warning

    Unsure.

    Alameda
    @AlamedaCode
    Hi guys, one question I'm trying to run a RSpec test (model test), but when is running shows this message: "Aws::Errors::MissingCredentialsError:
    unable to sign request without credentials set", I need to create an entire Test Stack to be able to run the tests ?
    Tung Nguyen
    @tongueroo
    No you shouldn’t. For some reason, the unit tests are calling the AWS api. Maybe try commenting out tests until you find the spec.
    Alameda
    @AlamedaCode
    Thanks for the response, for the momento I commented the code for the tests until I find the error, but now I have another problem, when try to do the deploy jets says: Stack with id <stack_name>-dev does not exist (Aws::CloudFormation::Errors::ValidationError), I'm just running jest deploy, and also added two more key-secret pairs in .aws/credentials
    Alameda
    @AlamedaCode
    But this is just the first deploy
    Alameda
    @AlamedaCode
    Problem solved, i have an issue in my shared resources
    Jacob Herrington
    @jacobherrington
    :wave: Hi everyone
    I forgot about this gitter, but I'm here now
    Nick S
    @nspinazz89
    Just met @tongueroo at southeast ruby. Really interested and wanted to contribute! So figured I'd join the party!
    Jacob Herrington
    @jacobherrington
    :tada: :cake: :confetti_ball:
    Nick S
    @nspinazz89
    Christian Bruckmayer
    @ChrisBr
    Hello :wave: When I deploy from CircleCI, my Jets function does loose the environment variables I set, however, deploying locally it keeps it :smile: Is this normal?
    Logan Bowers
    @loganb
    Hey everyone, I tried to sign up for the Lambda Gems service because I'm missing native extensions for a gem I use. But after email confirmation, I just get a blank page that says updates are coming. Do any of y'all know if updates are in the near future or should I just try to create a customer lambda layer?
    Logan Bowers
    @loganb
    Hey @tongueroo, are you around to talk about how rendering in Jets is plumbed in? I'm back to working on getting helper_method implemented and I can't quite figure it out.
    But I can't find anywhere a location where Jets passes the current controller instance to the renderer. Obviously it must exist, I just can't tell where.
    Tung Nguyen
    @tongueroo
    For those interested helpler_method was added tongueroo/jets#344
    Also, found out that Rails 6 was released I guess 2 days ago? So updated Jets to use Rails 6 components. Jets v2.1.0 uses Rails 6 components now. tongueroo/jets#345 👍
    sapristi
    @sapristi
    hello
    I am trying to set up a jets project, and I have a question about project structure
    according to https://rubyonjets.com/docs/structure/ , there is no "lib" folder
    is there a standard place to put files containing helper functions ?
    sapristi
    @sapristi
    Also I noticed undocumented specifications: the payload passed to a job should be a json hash, and not a json array