Code Monkey home page Code Monkey logo

lamex's Introduction

lamex

I couldn't come up with a good name, so I came up with a lame one instead: LAMbdaEXecutor.

Motivation

We often write our system tests as Go tests. Sometimes these tests can also be pointed at either local or remote deployments. The issue arises when our CI/CD pipeline needs to run system tests against services which are only accessible inside of our VPC. We were scping test files to jump boxes and running them as a manual process. Automating it didn't feel much better.

So I was wondering whether it'd be possible to compile a Go test binary and run it in a Lambda. The answer was yes, but even if the process returned 0, Lambda would interpret that as a failed invocation, since it didn't receive the response it expected.

How it works

This is a very simple approach to the problem. Take a newline separated text file for any commands you may want to run, parse it, run the commands sequentially while piping their output to stdout, and return an error if any of them errored, else return nil.

How to use it

First compile the lamex binary to run on Lambda (or get it from the releases page)

cd $GOPATH/src/gitub.com/sbogacz/lamex
GOOS=linux GOARCH=amd64 go build -o lamex

Write your commands.txt file, e.g.

echo "./system-tests -test.v" > commands.txt

Zip it up with the binary you'd like to run, e.g.

zip code.zip lamex yourCompiledBinary commands.txt

Upload it to Lambda, and make sure the Handler is set to lamex (or whatever name you gave it at compilation time)

lamex's People

Contributors

sbogacz avatar

Watchers

James Cloos avatar

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.