Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Add Dockerfile for modelmesh-minio-examples image #300

Conversation

tedhtchang
Copy link
Contributor

@tedhtchang tedhtchang commented Jan 7, 2023

Motivation

Provide instructions to build a MinIO model examples image

Resolves #297 #302


***** UPDATE Jan 24, 2023 *****

The files in this PR are entirely moved to this new repository:
https://github.com/kserve/modelmesh-minio-examples/


@kserve-oss-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: tedhtchang
To complete the pull request process, please assign animeshsingh after the PR has been reviewed.
You can assign the PR to them by writing /assign @animeshsingh in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tedhtchang
Copy link
Contributor Author

/cc @ckadner

@kserve-oss-bot kserve-oss-bot requested a review from ckadner January 7, 2023 05:01
@rafvasq rafvasq requested review from njhill and removed request for animeshsingh January 9, 2023 20:49
Signed-off-by: ted chang <htchang@us.ibm.com>
Signed-off-by: ted chang <htchang@us.ibm.com>
@tedhtchang tedhtchang force-pushed the Add-dockerfile-for-modelmesh-minio-examples-image branch from b65075f to cee8e3a Compare January 11, 2023 00:54
Signed-off-by: ted chang <htchang@us.ibm.com>
@ckadner
Copy link
Member

ckadner commented Jan 11, 2023

Hi @tedhtchang -- thank you for your PR. Do you know where all those large model files originate from? Since they are so large, I think it would be great if we don't have to keep a copy of those files in the repo, instead, maybe they could be copied/downloaded from their original source at the time we build the image? Or whenever we need them for testing. And delete them afterwards.

@rafvasq
Copy link
Member

rafvasq commented Jan 11, 2023

Thanks @tedhtchang this is really helpful.

Probably a question for @njhill and @ckadner, I'm wondering whether fvt would be the correct directory to host both Dockerfiles. Maybe it'd be a new quickstart directory for the examples-only Dockerfile while the FVT-related image stays here?

@njhill
Copy link
Member

njhill commented Jan 11, 2023

Yes thanks @tedhtchang. I think we should add just the Dockerfile(s) for now while we figure out where to host the larger model files, maybe we could do that in a separate PR so that we keep this branch with all the files until we figure that out.

I agree with @rafvasq that the existing fvt dir probably isn't the best place for this to live. Probably it makes sense to have a new top-level dir called something like mino_build, since I can't really see anywhere else that it would fit very well.

njhill and others added 3 commits January 11, 2023 12:59
Signed-off-by: Nick Hill <nickhill@us.ibm.com>
Signed-off-by: Christian Kadner <ckadner@us.ibm.com>
@ckadner ckadner changed the title Add Dockerfile for modelmesh-minio-examples image Add Dockerfile for modelmesh-minio-examples image Jan 11, 2023
@ckadner ckadner marked this pull request as draft January 11, 2023 22:20
@ckadner
Copy link
Member

ckadner commented Jan 11, 2023

Hi Ted,

I moved the files to into a new minio_examples folder at the project root level, for now.

Although I don’t think we should add this to the modelmesh-serving repo — a 600 MB addition is just too large.

I think we create a new repo soon modelmesh-minio-examples with it's own CI/CD and figure out a way to offload the model files either to COS buckets with public read-access (or even credentialed access for MM maintainers only) or we use another mechanism like Git LFS for Large File Storage as @njhill has suggested

@ckadner
Copy link
Member

ckadner commented Jan 11, 2023

For today, I will just build it off of your branch, push it to DockerHub, deploy it on an OCP cluster and test it.

Signed-off-by: Christian Kadner <ckadner@us.ibm.com>
@ckadner ckadner force-pushed the Add-dockerfile-for-modelmesh-minio-examples-image branch from faf271e to c58bdea Compare January 11, 2023 22:32
Signed-off-by: Christian Kadner <ckadner@us.ibm.com>
Signed-off-by: Christian Kadner <ckadner@us.ibm.com>

RUN useradd -u 1000 -g 0 modelmesh

RUN chown -R 1000:0 /data1
Copy link
Member

@ckadner ckadner Jan 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as Nick pointed out, doing a chown after the COPY layers causes the final Docker image to be about 86 MB larger.

$ docker images | grep "modelmesh-minio-examples"

kserve/modelmesh-minio-examples   chown_before_cp      15eb3d6f159e   45 minutes ago   438MB
kserve/modelmesh-minio-examples   chown_after_cp       ad16135035ff   2 hours ago      524MB
kserve/modelmesh-minio-examples   cp-chown             7579fe5ccdea   57 minutes ago   438MB
quay.io/cloudservices/minio       RELEASE.2021-06-17   1377bf686561   11 months ago    351MB
kserve/modelmesh-minio-examples   latest               c773b3dc52e5   11 months ago    382MB
kserve/modelmesh-minio-examples   v0.9.0               c773b3dc52e5   11 months ago    382MB

I reverted to COPY --chown 1000:0 ... in commit 33c2f17

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ckadner ckadner changed the title Add Dockerfile for modelmesh-minio-examples image [WIP] Add Dockerfile for modelmesh-minio-examples image Jan 12, 2023
@rafvasq rafvasq mentioned this pull request Jan 12, 2023
Signed-off-by: Rafael Vasquez <raf.vasquez@ibm.com>
Signed-off-by: Rafael Vasquez <raf.vasquez@ibm.com>
@ckadner
Copy link
Member

ckadner commented Jan 20, 2023

@rafvasq -- I pushed a new modelmesh-minio-dev-examples:latest image with the FVT models you added

https://hub.docker.com/r/kserve/modelmesh-minio-dev-examples/tags

Signed-off-by: Christian Kadner <ckadner@us.ibm.com>
@ckadner
Copy link
Member

ckadner commented Jan 24, 2023

I created a new repository https://github.com/kserve/modelmesh-minio-examples/ from the commits in this PR with a few modifications to

  • remove the biggest unused models:
    • fvt/onnx/onnx-mobilenet (14 MB)
    • fvt/onnx/onnx-pytorch-converted (4.5 MB)
    • fvt/onnx/onnx-test-model (38 MB)
    • fvt/tensorflow/tfmnist (78 MB)
    • fvt/tensorflow/tfmnistnew (39 MB)
  • removing any duplicate models in favor of doing COPYs in the Dockerfile:
    • fvt/keras (6.5 MB)
    • fvt/pytorch/pytorch-mar-dup (4.6 MB)
    • fvt/tensorflow/keras-mnist (6.5 MB)
    • fvt/tensorflow/keras-mnistnew (6.5 MB)
    • fvt/tensorflow/mnist-dup.savedmodel (39 MB)
    • fvt/tensorflow/mnist.savedmodel (39 MB)
    • tensorflow/mnist.savedmodel (39 MB)

Shaving off about 315 MB from the size of the repo -- before any of those files were ever committed since Git would keep a history of the files and the repo would stay larger even if we deleted those file subsequently.

@ckadner ckadner closed this Jan 24, 2023
@ckadner
Copy link
Member

ckadner commented Jan 24, 2023

@tedhtchang -- thank you again for this PR. It was really helpful to get the new https://github.com/kserve/modelmesh-minio-examples/ repo seeded.

If you don't mind keeping your fork and branch alive for the coming weeks so we can go back to it in case some of my trimming down was over eager ;-)

@tedhtchang
Copy link
Contributor Author

@tedhtchang -- thank you again for this PR. It was really helpful to get the new https://github.com/kserve/modelmesh-minio-examples/ repo seeded.

Good good. Thanks.

If you don't mind keeping your fork and branch alive for the coming weeks so we can go back to it in case some of my trimming down was over eager ;-)

I don't mind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Dockerfile for modelmesh-minio-examples image
5 participants