跳转至

Continuous Integration, CI

导言

在交付PTA需求的时候,发现需求在测试人员的更大的测试规模下出现了问题:

在增多了不同的测试样例,和不同的测试设备(910A,910B,310P)时;程序是否可执行,性能是否达标,精度是不是正常;都有待监控。

说明在开发过程中,我构建个人的每日测试框架,持续监控开发的测试和性能。

集成 windmill-labs / windmill。

本地部署

docker 中网络设置与证书

由于 windmill 初始化是需要联网的,请通过log检查网络代理和证书相关的问题。

windmill_worker:
    image: ${WM_IMAGE}
    pull_policy: always
    deploy:
    replicas: 3
    resources:
        limits:
        cpus: "1"
        memory: 2048M
        # for GB, use syntax '2Gi'
    restart: unless-stopped
    environment:
    - http_proxy=http://p_atlas:proxy%[email protected]:8080
    - https_proxy=http://p_atlas:proxy%[email protected]:8080
    - HTTP_PROXY=http://p_atlas:proxy%[email protected]:8080
    - HTTPS_PROXY=http://p_atlas:proxy%[email protected]:8080
    - DENO_CERT=/etc/ssl/certs/ca-certificates.crt
    - NO_PROXY=localhost,127.0.0.1
    volumes:
        # mount the docker socket to allow to run docker containers from within the workers
        - /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem:/etc/ssl/certs/ca-certificates.crt:ro
caddy:
    image: ghcr.io/windmill-labs/caddy-l4:latest
    restart: unless-stopped
    # Configure the mounted Caddyfile and the exposed ports or use another reverse proxy if needed
    volumes:
    - ./Caddyfile:/etc/caddy/Caddyfile
    # - ./certs:/certs # Provide custom certificate files like cert.pem and key.pem to enable HTTPS - See the corresponding section in the Caddyfile
    ports:
    # To change the exposed port, simply change 80:80 to <desired_port>:80. No other changes needed
    - 8233:80
    - 25:25
    # - 443:443 # Uncomment to enable HTTPS handling by Caddy
    environment:
    - BASE_URL=":80"
    - HTTP_PROXY=
    - HTTPS_PROXY=
    - NO_PROXY=localhost,127.0.0.1

信息流打通

同步脚本

  • 参考文档
  • 需要安装CLI工具来设置和同步docker内外的文件,但是不是实时同步的,需要pull/push,并且push前还需要生成metadata文件。
    • wmill --version 需要非代理联网,不能使用。但是不影响其余命令。
  • 建议在网页里编辑,只是使用pull备份。
wmill init
# 查看已有的workspace
wmill workspace

访问网络

  • 为docker设置代理(通过环境变量)。
  • 设置python/pip相关的环境变量。
export PIP_INDEX_URL=https://mirrors.aliyun.com/pypi/simple/
export PIP_TRUSTED_HOST=mirrors.aliyun.com

访问外部文件

docker外文件(数据集,服务器的测试代码):挂载在windmill-worker里。

执行裸机命令

(npu-smi): 挂载可执行文件目录。

模块功能

参考文献

评论