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

[FEATURE] Support CodeBuild runtime-versions in module deployspecs #467

Closed
chamcca opened this issue Dec 14, 2023 · 4 comments
Closed

[FEATURE] Support CodeBuild runtime-versions in module deployspecs #467

chamcca opened this issue Dec 14, 2023 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@chamcca
Copy link
Contributor

chamcca commented Dec 14, 2023

Is your feature request related to a problem? Please describe.
Not a problem yet, but will be. Current runtimes for python and nodejs are locked (and kind of out of date) in the CodeBuild Build definition. It would be really useful to reuse the runtime-versions support from the buildspec in the seedfarmer deployspec.

Describe the solution you'd like
In the deployspec.yaml for a module, support adding the runtime-versions attribute to the install phase of the deploy and destroy sections:

phases: 
    install: 
      runtime-versions: 
        nodejs: 10 
        python: 3.7

This seems doable since seedfarmer is utilizing CodeBuild's base images which already support runtime declaration. Brief investigation of the code appears to support passing through from deployspec to the CodeBuild API overrides.

Describe alternatives you've considered
Manually modifying the CodeBuild Build definition after bootstrapping the environment. But this is just a temporary workaround as it then applies to any/all modules in the project.

@chamcca chamcca added the enhancement New feature or request label Dec 14, 2023
@dgraeber
Copy link
Contributor

dgraeber commented Dec 14, 2023

We will evaluate.

@chamcca Can you comment on the level of need ("I need this now, it is blocking", "Q1 2024 will be ok", etc etc)

@dgraeber dgraeber self-assigned this Dec 14, 2023
@chamcca
Copy link
Contributor Author

chamcca commented Dec 14, 2023

Q1 2024 is probably fine as this isn't really blocking. Really the concern is about being locked into runtime-versions which are EOL, specifically Node 16. Suspect it's just a matter of time until CDK CLI drops support for it (as they've done in the past).

In addition, controlling the runtime-version for a module ensures repeatable, consistent results even if the underlying image is updated.

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!                                                                            !!
!!  Node 16 has reached end-of-life on 2023-09-11 and is not supported.       !!
!!  Please upgrade to a supported node version as soon as possible.           !!
!!                                                                            !!
!!  This software is currently running on node v16.20.2.                      !!
!!  As of the current release of this software, supported node releases are:  !!
!!  - ^20.0.0 (Planned end-of-life: 2026-04-30)                               !!
!!  - ^18.0.0 (Planned end-of-life: 2025-04-30)                               !!
!!                                                                            !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

@dgraeber
Copy link
Contributor

dgraeber commented Jan 2, 2024

We have evaluated and there are some wrinkles that we will need to figure out (no blockers here). We currently do support overriding the build image at the module level (not deployspec level) and that will remain consistent. As far as the runtime support, the AWS-provided images have specific runtimes they support (ex: aws/standard:6 supports nodejs 16 and not 18), so we are evaluating whether we want the runtime support for standard images to be supported in the deployspec (or how that would be handled if not a standard image is used)

@dgraeber
Copy link
Contributor

dgraeber commented Jan 8, 2024

After reviewing this request and also the code, we have decided to to the following:

  1. Support overrides with AWS Curated Build Images (ex. aws/codebuild/standard:7.0) at the module, account/region and account levels - leveraging existing support
  2. Added runtime support lookup for runtimes of at least two (2) Ubuntu-based AWS Curated images
  3. Negated the support of runtime-versions in the deployspec

Reasoning: the runtimes of the AWS Curated Build image are specific to the image itself (i.e standard:6.0 only supports python 3.10 not 3.11) and to install the latest version will not suffice b/c seedfarmer/codeseeder do not support all versions of python (i.e. not 3.12 as in standard:7.0). We now lookup the runtime configurations in seedfarmer to match the specified AWS Curated Build Image. Documentation is here when published : https://seed-farmer.readthedocs.io/en/latest/manifests.html

Adding runtime support to the deployspec will tightly couple a module to a particular build image with no chance to make it configurable as the deployspec is apart of the code itself (in checksum calc / gitpath pulls). In other words, a deployspec (module) that specifies a runtime (ie. using an AWS Curated Image) can ONLY use images that have that runtime available in the image, introducing a coupling to the image itself. As we can see, there is a tight mapping between the build image and the runtimes it supports (see links below.)

The latest version of AWS CodeSeeder will allow AWS Curated build overrides and SeedFarmer will leverage that when deploying modules.
This change will be apart of the next seedfarmer release.

REF:
https://docs.aws.amazon.com/codebuild/latest/userguide/available-runtimes.html
https://docs.aws.amazon.com/codebuild/latest/userguide/runtime-versions.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants