Giter VIP home page Giter VIP logo

ll2's Introduction

LL2

๐Ÿšง

Setup

  1. Clone package: git clone https://github.com/layuplist/ll2
  2. Install yarn if not already available: npm install -g yarn
  3. (inside package) Install dependencies: yarn install
  4. (inside package) Build packages: yarn build

Optional:

  1. Install AWS CLI
  2. Install SAM CLI

Note: All setup and development resources in this repository were written and tested using MacOS on Apple Silicon. Although everything should be compatible with MacOS on Intel, Windows, and most Linux distributions, they remain untested and procedures may differ slightly.

Local Invocation

Most resources in this application can be locally simulated and invoked via the AWS SAM CLI. It is important to note that when a single resource is simulated locally, resulting requests/invocations external to that resource are likely not simulated, and will run from your default AWS account.

To prime resource templates for local SAM invocation, run CDK synthesis for your entire workspace using yarn synth (this may take a few seconds, as it will build all packages in your workspace). Look for a log message that reads: Successfully synthesized to /.../ll2/infra/cdk.out, this is where your resource templates were generated.

Once resource templates are generated, you can use the SAM CLI to simulate and invoke various resources as needed. For example, to run the spider-sync-handler lambda function with an empty event (handy for priming a fresh ll2 deployment), run the following command:

sam local invoke spider-sync-handler --no-event -t ./infra/cdk.out/api-stack.template.json

The first argument after "invoke" is the name of the function, in this case spider-sync-lambda. Then the --no-event flag is used to tell SAM not to pass an event, and the -t flag tells SAM where to find the resource template for the function.

It can be helpful when locally invoking functions to override some of its usual parameters. For instance, when priming a fresh ll2 deployment, the sync handler will likely need longer than 15 minutes to compile and publish all course updates to the database. The api-stack accepts a custom Timeout parameter to override that, and SAM will allow you to enter a timeout that is higher than 15 minutes (the max allowed on an actual lambda host).

sam local invoke spider-sync-handler --no-event -t ./infra/cdk.out/api-stack.template.json --parameter-overrides ParameterKey=spidersynchandlertimeoutparameter,ParameterValue=3600

The above command will run for up to an hour (3600 seconds), plenty of time for the first sync operation. Another useful flag is --profile, which allows you to tell the SAM CLI which AWS CLI profile to use. For instance, I have several AWS accounts, and have aliased the LayupList AWS account as "layuplist", so I use --profile layuplist with SAM.

ll2's People

Contributors

jaismith avatar

Stargazers

Zack Gottesman avatar

Watchers

Daniel Chen avatar

ll2's Issues

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.