wkozaczuk / docker_osv_runner

Docker container that demonstrates running OSv apps
5 stars 3 forks source link

python flask application #1

Open Towfiqomi opened 4 years ago

Towfiqomi commented 4 years ago

Hi is it possible to create a python flask unikernel using capstan.

Thanks.

wkozaczuk commented 4 years ago

Hi,

Since I created this repo 2 years ago, we have migrated most of it to the main OSv repo (please see this).

Yeah, obviously you should be able to run your python app on OSv as long as it runs on Linux and does not use fork() under the hood. I am not familiar with Flask but I assume it is HTTP webapp type of framework so that should not be an issue.

I would encourage to first try to use capstan in the package mode. For starters you may want to look at this guide or this one. In high-level you need to put python and your flask app files into an OSv image. You may also notice that capstan supports Python runtimes but I would NOT recommend using it as it depends on some old python version.

Capstan is able to pull kernel and mpm artifacts from OSv github releases which contains way newer version than older S3 Mikelagelo repo. Please note that capstan caches downloaded kernel and mpm artifacts under $(HOME)/.capstan directory so if you want to use latest OSv kernel (osv-loader.qemu), you can pull it from the nighty releases github repo and replace it in proper directory under ~/.capstan/repository/osv-loader/ (if you use newest kernel please also use also corresponding osv-bootstrap.mpm from the nightly repo and put it under ~/.capstan/packages). Capstan cannot pull artifacts from the nightly releases repo yet, but it will soon.

Please contact us on the OSv mailing list and I am sure you will have some :-).

Waldek