Tebako

Announcing Tebako v0.11.0: decoupling runtime and application

Author’s picture Maxim Samsonov on 24 Dec 2024

We are excited to announce the release of Tebako v0.11.0, introducing a groundbreaking feature that allows the separate packaging of the runtime environment and application.

This advancement enables developers to create a reusable Ruby execution environment, facilitating the deployment of multiple applications or different versions of the same application with greater efficiency and flexibility.

Before:

Tebako pre-v0.11.0 architecture
+------------------------+
|    Tebako package      |
|  +----------------+    |
|  | Ruby Runtime   |    |
|  +----------------+    |
|  | Application    |    |
|  +----------------+    |
+------------------------+

After:

Tebako v0.11.0 architecture
+-----------------------+     +----------------------+
|    Runtime package    |     |  Application package |
|  +----------------+   |     |   +--------------+   |
|  | Ruby Runtime   |   |     |   | Application  |   |
|  | Interpreter    |<----------->| Code         |   |
|  | Dependencies   |   |     |   | Resources    |   |
|  +----------------+   |     |   +--------------+   |
+-----------------------+     +----------------------+

Decoupling runtime and application

In previous versions, Tebako packaged all these components into a single executable:

  • Ruby interpreter

  • Ruby dependencies

  • the application code and resources

While effective, this approach required repackaging the entire stack for each application or version update.

With v0.11.0, we have decoupled the runtime from the application, allowing the creation of a standalone runtime package that can be reused across various applications.

Benefits of the new feature

Enhanced flexibility

Tebako v0.11.0’s decoupled architecture introduces a new level of flexibility in deployment scenarios. By maintaining a consistent runtime environment across multiple applications, organizations can ensure standardization and compatibility throughout their Ruby application ecosystem.

This separation allows developers to deploy different applications or versions while maintaining the same underlying Ruby environment, significantly reducing complexity in managing multiple deployments.

Improved efficiency

The new architecture brings substantial improvements in resource utilization and deployment speed. Instead of packaging the entire Ruby runtime with each application, developers can now reuse a single runtime package across multiple applications.

This approach significantly reduces:

  • Storage requirements for deployed applications

  • Time spent packaging applications

  • Network bandwidth needed for distribution

  • System resource usage during deployment

Simplified updates and maintenance

One of the most significant advantages of the decoupled architecture is the streamlined update process.

When updates to the Ruby runtime or its dependencies are required, developers can now:

  • Update the runtime package once

  • Deploy the updated runtime across all applications

  • Avoid the need to repackage individual applications

This approach dramatically reduces maintenance overhead and ensures consistent runtime environments across all deployments.

Deployment options

Packaging modes

Tebako v0.11.0 introduces flexible packaging modes to accommodate various deployment scenarios:

  • Bundle mode

  • Runtime mode

  • Application mode

  • "Both" mode

Bundle mode

The traditional single-file packaging mode, combining both runtime and application in a single executable.

If you want to distribute a single, simple executable without any local or remote dependencies, this is the mode for you.

Characteristics:

  • Ideal for standalone deployments.

  • Ensures complete portability.

  • Maintains backwards compatibility.

Note
This is the default Tebako pre-v0.11.0 behavior.

Runtime mode

In this mode, Tebako creates a separate runtime package containing the Ruby interpreter and its dependencies. This runtime package can be shared across multiple applications.

Characteristics:

  • Reduces overall deployment size of the application.

  • Simplifies runtime updates.

  • Enhances application portability.

Application mode

In this mode, Tebako packages only the application code and resources, relying on a shared runtime package for execution.

Characteristics:

  • Requires a compatible runtime package built using runtime mode.

  • Enables quick application updates.

  • Reduces package size.

Both mode

Creates separate runtime and application packages in one go.

Characteristics:

  • Provides maximum flexibility.

  • Enables independent updates.

  • Ideal for complex deployment scenarios.

Building Tebako packages

To leverage these new features, follow this streamlined process.

Given a Ruby application at hello.rb:

puts "Hello, #{ARGV[0]}!"
  1. Create the runtime package:

    $ tebako press -m runtime -o tebako-runtime-package [-R {ruby-ver}]
  2. Create the application package:

    $ tebako press -m application -o tebako-application-package -e hello.rb -r test
  3. Run the application: using the pre-packaged runtime.

    $ tebako-runtime-package --tebako-run tebako-application-package Maxim

    Which outputs:

    Hello, Maxim!
  4. Deploy the packages

    • Deploy the runtime package to a shared location for download

    • Distribute application packages as needed

    • Execute applications using the shared runtime

This flexibility allows developers to tailor their deployment strategy to their specific needs while reducing redundant effort.

For detailed instructions and examples, please refer to our documentation.

Conclusion

The release of Tebako v0.11.0 marks a significant milestone in our mission to provide innovative solutions for Ruby application deployment.

By enabling the separate packaging of runtime and application, we empower developers with greater flexibility, efficiency, and control over their deployment processes.

We encourage you to explore this new feature and share your feedback with us. Your insights are invaluable as we continue to enhance Tebako to better serve the developer community.

Feedback and contacts

Our team is dedicated to supporting Tebako users and continuously improving Tebako to meet your needs.

If you encounter any issues or have questions regarding Tebako, please reach out to us through our GitHub issues page.

Press on with Tebako!

Tebako is a project of Ribose. — All rights reserved.