add model register job template

This commit is contained in:
chendile 2023-04-06 22:58:32 +08:00
parent 67fd952c5f
commit 772a51ebcf
4 changed files with 10 additions and 25 deletions

View File

@ -1,27 +1,12 @@
FROM ubuntu:18.04
# 安装运维工具
RUN apt-get update && apt install -y --force-yes --no-install-recommends vim apt-transport-https gnupg2 ca-certificates-java rsync jq wget git dnsutils iputils-ping net-tools curl locales zip
# 安装python
RUN apt install -y python3.6-dev python3-pip libsasl2-dev libpq-dev \
&& ln -s /usr/bin/python3 /usr/bin/python \
&& ln -s /usr/bin/pip3 /usr/bin/pip
FROM python:3.9
# 安装中文
RUN apt install -y --force-yes --no-install-recommends locales ttf-wqy-microhei ttf-wqy-zenhei xfonts-wqy && locale-gen zh_CN && locale-gen zh_CN.utf8
ENV LANG zh_CN.UTF-8
ENV LC_ALL zh_CN.UTF-8
ENV LANGUAGE zh_CN.UTF-8
ENV TZ Asia/Shanghai
ENV DEBIAN_FRONTEND noninteractive
# 便捷操作
RUN echo "alias ll='ls -alF'" >> /root/.bashrc && \
echo "alias la='ls -A'" >> /root/.bashrc && \
echo "alias vi='vim'" >> /root/.bashrc && \
/bin/bash -c "source /root/.bashrc"
RUN pip install kubernetes==18.20.0 pysnooper psutil requests
RUN pip install kubernetes==18.20.0 pysnooper psutil
COPY job/register_model/* /app/
COPY job/model_register/* /app/
WORKDIR /app
ENV PYTHONPATH=/app:$PYTHONPATH

View File

@ -1,5 +1,5 @@
# register_model 模板
镜像ccr.ccs.tencentyun.com/cube-studio/model:20221001
镜像ccr.ccs.tencentyun.com/cube-studio/model_register:20221001
启动参数:
```bash
{
@ -21,7 +21,7 @@
"--model_name": {
"type": "str",
"item_type": "str",
"label": "模型名",
"label": "模型名(a-z0-9-字符组成最长54个字符)",
"require": 1,
"choice": [],
"range": "",

View File

@ -2,8 +2,8 @@
set -ex
docker build -t ccr.ccs.tencentyun.com/cube-studio/model:20221001 -f job/register_model/Dockerfile .
docker push ccr.ccs.tencentyun.com/cube-studio/model:20221001
docker build -t ccr.ccs.tencentyun.com/cube-studio/model_register:20221001 -f job/model_register/Dockerfile .
docker push ccr.ccs.tencentyun.com/cube-studio/model_register:20221001

View File

@ -16,7 +16,7 @@ KFJ_RUN_ID = os.getenv('KFJ_RUN_ID', '')
KFJ_PIPELINE_ID = os.getenv('KFJ_PIPELINE_ID', '0')
host = os.getenv('HOST',os.getenv('KFJ_MODEL_REPO_API_URL','http://kubeflow-dashboard.infra')).strip('/')
@pysnooper.snoop()
# @pysnooper.snoop()
def deploy(**kwargs):
# print(kwargs)
headers = {