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

Introduce function versioning #11

Merged
merged 6 commits into from
May 12, 2023
Merged

Conversation

thomasgouveia
Copy link
Member

@thomasgouveia thomasgouveia commented Apr 28, 2023

This PR brings the following improvements and fixes :

  • Function are now versioned using semantic versioning. That means that you can build and invoke multiple versions of a specific function.
  • Client SDKs are updated to match the new APIs
  • Fix the DeleteFunctionInstance function signature
  • Remove deprecated code for LZ4 compression

See #10 for more details.

Closes #10

How to test ?

Run a classic Morty instance on this branch. Please note that I wasn't able to test the PR with a previous state (e.g: updating an existing morty instance). If you can test this, its great !

Prerequisites

Steps

Create a new function with the CLI :

morty fn init -r go-1.19 my-versioned-function

Build it :

morty fn build my-versioned-function

Invoke it (by default, if you don't specify a version with the --version flag, the latest version will be invoked):

morty fn invoke my-versioned-function
# Expected output 
{"message": "Hello, World!"}

Now, update the code of your function to return another message, for example "Hello from my new version". Bump the version in the morty.yaml file to v0.1.1, and re-build your function :

morty fn build my-versioned-function

Once done, invoke the new version :

morty fn invoke my-versioned-function --version v0.1.1 # You can omit the version to ensure that the latest is called
# Expected output
{"message": "Hello from my new version"}

Ensure that you can also invoke the previous version :

morty fn invoke my-versioned-function --version v0.1.0
# Expected output
{"message": "Hello, World!"}

registry/registry/build.go Fixed Show fixed Hide fixed
@thomasgouveia thomasgouveia removed the request for review from hugoamalric May 8, 2023 13:40
@thomasgouveia thomasgouveia force-pushed the f-allow-rebuilding-function branch 2 times, most recently from 921be6b to 51932fb Compare May 8, 2023 15:48
@thomasgouveia thomasgouveia marked this pull request as ready for review May 8, 2023 15:51
@thomasgouveia thomasgouveia changed the title Allow multiple builds for a function Introduce function versioning May 8, 2023
@thomasgouveia thomasgouveia force-pushed the f-allow-rebuilding-function branch 3 times, most recently from 1b144a4 to 7543c03 Compare May 11, 2023 17:33
Signed-off-by: thomasgouveia <gouveia.thomas@outlook.fr>
Signed-off-by: thomasgouveia <gouveia.thomas@outlook.fr>
Signed-off-by: thomasgouveia <gouveia.thomas@outlook.fr>
Signed-off-by: thomasgouveia <gouveia.thomas@outlook.fr>
- Updated function structs to handle version
- Updated states engines to manage keys with versions
- Update `rik` orchestrator engine so workloads will have the following name pattern: `name:version`

Signed-off-by: thomasgouveia <gouveia.thomas@outlook.fr>
Signed-off-by: thomasgouveia <gouveia.thomas@outlook.fr>
@thomasgouveia thomasgouveia merged commit 5e2511f into main May 12, 2023
@thomasgouveia thomasgouveia deleted the f-allow-rebuilding-function branch May 12, 2023 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🚀 Done
Development

Successfully merging this pull request may close these issues.

Ability to re-build a function
2 participants