UNCLASSIFIED

Commit fa7166a8 authored by Daniel Etrata's avatar Daniel Etrata
Browse files

Remove vendored files, add makefile, resolve vulns

parent a3ef34b8
Pipeline #151438 failed with stages
in 110 minutes and 15 seconds
pip_pkgs/
download_script.log
# Makefile
build.log
# original.Dockerfile
.vscode
.pip_pkg_*
.conda_pkg_*
files/channel
artifacts
\ No newline at end of file
artifacts
pip_pkg_*
\ No newline at end of file
......@@ -12,33 +12,33 @@ FROM gcr.io/kfserving/pytorchserver:0.2.2 as source
FROM ${BASE_REGISTRY}/${BASE_IMAGE}:${BASE_TAG} as builder
# WORKDIR /
COPY --from=source /opt/conda/envs/ /opt/conda/envs/
# COPY --from=source /opt/conda /opt/conda
# COPY --from=source /workspace/pytorchserver pytorchserver
# COPY --from=source /workspace/kfserving kfserving
# RUN ["/bin/sh", "-c", "/opt/conda/envs/pytorch-py37/bin/python -m pip install --no-deps ./kfserving ./pytorchserver"]
# COPY ./pip_pkg_*.tar.gz pkgs/
# COPY ./pip_pkg_*.whl pkgs/
# COPY scripts/rename_pkgs.sh scripts/
# RUN ./scripts/rename_pkgs.sh -p pip_pkg_ -d pkgs -o pip_pkgs
COPY ./pip_pkg_*.tar.gz pkgs/
COPY ./pip_pkg_*.whl pkgs/
COPY scripts/rename_pkgs.sh scripts/
RUN chmod +x ./scripts/rename_pkgs.sh && \
./scripts/rename_pkgs.sh -p pip_pkg_ -d pkgs -o pip_pkgs
# RUN ["/bin/sh", "-c", "/opt/conda/envs/pytorch-py37/bin/python -m pip install --no-deps ./pip_pkgs/pip-*.whl"]
# RUN ["/bin/sh", "-c", "/opt/conda/envs/pytorch-py37/bin/python -m pip install --no-deps ./pip_pkgs/setuptools-*.whl"]
# # RUN ["/bin/sh", "-c", "/opt/conda/envs/pytorch-py37/bin/python -m pip install --no-deps ./pip_pkgs/wheel-*.whl"]
# RUN ["/bin/sh", "-c", "/opt/conda/envs/pytorch-py37/bin/python -m pip install --no-deps ./pip_pkgs/* "]
RUN ["/bin/sh", "-c", "/opt/conda/envs/pytorch-py37/bin/python -m pip install --no-deps ./pip_pkgs/pip-*.whl"]
RUN ["/bin/sh", "-c", "/opt/conda/envs/pytorch-py37/bin/python -m pip install --no-deps ./pip_pkgs/setuptools-*.whl"]
# RUN ["/bin/sh", "-c", "/opt/conda/envs/pytorch-py37/bin/python -m pip install --no-deps ./pip_pkgs/wheel-*.whl"]
# # RUN pip3 --disable-pip-version-check install ./pip_pkgs/pip-20.2.3-py2.py3-none-any.whl
# # RUN pip3 --disable-pip-version-check install ./pip_pkgs/setuptools-50.3.0-py3-none-any.whl
# # RUN pip3 --disable-pip-version-check install ./pip_pkgs/wheel-0.35.1-py2.py3-none-any.whl
# # # Install the rest of our libraries
# # # RUN pip3 --disable-pip-version-check install ./pip_pkgs/cffi-1.14.2-cp36-cp36m-manylinux1_x86_64.whl
# # RUN tar -xzf ./pip_pkgs/cryptography-3.1.tar.gz
# # RUN rm ./pip_pkgs/cryptography-*.tar.gz
# Temporarily remove crypto from list of packages
RUN tar -xzf ./pip_pkgs/cryptography-3.3.tar.gz
RUN rm ./pip_pkgs/cryptography-*.tar.gz
# # RUN pip3 --disable-pip-version-check install --no-deps ./pip_pkgs/*
RUN ["/bin/sh", "-c", "/opt/conda/envs/pytorch-py37/bin/python -m pip install --no-deps ./pip_pkgs/* "]
# # RUN cd cryptography-3.1 && python3 setup.py install && cd ..
# Build crypto locally
RUN dnf install -y redhat-rpm-config gcc libffi-devel python3-devel openssl-devel
RUN ["/bin/sh", "-c", "cd cryptography-3.3 && /opt/conda/envs/pytorch-py37/bin/python setup.py install"]
# # # ##### make final image
FROM ${BASE_REGISTRY}/${BASE_IMAGE}:${BASE_TAG} as final
......@@ -52,7 +52,7 @@ RUN dnf install -y procps && \
rm -rf /var/cache/dnf
# # Copy python binary
COPY --from=source /opt/conda/envs/ /opt/conda/envs/
COPY --from=builder /opt/conda/envs/ /opt/conda/envs/
COPY --from=source /workspace/pytorchserver/pytorchserver pytorchserver
COPY --from=source /workspace/kfserving/kfserving kfserving
......
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/
venv/
.python-version
# Translations
*.mo
*.pot
# Django stuff:
*.log
# Sphinx documentation
docs/_build/
# PyBuilder
target/
#Ipython Notebook
.ipynb_checkpoints
.PHONY: test
dev_install:
pip install -e .
pip install -e .[test]
test:
pytest -W ignore
type_check:
mypy --ignore-missing-imports kfserving
# KFServing Python SDK
Python SDK for KFServing Server and Client.
## Installation
KFServing Python SDK can be installed by `pip` or `Setuptools`.
### pip install
```sh
pip install kfserving
```
### Setuptools
Install via [Setuptools](http://pypi.python.org/pypi/setuptools).
```sh
python setup.py install --user
```
(or `sudo python setup.py install` to install the package for all users)
## KFServing Server
KFServing's python server libraries implement a standardized KFServing library that is extended by model serving frameworks such as Scikit Learn, XGBoost and PyTorch. It encapsulates data plane API definitions and storage retrieval for models.
KFServing provides many functionalities, including among others:
* Registering a model and starting the server
* Prediction Handler
* Liveness Handler
* Readiness Handlers
KFServing supports the following storage providers:
* Google Cloud Storage with a prefix: "gs://"
* By default, it uses `GOOGLE_APPLICATION_CREDENTIALS` environment variable for user authentication.
* If `GOOGLE_APPLICATION_CREDENTIALS` is not provided, anonymous client will be used to download the artifacts.
* S3 Compatible Object Storage with a prefix "s3://"
* By default, it uses `S3_ENDPOINT`, `AWS_ACCESS_KEY_ID`, and `AWS_SECRET_ACCESS_KEY` environment variables for user authentication.
* Azure Blob Storage with the format: "https://{$STORAGE_ACCOUNT_NAME}.blob.core.windows.net/{$CONTAINER}/{$PATH}"
* By default, it uses anonymous client to download the artifacts.
* For e.g. https://kfserving.blob.core.windows.net/triton/simple_string/
* Local filesystem either without any prefix or with a prefix "file://". For example:
* Absolute path: `/absolute/path` or `file:///absolute/path`
* Relative path: `relative/path` or `file://relative/path`
* For local filesystem, we recommended to use relative path without any prefix.
* Persistent Volume Claim (PVC) with the format "pvc://{$pvcname}/[path]".
* The `pvcname` is the name of the PVC that contains the model.
* The `[path]` is the relative path to the model on the PVC.
* For e.g. `pvc://mypvcname/model/path/on/pvc`
* Generic URI, over either `HTTP`, prefixed with `http://` or `HTTPS`, prefixed with `https://`. For example:
* `https://<some_url>.com/model.joblib`
* `http://<some_url>.com/model.joblib`
## KFServing Client
### Getting Started
KFServing's python client interacts with KFServing APIs for executing operations on a remote KFServing cluster, such as creating, patching and deleting of a InferenceService instance. See the [Sample for KFServing Python SDK Client](../../docs/samples/client/kfserving_sdk_sample.ipynb) to get started.
### Documentation for Client API
Class | Method | Description
------------ | ------------- | -------------
[KFServingClient](docs/KFServingClient.md) | [set_credentials](docs/KFServingClient.md#set_credentials) | Set Credentials|
[KFServingClient](docs/KFServingClient.md) | [create](docs/KFServingClient.md#create) | Create InferenceService|
[KFServingClient](docs/KFServingClient.md) | [get](docs/KFServingClient.md#get) | Get or watch the specified InferenceService or all InferenceServices in the namespace |
[KFServingClient](docs/KFServingClient.md) | [patch](docs/KFServingClient.md#patch) | Patch the specified InferenceService|
[KFServingClient](docs/KFServingClient.md) | [replace](docs/KFServingClient.md#replace) | Replace the specified InferenceService|
[KFServingClient](docs/KFServingClient.md) | [rollout_canary](docs/KFServingClient.md#rollout_canary) | Rollout the traffic on `canary` version for specified InferenceService|
[KFServingClient](docs/KFServingClient.md) | [promote](docs/KFServingClient.md#promote) | Promote the `canary` version of the InferenceService to `default`|
[KFServingClient](docs/KFServingClient.md) | [delete](docs/KFServingClient.md#delete) | Delete the specified InferenceService |
[KFServingClient](docs/KFServingClient.md) | [wait_isvc_ready](docs/KFServingClient.md#wait_isvc_ready) | Wait for the InferenceService to be ready |
[KFServingClient](docs/KFServingClient.md) | [is_isvc_ready](docs/KFServingClient.md#is_isvc_ready) | Check if the InferenceService is ready |
## Documentation For Models
- [KnativeAddressable](docs/KnativeAddressable.md)
- [KnativeCondition](docs/KnativeCondition.md)
- [KnativeURL](docs/KnativeURL.md)
- [KnativeVolatileTime](docs/KnativeVolatileTime.md)
- [NetUrlUserinfo](docs/NetUrlUserinfo.md)
- [V1alpha2AlibiExplainerSpec](docs/V1alpha2AlibiExplainerSpec.md)
- [V1alpha2Batcher](docs/V1alpha2Batcher.md)
- [V1alpha2CustomSpec](docs/V1alpha2CustomSpec.md)
- [V1alpha2DeploymentSpec](docs/V1alpha2DeploymentSpec.md)
- [V1alpha2EndpointSpec](docs/V1alpha2EndpointSpec.md)
- [V1alpha2ExplainerSpec](docs/V1alpha2ExplainerSpec.md)
- [V1alpha2InferenceService](docs/V1alpha2InferenceService.md)
- [V1alpha2InferenceServiceList](docs/V1alpha2InferenceServiceList.md)
- [V1alpha2InferenceServiceSpec](docs/V1alpha2InferenceServiceSpec.md)
- [V1alpha2InferenceServiceStatus](docs/V1alpha2InferenceServiceStatus.md)
- [V1alpha2Logger](docs/V1alpha2Logger.md)
- [V1alpha2ONNXSpec](docs/V1alpha2ONNXSpec.md)
- [V1alpha2PredictorSpec](docs/V1alpha2PredictorSpec.md)
- [V1alpha2PyTorchSpec](docs/V1alpha2PyTorchSpec.md)
- [V1alpha2SKLearnSpec](docs/V1alpha2SKLearnSpec.md)
- [V1alpha2StatusConfigurationSpec](docs/V1alpha2StatusConfigurationSpec.md)
- [V1alpha2TritonSpec](docs/V1alpha2TritonSpec.md)
- [V1alpha2TensorflowSpec](docs/V1alpha2TensorflowSpec.md)
- [V1alpha2TransformerSpec](docs/V1alpha2TransformerSpec.md)
- [V1alpha2XGBoostSpec](docs/V1alpha2XGBoostSpec.md)
This diff is collapsed.
# KnativeAddressable
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**url** | [**KnativeURL**](KnativeURL.md) | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
# KnativeCondition
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**last_transition_time** | [**KnativeVolatileTime**](KnativeVolatileTime.md) | LastTransitionTime is the last time the condition transitioned from one status to another. We use VolatileTime in place of metav1.Time to exclude this from creating equality.Semantic differences (all other things held constant). | [optional]
**message** | **str** | A human readable message indicating details about the transition. | [optional]
**reason** | **str** | The reason for the condition&#39;s last transition. | [optional]
**severity** | **str** | Severity with which to treat failures of this type of condition. When this is not specified, it defaults to Error. | [optional]
**status** | **str** | Status of the condition, one of True, False, Unknown. |
**type** | **str** | Type of condition. |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
# KnativeURL
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**force_query** | **bool** | encoded path hint (see EscapedPath method) |
**fragment** | **str** | encoded query values, without &#39;?&#39; |
**host** | **str** | username and password information |
**opaque** | **str** | |
**path** | **str** | host or host:port |
**raw_path** | **str** | path (relative paths may omit leading slash) |
**raw_query** | **str** | append a query (&#39;?&#39;) even if RawQuery is empty |
**scheme** | **str** | |
**user** | [**NetUrlUserinfo**](NetUrlUserinfo.md) | encoded opaque data |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
# KnativeVolatileTime
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**time** | **datetime** | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
# NetUrlUserinfo
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**password** | **str** | |
**password_set** | **bool** | |
**username** | **str** | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
# V1Time
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
# V1alpha2AlibiExplainerSpec
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**config** | **dict(str, str)** | Inline custom parameter settings for explainer | [optional]
**resources** | [**V1ResourceRequirements**](https://github.com/kubernetes-client/python/blob/master/kubernetes/docs/V1ResourceRequirements.md) | Defaults to requests and limits of 1CPU, 2Gb MEM. | [optional]
**runtime_version** | **str** | Alibi docker image version which defaults to latest release | [optional]
**storage_uri** | **str** | The location of a trained explanation model | [optional]
**type** | **str** | The type of Alibi explainer |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
# V1alpha2Batcher
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**max_batch_size** | **int** | MaxBatchSize of batcher service | [optional]
**max_latency** | **int** | MaxLatency of batcher service | [optional]
**timeout** | **int** | Timeout of batcher service | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
# V1alpha2CustomSpec
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**container** | [**V1Container**](https://github.com/kubernetes-client/python/blob/master/kubernetes/docs/V1Container.md) | |
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
# V1alpha2DeploymentSpec
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**batcher** | [**V1alpha2Batcher**](V1alpha2Batcher.md) | Activate request batching | [optional]
**logger** | [**V1alpha2Logger**](V1alpha2Logger.md) | Activate request/response logging | [optional]
**max_replicas** | **int** | This is the up bound for autoscaler to scale to | [optional]
**min_replicas** | **int** | Minimum number of replicas which defaults to 1, when minReplicas &#x3D; 0 pods scale down to 0 in case of no traffic | [optional]
**parallelism** | **int** | Parallelism specifies how many requests can be processed concurrently, this sets the hard limit of the container concurrency(https://knative.dev/docs/serving/autoscaling/concurrency). | [optional]
**service_account_name** | **str** | ServiceAccountName is the name of the ServiceAccount to use to run the service | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
# V1alpha2EndpointSpec
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**explainer** | [**V1alpha2ExplainerSpec**](V1alpha2ExplainerSpec.md) | Explainer defines the model explanation service spec, explainer service calls to predictor or transformer if it is specified. | [optional]
**predictor** | [**V1alpha2PredictorSpec**](V1alpha2PredictorSpec.md) | Predictor defines the model serving spec |
**transformer** | [**V1alpha2TransformerSpec**](V1alpha2TransformerSpec.md) | Transformer defines the pre/post processing before and after the predictor call, transformer service calls to predictor service. | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
# V1alpha2ExplainerSpec
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**alibi** | [**V1alpha2AlibiExplainerSpec**](V1alpha2AlibiExplainerSpec.md) | Spec for alibi explainer | [optional]
**batcher** | [**V1alpha2Batcher**](V1alpha2Batcher.md) | Activate request batching | [optional]
**custom** | [**V1alpha2CustomSpec**](V1alpha2CustomSpec.md) | Spec for a custom explainer | [optional]
**logger** | [**V1alpha2Logger**](V1alpha2Logger.md) | Activate request/response logging | [optional]
**max_replicas** | **int** | This is the up bound for autoscaler to scale to | [optional]
**min_replicas** | **int** | Minimum number of replicas which defaults to 1, when minReplicas &#x3D; 0 pods scale down to 0 in case of no traffic | [optional]
**parallelism** | **int** | Parallelism specifies how many requests can be processed concurrently, this sets the hard limit of the container concurrency(https://knative.dev/docs/serving/autoscaling/concurrency). | [optional]
**service_account_name** | **str** | ServiceAccountName is the name of the ServiceAccount to use to run the service | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
# V1alpha2InferenceService
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**api_version** | **str** | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources | [optional]
**kind** | **str** | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | [optional]
**metadata** | [**V1ObjectMeta**](https://github.com/kubernetes-client/python/blob/master/kubernetes/docs/V1ObjectMeta.md) | | [optional]
**spec** | [**V1alpha2InferenceServiceSpec**](V1alpha2InferenceServiceSpec.md) | | [optional]
**status** | [**V1alpha2InferenceServiceStatus**](V1alpha2InferenceServiceStatus.md) | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment