Skip to content

Commit 9ea3bd0

Browse files
committed
Implement editing model servers
Signed-off-by: Mark Winter <mark.winter@navercorp.com>
1 parent da68607 commit 9ea3bd0

File tree

82 files changed

+29275
-9187
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+29275
-9187
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Models web app Docker Publisher (Releasing)
2+
3+
on:
4+
push:
5+
# Publish `master` as Docker `latest` image.
6+
branches:
7+
- master
8+
9+
paths:
10+
- releasing/VERSION
11+
12+
# Run tests for any PRs.
13+
pull_request:
14+
15+
env:
16+
IMAGE_NAME: models-web-app
17+
18+
jobs:
19+
# Run tests.
20+
# See also https://docs.docker.com/docker-hub/builds/automated-testing/
21+
test:
22+
runs-on: ubuntu-latest
23+
24+
steps:
25+
- uses: actions/checkout@v2
26+
27+
- name: Run tests
28+
run: |
29+
docker build . --file Dockerfile
30+
# Push image to GitHub Packages.
31+
# See also https://docs.docker.com/docker-hub/builds/
32+
push:
33+
# Ensure test job passes before pushing image.
34+
needs: test
35+
36+
runs-on: ubuntu-latest
37+
if: github.event_name == 'push'
38+
39+
steps:
40+
- uses: actions/checkout@v2
41+
42+
- name: Build image
43+
run: |
44+
docker build . --file Dockerfile --tag ${IMAGE_NAME}
45+
- name: Log into registry
46+
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PASSWORD }}
47+
48+
- name: Push image
49+
run: |
50+
IMAGE_ID=kserve/$IMAGE_NAME
51+
# Change all uppercase to lowercase
52+
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
53+
VERSION=$(cat ./releasing/VERSION)
54+
55+
echo IMAGE_ID=$IMAGE_ID
56+
echo VERSION=$VERSION
57+
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
58+
docker push $IMAGE_ID:$VERSION

.github/workflows/flake-lint.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Python checks
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
jobs:
9+
flake8-lint:
10+
runs-on: ubuntu-latest
11+
name: Lint
12+
steps:
13+
- name: Check out source repository
14+
uses: actions/checkout@v2
15+
- name: Set up Python environment
16+
uses: actions/setup-python@v1
17+
with:
18+
python-version: "3.7"
19+
- name: flake8 Lint
20+
uses: py-actions/flake8@v1
21+
with:
22+
path: backend

.gitignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
11
**/__pycache__/
22
**/.vscode/
33
**/static/*
4+
**/fonts/
5+
6+
# Swap
7+
[._]*.s[a-v][a-z]
8+
!*.svg # comment out if you don't need vector files
9+
[._]*.sw[a-p]
10+
[._]s[a-rt-v][a-z]
11+
[._]ss[a-gi-z]
12+
[._]sw[a-p]
13+
14+
# Session
15+
Session.vim
16+
Sessionx.vim
17+
18+
# Temporary
19+
.netrwhist
20+
*~
21+
# Auto-generated tag files
22+
tags
23+
# Persistent undo
24+
[._]*.un~

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ RUN apt-get update && apt-get install git -y
66
WORKDIR /kf
77
RUN git clone https://github.com/kubeflow/kubeflow.git && \
88
cd kubeflow && \
9-
git checkout e6fdf51
9+
git checkout d1da825
1010

1111
# --- Build the backend kubeflow-wheel ---
1212
FROM python:3.7-slim-buster AS backend-kubeflow-wheel
@@ -18,7 +18,7 @@ COPY --from=fetch-kubeflow-kubeflow $BACKEND_LIB .
1818
RUN python setup.py sdist bdist_wheel
1919

2020
# --- Build the frontend kubeflow library ---
21-
FROM node:10 AS frontend-kubeflow-lib
21+
FROM node:12-buster-slim AS frontend-kubeflow-lib
2222

2323
WORKDIR /src
2424

@@ -30,7 +30,7 @@ COPY --from=fetch-kubeflow-kubeflow $LIB/ ./
3030
RUN npm run build
3131

3232
# --- Build the frontend ---
33-
FROM node:12 AS frontend
33+
FROM node:12-buster-slim AS frontend
3434

3535
WORKDIR /src
3636
COPY ./frontend/package*.json ./

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
IMG ?= gcr.io/kfserving/models-web-app
1+
IMG ?= kserve/models-web-app
22

33
# We want the git tag to be the last commit to this directory so we don't
44
# bump the image on unrelated changes.

OWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
approvers:
22
- kimwnasptd
3+
- yuzisun
34
reviewers:
45
- elikatsis
56
- StefanoFioravanzo

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ The web app currently works with `v1beta1` versions of `InferenceService` object
66

77
## Connect to the app
88

9-
The web app is installed alongside the other KFServing components, either in the `kfserving-system` or in the `kubeflow` namespace. There is a `VirtualService` that exposes the app via an Istio Ingress Gateway. Depending on the installation environment the following Ingress Gateway will be used.
9+
The web app is installed alongside the other KServe components, either in the `kserve` or in the `kubeflow` namespace. There is a `VirtualService` that exposes the app via an Istio Ingress Gateway. Depending on the installation environment the following Ingress Gateway will be used.
1010

1111
| Installation mode | IngressGateway |
1212
| - | - |
13-
| Standalone KFServing | knative-ingress-gateway.knative-serving |
13+
| Standalone KServe | knative-ingress-gateway.knative-serving |
1414
| Kubeflow | kubeflow-gateway.kubeflow |
1515

1616
To access the app you will need to navigate with your browser to
@@ -27,11 +27,11 @@ You can apply the mentioned configurations by doing the following commands:
2727
```bash
2828
# edit the configmap
2929
# CONFIG=config/overlays/kubeflow/kustomization.yaml
30-
CONFIG=config/web-app/kustomization.yaml
30+
CONFIG=config/base/kustomization.yaml
3131
vim ${CONFIG}
3232

3333
# Add the following env vars to the configMapGenerator's literals
34-
# for kfserving-models-web-app-config
34+
# for kserve-models-web-app-config
3535
- APP_PREFIX=/
3636
- APP_DISABLE_AUTH="True"
3737
- APP_SECURE_COOKIES="False"
@@ -83,7 +83,7 @@ cd dist/kubeflow
8383
npm link
8484

8585
# run the app frontend
86-
cd $KFSERVING_REPO/web-app/frontend
86+
cd $KSERVE_MODELS_WEB_APP_REPO/frontend
8787
npm i
8888
npm link kubeflow
8989
npm run build:watch
@@ -95,7 +95,7 @@ npm run build:watch
9595
```bash
9696
# create a virtual env and install deps
9797
# https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/
98-
cd $KFSERVING_REPO/web-app/backend
98+
cd $KSERVE_MODELS_WEB_APP_REPO/backend
9999
python3.7 -m pip install --user virtualenv
100100
python3.7 -m venv web-apps-dev
101101
source web-apps-dev/bin/activate

backend/.flake8

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[flake8]
2+
docstring_convention = google
3+
exclude = assets,__init__.py,__pycache__
4+
ignore = D100,D104,D107,W503

backend/apps/common/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"""Package with the base code between backend versions."""
12
import kubeflow.kubeflow.crud_backend as base
23
from kubeflow.kubeflow.crud_backend import config, logging
34

@@ -8,6 +9,7 @@
89

910
def create_app(name=__name__, static_folder="static",
1011
cfg: config.Config = None):
12+
"""Create the WSGI app."""
1113
cfg = config.Config() if cfg is None else cfg
1214

1315
app = base.create_app(name, static_folder, cfg)

backend/apps/common/routes/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
"""Common routes across backends."""
12
from flask import Blueprint
23

34
bp = Blueprint("base_routes", __name__)

0 commit comments

Comments
 (0)