Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

WIP: Integrate Kubernetes deployment requirements for ink! playground #737

Closed
wants to merge 43 commits into from

Conversation

achimcc
Copy link
Contributor

@achimcc achimcc commented Jun 10, 2023

This is a very much WIP PR to move away from running the Dockerfile in a sysbox runtime to a full Kubernetes to add a Kubernetes feature for deployment. As discussed in https://github.com/paritytech/devops/issues/2526.

I'd prefer to keep the working Docker config, as it could be useful self-hosting and testing purposes.

I started to implement a kubernetes feature flag in the backend crate, which allows the main/webserver pod to call into the Kubernetes AI through kube instead of using the sysbox docker runtime.

Supposed to solve:

#704
https://github.com/paritytech/devops/issues/2526

@achimcc achimcc changed the title WIP: move from sysbox to Kubernetes WIP: migrate from sysbox to Kubernetes deployment Jun 11, 2023
@JoshOrndorff
Copy link
Collaborator

Excellent start! Keep it up!

FYI, those paritytech/devops links are 404 (probably a private repo). NBD, just wanted you to know.

@achimcc achimcc changed the title WIP: migrate from sysbox to Kubernetes deployment WIP: Integrate Kubernetes deployment requirements for ink! playground Jun 13, 2023
@achimcc
Copy link
Contributor Author

achimcc commented Jun 15, 2023

Architecture update:

  • We will use Kubernetes jobs instead of pods for Smart Contract compilation.
  • We assemble a thin compiler image which contains cargo contract compilation machinery but not any compiled artifacts.
  • We instantiate a permanent base compilation volume, which gets populated by the main ink-playground Webserver pod at its first instantiation.
  • On every new Job instantiation we create a temporary overlay over the base compilation volume, which stores the result from the requested Smart Contract compilation.

With the Kubernetes implementation it should also be trivial to orchestrate different base images for Smart Contract compilation for job instantiations, so that we can finally also implement the versioning of ink! Smart Contracts which was requested by @cmichi in #427 and continued in #460 .

Thanks for support and discussion @ArshamTeymouri !

We make the Kubernetes namespace in the backend crate configurable with a namespace cli feature. We can pass this cli feature through an internal .env variable of the ink-playground Dockerfile with default value "namespace", so that @paritytech/devops can provide their custom 'namespace' there.

@deuszx
Copy link

deuszx commented Jun 23, 2023

As I understand, this PR is supposed to solve current issues with https://ink-playground.substrate.io/ ?

Any ETA on it?

@kamalbuilds
Copy link

+1 to @deuszx cc @achimcc

@cmichi cmichi closed this Feb 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants