Giter Club home page Giter Club logo

envoy-gloo's Introduction

Build

Laptop

bazel build -c dbg :envoy --jobs=$[$(nproc --all)-2]

In the command above jobs is set to number of CPUs minus 2. This should help keep your laptop alive.

Optimized with debug symbols

bazel build -c opt :envoy
objcopy --only-keep-debug bazel-bin/envoy bazel-bin/envoy.debug
strip -g bazel-bin/envoy -o bazel-bin/envoy.striped

Upload debug symbols to s3

Create bucket (only one time):

aws s3 mb s3://artifacts.solo.io

Copy:

BUILDID=$(readelf -n ./bazel-bin/envoy|grep "Build ID:" |cut -f2 -d:|tr -d ' ')
aws s3 cp bazel-bin/envoy.debug s3://artifacts.solo.io/$BUILDID/envoy.debug

Check stamp

Builds are stampped with the commit hash. to see the stamp:

eu-readelf -n bazel-bin/envoy
...
  GNU                   20  GNU_BUILD_ID
    Build ID: 45c2b7a08b480aae64cf8bb1360aea9bc0cd0576
...

Bazel dependencies, tips

  • Dependencies
    • ninja
  • Troubleshooting
    • remove build artifacts: bazel clean --expunge
    • update bazel

Test

bazel test -c dbg //test/... --jobs=$[$(nproc --all)-2]

Test and e2e

bazel test -c dbg //test/... //e2e/... --jobs=$[$(nproc --all)-2]

Format fix

BUILDIFIER=$GOPATH/bin/buildifier CLANG_FORMAT=clang-format /path/to/envoy/tools/check_format.py fix --skip_envoy_build_rule_check

Submit a build

gcloud builds submit --project=solo-public --config=cloudbuild.yaml \
   --substitutions=COMMIT_SHA=$(git rev-parse HEAD) .

ARM Support (Experimental)

Support to target arm64 architectures, such as the Raspberry Pi 2 (v1.2) 3 & 4, is HIGLY EXPERIMENTAL These builds need to be executed on a machine with the same target architecture to produce the desired outcome. (WARNING: If building on Raspberry Pi 4 or other equivalent SBC, using the 8GB version is recommended. To produce gloo-envoy builds, 4GB might not be enough, especially when including tests)

Fastbuild

This method is intended to produce a gloo-envoy binary without performing tests (Might take approx. 12h to complete on a Raspberry Pi)

make fast-build-arm

Build release version

Produces and tests a gloo-envoy build.

make build-arm

Docker Release for ARM

You can optionally set your own registry to push gloo-envoy images by setting the REGISTRY environment variable or passing it as input. It defaults to quay.io/solo-io.

make docker-release-arm

envoy-gloo's People

Contributors

artberger avatar ashishb-solo avatar axhixh avatar ben-taussig-solo avatar birkland avatar celsosantos avatar christian-posta avatar chunter0 avatar dhawton avatar dmitri-d avatar eitanya avatar gunnar-solo avatar ilackarms avatar ilevine avatar jahvon avatar jbohanon avatar kdorosh avatar mitchdraft avatar nfuden avatar npolshakova avatar saiskee avatar sirajmansour avatar sodman avatar talnordan avatar yuval-k 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

Watchers

 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

envoy-gloo's Issues

Envoy with Modsecurity

I tried to compile Envoy with libmodsecurity, but it requires some dynamic libs like xml2, pcre and so on, as a result, to compile or run Envoy, these dynamic libs must be installed in the environment. Is it also nesscessary in Gloo Envoy? PLease help, thanks!

Inja bump from 2.1 -> 3.4

The following is a curated enumeration of the functional changes to the Inja library as we consume it when upgrading from v2.1 to v3.4. This is to track the work required to support solo-io/gloo#8177

2.2

  • ✔️ [CHANGE] Environment() constructor changed to use empty string instead of "./". link
    • ensure we aren't calling naked Environment() anywhere
    • this change was reverted in 3.4
  • [FEATURE] added at function to access elements in an array by index link
    • index out of range?
  • ✔️ [CHANGE] Environment's load_json will throw exception if file not found link
    • trace codepaths that use this and ensure we aren't using any
  • [FEATURE] add whitespace control options trim_blocks and lstrip_block link jinja reference
  • [FEATURE] a template can be included inside a loop, retaining the parent context link
  • ✔️ [CHANGE] Environment's Impl class removed link
    • ensure we aren't using this piece of Environment

3.0

  • ✔️ [CHANGE] Reworked exception throwing link
    • ensure we're not relying on the format of exceptions thrown out of inja; update accordingly
  • [FEATURE] Loop features index, index1, is_first, is_last can be used when looping over objects (maps) link
  • [PERFORMANCE] Improved performance when looping over large datasets link
  • ✔️ [CHANGE] removal of polyfill; not sure what was being polyfilled link
    • ensure we build without this
  • [FEATURE] disable searching for templates on file system link
    • New field in ParserConfig
    • Expose or explicitly enable depending on how we currently allow template configuration
  • [FEATURE] disable throwing an exception if included template not found link
    • New struct RenderConfig
    • Expose?
    • Test envoy behavior with/without setting with missing include
  • [FEATURE] add fine-grained whitespace control for statements e.g. {%+, {%-, -%} link
  • ✔️ [CHANGE] Node constructor signatures all changed to require size_t argument link
    • ensure we are not calling this constructor anywhere
  • ✔️ [CHANGE] Major rewrite of core (AKA the big one) link
    • Parser constructor now take 4 args instead of 3
      • 4th argument function_storage...
    • Pointer element notation removed from Parser config JSON Pointer RFC
      • test Envoy behavior if templates use pointer notation
      • explore possibly translating JSON pointers as a stopgap
  • [FEATURE] Plus, minus, times, slash, percent, power tokens added
    • test these operations for common errors, validate envoy behavior if failure
      • e.g. divide by zero, operations on NaN tokens
  • ✔️ [CHANGE] Numerous methods in Parser and Renderer made private link
    • ensure we build with this
  • [FEATURE] exists operation extended to be able to safely chain json pointers link
    • e.g. exists("array.1.name") can be used instead of the multiple calls exists("array"), existsIn("1", array), and existsIn("name", array.1)
  • [FEATURE] AtId operation added to access specific elements in a list of objects link
  • [PERFORMANCE] strings are no longer copied around needlessly link

3.1

  • [FEATURE] Add set statement to mutate data link
    • verify this only affects current scope and all child scopes; not parent scope
  • ✔️ [CHANGE] numerous values changed to const link
    • verify we build with this
  • [FEATURE] Add void callback link
    • we could use for logging or mutating dynamic metadata or modifying stats
  • [FEATURE] add fine-grained whitespace control for expressions e.g. {{%-, -%}} link
  • [FEATURE] consume UTF-8 byte order mark (BOM) link
    • this will not affect us

3.2

  • [FEATURE] Allow variables starting with @ and $ link
  • [FEATURE] Inja can be configured to abort instead of throw link

3.3

  • [CHANGE] short-circuit evaluation link
  • [FEATURE] inheritance between templates link
    • we should add extensive testing around this in case users build mega-templates with multiple levels of inheritence
  • [FEATURE] set statements can access child data via dot notation (not pointer notation as the docs state) link
  • [FEATURE] add fine-grained whitespace control for comments e.g. {#-, -#} link
  • [FEATURE] at can be nested to dynamically access object fields link
    • see test case for usage
  • [FEATURE] join function added to join lists with a separator link

3.4

  • [FEATURE] include callback link
    • this should be of limited use to us since we do not include from filesystem
  • ✔️ [CHANGE] Environment fields input_path and output_path changed from Public to Protected link
    • ensure we build with this
  • ✔️ [CHANGE] Environment() constructor changed to use "./" instead of empty string link
    • this is a reversion of a change in 2.2, no action should be required
  • [CHANGE] passing too few arguments to a function throws a parser error link
    • test envoy behavior when this error is thrown

Tasks

envoy body extraction

add:

  • be able to extract regex from body
  • be able to ref the body from inja template
  • be able to add templates to dynamic metadata

Update CI to account for upstream ci changes

Upstream has had some amazing work done on its ci in 1.26

This put us in an unenviable space where we had to change our envoy-gloo release process from relying on the upstream do_ci.

Our current work around is to checkout 1.25 to use that ci script as our base.

In this issue we MUST decide if we are to move off from upstream do_ci or to update our ci to work with the new upstream ci scripts.

This MAY include putting up prs for envoy that may only be in 1.27+ but we shouldnt rely on this checkout strategy for the long time.

Base64 decode fails when presented with Base64Url encoded string

JWTs and other usages use a modified character set from the standard base64. This variant is called base64url. When our Transformation filter is presented with a base64url encoded string to the base64_decode inja callback, the transformation fails silently because the decode returned an empty string.

make fast-build-arm not working correctly

While trying to build the project to ARM the command make fast-build-arm fails with:

ERROR: Skipping '//contrib/...': no targets found beneath 'contrib'
ERROR: no targets found beneath 'contrib'
INFO: Elapsed time: 3.005s
INFO: 0 processes.
ERROR: Couldn't start the build. Unable to run tests

Can you help?

Used Envoy Pre-Release Version 1.23.0 causes segmentation fault in Gloo Gateway Proxy

As described in the Gloo issue solo-io/gloo#6956, a segmentation fault occurs when a SNI is configured on an Upstream SSLConfig.

After some analysis (see comments + reproducer in solo-io/gloo#6956), I figured out that the problem occurs within the Envoy pre-release version 1.23.0 (https://github.com/solo-io/envoy-gloo/blob/v1.23.0-patch3/bazel/repository_locations.bzl#L4).

As shown in the reproducer, the problem does not occur in the final Envoy release 1.23.0.

Support for delete json keys in inja template

Univision is looking to remove some json keys from the body if certain properties.

Here is the javascript code they currently use to remove it

var content = context.getVariable("request.content")
if ( content !== '' ) { 
    if ( JSON.parse(content).hasOwnProperty('video') ) {
        var payload = JSON.parse(content)
        video = payload['video']; 
        if ( video.hasOwnProperty('mediaId') ) {
            var mediaid = payload['video']['mediaId']+"";
            if ( mediaid.match(/^transmission:matchid:.*/) ) {
                payload['video']['mediaId'] = "video:mcp:unexpected-live-match";
                context.setVariable('request.content', JSON.stringify(payload));
            }
        }
        if ( video.hasOwnProperty('seriesMediaId') ) {
            var seriesmediaid = payload['video']['seriesMediaId'];
            if ( seriesmediaid === "" ) { 
                delete payload['video']['seriesMediaId'];
                if ( video.hasOwnProperty('nextEpisodeMediaId') ) {
                    delete payload['video']['nextEpisodeMediaId'];
                }   
                context.setVariable('request.content', JSON.stringify(payload))
            }
        } else if ( video.hasOwnProperty('nextEpisodeMediaId') ) {
            delete payload['video']['nextEpisodeMediaId'];
            context.setVariable('request.content', JSON.stringify(payload))
        } 
    } else {
        context.setVariable('vixdebug.remove_empty_series_media_id','payload does not have a json video object')
    }
}

PR: #347

Lambda filter overhaul

Now that upstream has also implemented their own lambda filter there are some really nice improvements that we can emulate.

Ideally we would align closer to upstream and slot our authentication and transformation improvements.

TODO: @nfuden link the changes such as:

  • splitting out signing to not be lambda specific
  • allow lambdas signing to happen later as an http extension so that transforms dont mess up signing

UnwrapAsAlb should be a transformer to match the pattern of other AWS transformations

When wrapAsApiGateway and unwrapAsApiGateway were implemented, they were implemented as custom transformers which were defined in envoy-gloo-ee to protect them as enterprise features. After moving unwrapAsApiGateway into OSS, and looking ahead toward other potential request/response transformer implementations, it makes sense to extract the logic for unwrapAsAlb out into a custom transformer as well. This will be more uniform and will serve to simplify the internal API

Typo on line 27 of envoy-gloo/ci/run_envoy_docker.sh

envoy-gloo/ci/run_envoy_docker.sh file has a line of code which should be commented perhaps? Running the make build-arm or whenever this shell script is invoked give an error.

./ci/run_envoy_docker.sh: line 27: Since: command not found

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.