Add code-only function init and runtime discovery support#707
Open
Add code-only function init and runtime discovery support#707
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces the first slice of code-only function support in Fn CLI.
It adds:
This allows users to initialize code-only functions using the new schema/version and discover valid managed runtimes and runtime versions without leaving Fn CLI.
Included in this PR
Code-only init
Funcfile/schema support
Runtime discovery
### Runtime-specific code-only init behaviour
For code-only init, runtime handling is explicit.
Python / Node
Python and Node use custom code-only boilerplate generators because the existing helpers produce file names and conventions tied to older image-based flows.
Java / Go
Java and Go also go through explicit code-only init branches, but delegate to the existing shared language helpers
This keeps the code-only init flow more uniform across supported runtimes while still reusing the existing language generators where appropriate.
### Validation
Code-only init
fn init --code-only --runtime-name python311.ol9 --runtime-config-type function-update
cat func.yaml
schema_version: 20260325
code_only: true
runtime_config:
type: function-update
runtime_name: python311.ol9
handler: hello_world.handler
Runtime discovery
fn list runtimes
fn list runtime-versions --runtime-name python311.ol9
fn get latest-runtime-version --runtime-name python311.ol9
This PR establishes the initialization and runtime discovery for code-only workflows. The PR intentionally leaves the existing legacy versioned internal type names (for example 'FuncFileV20180708' and 'RuntimeConfigV20180708') unchanged. Renaming these to version-agnostic names is planned as a follow-up cleanup PR.