Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/helm-chart-smoketest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ jobs:
- name: apply Spin shim
run: |
# Ensure shim binary is compatible with runner arch
yq -i '.spec.fetchStrategy.anonHttp.location = "https://github.com/spinkube/containerd-shim-spin/releases/download/${{ env.SHIM_SPIN_VERSION }}/containerd-shim-spin-v2-linux-x86_64.tar.gz"' \
yq -i '.spec.fetchStrategy.anonHttp.location = "https://github.com/spinframework/containerd-shim-spin/releases/download/${{ env.SHIM_SPIN_VERSION }}/containerd-shim-spin-v2-linux-x86_64.tar.gz"' \
config/samples/test_shim_spin.yaml
kubectl apply -f config/samples/test_shim_spin.yaml

Expand Down
4 changes: 2 additions & 2 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ domain: kwasm.sh
layout:
- go.kubebuilder.io/v4
projectName: runtime-class-manager
repo: github.com/spinkube/runtime-class-manager
repo: github.com/spinframework/runtime-class-manager
resources:
- api:
crdVersion: v1
Expand All @@ -15,7 +15,7 @@ resources:
domain: kwasm.sh
group: runtime
kind: Shim
path: github.com/spinkube/runtime-class-manager/api/v1alpha1
path: github.com/spinframework/runtime-class-manager/api/v1alpha1
version: v1alpha1
- controller: true
domain: kwasm.sh
Expand Down
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# runtime-class-manager

[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/spinkube/runtime-class-manager/badge)](https://securityscorecards.dev/viewer/?uri=github.com/spinkube/runtime-class-manager)
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/spinframework/runtime-class-manager/badge)](https://securityscorecards.dev/viewer/?uri=github.com/spinframework/runtime-class-manager)

The runtime-class-manager is the spiritual successor to the kwasm-operator. kwasm has been developed as an experimental, simple way to install Wasm runtimes. This experiment has been relatively successful, as more and more users utilized it to fiddle around with Wasm on Kubernetes. However, the kwasm-operator has some limitations that make it difficult to use in production. The runtime-class-manager is an attempt to address these limitations to make it a reliable and secure way to deploy arbitrary containerd shims.

Expand All @@ -12,16 +12,16 @@ The name should be treated as a working title and is hopefully subject to change

For the 1.0 release of runtime-class-manager, we consider three milestones:

- **M1: [RCM MVP for Spinkube](https://github.com/spinkube/runtime-class-manager/milestone/1)**
This milestone is about getting RCM to a state where Spinkube can rely on RCM and use it as a dependency instead of Kwasm. This means, that the focus is on managing lifecycle of [containerd-shim-spin](https://github.com/spinkube/containerd-shim-spin) on nodes.
- **M2: [Kwasm Feature Parity](https://github.com/spinkube/runtime-class-manager/milestone/2)**
- **M1: [RCM MVP for Spinkube](https://github.com/spinframework/runtime-class-manager/milestone/1)**
This milestone is about getting RCM to a state where Spinkube can rely on RCM and use it as a dependency instead of Kwasm. This means, that the focus is on managing lifecycle of [containerd-shim-spin](https://github.com/spinframework/containerd-shim-spin) on nodes.
- **M2: [Kwasm Feature Parity](https://github.com/spinframework/runtime-class-manager/milestone/2)**
All shims that kwasm can install, should be installable via rcm. Automated tests are in place to ensure installation of RCM and shims that are supported by Kwasm.
- **M3: [Full implementation of the initial spec](https://github.com/spinkube/runtime-class-manager/milestone/3)**
- **M3: [Full implementation of the initial spec](https://github.com/spinframework/runtime-class-manager/milestone/3)**
Stable spec of the Shim CRD based on the [initial proposal](https://hackmd.io/TwC8Fc8wTCKdoWlgNOqTgA). After 1.0 we assume no breaking changes of the Shim CRD. Arbitrary shims can be installed via RCM and prominent shims are tested automatically, on various Kubernetes distributions.
- Future (ideas):
- support for additional container runtimes, like CRI-O to enable RCM on OpenShift
- alternative shim installation via Daemonset instead of Jobs
- treating node-installer as a daemon process, to enable better conflict resolution
- support for additional container runtimes, like CRI-O to enable RCM on OpenShift
- alternative shim installation via Daemonset instead of Jobs
- treating node-installer as a daemon process, to enable better conflict resolution

## Usage

Expand All @@ -33,8 +33,8 @@ Stable spec of the Shim CRD based on the [initial proposal](https://hackmd.io/Tw
make docker-build docker-push IMG=<some-registry>/runtime-class-manager:tag
```

**NOTE:** This image ought to be published in the personal registry you specified.
And it is required to have access to pull the image from the working environment.
**NOTE:** This image ought to be published in the personal registry you specified.
And it is required to have access to pull the image from the working environment.
Make sure you have the proper permission to the registry if the above commands don’t work.

**Install the CRDs into the cluster:**
Expand All @@ -49,7 +49,7 @@ make install
make deploy IMG=<some-registry>/runtime-class-manager:tag
```

> **NOTE**: If you encounter RBAC errors, you may need to grant yourself cluster-admin
> **NOTE**: If you encounter RBAC errors, you may need to grant yourself cluster-admin
privileges or be logged in as admin.

**Create instances of your solution**
Expand All @@ -62,6 +62,7 @@ kubectl apply -k config/samples/
>**NOTE**: Ensure that the samples has default values to test it out.

### To Uninstall

**Delete the instances (CRs) from the cluster:**

```sh
Expand Down Expand Up @@ -95,4 +96,3 @@ distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

2 changes: 1 addition & 1 deletion cmd/node-installer/detect.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"log/slog"

"github.com/spf13/afero"
"github.com/spinkube/runtime-class-manager/internal/preset"
"github.com/spinframework/runtime-class-manager/internal/preset"
)

var containerdConfigLocations = map[string]preset.Settings{
Expand Down
6 changes: 3 additions & 3 deletions cmd/node-installer/detect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ import (
"testing"

"github.com/spf13/afero"
main "github.com/spinkube/runtime-class-manager/cmd/node-installer"
"github.com/spinkube/runtime-class-manager/internal/preset"
tests "github.com/spinkube/runtime-class-manager/tests/node-installer"
main "github.com/spinframework/runtime-class-manager/cmd/node-installer"
"github.com/spinframework/runtime-class-manager/internal/preset"
tests "github.com/spinframework/runtime-class-manager/tests/node-installer"
"github.com/stretchr/testify/require"
)

Expand Down
6 changes: 3 additions & 3 deletions cmd/node-installer/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ import (

"github.com/spf13/afero"
"github.com/spf13/cobra"
"github.com/spinkube/runtime-class-manager/internal/containerd"
"github.com/spinkube/runtime-class-manager/internal/preset"
"github.com/spinkube/runtime-class-manager/internal/shim"
"github.com/spinframework/runtime-class-manager/internal/containerd"
"github.com/spinframework/runtime-class-manager/internal/preset"
"github.com/spinframework/runtime-class-manager/internal/shim"
)

// installCmd represents the install command.
Expand Down
4 changes: 2 additions & 2 deletions cmd/node-installer/install_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
"testing"

"github.com/spf13/afero"
main "github.com/spinkube/runtime-class-manager/cmd/node-installer"
tests "github.com/spinkube/runtime-class-manager/tests/node-installer"
main "github.com/spinframework/runtime-class-manager/cmd/node-installer"
tests "github.com/spinframework/runtime-class-manager/tests/node-installer"
"github.com/stretchr/testify/require"
)

Expand Down
4 changes: 2 additions & 2 deletions cmd/node-installer/uninstall.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import (
"github.com/spf13/afero"
"github.com/spf13/cobra"

"github.com/spinkube/runtime-class-manager/internal/containerd"
"github.com/spinkube/runtime-class-manager/internal/shim"
"github.com/spinframework/runtime-class-manager/internal/containerd"
"github.com/spinframework/runtime-class-manager/internal/shim"
)

// uninstallCmd represents the uninstall command.
Expand Down
4 changes: 2 additions & 2 deletions cmd/rcm/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ import (
"sigs.k8s.io/controller-runtime/pkg/log/zap"
metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"

runtimev1alpha1 "github.com/spinkube/runtime-class-manager/api/v1alpha1"
"github.com/spinkube/runtime-class-manager/internal/controller"
runtimev1alpha1 "github.com/spinframework/runtime-class-manager/api/v1alpha1"
"github.com/spinframework/runtime-class-manager/internal/controller"
//+kubebuilder:scaffold:imports
)

Expand Down
4 changes: 2 additions & 2 deletions config/samples/test_shim_spin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ spec:
fetchStrategy:
type: anonymousHttp
anonHttp:
location: "https://github.com/spinkube/containerd-shim-spin/releases/download/v0.15.1/containerd-shim-spin-v2-linux-aarch64.tar.gz"
location: "https://github.com/spinframework/containerd-shim-spin/releases/download/v0.15.1/containerd-shim-spin-v2-linux-aarch64.tar.gz"

runtimeClass:
# Note: this name is used by the Spin Operator project as its default:
# https://github.com/spinkube/spin-operator/blob/main/config/samples/spin-shim-executor.yaml
# https://github.com/spinframework/spin-operator/blob/main/config/samples/spin-shim-executor.yaml
name: wasmtime-spin-v2
handler: spin-v2

Expand Down
6 changes: 3 additions & 3 deletions deploy/helm/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ Welcome to Runtime-Class-Manager.

Next steps:

Create one or more Wasm Shim custom resources. See the samples in https://github.com/spinkube/runtime-class-manager/tree/main/config/samples.
Create one or more Wasm Shim custom resources. See the samples in https://github.com/spinframework/runtime-class-manager/tree/main/config/samples.

> Note: Ensure that the `location` for the specified shim binary points to the correct architecture for your Node(s)

For example, install the Spin shim:

```shell
kubectl apply -f https://raw.githubusercontent.com/spinkube/runtime-class-manager/refs/heads/main/config/samples/test_shim_spin.yaml
kubectl apply -f https://raw.githubusercontent.com/spinframework/runtime-class-manager/refs/heads/main/config/samples/test_shim_spin.yaml
```

Next, annotate one or more nodes with a label corresponding to the `nodeSelector` declared in the Shim, runtime-class-manager will install the shim as well as create the corresponding RuntimeClass:
Expand All @@ -18,4 +18,4 @@ Next, annotate one or more nodes with a label corresponding to the `nodeSelector
kubectl label node --all spin=true
```

You are now ready to deploy your Wasm workloads.
You are now ready to deploy your Wasm workloads.
6 changes: 3 additions & 3 deletions deploy/helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
replicaCount: 1

image:
repository: "ghcr.io/spinkube/runtime-class-manager"
repository: "ghcr.io/spinframework/runtime-class-manager"
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: "latest"

rcm:
shimDownloaderImage:
repository: "ghcr.io/spinkube/shim-downloader"
repository: "ghcr.io/spinframework/shim-downloader"
tag: "latest"
nodeInstallerImage:
repository: "ghcr.io/spinkube/node-installer"
repository: "ghcr.io/spinframework/node-installer"
tag: "latest"
nodeInstallerJob:
ttl: 0
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/spinkube/runtime-class-manager
module github.com/spinframework/runtime-class-manager

go 1.23.0

Expand Down
2 changes: 1 addition & 1 deletion internal/containerd/configure.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"strings"

"github.com/spf13/afero"
"github.com/spinkube/runtime-class-manager/internal/shim"
"github.com/spinframework/runtime-class-manager/internal/shim"
)

type Restarter interface {
Expand Down
2 changes: 1 addition & 1 deletion internal/containerd/configure_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"testing"

"github.com/spf13/afero"
tests "github.com/spinkube/runtime-class-manager/tests/node-installer"
tests "github.com/spinframework/runtime-class-manager/tests/node-installer"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
Expand Down
2 changes: 1 addition & 1 deletion internal/controller/node_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ package controller
// "os"
// "strings"

// kwasmv1 "github.com/spinkube/runtime-class-manager/api/v1alpha1"
// kwasmv1 "github.com/spinframework/runtime-class-manager/api/v1alpha1"
// "github.com/rs/zerolog/log"
// batchv1 "k8s.io/api/batch/v1"
// corev1 "k8s.io/api/core/v1"
Expand Down
2 changes: 1 addition & 1 deletion internal/controller/shim_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/predicate"
"sigs.k8s.io/controller-runtime/pkg/reconcile"

rcmv1 "github.com/spinkube/runtime-class-manager/api/v1alpha1"
rcmv1 "github.com/spinframework/runtime-class-manager/api/v1alpha1"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion internal/controller/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/log/zap"

runtimev1alpha1 "github.com/spinkube/runtime-class-manager/api/v1alpha1"
runtimev1alpha1 "github.com/spinframework/runtime-class-manager/api/v1alpha1"
//+kubebuilder:scaffold:imports
)

Expand Down
2 changes: 1 addition & 1 deletion internal/preset/preset.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"strings"

"github.com/spf13/afero"
"github.com/spinkube/runtime-class-manager/internal/containerd"
"github.com/spinframework/runtime-class-manager/internal/containerd"
)

type Settings struct {
Expand Down
4 changes: 2 additions & 2 deletions internal/preset/preset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"testing"

"github.com/spf13/afero"
"github.com/spinkube/runtime-class-manager/internal/preset"
tests "github.com/spinkube/runtime-class-manager/tests/node-installer"
"github.com/spinframework/runtime-class-manager/internal/preset"
tests "github.com/spinframework/runtime-class-manager/tests/node-installer"
"github.com/stretchr/testify/require"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/shim/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"path"
"path/filepath"

"github.com/spinkube/runtime-class-manager/internal/state"
"github.com/spinframework/runtime-class-manager/internal/state"
)

func (c *Config) Install(shimName string) (filePath string, changed bool, err error) {
Expand Down
2 changes: 1 addition & 1 deletion internal/shim/install_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"testing"

"github.com/spf13/afero"
tests "github.com/spinkube/runtime-class-manager/tests/node-installer"
tests "github.com/spinframework/runtime-class-manager/tests/node-installer"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
Expand Down
2 changes: 1 addition & 1 deletion internal/shim/uninstall.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"os"

"github.com/spinkube/runtime-class-manager/internal/state"
"github.com/spinframework/runtime-class-manager/internal/state"
)

func (c *Config) Uninstall(shimName string) (string, error) {
Expand Down
2 changes: 1 addition & 1 deletion internal/shim/uninstall_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"testing"

"github.com/spf13/afero"
tests "github.com/spinkube/runtime-class-manager/tests/node-installer"
tests "github.com/spinframework/runtime-class-manager/tests/node-installer"
)

func TestConfig_Uninstall(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions internal/state/state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"testing"

"github.com/spf13/afero"
"github.com/spinkube/runtime-class-manager/internal/state"
tests "github.com/spinkube/runtime-class-manager/tests/node-installer"
"github.com/spinframework/runtime-class-manager/internal/state"
tests "github.com/spinframework/runtime-class-manager/tests/node-installer"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
Expand Down
4 changes: 2 additions & 2 deletions testdata/apps/spin-app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ spec:
runtimeClassName: wasmtime-spin-v2
containers:
- name: spin-hello
image: ghcr.io/spinkube/spin-operator/hello-world:20240909-145818-g30def7d
image: ghcr.io/spinframework/spin-operator/hello-world:20240909-145818-g30def7d
command: ["/"]
---
apiVersion: v1
Expand All @@ -29,4 +29,4 @@ spec:
port: 80
targetPort: 80
selector:
app: wasm-spin
app: wasm-spin
Loading