inception icon indicating copy to clipboard operation
inception copied to clipboard

Added kubernetes artifacts

Open MATRIX4284 opened this issue 3 years ago • 19 comments

What's in the PR

  • Kubernetes config file to run INCEpTION

How to test manually

kubectl create -f inception.yaml

Automatic testing

  • [ ] PR includes unit tests

Documentation

  • [ ] PR updates documentation

MATRIX4284 avatar Sep 30 '21 21:09 MATRIX4284

Can one of the admins verify this patch?

ukp-svc-jenkins avatar Sep 30 '21 21:09 ukp-svc-jenkins

Thanks for the PR :) Could you please fill in the description template so we have an idea what the PR actually is?

reckart avatar Oct 02 '21 11:10 reckart

Added kuberetes artifact for inception so that it can e run as cloud native

MATRIX4284 avatar Oct 02 '21 17:10 MATRIX4284

Thanks for the PR :) Could you please fill in the description template so we have an idea what the PR actually is?

I provided the kubernetes artifact so that we can run inception on kubernetes .

MATRIX4284 avatar Oct 02 '21 17:10 MATRIX4284

Ok, nice. How can one use it?

reckart avatar Oct 05 '21 09:10 reckart

Hi ,

It is executed by this command below.

kubectl create -f inception.yaml

I am giving the manual as a part of next pr.

Thanks & Regards, Ka

On Tue, Oct 5, 2021, 3:12 PM Richard Eckart de Castilho < @.***> wrote:

Ok, nice. How can one use it?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/inception-project/inception/pull/2640#issuecomment-934243855, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE7YQAGCY674PFFYPY3RSPTUFLCBTANCNFSM5FDI2JZA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

MATRIX4284 avatar Oct 05 '21 11:10 MATRIX4284

Ok, nice. How can one use it?

Hi ,

It is executed by this command below.

kubectl create -f inception.yaml

I am giving the manual as a part of next pr.

Please let me know about the decision to merge.

Thanks & Regards, Kaustav

MATRIX4284 avatar Oct 07 '21 18:10 MATRIX4284

The PR looks very helpful indeed.

However, I cannot tell if the location where the PR places the file is a good one.

Is it something that should be used out of the box? Probably not because there seem to be lots of settings that a particular user would want to change for their particular deployment. So a new module (as in the PR) doesn't seem quite right to me.

So it may be more an example file like the docker-compose.yml? In that case it would probably go next to the docker-compose.yml in the admin documentation: inception/inception-doc/src/main/resources/META-INF/asciidoc/admin-guide/scripts/ - and then a short piece of text explaining what the file does and how one would use it would be very useful - some installation_kubernetes.adoc file in /inception/inception-doc/src/main/resources/META-INF/asciidoc/admin-guide.

reckart avatar Oct 08 '21 05:10 reckart

I have enabled Kubernetes on my Docker Desktop and tried the command that you said, but it doesn't seem to work:

% kubectl create -f inception.yaml
persistentvolume/inception-pv created
persistentvolumeclaim/inception-pvc created
service/inception-svc created
The Deployment "inception" is invalid: spec.template.spec.containers[0].volumeMounts[0].name: Not found: "mapr"

reckart avatar Oct 08 '21 05:10 reckart

Corrected the typo in the volume name which was causing it to fail .

MATRIX4284 avatar Oct 08 '21 09:10 MATRIX4284

I have enabled Kubernetes on my Docker Desktop and tried the command that you said, but it doesn't seem to work:

% kubectl create -f inception.yaml
persistentvolume/inception-pv created
persistentvolumeclaim/inception-pvc created
service/inception-svc created
The Deployment "inception" is invalid: spec.template.spec.containers[0].volumeMounts[0].name: Not found: "mapr"

Hi there was a typo in volume name I fixed that ..now it will run without errors

MATRIX4284 avatar Oct 08 '21 09:10 MATRIX4284

I still have not managed to actually start it. While the required things now all seem to be configured ok, the docker image does not start on my M1 Mac - interestingly I get further than if I try running the same image via docker run. I'm looking into doing a multi-platform image and then need to have another look at the kubernetes file. Looks like there is no database? How would one inject a custom settings.properties with kubernetes?

reckart avatar Oct 12 '21 10:10 reckart

M1 is a ARM architecture that is the reason it is failing . It is not a kubernetes issue but rather a docker image issue.

I am using the docker image supplied in our inception docker which I guess is a X64 docker .

In that case we need to add another docker for ARM to support m1 mac as m1 is a arm64 based architecture.

Reference:

https://www.toptal.com/apple/apple-m1-processor-compatibility-overview

Thanks, Kaustav

On Tue, Oct 12, 2021, 4:19 PM Richard Eckart de Castilho < @.***> wrote:

I still have not managed to actually start it. While the required things now all seem to be configured ok, the docker image does not start on my M1 Mac - interestingly I get further than if I try running the same image via docker run. I'm looking into doing a multi-platform image and then need to have another look at the kubernetes file. Looks like there is no database? How would one inject a custom settings.properties with kubernetes?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/inception-project/inception/pull/2640#issuecomment-940893265, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE7YQAAEYTT5KZW2MAA4HZLUGQHE5ANCNFSM5FDI2JZA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

MATRIX4284 avatar Oct 12 '21 11:10 MATRIX4284

Yes, as I said, I am looking into setting up a multi-platform image using docker buildx. Actually, I have meanwhile already managed to build an M1 compatible image. Next I need to look into how the multi-image setup can be pushed as part of the Maven build. Normally, I am using a Maven plugin to do that and that picks up the dockerhub credentials from my machine. When I try the same thing using docker buildx, it currently fails because of missing credentials. Baby steps...

reckart avatar Oct 12 '21 12:10 reckart

Ok, so have a multi-platform image now -> https://github.com/inception-project/inception/pull/2651

I have managed to start INCEpTION using kubectl but I was unable to access port 8080 despite the YAML listing that port as exposed. docker ps also shows no accessible ports:

% docker ps
CONTAINER ID   IMAGE                                  COMMAND                  CREATED          STATUS          PORTS     NAMES
8be0756cb2df   inceptionproject/inception-snapshots   "/bin/sh -c 'java ${…"   22 seconds ago   Up 21 seconds             k8s_inception_inception-5c7dd56bc-9qqj2_default_fb030190-fddf-41f1-aa9e-b78cd2ba8ebf_0

Also, every once in a while when I start, the start fails:

% kubectl describe pods
...
Events:
  Type     Reason            Age              From               Message
  ----     ------            ----             ----               -------
  Warning  FailedScheduling  5s (x2 over 6s)  default-scheduler  0/1 nodes are available: 1 pod has unbound immediate PersistentVolumeClaims.

It seems that I always need to run kubectl delete -f ...; kubectl create -f ... twice until the whole thing starts up again.

reckart avatar Oct 12 '21 17:10 reckart

Seems like the volume is not getting created resulting in pvc without any bounded volume.

I will run my check and update.

Thanks & Regards, Kaustav

On Tue, Oct 12, 2021, 11:21 PM Richard Eckart de Castilho < @.***> wrote:

Ok, so have a multi-platform image now -> #2651 https://github.com/inception-project/inception/pull/2651

I have managed to start INCEpTION using kubectl but I was unable to access port 8080 despite the YAML listing that port as exposed. docker ps also shows no accessible ports:

% docker ps

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

8be0756cb2df inceptionproject/inception-snapshots "/bin/sh -c 'java ${…" 22 seconds ago Up 21 seconds k8s_inception_inception-5c7dd56bc-9qqj2_default_fb030190-fddf-41f1-aa9e-b78cd2ba8ebf_0

Also, every once in a while when I start, the start fails:

% kubectl describe pods

...

Events:

Type Reason Age From Message


Warning FailedScheduling 5s (x2 over 6s) default-scheduler 0/1 nodes are available: 1 pod has unbound immediate PersistentVolumeClaims.

It seems that I always need to run kubectl delete -f ...; kubectl create -f ... twice until the whole thing starts up again.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/inception-project/inception/pull/2640#issuecomment-941236969, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE7YQACQZ3CTCEB32UKCSCDUGRYSVANCNFSM5FDI2JZA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

MATRIX4284 avatar Oct 13 '21 04:10 MATRIX4284

@MATRIX4284 IMHO the question why the port doesn't seem accessible would be more interesting to look at. The volume seems a bit flaky but at least it also works from time to time. Do you have any idea regarding the port?

reckart avatar Oct 13 '21 06:10 reckart

Hi,

I will look into it and get back to you.

Thanks & Regards, Kaustav

On Wed, Oct 13, 2021, 11:48 AM Richard Eckart de Castilho < @.***> wrote:

@MATRIX4284 https://github.com/MATRIX4284 IMHO the question why the port doesn't seem accessible would be more interesting to look at. The volume seems a bit flaky but at least it also works from time to time. Do you have any idea regarding the port?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/inception-project/inception/pull/2640#issuecomment-941959057, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE7YQAAAGGCGASTJU24W633UGUQCNANCNFSM5FDI2JZA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

MATRIX4284 avatar Oct 13 '21 09:10 MATRIX4284

You may want to look into an init container and mounting the volume for the config's required to get this to run in Kubernetes. In addition, having an Ingress config in the code might be helpful as well.

blochs avatar Dec 13 '21 14:12 blochs

Trying this again now using Docker Desktop 4.25.1 (128006) and its built-in Kubernetes v1.28.2 - and ... it actually launches! 🚀

reckart avatar Nov 21 '23 19:11 reckart

Superseded by https://github.com/inception-project/inception/pull/4325

reckart avatar Nov 27 '23 19:11 reckart