Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Marketplace support #466

Merged
merged 15 commits into from
Aug 28, 2021
Merged

Marketplace support #466

merged 15 commits into from
Aug 28, 2021

Conversation

cristim
Copy link
Member

@cristim cristim commented Aug 13, 2021

Issue Type

  • Feature Pull Request

Summary

Implementation details:

  • convert the Lambda function to use Docker images coming from am AWS Marketplace Docker product instead of Zip files
  • use Alpine Linux as base for the Marketplace Docker image to appease the Marketplace ECR image scanner
  • Custom CloudFormation resource that copies the Docker image to a local ECR, since Lambda can currently only run from Docker images stored in a local ECR
  • metering the generated savings for billing 5% of it through the Marketplace metering API. Billing is done in $0.001/h increments charged for each $0.02/h saved by AutoSpotting, free below $0.02/h and for fractional amounts below the next $0.02/h savings step
  • Fargate scheduled job based on the same Docker image, hourly for the metering/billing, and a few required ancillary resources(VPC, networking configuration, IAM resources, SSM parameter, etc.), required because the metering API isn't currently working from Lambda
  • build system updates for building a Docker image instead of a Zip file
  • documentation updates

Notes:

  • currently only CloudFormation is supported, Terraform support will be implemented after the release
  • custom and evaluation builds haven't yet been tested thoroughly

Code contribution checklist

  1. [n/a] I hereby allow the Copyright holder the rights to distribute this piece of
    code under any software license.
  2. [n/a] The contribution fixes a single existing github issue, and it is linked
    to it.
  3. The code is as simple as possible, readable and follows the idiomatic Go
    guidelines.
  4. All new functionality is covered by automated test cases so the overall
    test coverage doesn't decrease.
  5. No issues are reported when running make full-test.
  6. [n/a] Functionality not applicable to all users should be configurable.
  7. [n/a] Configurations should be exposed through Lambda function environment
    variables which are also passed as parameters to the
    CloudFormation
    and
    Terraform
    stacks defined as infrastructure code.
  8. [n/a] Global configurations set from the infrastructure stack level should also
    support per-group overrides using tags.
  9. [n/a] Tags names and expected values should be similar to the other existing
    configurations.
  10. [n/a] Both global and tag-based configuration mechanisms should be tested and
    proven to work using log output from various test runs.
  11. The logs should be kept as clean as possible (use log levels as
    appropriate) and formatted consistently to the existing log output.
  12. The documentation is updated to cover the new behavior, as well as the
    new configuration options for both stack parameters and tag overrides.
  13. A code reviewer reproduced the problem and can confirm the code
    contribution actually resolves it.

@codeclimate
Copy link

codeclimate bot commented Aug 16, 2021

Code Climate has analyzed commit 539edbb and detected 1 issue on this pull request.

Here's the issue category breakdown:

Category Count
Bug Risk 1

View more on Code Climate.

@cristim cristim marked this pull request as ready for review August 28, 2021 18:08
@cristim cristim merged commit f2dc606 into master Aug 28, 2021
@cristim cristim deleted the feat/marketplace branch August 28, 2021 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant