sealer icon indicating copy to clipboard operation
sealer copied to clipboard

support run sealer image locally

Open kakaZhou719 opened this issue 1 year ago • 6 comments

Issue Description

Type: feature request

Describe what feature you want

For testing purposes, could sealer support run image locally, and no need to care about the underlying infrastructure. no matter the os is win, mac, linux, perhaps we could implement is though docker Or others container technology .

for example:

sealer run my-cluster:v1.22.15 . thats it. sealer run my-apps:v1 . thats it.

Additional context

Add any other context or screenshots about the feature request here.

kakaZhou719 avatar Mar 08 '23 05:03 kakaZhou719

Actually ,we already support to run sealer image on github action, i assume that we can use those container image to do this.

kakaZhou719 avatar Mar 10 '23 08:03 kakaZhou719

I want to solve this issue, Can I have a try : )

Daz-3ux avatar Apr 18 '23 09:04 Daz-3ux

Is the goal to achieve running a specified image locally, such that after using 'sealer pull' to pull the image, running 'sealer run a' would directly run the image (similar to running the 'a' image using Docker), rather than deploying it on a node? Is my understanding off? 👀 If there are more reference materials available, I would greatly appreciate it.

Daz-3ux avatar Apr 23 '23 05:04 Daz-3ux

Is the goal to achieve running a specified image locally, such that after using 'sealer pull' to pull the image, running 'sealer run a' would directly run the image (similar to running the 'a' image using Docker), rather than deploying it on a node? Is my understanding off? 👀 If there are more reference materials available, I would greatly appreciate it.

yes ~ Currently, we support running a sealer image by specifying a host IP and SSH auth , like -m 192.168.1.100 -p xxxx.

In fact, there is another way, which is to rely on the local container environment , and run this image on the host machine. maybe cmd looks like sealer run my-image:v1 --provider container Or more simple sealer run my-image:v1 (about how to use, we could discuss later).

more over, The ability to run in a container environment is now supported in the sealer code.

FYI:https://github.com/sealerio/sealer/blob/035b662d16628304452882c2453df976ec08a98c/pkg/infra/infra.go#L58

kakaZhou719 avatar Apr 23 '23 05:04 kakaZhou719

Is the goal to achieve running a specified image locally, such that after using 'sealer pull' to pull the image, running 'sealer run a' would directly run the image (similar to running the 'a' image using Docker), rather than deploying it on a node? Is my understanding off? 👀 If there are more reference materials available, I would greatly appreciate it.

For the purpose of testing, sealer can support the execution of sealer image in the container of linux (amd64) environment at present, but there are still problems in the execution of sealer image in other environments. In my opinion, in order to support the local execution of sealer image in other environments, We need to modify the base image of the corresponding environment. FYI: https://github.com/sealerio/sealer/blob/035b662d16628304452882c2453df976ec08a98c/pkg/infra/container/imagecontext/base/Dockerfile#L1 For example, first of all, it is necessary to detect the host environment. If the host environment is arm architecture, it needs to use the docker file of arm architecture to build the container running environment. You can also see test architecture(We took inspiration from kind to support sealer execution in containers),FYI: test architecture

zhy76 avatar Apr 23 '23 09:04 zhy76

AFAIU, this is the TODO:

  1. Specify the image to be run on the CLI (I prefer the format 'sealer run my-image:v1 --provider container').
  2. Detect the host's architecture and Add support for ARM architecture (by modifying the base image).

Daz-3ux avatar Apr 23 '23 10:04 Daz-3ux