Python研发:setup打包
简述项目部署时,发现CI自动打包的Docker镜像内代码不全,最终定位原因是由于python打包时未打包新建的代码文件导致。特意整理本文章,整理python打包配置。
基础信息python标准打包工具为setuptools,可通过setuptools官方文档详细了解该工具。现整理一些常用内容,记录如下:
基本命令Python官方文档:https://packaging.python.org/tutorials/distributing-packages/
根据 application 包含的代码类型以及其所支持的 python 版本, wheel 格式可细分为三种
Universal wheel:纯 python 代码,并且支持 python 2 和 3
Pure python wheel:纯 python 代码,不同时支持 python2 和 3
Platform wheel:非纯 python 代码
采用如下命令可编译成 universal wheel:
1python setup.py bdist_wheel --universal
采用如下命令可编译成非 universa ...
Windows使用:系统激活方案调研
简述由于项目需求,需调研目前所有的windows 10激活方式成本及其法律风险,现将调研内容整理至本文章,本文主要介绍目前各种常见的windows 10激活方式对企业用户的风险及成本评估。微软不追究个人用户的盗版使用,所以个人用户不在本次调研范围内,个人用户可随意使用本文中的各种激活方式。
永久激活方案方案介绍官方渠道官方渠道报价:1800/套,量大可优惠至1600 ~ 1700
官方license可接受5次硬件变动,同时只能有一套该license激活的系统在运行。硬件变动范围包括但不限于插拔内存条、插拔硬盘、更换主板等操作。
该激活方式不存在法律风险,唯一的不足就是太贵了。在云场景上,虚机需要不断创删,删除后的虚机会消耗license数量,无法回收,所以该方案的成本非常高。
淘宝店铺淘宝/京东搜索windows激活,即可搜到很多可提供windows激活的店铺,激活价格在几块到几百不等。区别在于一次性过期还是可重复安装,根据调研及网络上各企业反馈,该方式激活的windows同样也会收到微软的律师函,及该方式企业使用是存在法律风险的。该方式个人认为是最不值得的一种方式,既花了钱,还不能规 ...
NVIDIA研发:vGPU Unlock
简介This tool enables the use of Geforce and Quadro GPUs with the NVIDIA vGPU graphics virtualization technology. NVIDIA vGPU normally only supports a few datacenter Teslas and professional Quadro GPUs by design, but not consumer graphics cards through a software limitation. This vgpu_unlock tool aims to remove this limitation on Linux based systems, thus enabling most Maxwell, Pascal, Volta (untested), and Turing based GPUs to use the vGPU technology. Ampere support is currently a work in progres ...
NVIDIA使用:CUDA安装
安装资源包下载根据NVIDIA GPU Driver Version,在官网寻找合适的CUDA版本:Release Notes :: CUDA Toolkit Documentation
CUDA Toolkit下载地址:CUDA Toolkit 11.2 Downloads | NVIDIA Developer
cuDNN下载地址:官方cuDNN下载
CUDA Toolkit
Toolkit Driver Version
—
Linux x86_64 Driver Version
Windows x86_64 Driver Version
CUDA 11.8 GA
>=520.61.05
>=522.06
CUDA 11.7 Update 1
>=515.48.07
>=516.31
CUDA 11.7 GA
>=515.43.04
>=516.01
CUDA 11.6 Update 2
>=510.47.03
>=511.65
CUDA 11.6 Update 1
>=510.47.03
> ...
Libvirt研发:9p virtio
简介主要需求是透传主机目录至虚机内部使用,9p virtio可以提供该能力,9p的官方介绍如下:
With QEMU’s 9pfs you can create virtual filesystem devices (virtio-9p-device) and expose them to guests, which essentially means that a certain directory on host machine is made directly accessible by a guest OS as a pass-through file system by using the 9P network protocol for communication between host and guest, if desired even accessible, shared by several guests simultaniously.
This section details the steps involved in setting up VirtFS (Pla ...
Libvirt研发:Qemu编译
简介QEMU is a generic and open source machine & userspace emulator and virtualizer.
QEMU is capable of emulating a complete machine in software without any need for hardware virtualization support. By using dynamic translation, it achieves very good performance. QEMU can also integrate with the Xen and KVM hypervisors to provide emulated hardware while allowing the hypervisor to manage the CPU. With hypervisor support, QEMU can achieve near native performance for CPUs. When QEMU emulates CPUs ...
NVIDIA使用:GPU驱动安装
安装安装依赖环境要装的两个依赖分别是:gcc、kernel-devel,其中需要注意的是,kernel-devel的版本需要与当前内核的版本一致,不然后面会出现找不到文件的情况。
1)查看我的内核版本:
12[root@k104 vGPU]# uname -r3.10.0-1127.el7.x86_64
2)查看一下可以安装的版本,安装对应内核版本:
12[root@k104 vGPU]# yum list | grep kernel-develkernel-devel.x86_64 3.10.0-1127.el7 @/kernel-devel-3.10.0-1127.el7.x86_64
3)安装依赖
1yum install kernel-devel-$(uname -r) gcc dkms -y
屏蔽系统自带的nouveau(重启生效)123456789101112echo "blacklist nouveau" >> /lib/modprobe.d/dist-blackl ...
NVIDIA研发:GPU Manager部署
简介本文介绍GPU Manager的部署流程,其原理本文不做介绍,原理可参考:论文笔记《GaiaGPU:Sharing GPUs in Container Clouds》
源码地址1234# Githubgpu-quota-admission https://github.com/tkestack/gpu-admissiongpu-manager https://github.com/tkestack/gpu-managervcuda-controller https://github.com/tkestack/vcuda-controller
环境信息123456789[root@k104 vGPU]# uname -aLinux k104 3.10.0-1127.el7.x86_64 #1 SMP Tue Mar 31 23:36:51 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux[root@k104 vGPU]# cat /etc/centos-releaseCentOS Linux release ...
Chrome使用:通用手册
常见问题NET::ERR_CERT_INVALID
在chrome该页面上,直接键盘敲入这12个字符:thisisunsafe
注意:鼠标点击当前页面任意位置,让页面处于最上层即可输入
OpenStack研发:cinderclient
研发环境
python:2.7.5
python-cinderclient 5.0.2
源码cinderclient调用方法123456789101112131415161718192021222324252627from keystoneauth1 import identityfrom keystoneauth1 import sessionfrom cinderclient import clientusername='admin'password='Inspur@123'project_name='admin'project_domain_id='default'user_domain_id='default'auth_url='http://111.111.9.207:35357/v3'CINDER_API_VERSION = "3.0"auth = identity.Password(auth_url=auth_url, ...