canonical / seldon-core-operator

Seldon Core Operator
Apache License 2.0
5 stars 10 forks source link

Integration of ROCK images into Seldon Core Operator #133

Open i-chvets opened 1 year ago

i-chvets commented 1 year ago

Description

Integration of ROCK images. https://github.com/canonical/seldonio-rocks

The following ROCK images need to be integrated into Seldon Core Operator: Charm managed:

Workload managed:

Design

Design of how ROCKs are built, tested and integrated is captured in related specification (KF-044). Main design points for Seldon ROCKs:

Testing

Existing integration tests are to be re-used to test functionality of new ROCK images. Follow Seldon documenation for testing: https://docs.seldon.io/projects/seldon-core/en/latest/reference/apis/index.html https://docs.seldon.io/projects/seldon-core/en/latest/nav/config/servers.html

Integration tests

Implementation

i-chvets commented 1 year ago

Recording status of s2i. Updated ROCK: https://github.com/canonical/seldonio-rocks/blob/feat-s2i-rock/seldon-core-s2i-python3.8/rockcraft.yaml Use existing example to buid. When using the ROCK container it fails. Evenlocation of those assemble/run scripts is specified with --image-scripts-url, it still refuses to run:

$ git clone https://github.com/seldonio/seldon-core.git
$ cd seldon-core
$ s2i build --image-scripts-url "image:///s2i/bin" wrappers/s2i/python/test/model-template-app  charmedkubeflow/seldon-core-s2i:v1.16.0_22.04_1 test-image
WARNING: could not inspect the builder image for labels: reading manifest v1.16.0_22.04_1 in docker.io/charmedkubeflow/seldon-core-s2i: requested access to the resource is denied
warning: Image sha256:9d65f600b06a0a916b70a3d48f16d1b4197549a63e7cc5f5b9014ce26228ad8d does not contain a value for the io.openshift.s2i.scripts-url label
Build failed
ERROR: An error occurred: failed to install [assemble run]
ERROR: Suggested solution: set the scripts URL parameter with the location of the S2I scripts, or check if the image has the "io.openshift.s2i.scripts-url" label set
ERROR: If the problem persists consult the docs at https://github.com/openshift/source-to-image/tree/master/docs. Eventually reach us on freenode #openshift or file an issue at https://github.com/openshift/source-to-image/issues providing us with a log from your build using log output level 3.

And those script do exist in the ROCK container:

$ docker run charmedkubeflow/seldon-core-s2i:v1.16.0_22.04_1 exec ls -la /s2i/bin
drwxr-xr-x 2 root root 4096 Jul 14 15:11 .
drwxr-xr-x 3 root root 4096 Jul 14 15:11 ..
-rwxr-xr-x 1 root root 2399 Jul 14 15:10 assemble
-rwxr-xr-x 1 root root 1495 Jul 14 15:10 run
-rwxr-xr-x 1 root root  406 Jul 14 15:10 save-artifacts
-rwxr-xr-x 1 root root 1867 Jul 14 15:10 usage
i-chvets commented 1 year ago

Add label to existin container to enable s2i to find scripts:

echo "FROM charmedkubeflow/seldon-core-s2i:v1.16.0_22.04_1" | docker build --label io.openshift.s2i.scripts-url="image:///s2i/bin" -t "charmedkubeflow/seldon-core-s2i:v1.16.0_22.04_1" -

Problem: https://github.com/openshift/source-to-image/issues/475

i-chvets commented 1 year ago

Update ROCK:

echo '''FROM charmedkubeflow/seldon-core-s2i:v1.16.0_22.04_1
ENTRYPOINT []''' | docker build --label io.openshift.s2i.scripts-url="image:///s2i/bin" -t "charmedkubeflow/seldon-core-s2i:v1.16.0_22.04_1" -
i-chvets commented 1 year ago

It is possible to build S2I base container image using rockcraft.yaml as a source, however it will require some adjustmetns and basically a rebuild using Docker. The process is as follows:

This will create a container image suitable to be used in S2I build process describe in Seldon documentation: https://docs.seldon.io/projects/seldon-core/en/latest/python/python_wrapping_s2i.html

This method does not really produce an S2I base ROCK image based on rockcraft.yaml, but rather Dockerfile based container image.